summaryrefslogtreecommitdiffstats
path: root/ubuntu/precise/applications/tdesudo/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/tdesudo/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/tdesudo/debian/preinst')
-rw-r--r--ubuntu/precise/applications/tdesudo/debian/preinst13
1 files changed, 10 insertions, 3 deletions
diff --git a/ubuntu/precise/applications/tdesudo/debian/preinst b/ubuntu/precise/applications/tdesudo/debian/preinst
index a13492559..770dfaacb 100644
--- a/ubuntu/precise/applications/tdesudo/debian/preinst
+++ b/ubuntu/precise/applications/tdesudo/debian/preinst
@@ -16,9 +16,16 @@ case "$1" in
--rename /opt/trinity/bin/tdesu
;;
upgrade)
- dpkg-divert --package $package_name \
- --divert /opt/trinity/bin/tdesu.distrib \
- --rename /opt/trinity/bin/tdesu
+ divert=`dpkg-divert --listpackage "/usr/trinity/bin/tdesu"`
+ if [ -n "$divert" ] && [ "$divert" = "$package_name" ]; then
+ dpkg-divert --remove --package $package_name --rename "/usr/trinity/bin/tdesu"
+ fi
+ divert=`dpkg-divert --listpackage "/opt/trinity/bin/tdesu"`
+ if [ -z "$divert" ]; then
+ dpkg-divert --package $package_name \
+ --divert /opt/trinity/bin/tdesu.distrib \
+ --rename /opt/trinity/bin/tdesu
+ fi
;;
abort-upgrade)
;;