]> git.proxmox.com Git - pve-manager.git/blob - debian/prerm
3eca4eb62dbb2bf6254e039521ff378efa0b4aa9
[pve-manager.git] / debian / prerm
1 #! /bin/sh
2
3 # Abort if any command returns an error value
4 set -e
5
6 # This script is called as the first step in removing the package from
7 # the system. This includes cases where the user explicitly asked for
8 # the package to be removed, upgrade, automatic removal due to conflicts,
9 # and deconfiguration due to temporary removal of a depended-on package.
10
11 package_name=pve-manager;
12
13 case "$1" in
14 remove)
15 # This package about to be removed.
16
17 # There are two sub-cases:
18 if test "${2+set}" = set; then
19 if test "$2" != in-favour; then
20 echo "$0: undocumented call to \`prerm $*'" 1>&2
21 exit 0
22 fi
23 # We are being removed because of a conflict with package $3
24 # (version $4), which is now being installed.
25 :
26
27 else
28 # The package is being removed in its own right.
29 :
30
31 fi ;;
32 deconfigure)
33 if test "$2" != in-favour -o "$5" != removing; then
34 echo "$0: undocumented call to \`prerm $*'" 1>&2
35 exit 0
36 fi
37 # Package $6 (version $7) which we depend on is being removed due
38 # to a conflict with package $3 (version $4), and this package is
39 # being deconfigured until $6 can be reinstalled.
40 :
41
42 ;;
43 upgrade)
44 # Prepare to upgrade FROM THIS VERSION of this package to version $2.
45
46 if [ -L /usr/doc/$package_name ]; then
47 rm -f /usr/doc/$package_name
48 fi
49
50
51 ;;
52 failed-upgrade)
53 # Prepare to upgrade from version $2 of this package TO THIS VERSION.
54 # This is only used if the old version's prerm couldn't handle it,
55 # and returned non-zero. (Fix old prerm bugs here.)
56 :
57
58 ;;
59 *) echo "$0: didn't understand being called with \`$1'" 1>&2
60 exit 0;;
61 esac
62
63 exit 0