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

Revision 26011, 1.6 KB checked in by achernya, 11 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# preinst script for debathena-reactivate
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <new-preinst> `install'
10#        * <new-preinst> `install' <old-version>
11#        * <new-preinst> `upgrade' <old-version>
12#        * <old-preinst> `abort-upgrade' <new-version>
13# for details, see http://www.debian.org/doc/debian-policy/ or
14# the debian-policy package
15       
16if dpkg-maintscript-helper supports rm_conffile 2> /dev/null; then
17    dpkg-maintscript-helper rm_conffile /etc/athena/sudo-error 2.0.39 -- "$@"
18    dpkg-maintscript-helper rm_conffile /etc/athena/su-error 2.0.39 -- "$@"
19else
20    # From http://wiki.debian.org/DpkgConffileHandling
21    rm_conffile() {
22        local PKGNAME="$1"
23        local CONFFILE="$2"
24       
25        [ -e "$CONFFILE" ] || return 0
26       
27        local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
28        local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
29            sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
30        if [ "$md5sum" != "$old_md5sum" ]; then
31            echo "Obsolete conffile $CONFFILE has been modified by you."
32            echo "Saving as $CONFFILE.dpkg-bak ..."
33            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
34        else
35            echo "Removing obsolete conffile $CONFFILE ..."
36            mv -f "$CONFFILE" "$CONFFILE".dpkg-del
37        fi
38    }
39    case "$1" in
40        install|upgrade)
41            if dpkg --compare-versions "$2" le-nl 2.0.39; then
42                rm_conffile debathena-reactivate "/etc/athena/sudo-error"
43                rm_conffile debathena-reactivate "/etc/athena/su-error"
44            fi
45    esac
46fi
47
48# dh_installdeb will replace this with shell code automatically
49# generated by other debhelper scripts.
50
51#DEBHELPER#
52
53exit 0
Note: See TracBrowser for help on using the repository browser.