1 | #!/bin/sh |
---|
2 | # $Id: finish-update.sh,v 1.23 2004-11-30 20:00:25 rbasch Exp $ |
---|
3 | |
---|
4 | # Copyright 1996 by the Massachusetts Institute of Technology. |
---|
5 | # |
---|
6 | # Permission to use, copy, modify, and distribute this |
---|
7 | # software and its documentation for any purpose and without |
---|
8 | # fee is hereby granted, provided that the above copyright |
---|
9 | # notice appear in all copies and that both that copyright |
---|
10 | # notice and this permission notice appear in supporting |
---|
11 | # documentation, and that the name of M.I.T. not be used in |
---|
12 | # advertising or publicity pertaining to distribution of the |
---|
13 | # software without specific, written prior permission. |
---|
14 | # M.I.T. makes no representations about the suitability of |
---|
15 | # this software for any purpose. It is provided "as is" |
---|
16 | # without express or implied warranty. |
---|
17 | |
---|
18 | echo "Starting the second stage of the update at `date`." |
---|
19 | . /srvd/usr/athena/lib/update/update-environment |
---|
20 | |
---|
21 | # We get one argument, the new workstation version we're updating to. |
---|
22 | newvers="$1" |
---|
23 | |
---|
24 | . $CONFVARS |
---|
25 | . $CONFDIR/rc.conf |
---|
26 | |
---|
27 | if [ -s "$MIT_OLD_PACKAGES" ]; then |
---|
28 | echo "Removing old Athena packages." |
---|
29 | for i in `cat "$MIT_OLD_PACKAGES"`; do |
---|
30 | echo "$i" |
---|
31 | pkgrm -a $LIBDIR/admin-update -n -R "${UPDATE_ROOT:-/}" "$i" |
---|
32 | done |
---|
33 | echo "Finished removing old Athena packages." |
---|
34 | fi |
---|
35 | |
---|
36 | if [ -s "$MIT_NONCORE_PACKAGES" ]; then |
---|
37 | echo "Installing new Athena non-core packages." |
---|
38 | for i in `cat "$MIT_NONCORE_PACKAGES"`; do |
---|
39 | echo "$i" |
---|
40 | $LIBDIR/pkg-update -R "${UPDATE_ROOT:-/}" -d "/srvd/pkg/$newvers" "$i" |
---|
41 | done |
---|
42 | echo "Finished installing Athena packages." |
---|
43 | fi |
---|
44 | |
---|
45 | # Run catman to format Athena man pages, and create the windex |
---|
46 | # database. Suppress all output, since catman will complain about |
---|
47 | # pages in lockers which cannot be read without tokens (e.g. psutils). |
---|
48 | echo "Formatting Athena man pages." |
---|
49 | /usr/bin/catman -M $UPDATE_ROOT/usr/athena/man > /dev/null 2>&1 |
---|
50 | |
---|
51 | rm -f $UPDATE_ROOT/var/athena/rc.conf.sync |
---|
52 | |
---|
53 | if [ "$OSCHANGES" = true ]; then |
---|
54 | echo "Creating windex databases." |
---|
55 | /usr/bin/catman -w -M $UPDATE_ROOT/usr/openwin/share/man:$UPDATE_ROOT/usr/dt/share/man:$UPDATE_ROOT/usr/share/man:$UPDATE_ROOT/usr/sfw/share/man |
---|
56 | fi |
---|
57 | |
---|
58 | # Remove the version script state files. |
---|
59 | rm -f "$CONFCHG" "$CONFVARS" "$AUXDEVS" "$OLDBINS" "$OLDLIBS" "$DEADFILES" |
---|
60 | rm -f "$OSCONFCHG" "$PACKAGES" "$PATCHES" "$OLDPKGS" "$OLDPTCHS" |
---|
61 | rm -f "$MIT_CORE_PACKAGES" "$MIT_NONCORE_PACKAGES" "$MIT_OLD_PACKAGES" |
---|
62 | if [ -n "$PACKAGES" ]; then |
---|
63 | rm -f "$PACKAGES".* |
---|
64 | fi |
---|
65 | |
---|
66 | # Convert old attachtab files. |
---|
67 | if [ -f /var/athena/attachtab.old ]; then |
---|
68 | echo "Converting old attachtab to liblocker format." |
---|
69 | /srvd/usr/athena/etc/atconvert /var/athena/attachtab.old \ |
---|
70 | && rm -f /var/athena/attachtab.old |
---|
71 | fi |
---|
72 | |
---|
73 | echo "Updating version" |
---|
74 | echo "Athena Workstation ($HOSTTYPE) Version $newvers `date`" >> \ |
---|
75 | $CONFDIR/version |
---|
76 | |
---|
77 | # Re-customize the workstation |
---|
78 | if [ "$PUBLIC" = "true" ]; then |
---|
79 | rm -rf "$SERVERDIR" |
---|
80 | fi |
---|
81 | |
---|
82 | if [ -d "$SERVERDIR" ]; then |
---|
83 | echo "Running mkserv." |
---|
84 | /srvd/usr/athena/bin/mkserv -v update < /dev/null |
---|
85 | fi |
---|
86 | echo "Finished with update at `date`." |
---|
87 | rm -rf /var/athena/update.running |
---|