~ubuntu-branches/ubuntu/lucid/wpasupplicant/lucid-security

« back to all changes in this revision

Viewing changes to debian/wpasupplicant.postrm

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-12-02 20:52:16 UTC
  • mfrom: (2.1.30 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081202205216-72fqozu84sdt89a8
Tags: 0.6.4-3
Bugfix: "Missing -d in testing for a directory in init script". 
Thanks to Braun Gábor <braung@renyi.hu> for reporting and the patch.
(Closes: #506328)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
# If preinst fails during upgrade:
27
27
#       <new-postrm> abort-upgrade <old-version>
28
28
 
29
 
# Undo removal of a no-longer used conffile
30
 
undo_rm_conffile()
31
 
{
32
 
    CONFFILE="$1"
33
 
 
34
 
    if [ ! -e "$CONFFILE" ]; then
35
 
        if [ -e "$CONFFILE".dpkg-bak ]; then
36
 
            echo "Restoring modified conffile $CONFFILE"
37
 
            mv -f "$CONFFILE".dpkg-bak "$CONFFILE"
38
 
        fi
39
 
    fi
40
 
}
41
 
 
42
 
 
43
 
# Undo removal of init script
44
 
undo_rm_init_script()
45
 
{
46
 
    undo_rm_conffile /etc/default/wpasupplicant
47
 
    undo_rm_conffile /etc/init.d/wpasupplicant
48
 
    undo_rm_conffile /etc/wpa_supplicant.conf
49
 
    undo_rm_conffile /etc/network/if-pre-up.d/wpasupplicant
50
 
    undo_rm_conffile /etc/network/if-post-down.d/wpasupplicant
51
 
}
52
 
 
53
 
 
54
29
case "$1" in
55
 
    remove)
56
 
        ;;
57
 
 
58
 
    purge)
59
 
        # Remove logfiles
60
 
        rm -f /var/log/wpa_action.log*
61
 
        # Remove stale lock file (lockfile absent since 0.5.5-2)
62
 
        rm -f /var/lock/wpa_action.*.lock
63
 
        ;;
64
 
 
65
 
    upgrade|failed-upgrade|disappear)
66
 
        ;;
67
 
 
68
 
    abort-install|abort-upgrade)
69
 
        if dpkg --compare-versions "$2" lt "0.4.8-1"; then
70
 
            undo_rm_init_script
71
 
        fi
72
 
        ;;
73
 
 
74
 
    *)
75
 
        echo "$0 called with unknown argument \`$1'" 1>&2
76
 
        exit 1
77
 
        ;;
 
30
        remove)
 
31
                ;;
 
32
        purge)
 
33
                # Remove logfiles
 
34
                rm -f /var/log/wpa_action.log* /var/log/wpa_action.*.log*
 
35
                rm -f /var/log/wpa_supplicant.log* /var/log/wpa_supplicant.*.log*
 
36
                ;;
 
37
        upgrade|failed-upgrade|disappear)
 
38
                ;;
 
39
        abort-install|abort-upgrade)
 
40
                ;;
 
41
        *)
 
42
                echo "$0 called with unknown argument \`$1'" 1>&2
 
43
                exit 1
 
44
                ;;
78
45
esac
79
46
 
80
47
#DEBHELPER#