Debian Codegraph @

debian/postrm

raw symbols SCIP
1 #! /bin/sh
2 # -*- Mode: Sh -*-
3 # postrm ---
4 # Author : Manoj Srivastava ( [email protected] )
5 # Created On : Fri Nov 14 12:22:20 2003
6 # Created On Node : glaurung.green-gryphon.com
7 # Last Modified By : Manoj Srivastava
8 # Last Modified On : Sat Dec 6 18:27:05 2003
9 # Last Machine Used: glaurung.green-gryphon.com
10 # Update Count : 10
11 # Status : Unknown, Use with caution!
12 # HISTORY :
13 # Description :
14 #
15 # arch-tag: 56802d51-d980-4822-85c0-28fce19ed430
16 #
17 # This program is free software; you can redistribute it and/or modify
18 # it under the terms of the GNU General Public License as published by
19 # the Free Software Foundation; either version 2 of the License, or
20 # (at your option) any later version.
21 #
22 # This program is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
26 #
27 # You should have received a copy of the GNU General Public License
28 # along with this program; if not, write to the Free Software
29 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #
31
32
33 # Abort if any command returns an error value
34 set -e
35
36 package_name=psgml
37
38 if [ -z "$package_name" ]; then
39 print >&2 "Internal Error. Please report a bug."
40 exit 1;
41 fi
42
43 # This script is called twice during the removal of the package; once
44 # after the removal of the package's files from the system, and as
45 # the final step in the removal of this package, after the package's
46 # conffiles have been removed.
47 # summary of how this script can be called:
48 # * <postrm> `remove'
49 # * <postrm> `purge'
50 # * <old-postrm> `upgrade' <new-version>
51 # * <new-postrm> `failed-upgrade' <old-version>
52 # * <new-postrm> `abort-install'
53 # * <new-postrm> `abort-install' <old-version>
54 # * <new-postrm> `abort-upgrade' <old-version>
55 # * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
56 # for details, see http://www.debian.org/doc/debian-policy/ or
57 # the debian-policy package
58
59 # Ensure the menu system is updated
60 #[ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus
61
62 case "$1" in
63 remove)
64 # This package is being removed, but its configuration has not yet
65 # been purged.
66 :
67
68 # Remove diversion
69 ##: dpkg-divert --package ${package_name} --remove --rename \
70 ##: --divert /usr/bin/other.real /usr/bin/other
71
72 # ldconfig is NOT needed during removal of a library, only during
73 # installation
74 if [ -d /usr/share/emacs/site-lisp/psgml ]; then
75 rm -rf /usr/share/emacs/site-lisp/$package_name
76 fi
77 ;;
78 purge)
79 # This package has previously been removed and is now having
80 # its configuration purged from the system.
81 :
82
83 # we mimic dpkg as closely as possible, so we remove configuration
84 # files with dpkg backup extensions too:
85 ### Some of the following is from Tore Anderson:
86 ##: for ext in '~' '%' .bak .dpkg-tmp .dpkg-new .dpkg-old .dpkg-dist; do
87 ##: rm -f /etc/${package_name}.conf$ext
88 ##: done
89
90 # remove the configuration file itself
91 ##: rm -f /etc/${package_name}.conf
92
93 # and finally clear it out from the ucf database
94 ##: ucf --purge /etc/${package_name}.conf
95
96 # Remove symlinks from /etc/rc?.d
97 ##: update-rc.d ${package_name} remove >/dev/null
98
99 ##: if [ -e /usr/share/debconf/confmodule ]; then
100 ##: # Purge this package's data from the debconf database.
101 ##: . /usr/share/debconf/confmodule
102 ##: db_purge
103 ##: fi
104
105 # This package has previously been removed and is now having
106 # its configuration purged from the system.
107 for flavour in xemacs21 emacs20 emacs21 emacs22 emacs23 emacs24 emacs25 emacs-snapshot emacs; do
108 FLAVOURDIR=/etc/$flavour;
109 STARTDIR=$FLAVOURDIR/site-start.d;
110 STARTFILE="${package_name}-init.el";
111 if [ -e "$STARTDIR/50$STARTFILE" ]; then
112 echo "Removing $STARTDIR/50$STARTFILE"
113 if which ucf >/dev/null; then
114 ucf --purge "$STARTDIR/50$STARTFILE"
115 fi
116 if which ucfr >/dev/null; then
117 ucfr --purge psgml "$STARTDIR/50$STARTFILE"
118 fi
119 rm -f "$STARTDIR/50$STARTFILE"
120 fi
121 if [ -d "$STARTDIR" ]; then
122 rmdir --ignore-fail-on-non-empty "$STARTDIR"
123 fi
124 if [ -d "$FLAVOURDIR" ]; then
125 rmdir --ignore-fail-on-non-empty "$FLAVOURDIR"
126 fi
127 done
128
129 ;;
130 disappear)
131 if test "$2" != overwriter; then
132 echo "$0: undocumented call to \`postrm $*'" 1>&2
133 exit 0
134 fi
135 # This package has been completely overwritten by package $3
136 # (version $4). All our files are already gone from the system.
137 # This is a special case: neither "prerm remove" nor "postrm remove"
138 # have been called, because dpkg didn't know that this package would
139 # disappear until this stage.
140 :
141
142 ;;
143 upgrade)
144 # About to upgrade FROM THIS VERSION to version $2 of this package.
145 # "prerm upgrade" has been called for this version, and "preinst
146 # upgrade" has been called for the new version. Last chance to
147 # clean up.
148 :
149
150 ;;
151 failed-upgrade)
152 # About to upgrade from version $2 of this package TO THIS VERSION.
153 # "prerm upgrade" has been called for the old version, and "preinst
154 # upgrade" has been called for this version. This is only used if
155 # the previous version's "postrm upgrade" couldn't handle it and
156 # returned non-zero. (Fix old postrm bugs here.)
157 :
158
159 ;;
160 abort-install)
161 # Back out of an attempt to install this package. Undo the effects of
162 # "preinst install...". There are two sub-cases.
163 :
164
165 if test "${2+set}" = set; then
166 # When the install was attempted, version $2's configuration
167 # files were still on the system. Undo the effects of "preinst
168 # install $2".
169 :
170
171 else
172 # We were being installed from scratch. Undo the effects of
173 # "preinst install".
174 :
175
176 fi ;;
177 abort-upgrade)
178 # Back out of an attempt to upgrade this package from version $2
179 # TO THIS VERSION. Undo the effects of "preinst upgrade $2".
180 :
181
182 ;;
183 *) echo "$0: didn't understand being called with \`$1'" 1>&2
184 exit 0;;
185 esac
186
187 exit 0