]>
git.saurik.com Git - apt.git/blob - debian/apt.postinst
5 # summary of how this script can be called:
6 # * <postinst> `configure' <most-recently-configured-version>
7 # * <old-postinst> `abort-upgrade' <new version>
8 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
10 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
11 # <failed-install-package> <version> `removing'
12 # <conflicting-package> <version>
13 # for details, see http://www.debian.org/doc/debian-policy/ or
14 # the debian-policy package
18 if dpkg
--compare-versions "$2" lt
1.0.7; then
19 # apt-key before 0.9.10 could leave empty keyrings around
20 find /etc
/apt
/trusted.gpg.d
/ -name '*.gpg' | while read keyring
; do
21 if ! test -s "$keyring"; then
27 if dpkg
--compare-versions "$2" lt
-nl 0.9.9.5; then
28 # we are using tmpfiles for both
29 rm -f /etc
/apt
/trustdb.gpg
30 # this removal was done unconditional since 0.8.15.3
31 SECRING
='/etc/apt/secring.gpg'
32 # test if secring is an empty normal file
33 if test -f $SECRING -a ! -s $SECRING; then
38 # add unprivileged user for the apt methods
39 adduser
--force-badname --system -home /var
/empty \
40 --no-create-home --quiet _apt
|| true
42 # deal with upgrades from experimental
43 if dpkg
--compare-versions "$2" 'eq' '1.1~exp3'; then
44 # libapt will setup partial/ at runtime
45 chown
-R root
:root
/var
/lib
/apt
/lists
/var
/cache
/apt
/archives
|| true
48 # ensure tighter permissons on the logs, see LP: #975199
49 if dpkg
--compare-versions "$2" lt
-nl 0.9.7.7; then
50 # ensure permissions are right
51 chmod -f 0640 /var
/log
/apt
/term.log
* || true
54 # create kernel autoremoval blacklist on update
55 if dpkg
--compare-versions "$2" lt
0.9.9.3; then
56 /etc
/kernel
/postinst.d
/apt
-auto-removal
60 abort
-upgrade|abort
-remove|abort
-deconfigure)
65 echo "postinst called with unknown argument \`$1'" >&2
70 # dh_installdeb will replace this with shell code automatically
71 # generated by other debhelper scripts.