2 # postinst script for apt-p2p
4 # see: dh_installdeb(1)
8 . /usr/share/debconf/confmodule
10 # summary of how this script can be called:
11 # * <postinst> `configure' <most-recently-configured-version>
12 # * <old-postinst> `abort-upgrade' <new version>
13 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
15 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
16 # <failed-install-package> <version> `removing'
17 # <conflicting-package> <version>
18 # for details, see http://www.debian.org/doc/debian-policy/ or
19 # the debian-policy package
21 # quoting from the policy:
22 # Any necessary prompting should almost always be confined to the
23 # post-installation script, and should be protected with a conditional
24 # so that unnecessary prompting doesn't happen if a package's
25 # installation fails and the `postinst' is called with `abort-upgrade',
26 # `abort-remove' or `abort-deconfigure'.
30 if ! getent passwd apt-p2p >/dev/null; then
31 adduser --quiet --system --no-create-home \
32 --home /var/cache/apt-p2p --disabled-password \
33 --disabled-login --shell /bin/false --ingroup nogroup \
37 touch /var/log/apt-p2p.log
38 chown apt-p2p:adm /var/log/apt-p2p.log
39 mkdir -p /var/cache/apt-p2p
40 chown -R apt-p2p:adm /var/cache/apt-p2p
43 abort-upgrade|abort-remove|abort-deconfigure)
47 echo "postinst called with unknown argument \`$1'" >&2
52 # Tell debconf to stop so it doesn't get confused
55 # dh_installdeb will replace this with shell code automatically
56 # generated by other debhelper scripts.