1b834a654a6ebba773979ddd6dbd29cfcc5f15ba
[citadel.git] / webcit / debian / citadel-webcit.postrm
1 #! /bin/sh
2 # postrm.skeleton
3 # Skeleton maintainer script showing all the possible cases.
4 # Written by Charles Briscoe-Smith, March-June 1998.  Public Domain.
5
6 # Abort if any command returns an error value
7 set -e
8
9 # This script is called twice during the removal of the package; once
10 # after the removal of the package's files from the system, and as
11 # the final step in the removal of this package, after the package's
12 # conffiles have been removed.
13
14 # Ensure the menu system is updated
15 : [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus
16
17 case "$1" in
18   remove)
19     # This package is being removed, but its configuration has not yet
20     # been purged.
21     
22
23     # Remove diversion
24     #: dpkg-divert --package foo --remove --rename \
25     #:             --divert /usr/bin/other.real /usr/bin/other
26
27     # ldconfig is NOT needed during removal of a library, only during
28     # installation
29
30     ;;
31   purge)
32     # This package has previously been removed and is now having
33     # its configuration purged from the system.
34         # remove the gunzipped setup executable.
35     # we mimic dpkg as closely as possible, so we remove configuration
36     # files with dpkg backup extensions too:
37     ### Some of the following is from Tore Anderson:
38         cd /usr/share/doc/citadel-webcit/examples/static; for i in *; do 
39                 i=`echo $i|sed "s;.gz;;"`
40                 ucf --purge "/var/lib/citadel/www/static/$i"
41                 rm -f "/var/lib/citadel/www/static/$i"
42         done
43         ### TODO: remove citadel from inittab!
44     ;;
45   disappear)
46     if test "$2" != overwriter; then
47       echo "$0: undocumented call to \`postrm $*'" 1>&2
48       exit 0
49     fi
50     # This package has been completely overwritten by package $3
51     # (version $4).  All our files are already gone from the system.
52     # This is a special case: neither "prerm remove" nor "postrm remove"
53     # have been called, because dpkg didn't know that this package would
54     # disappear until this stage.
55     :
56
57     ;;
58   upgrade)
59     # About to upgrade FROM THIS VERSION to version $2 of this package.
60     # "prerm upgrade" has been called for this version, and "preinst
61     # upgrade" has been called for the new version.  Last chance to
62     # clean up.
63     :
64
65     ;;
66   failed-upgrade)
67     # About to upgrade from version $2 of this package TO THIS VERSION.
68     # "prerm upgrade" has been called for the old version, and "preinst
69     # upgrade" has been called for this version.  This is only used if
70     # the previous version's "postrm upgrade" couldn't handle it and
71     # returned non-zero. (Fix old postrm bugs here.)
72     :
73
74     ;;
75   abort-install)
76     # Back out of an attempt to install this package.  Undo the effects of
77     # "preinst install...".  There are two sub-cases.
78     :
79
80     if test "${2+set}" = set; then
81       # When the install was attempted, version $2's configuration
82       # files were still on the system.  Undo the effects of "preinst
83       # install $2".
84       :
85
86     else
87       # We were being installed from scratch.  Undo the effects of
88       # "preinst install".
89       :
90
91     fi ;;
92   abort-upgrade)
93     # Back out of an attempt to upgrade this package from version $2
94     # TO THIS VERSION.  Undo the effects of "preinst upgrade $2".
95     :
96
97     ;;
98   *) echo "$0: didn't understand being called with \`$1'" 1>&2
99      exit 0;;
100 esac
101
102 exit 0