]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/prerm.in
* Added doc-base support for all of the HTML docs in the package
[debian/debian-policy.git] / debian / prerm.in
1 #!/bin/sh
2 #                               -*- Mode: Sh -*- 
3 # prerm --- 
4 # Author           : Manoj Srivastava ( srivasta@tiamat.datasync.com ) 
5 # Created On       : Thu Oct 29 15:31:03 1998
6 # Created On Node  : tiamat.datasync.com
7 # Last Modified By : Manoj Srivastava
8 # Last Modified On : Fri Mar 17 17:10:23 2000
9 # Last Machine Used: glaurung.green-gryphon.com
10 # Update Count     : 2
11 # Status           : Unknown, Use with caution!
12 # HISTORY          : 
13 # Description      : 
14
15
16
17 # Abort if any command returns an error value
18 set -e
19
20 # This is filled in by debian/rules
21 package_name=#PACKAGE#
22
23 # This script is called as the first step in removing the package from
24 # the system.  This includes cases where the user explicitly asked for
25 # the package to be removed, upgrade, automatic removal due to conflicts,
26 # and deconfiguration due to temporary removal of a depended-on package.
27
28 case "$1" in
29   remove)
30     # This package about to be removed.
31     :
32     if [ -L /usr/doc/$package_name ]; then
33         rm -f /usr/doc/$package_name
34     fi
35
36     # There are two sub-cases:
37     if test "${2+set}" = set; then
38       if test "$2" != in-favour; then
39         echo "$0: undocumented call to \`prerm $*'" 1>&2
40         exit 0
41       fi
42       # We are being removed because of a conflict with package $3
43       # (version $4), which is now being installed.
44       :
45
46     else
47       # The package is being removed in its own right.
48       :
49
50     fi ;;
51   deconfigure)
52     if test "$2" != in-favour -o "$5" != removing; then
53       echo "$0: undocumented call to \`prerm $*'" 1>&2
54       exit 0
55     fi
56     # Package $6 (version $7) which we depend on is being removed due
57     # to a conflict with package $3 (version $4), and this package is
58     # being deconfigured until $6 can be reinstalled.
59     :
60
61     ;;
62   upgrade)
63     # Prepare to upgrade FROM THIS VERSION of this package to version $2.
64     :
65     if [ -L /usr/doc/$package_name ]; then
66         rm -f /usr/doc/$package_name
67     fi
68
69     ;;
70   failed-upgrade)
71     # Prepare to upgrade from version $2 of this package TO THIS VERSION.
72     # This is only used if the old version's prerm couldn't handle it,
73     # and returned non-zero.  (Fix old prerm bugs here.)
74     :
75
76     ;;
77   *) echo "$0: didn't understand being called with \`$1'" 1>&2
78      exit 0;;
79 esac
80
81
82
83 if [ -x /usr/sbin/install-docs ]; then
84     /usr/sbin/install-docs -r debian-policy
85     /usr/sbin/install-docs -r debian-menu-policy
86     /usr/sbin/install-docs -r debian-mime-policy
87     /usr/sbin/install-docs -r debian-perl-policy
88     /usr/sbin/install-docs -r debian-policy-process
89     /usr/sbin/install-docs -r debconf-spec
90 fi
91
92 exit 0