~ubuntu-branches/ubuntu/lucid/acpid/lucid-updates

« back to all changes in this revision

Viewing changes to debian/acpid.preinst

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-11-17 14:50:01 UTC
  • mfrom: (2.1.12 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091117145001-y5hevyg7gcg6uwjk
Tags: 1.0.10-4
Updated netlink patch to version 6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
            echo "Saving as $CONFFILE.dpkg-bak ..."
17
17
            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
18
18
        else
19
 
            echo "Removing obsolete conffile $CONFFILE ..."
20
 
            rm -f "$CONFFILE"
 
19
            if [ "$CONFFILE" = "/etc/acpi/events/powerbtn" -a -e /etc/acpi/powerbtn.sh.dpkg-bak ]; then
 
20
                # we need some special logic for /etc/acpi/events/powerbtn because it might
 
21
                # be kept because it was changed itself or because /etc/acpi/powerbtn.sh was changed
 
22
                echo "Obsolete conffile $CONFFILE saved as $CONFFILE.dpkg-bak ..."
 
23
                sed -e 's#/etc/acpi/powerbtn.sh#/etc/acpi/powerbtn.sh.dpkg-bak#' < "$CONFFILE" > "$CONFFILE".dpkg-bak
 
24
            else
 
25
                echo "Removing obsolete conffile $CONFFILE ..."
 
26
            fi
 
27
            rm -f "$CONFFILE"
21
28
        fi
22
29
    fi
23
30
}
 
31
 
24
32
case "$1" in
25
33
  install|upgrade)
26
 
    rm_conffile acpid /etc/logrotate.d/acpid
 
34
    if dpkg --compare-versions "$2" lt 1.0.8-7; then
 
35
        rm_conffile acpid /etc/logrotate.d/acpid
 
36
        rm_conffile acpid /etc/acpi/powerbtn.sh
 
37
        rm_conffile acpid /etc/acpi/events/powerbtn
 
38
    fi
27
39
  ;;
28
40
esac
29
41