]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/postinst
Synchronized with patch 33 from Manojs tree
[debian/debian-policy.git] / debian / postinst
1 #!/bin/sh
2 #                               -*- Mode: Sh -*- 
3 # postinst --- 
4 # Author           : Manoj Srivastava ( srivasta@tiamat.datasync.com ) 
5 # Created On       : Thu Oct 29 15:23:36 1998
6 # Created On Node  : tiamat.datasync.com
7 # Last Modified By : Manoj Srivastava
8 # Last Modified On : Thu Oct 29 15:28:24 1998
9 # Last Machine Used: tiamat.datasync.com
10 # Update Count     : 3
11 # Status           : Unknown, Use with caution!
12 # HISTORY          : 
13 # Description      : 
14
15
16
17
18 # Abort if any command returns an error value
19 set -e
20
21
22 # This script is called as the last step of the installation of the
23 # package.  All the package's files are in place, dpkg has already done
24 # its automatic conffile handling, and all the packages we depend of
25 # are already fully installed and configured.
26
27
28 case "$1" in
29   configure)
30     # Configure this package.  If the package must prompt the user for
31     # information, do it here.
32     :
33
34     if [ -x /usr/sbin/install-docs ]; then
35         /usr/sbin/install-docs -i /usr/share/doc-base/debian-policy
36     fi
37
38     # There are three sub-cases:
39     if test "${2+set}" != set; then
40       # We're being installed by an ancient dpkg which doesn't remember
41       # which version was most recently configured, or even whether
42       # there is a most recently configured version.
43       :
44
45     elif test -z "$2" -o "$2" = "<unknown>"; then
46       # The package has not ever been configured on this system, or was
47       # purged since it was last configured.
48       :
49
50     else
51       # Version $2 is the most recently configured version of this
52       # package.
53       :
54
55     fi ;;
56   abort-upgrade)
57     # Back out of an attempt to upgrade this package FROM THIS VERSION
58     # to version $2.  Undo the effects of "prerm upgrade $2".
59     :
60
61     ;;
62   abort-remove)
63     if test "$2" != in-favour; then
64       echo "$0: undocumented call to \`postinst $*'" 1>&2
65       exit 0
66     fi
67     # Back out of an attempt to remove this package, which was due to
68     # a conflict with package $3 (version $4).  Undo the effects of
69     # "prerm remove in-favour $3 $4".
70     :
71
72     ;;
73   abort-deconfigure)
74     if test "$2" != in-favour -o "$5" != removing; then
75       echo "$0: undocumented call to \`postinst $*'" 1>&2
76       exit 0
77     fi
78     # Back out of an attempt to deconfigure this package, which was
79     # due to package $6 (version $7) which we depend on being removed
80     # to make way for package $3 (version $4).  Undo the effects of
81     # "prerm deconfigure in-favour $3 $4 removing $6 $7".
82     :
83
84     ;;
85   *) echo "$0: didn't understand being called with \`$1'" 1>&2
86      exit 0;;
87 esac
88
89 exit 0