3 # Skeleton maintainer script showing all the possible cases.
4 # Written by Charles Briscoe-Smith, March-June 1998. Public Domain.
6 # Abort if any command returns an error value
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.
14 # Ensure the menu system is updated
15 : [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus
19 # This package is being removed, but its configuration has not yet
24 #: dpkg-divert --package foo --remove --rename \
25 #: --divert /usr/bin/other.real /usr/bin/other
27 # ldconfig is NOT needed during removal of a library, only during
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 rm -f /usr/share/doc/citadel-server/contrib/setup
36 for i in '?' aide floors hours intro mail network nice policy software summary; do
37 ucf --purge "/var/lib/citadel/help/$i"
38 rm -f "/var/lib/citadel/help/$i"
41 for i in aideopt changepw dotopt entermsg entopt goodbye hello help mainmenu newuser readopt register roomaccess unlisted; do
42 ucf --purge "/var/lib/citadel/messages/$i"
43 rm -f "/var/lib/citadel/messages/$i"
46 for i in mail.aliases public_clients citadel.conf; do
47 ucf --purge "/etc/citadel/$i"
48 rm -f "/etc/citadel/$i"
50 # we mimic dpkg as closely as possible, so we remove configuration
51 # files with dpkg backup extensions too:
52 ### Some of the following is from Tore Anderson:
53 for ext in '~' '%' .bak .dpkg-tmp .dpkg-new .dpkg-old .dpkg-dist; do
54 rm -f /etc/citadel/*$ext
55 rm -f /var/lib/citadel/messages/*$ext
56 rm -f /var/lib/citadel/help/*$ext
58 ### TODO: remove citadel from inittab!
61 if test "$2" != overwriter; then
62 echo "$0: undocumented call to \`postrm $*'" 1>&2
65 # This package has been completely overwritten by package $3
66 # (version $4). All our files are already gone from the system.
67 # This is a special case: neither "prerm remove" nor "postrm remove"
68 # have been called, because dpkg didn't know that this package would
69 # disappear until this stage.
74 # About to upgrade FROM THIS VERSION to version $2 of this package.
75 # "prerm upgrade" has been called for this version, and "preinst
76 # upgrade" has been called for the new version. Last chance to
82 # About to upgrade from version $2 of this package TO THIS VERSION.
83 # "prerm upgrade" has been called for the old version, and "preinst
84 # upgrade" has been called for this version. This is only used if
85 # the previous version's "postrm upgrade" couldn't handle it and
86 # returned non-zero. (Fix old postrm bugs here.)
91 # Back out of an attempt to install this package. Undo the effects of
92 # "preinst install...". There are two sub-cases.
95 if test "${2+set}" = set; then
96 # When the install was attempted, version $2's configuration
97 # files were still on the system. Undo the effects of "preinst
102 # We were being installed from scratch. Undo the effects of
108 # Back out of an attempt to upgrade this package from version $2
109 # TO THIS VERSION. Undo the effects of "preinst upgrade $2".
113 *) echo "$0: didn't understand being called with \`$1'" 1>&2