summaryrefslogtreecommitdiffstats
path: root/ubuntu/precise/applications/kpowersave/debian/preinst
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-02-15 16:59:06 +0100
committerSlávek Banko <slavek.banko@axis.cz>2013-02-15 16:59:06 +0100
commit683152f3b286a04a76f31ee1eed839bbdb2ab307 (patch)
treefc382ee1f535909a1892d0e07ebeb957fa68c49f /ubuntu/precise/applications/kpowersave/debian/preinst
parentcbfc487458706037e61278c9b5263685619d47f0 (diff)
downloadtde-packaging-683152f3b286a04a76f31ee1eed839bbdb2ab307.tar.gz
tde-packaging-683152f3b286a04a76f31ee1eed839bbdb2ab307.zip
Fix handling of diverts on Debian and Ubuntu
Diffstat (limited to 'ubuntu/precise/applications/kpowersave/debian/preinst')
-rw-r--r--ubuntu/precise/applications/kpowersave/debian/preinst14
1 files changed, 13 insertions, 1 deletions
diff --git a/ubuntu/precise/applications/kpowersave/debian/preinst b/ubuntu/precise/applications/kpowersave/debian/preinst
index b007ccf90..d0eb1227c 100644
--- a/ubuntu/precise/applications/kpowersave/debian/preinst
+++ b/ubuntu/precise/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)
;;