source: trunk/packs/update/finish-update.sh @ 20595

Revision 20595, 2.9 KB checked in by rbasch, 20 years ago (diff)
Run pkg-update to install Athena packages, so that any old files are cleaned up.
Line 
1#!/bin/sh
2# $Id: finish-update.sh,v 1.22 2004-07-30 20:52:55 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
18echo "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.
22newvers="$1"
23
24. $CONFVARS
25. $CONFDIR/rc.conf
26
27if [ -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."
34fi
35
36if [ -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."
43fi
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).
48echo "Formatting Athena man pages."
49/usr/bin/catman -M $UPDATE_ROOT/usr/athena/man > /dev/null 2>&1
50
51rm -f $UPDATE_ROOT/var/athena/rc.conf.sync
52
53if [ "$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
56fi
57
58# Remove the version script state files.
59rm -f "$CONFCHG" "$CONFVARS" "$AUXDEVS" "$OLDBINS" "$OLDLIBS" "$DEADFILES"
60rm -f "$OSCONFCHG" "$PACKAGES" "$PATCHES" "$OLDPKGS" "$OLDPTCHS"
61rm -f "$MIT_CORE_PACKAGES" "$MIT_NONCORE_PACKAGES" "$MIT_OLD_PACKAGES"
62if [ -n "$PACKAGES" ]; then
63        rm -f "$PACKAGES".*
64fi
65
66# Convert old attachtab files.
67if [ -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
71fi
72
73echo "Updating version"
74echo "Athena Workstation ($HOSTTYPE) Version $newvers `date`" >> \
75        $CONFDIR/version
76
77# Re-customize the workstation
78if [ "$PUBLIC" = "true" ]; then
79        rm -rf "$SERVERDIR"
80fi
81
82if [ -d "$SERVERDIR" ]; then
83        echo "Running mkserv."
84        /srvd/usr/athena/bin/mkserv -v update < /dev/null
85fi
86echo "Finished with update at `date`."
87rm -rf /var/athena/update.running
Note: See TracBrowser for help on using the repository browser.