diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-02-15 16:59:06 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-02-15 16:59:06 +0100 |
commit | 683152f3b286a04a76f31ee1eed839bbdb2ab307 (patch) | |
tree | fc382ee1f535909a1892d0e07ebeb957fa68c49f /ubuntu/maverick/tdebase/debian/ksmserver-trinity.preinst | |
parent | cbfc487458706037e61278c9b5263685619d47f0 (diff) | |
download | tde-packaging-683152f3b286a04a76f31ee1eed839bbdb2ab307.tar.gz tde-packaging-683152f3b286a04a76f31ee1eed839bbdb2ab307.zip |
Fix handling of diverts on Debian and Ubuntu
Diffstat (limited to 'ubuntu/maverick/tdebase/debian/ksmserver-trinity.preinst')
-rw-r--r-- | ubuntu/maverick/tdebase/debian/ksmserver-trinity.preinst | 84 |
1 files changed, 66 insertions, 18 deletions
diff --git a/ubuntu/maverick/tdebase/debian/ksmserver-trinity.preinst b/ubuntu/maverick/tdebase/debian/ksmserver-trinity.preinst index 884257d03..f4443b487 100644 --- a/ubuntu/maverick/tdebase/debian/ksmserver-trinity.preinst +++ b/ubuntu/maverick/tdebase/debian/ksmserver-trinity.preinst @@ -1,5 +1,7 @@ #! /bin/sh -e +package_name=ksmserver-trinity + case "$1" in upgrade) @@ -10,32 +12,78 @@ case "$1" in mkdir -p /usr/share/autostart # Intrepid plasma - dpkg-divert --remove --rename /usr/share/autostart/plasma.desktop - mkdir -p /usr/bin - dpkg-divert --add --rename --divert /usr/bin/plasma.kde4 /usr/bin/plasma - rm -f /usr/bin/plasma - ln -s /usr/bin/plasma.autodetect /usr/bin/plasma + divert=`dpkg-divert --listpackage /usr/share/autostart/plasma.desktop` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename /usr/share/autostart/plasma.desktop + fi + divert=`dpkg-divert --listpackage /usr/bin/plasma` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + if [ -L /usr/bin/plasma ]; then + rm -f /usr/bin/plasma + fi + dpkg-divert --remove --local --rename /usr/bin/plasma + divert="" + fi + if [ -z "$divert" ]; then + dpkg-divert --package $package_name --rename \ + --divert /usr/bin/plasma.kde4 \ + --add /usr/bin/plasma + fi # Jaunty plasma-desktop - dpkg-divert --remove --rename /usr/share/autostart/plasma-desktop.desktop - mkdir -p /usr/bin - dpkg-divert --add --rename --divert /usr/bin/plasma-desktop.kde4 /usr/bin/plasma-desktop - rm -f /usr/bin/plasma-desktop - ln -s /usr/bin/plasma-desktop.autodetect /usr/bin/plasma-desktop + divert=`dpkg-divert --listpackage /usr/share/autostart/plasma-desktop.desktop` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename /usr/share/autostart/plasma-desktop.desktop + fi + divert=`dpkg-divert --listpackage /usr/bin/plasma-desktop` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + if [ -L /usr/bin/plasma-desktop ]; then + rm -f /usr/bin/plasma-desktop + fi + dpkg-divert --remove --local --rename /usr/bin/plasma-desktop + divert="" + fi + if [ -z "$divert" ]; then + dpkg-divert --package $package_name --rename \ + --divert /usr/bin/plasma-desktop.kde4 \ + --add /usr/bin/plasma-desktop + fi ;; install) # Intrepid plasma - mkdir -p /usr/bin - dpkg-divert --add --rename --divert /usr/bin/plasma.kde4 /usr/bin/plasma - rm -f /usr/bin/plasma - ln -s /usr/bin/plasma.autodetect /usr/bin/plasma + divert=`dpkg-divert --listpackage /usr/share/autostart/plasma.desktop` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename /usr/share/autostart/plasma.desktop + fi + divert=`dpkg-divert --listpackage /usr/bin/plasma` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + if [ -L /usr/bin/plasma ]; then + rm -f /usr/bin/plasma + fi + dpkg-divert --remove --local --rename /usr/bin/plasma + divert="" + fi + dpkg-divert --package $package_name --rename \ + --divert /usr/bin/plasma.kde4 \ + --add /usr/bin/plasma # Jaunty plasma-desktop - mkdir -p /usr/bin - dpkg-divert --add --rename --divert /usr/bin/plasma-desktop.kde4 /usr/bin/plasma-desktop - rm -f /usr/bin/plasma-desktop - ln -s /usr/bin/plasma-desktop.autodetect /usr/bin/plasma-desktop + divert=`dpkg-divert --listpackage /usr/share/autostart/plasma-desktop.desktop` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename /usr/share/autostart/plasma-desktop.desktop + fi + divert=`dpkg-divert --listpackage /usr/bin/plasma-desktop` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + if [ -L /usr/bin/plasma-desktop ]; then + rm -f /usr/bin/plasma-desktop + fi + dpkg-divert --remove --local --rename /usr/bin/plasma-desktop + divert="" + fi + dpkg-divert --package $package_name --rename \ + --divert /usr/bin/plasma-desktop.kde4 \ + --add /usr/bin/plasma-desktop ;; abort-upgrade) |