diff options
Diffstat (limited to 'ubuntu/maverick/applications/kpowersave')
-rw-r--r-- | ubuntu/maverick/applications/kpowersave/debian/preinst | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ubuntu/maverick/applications/kpowersave/debian/preinst b/ubuntu/maverick/applications/kpowersave/debian/preinst index b007ccf90..d0eb1227c 100644 --- a/ubuntu/maverick/applications/kpowersave/debian/preinst +++ b/ubuntu/maverick/applications/kpowersave/debian/preinst @@ -11,10 +11,22 @@ fi case "$1" in install) + divert=`dpkg-divert --listpackage "/etc/acpi/powerbtn.sh"` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename "/etc/acpi/powerbtn.sh" + divert="" + fi dpkg-divert --package $package_name --divert /etc/acpi/powerbtn.sh.distrib --rename /etc/acpi/powerbtn.sh ;; upgrade) - dpkg-divert --package $package_name --divert /etc/acpi/powerbtn.sh.distrib --rename /etc/acpi/powerbtn.sh + divert=`dpkg-divert --listpackage "/etc/acpi/powerbtn.sh"` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename "/etc/acpi/powerbtn.sh" + divert="" + fi + if [ -z "$divert" ]; then + dpkg-divert --package $package_name --divert /etc/acpi/powerbtn.sh.distrib --rename /etc/acpi/powerbtn.sh + fi ;; abort-upgrade) ;; |