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 17:06:07 +0100 |
commit | bedc66d159b698e1c1a9721debbac4867e11f844 (patch) | |
tree | 8f99f3df7dfdfa7e208d7a085c0c921b08141f36 /ubuntu/maverick | |
parent | cf7d83dc30f0a050e17fee4b7a6c10c8bc15044b (diff) | |
download | tde-packaging-bedc66d159b698e1c1a9721debbac4867e11f844.tar.gz tde-packaging-bedc66d159b698e1c1a9721debbac4867e11f844.zip |
Fix handling of diverts on Debian and Ubuntu
(cherry picked from commit 683152f3b286a04a76f31ee1eed839bbdb2ab307)
Diffstat (limited to 'ubuntu/maverick')
12 files changed, 197 insertions, 66 deletions
diff --git a/ubuntu/maverick/applications/kdesudo/debian/postinst b/ubuntu/maverick/applications/kdesudo/debian/postinst index d452abce3..7ec0ace2f 100644 --- a/ubuntu/maverick/applications/kdesudo/debian/postinst +++ b/ubuntu/maverick/applications/kdesudo/debian/postinst @@ -11,8 +11,6 @@ fi case "$1" in configure) - dpkg-divert --package $package_name --rename --remove \ - /usr/trinity/bin/kdesu || true ;; abort-upgrade) ;; diff --git a/ubuntu/maverick/applications/kdesudo/debian/preinst b/ubuntu/maverick/applications/kdesudo/debian/preinst index d711fde5b..4ce843004 100644 --- a/ubuntu/maverick/applications/kdesudo/debian/preinst +++ b/ubuntu/maverick/applications/kdesudo/debian/preinst @@ -16,9 +16,16 @@ case "$1" in --rename /opt/trinity/bin/kdesu ;; upgrade) - dpkg-divert --package $package_name \ - --divert /opt/trinity/bin/kdesu.distrib \ - --rename /opt/trinity/bin/kdesu + divert=`dpkg-divert --listpackage "/usr/trinity/bin/kdesu"` + if [ -n "$divert" ] && [ "$divert" = "$package_name" ]; then + dpkg-divert --remove --package $package_name --rename "/usr/trinity/bin/kdesu" + fi + divert=`dpkg-divert --listpackage "/opt/trinity/bin/kdesu"` + if [ -z "$divert" ]; then + dpkg-divert --package $package_name \ + --divert /opt/trinity/bin/kdesu.distrib \ + --rename /opt/trinity/bin/kdesu + fi ;; abort-upgrade) ;; diff --git a/ubuntu/maverick/applications/kio-umountwrapper/debian/preinst b/ubuntu/maverick/applications/kio-umountwrapper/debian/preinst index f1e4f5d24..78e02c765 100644 --- a/ubuntu/maverick/applications/kio-umountwrapper/debian/preinst +++ b/ubuntu/maverick/applications/kio-umountwrapper/debian/preinst @@ -33,24 +33,35 @@ case "$1" in --rename /opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop dpkg-divert --package $package_name \ + --divert /opt/trinity/share/apps/dolphin/servicemenus/media_safelyremove.desktop.distrib \ + --rename /opt/trinity/share/apps/dolphin/servicemenus/media_safelyremove.desktop + + dpkg-divert --package $package_name \ --divert /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop.distrib \ --rename /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop - rm -f /opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop - rm -f /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop - ;; upgrade) - dpkg-divert --package $package_name \ - --divert /opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop.distrib \ - --rename /opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop + divert=`dpkg-divert --listpackage "/opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop"` + if [ -z "$divert" ]; then + dpkg-divert --package $package_name \ + --divert /opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop.distrib \ + --rename /opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop + fi - dpkg-divert --package $package_name \ - --divert /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop.distrib \ - --rename /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop + divert=`dpkg-divert --listpackage "/opt/trinity/share/apps/dolphin/servicemenus/media_safelyremove.desktop"` + if [ -z "$divert" ]; then + dpkg-divert --package $package_name \ + --divert /opt/trinity/share/apps/dolphin/servicemenus/media_safelyremove.desktop.distrib \ + --rename /opt/trinity/share/apps/dolphin/servicemenus/media_safelyremove.desktop + fi - rm -f /opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop - rm -f /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop + divert=`dpkg-divert --listpackage "/opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop"` + if [ -z "$divert" ]; then + dpkg-divert --package $package_name \ + --divert /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop.distrib \ + --rename /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop + fi exit 0 ;; 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) ;; diff --git a/ubuntu/maverick/kdeadmin/debian/knetworkconf-trinity.postinst b/ubuntu/maverick/kdeadmin/debian/knetworkconf-trinity.postinst index bcb12994d..94012bd76 100644 --- a/ubuntu/maverick/kdeadmin/debian/knetworkconf-trinity.postinst +++ b/ubuntu/maverick/kdeadmin/debian/knetworkconf-trinity.postinst @@ -1,15 +1,28 @@ #! /bin/sh -e +package_name=knetworkconf-trinity + +divert_remove() + { + divert=`dpkg-divert --listpackage "$1"` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename "$1" + fi + if [ -n "$divert" ] && [ "$divert" = "$package_name" ]; then + dpkg-divert --remove --package $package_name --rename "$1" + fi + } + case "$1" in configure) - dpkg-divert --remove /usr/share/icons/hicolor/16x16/apps/knetworkconf.png - dpkg-divert --remove /usr/share/icons/hicolor/22x22/apps/knetworkconf.png - dpkg-divert --remove /usr/share/icons/hicolor/32x32/apps/knetworkconf.png - dpkg-divert --remove /usr/share/icons/hicolor/22x22/actions/network_connected_lan_knc.png - dpkg-divert --remove /usr/share/icons/hicolor/22x22/actions/network_disconnected_lan.png - dpkg-divert --remove /usr/share/icons/hicolor/22x22/actions/network_disconnected_wlan.png - dpkg-divert --remove /usr/share/icons/hicolor/22x22/actions/network_traffic_wlan.png + divert_remove /usr/share/icons/hicolor/16x16/apps/knetworkconf.png + divert_remove /usr/share/icons/hicolor/22x22/apps/knetworkconf.png + divert_remove /usr/share/icons/hicolor/32x32/apps/knetworkconf.png + divert_remove /usr/share/icons/hicolor/22x22/actions/network_connected_lan_knc.png + divert_remove /usr/share/icons/hicolor/22x22/actions/network_disconnected_lan.png + divert_remove /usr/share/icons/hicolor/22x22/actions/network_disconnected_wlan.png + divert_remove /usr/share/icons/hicolor/22x22/actions/network_traffic_wlan.png ;; abort-upgrade) diff --git a/ubuntu/maverick/kdebase/debian/kappfinder-trinity.postinst b/ubuntu/maverick/kdebase/debian/kappfinder-trinity.postinst index 81ff28f5c..24b3e6df3 100644 --- a/ubuntu/maverick/kdebase/debian/kappfinder-trinity.postinst +++ b/ubuntu/maverick/kdebase/debian/kappfinder-trinity.postinst @@ -1,14 +1,27 @@ #! /bin/sh -e +package_name=kappfinder-trinity + +divert_remove() + { + divert=`dpkg-divert --listpackage "$1"` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename "$1" + fi + if [ -n "$divert" ] && [ "$divert" = "$package_name" ]; then + dpkg-divert --remove --package $package_name --rename "$1" + fi + } + case "$1" in configure) - dpkg-divert --remove /usr/share/icons/hicolor/128x128/apps/kappfinder.png - dpkg-divert --remove /usr/share/icons/hicolor/16x16/apps/kappfinder.png - dpkg-divert --remove /usr/share/icons/hicolor/22x22/apps/kappfinder.png - dpkg-divert --remove /usr/share/icons/hicolor/32x32/apps/kappfinder.png - dpkg-divert --remove /usr/share/icons/hicolor/48x48/apps/kappfinder.png - dpkg-divert --remove /usr/share/icons/hicolor/64x64/apps/kappfinder.png + divert_remove /usr/share/icons/hicolor/128x128/apps/kappfinder.png + divert_remove /usr/share/icons/hicolor/16x16/apps/kappfinder.png + divert_remove /usr/share/icons/hicolor/22x22/apps/kappfinder.png + divert_remove /usr/share/icons/hicolor/32x32/apps/kappfinder.png + divert_remove /usr/share/icons/hicolor/48x48/apps/kappfinder.png + divert_remove /usr/share/icons/hicolor/64x64/apps/kappfinder.png ;; install) diff --git a/ubuntu/maverick/kdebase/debian/kfind-trinity.postinst b/ubuntu/maverick/kdebase/debian/kfind-trinity.postinst index 7b6f6850a..1020c703e 100644 --- a/ubuntu/maverick/kdebase/debian/kfind-trinity.postinst +++ b/ubuntu/maverick/kdebase/debian/kfind-trinity.postinst @@ -1,13 +1,26 @@ #! /bin/sh -e +package_name=kfind-trinity + +divert_remove() + { + divert=`dpkg-divert --listpackage "$1"` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename "$1" + fi + if [ -n "$divert" ] && [ "$divert" = "$package_name" ]; then + dpkg-divert --remove --package $package_name --rename "$1" + fi + } + case "$1" in configure) - dpkg-divert --remove /usr/share/icons/hicolor/16x16/apps/kfind.png - dpkg-divert --remove /usr/share/icons/hicolor/22x22/apps/kfind.png - dpkg-divert --remove /usr/share/icons/hicolor/32x32/apps/kfind.png - dpkg-divert --remove /usr/share/icons/hicolor/48x48/apps/kfind.png - dpkg-divert --remove /usr/share/icons/hicolor/64x64/apps/kfind.png + divert_remove /usr/share/icons/hicolor/16x16/apps/kfind.png + divert_remove /usr/share/icons/hicolor/22x22/apps/kfind.png + divert_remove /usr/share/icons/hicolor/32x32/apps/kfind.png + divert_remove /usr/share/icons/hicolor/48x48/apps/kfind.png + divert_remove /usr/share/icons/hicolor/64x64/apps/kfind.png ;; install) diff --git a/ubuntu/maverick/kdebase/debian/konqueror-trinity.postinst b/ubuntu/maverick/kdebase/debian/konqueror-trinity.postinst index 17e89b8f9..ea83963d9 100644 --- a/ubuntu/maverick/kdebase/debian/konqueror-trinity.postinst +++ b/ubuntu/maverick/kdebase/debian/konqueror-trinity.postinst @@ -1,16 +1,29 @@ #! /bin/sh -e +package_name=konqueror-trinity + +divert_remove() + { + divert=`dpkg-divert --listpackage "$1"` + if [ -n "$divert" ] && [ "$divert" = "LOCAL" ]; then + dpkg-divert --remove --local --rename "$1" + fi + if [ -n "$divert" ] && [ "$divert" = "$package_name" ]; then + dpkg-divert --remove --package $package_name --rename "$1" + fi + } + case "$1" in configure) - dpkg-divert --remove /usr/share/autostart/konqy_preload.desktop - dpkg-divert --remove /usr/share/icons/hicolor/128x128/apps/konqueror.png - dpkg-divert --remove /usr/share/icons/hicolor/16x16/apps/konqueror.png - dpkg-divert --remove /usr/share/icons/hicolor/22x22/apps/konqueror.png - dpkg-divert --remove /usr/share/icons/hicolor/32x32/apps/konqueror.png - dpkg-divert --remove /usr/share/icons/hicolor/48x48/apps/konqueror.png - dpkg-divert --remove /usr/share/icons/hicolor/64x64/apps/konqueror.png - dpkg-divert --remove /usr/share/icons/hicolor/scalable/apps/konqueror.svgz + divert_remove /usr/share/autostart/konqy_preload.desktop + divert_remove /usr/share/icons/hicolor/128x128/apps/konqueror.png + divert_remove /usr/share/icons/hicolor/16x16/apps/konqueror.png + divert_remove /usr/share/icons/hicolor/22x22/apps/konqueror.png + divert_remove /usr/share/icons/hicolor/32x32/apps/konqueror.png + divert_remove /usr/share/icons/hicolor/48x48/apps/konqueror.png + divert_remove /usr/share/icons/hicolor/64x64/apps/konqueror.png + divert_remove /usr/share/icons/hicolor/scalable/apps/konqueror.svgz ;; install) diff --git a/ubuntu/maverick/kdebase/debian/ksmserver-trinity.postrm b/ubuntu/maverick/kdebase/debian/ksmserver-trinity.postrm index 3ebe49de7..424143ebe 100644 --- a/ubuntu/maverick/kdebase/debian/ksmserver-trinity.postrm +++ b/ubuntu/maverick/kdebase/debian/ksmserver-trinity.postrm @@ -1,12 +1,16 @@ #! /bin/sh -e +package_name=ksmserver-trinity + case "$1" in remove) # Intrepid plasma - dpkg-divert --remove --rename /usr/bin/plasma + dpkg-divert --package $package_name \ + --rename --remove /usr/bin/plasma # Jaunty plasma-desktop - dpkg-divert --remove --rename /usr/bin/plasma-desktop + dpkg-divert --package $package_name \ + --rename --remove /usr/bin/plasma-desktop ;; purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) diff --git a/ubuntu/maverick/kdebase/debian/ksmserver-trinity.preinst b/ubuntu/maverick/kdebase/debian/ksmserver-trinity.preinst index 73ee5043a..fa106bafc 100644 --- a/ubuntu/maverick/kdebase/debian/ksmserver-trinity.preinst +++ b/ubuntu/maverick/kdebase/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) diff --git a/ubuntu/maverick/kdebase/debian/ksmserver-trinity.prerm b/ubuntu/maverick/kdebase/debian/ksmserver-trinity.prerm index 11b4bc08a..cfe57810f 100644 --- a/ubuntu/maverick/kdebase/debian/ksmserver-trinity.prerm +++ b/ubuntu/maverick/kdebase/debian/ksmserver-trinity.prerm @@ -20,7 +20,6 @@ set -e case "$1" in remove) /usr/sbin/update-alternatives --remove x-session-manager /usr/trinity/bin/startkde - dpkg-divert --rename --remove /usr/share/autostart/plasma.desktop ;; upgrade|deconfigure) diff --git a/ubuntu/maverick/kdebase/debian/rules b/ubuntu/maverick/kdebase/debian/rules index e3ad86c98..3c5e0116a 100755 --- a/ubuntu/maverick/kdebase/debian/rules +++ b/ubuntu/maverick/kdebase/debian/rules @@ -273,5 +273,5 @@ binary-install/kdebase-trinity-bin:: binary-install/ksmserver-trinity:: install -p -D -m644 debian/tmp/opt/trinity/share/apps/kdm/sessions/tde.desktop debian/ksmserver-trinity/usr/share/xsessions/trinity.desktop - install -p -D -m755 debian/plasma.autodetect debian/ksmserver-trinity/usr/bin/plasma.autodetect - install -p -D -m755 debian/plasma-desktop.autodetect debian/ksmserver-trinity/usr/bin/plasma-desktop.autodetect + install -p -D -m755 debian/plasma.autodetect debian/ksmserver-trinity/usr/bin/plasma + install -p -D -m755 debian/plasma-desktop.autodetect debian/ksmserver-trinity/usr/bin/plasma-desktop |