]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/prerm
New version
[debian/debian-policy.git] / debian / prerm
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 : Thu Oct 29 15:33:43 1998
9 # Last Machine Used: tiamat.datasync.com
10 # Update Count     : 1
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 script is called as the first step in removing the package from
21 # the system.  This includes cases where the user explicitly asked for
22 # the package to be removed, upgrade, automatic removal due to conflicts,
23 # and deconfiguration due to temporary removal of a depended-on package.
24
25 case "$1" in
26   remove)
27     # This package about to be removed.
28     :
29
30     # There are two sub-cases:
31     if test "${2+set}" = set; then
32       if test "$2" != in-favour; then
33         echo "$0: undocumented call to \`prerm $*'" 1>&2
34         exit 0
35       fi
36       # We are being removed because of a conflict with package $3
37       # (version $4), which is now being installed.
38       :
39
40     else
41       # The package is being removed in its own right.
42       :
43
44     fi ;;
45   deconfigure)
46     if test "$2" != in-favour -o "$5" != removing; then
47       echo "$0: undocumented call to \`prerm $*'" 1>&2
48       exit 0
49     fi
50     # Package $6 (version $7) which we depend on is being removed due
51     # to a conflict with package $3 (version $4), and this package is
52     # being deconfigured until $6 can be reinstalled.
53     :
54
55     ;;
56   upgrade)
57     # Prepare to upgrade FROM THIS VERSION of this package to version $2.
58     :
59
60     ;;
61   failed-upgrade)
62     # Prepare to upgrade from version $2 of this package TO THIS VERSION.
63     # This is only used if the old version's prerm couldn't handle it,
64     # and returned non-zero.  (Fix old prerm bugs here.)
65     :
66
67     ;;
68   *) echo "$0: didn't understand being called with \`$1'" 1>&2
69      exit 0;;
70 esac
71
72 if [ -x /usr/sbin/install-docs ]; then
73     /usr/sbin/install-docs -r debian-policy
74 fi
75
76 exit 0