source: trunk/debathena/config/auto-update/debian/debathena-auto-update.postrm @ 25005

Revision 25005, 1.6 KB checked in by jdreed, 14 years ago (diff)
In auto-update: * Use the correct version notation when removing obsolete conffiles
RevLine 
[24942]1#!/bin/sh
2# postrm script for debathena-auto-update
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <postrm> `remove'
10#        * <postrm> `purge'
11#        * <old-postrm> `upgrade' <new-version>
12#        * <new-postrm> `failed-upgrade' <old-version>
13#        * <new-postrm> `abort-install'
14#        * <new-postrm> `abort-install' <old-version>
15#        * <new-postrm> `abort-upgrade' <old-version>
16#        * <disappearer's-postrm> `disappear' <overwriter>
17#          <overwriter-version>
18# for details, see http://www.debian.org/doc/debian-policy/ or
19# the debian-policy package
20
[24992]21if dpkg-maintscript-helper supports rm_conffile 2> /dev/null; then
22    dpkg-maintscript-helper rm_conffile \
[25005]23        /etc/cron.d/debathena-auto-update 1.22.2 -- "$@"
[24992]24else
25    # From http://wiki.debian.org/DpkgConffileHandling
26    rm_conffile() {
27        local PKGNAME="$1" # Unused
28        local CONFFILE="$2"
29       
30        if [ -f "$CONFFILE".dpkg-del ]; then
31            mv -f "$CONFFILE".dpkg-del "$CONFFILE"
32        fi
33    }
34    # See policy 6.6, item 3 and 5
35    case "$1" in
36        abort-install|abort-upgrade)
[25005]37            if dpkg --compare-versions "$2" le-nl 1.22.2; then
[24992]38                rm_conffile debathena-auto-update "/etc/cron.d/debathena-auto-update"
39            fi
40    esac
41fi
[24942]42
43case "$1" in
44    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
45        if [ -z "$2" ]; then
46            # Cleanup status file
47            rm -f /var/lib/athena-update-status
48        fi
49    ;;
50
51    *)
52        echo "postrm called with unknown argument \`$1'" >&2
53        exit 1
54    ;;
55esac
56
57# dh_installdeb will replace this with shell code automatically
58# generated by other debhelper scripts.
59
60#DEBHELPER#
61
62exit 0
Note: See TracBrowser for help on using the repository browser.