source: trunk/debathena/config/reactivate/debian/debathena-reactivate.postinst @ 26011

Revision 26011, 2.4 KB checked in by achernya, 12 years ago (diff)
In reactivate: * Remove old c-p-d undivert code, it's no longer needed * Stop processing schroot.conf in the preinst
  • Property svn:executable set to *
Line 
1#!/bin/sh
2# postinst script for debathena-reactivate
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <postinst> `configure' <most-recently-configured-version>
10#        * <old-postinst> `abort-upgrade' <new version>
11#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12#          <new-version>
13#        * <postinst> `abort-remove'
14#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15#          <failed-install-package> <version> `removing'
16#          <conflicting-package> <version>
17# for details, see http://www.debian.org/doc/debian-policy/ or
18# the debian-policy package
19
20. /usr/lib/debathena-cupsys-config/restart-cups.sh
21
22if dpkg-maintscript-helper supports rm_conffile 2> /dev/null; then
23    dpkg-maintscript-helper rm_conffile /etc/athena/sudo-error 2.0.39 -- "$@"
24    dpkg-maintscript-helper rm_conffile /etc/athena/su-error 2.0.39 -- "$@"
25else
26    # From http://wiki.debian.org/DpkgConffileHandling
27    rm_conffile() {
28        local PKGNAME="$1" # Unused
29        local CONFFILE="$2"
30        if [ -f "$CONFFILE".dpkg-del ]; then
31            rm -f "$CONFFILE".dpkg-del
32        fi
33    }
34    case "$1" in
35        configure)
36            if dpkg --compare-versions "$2" le-nl 2.0.39; then
37                rm_conffile debathena-reactivate "/etc/athena/sudo-error"
38                rm_conffile debathena-reactivate "/etc/athena/su-error"
39            fi
40    esac
41fi
42
43case "$1" in
44    configure)
45        # Users logging in will be added to several different
46        # groups. Make sure they all exist.
47        for group in $(sed -ne 's/^addgroups="\(.*\)"/\1/p' /etc/gdm/Xsession.debathena); do
48            getent group "$group" >/dev/null || addgroup --system "$group"
49        done
50        # Files in sudoers.d need to be chmod 0440
51        chmod 0440 /etc/sudoers.d/debathena-reactivate-sudoers
52
53        if dpkg --compare-versions "$2" lt 1.25.5~ && \
54            dpkg --compare-versions "$2" ge 1.25.2; then
55            ln -nsf su.debathena /etc/pam.d/su
56        fi
57        if dpkg --compare-versions "$2" lt 2.0.26~ && \
58            [ -x /usr/share/update-notifier/notify-reboot-required ]; then
59            /usr/share/update-notifier/notify-reboot-required
60        fi
61
62        # Make printing suck less
63        restart_cups
64    ;;
65
66    abort-upgrade|abort-remove|abort-deconfigure)
67    ;;
68
69    *)
70        echo "postinst called with unknown argument \`$1'" >&2
71        exit 1
72    ;;
73esac
74
75# dh_installdeb will replace this with shell code automatically
76# generated by other debhelper scripts.
77
78#DEBHELPER#
79
80exit 0
81
82
Note: See TracBrowser for help on using the repository browser.