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 | |
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')
13 files changed, 210 insertions, 67 deletions
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-nohal/debian/preinst b/ubuntu/maverick/applications/kpowersave-nohal/debian/preinst index a66bf589f..5b0e73f61 100644 --- a/ubuntu/maverick/applications/kpowersave-nohal/debian/preinst +++ b/ubuntu/maverick/applications/kpowersave-nohal/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/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/applications/tdesudo/debian/postinst b/ubuntu/maverick/applications/tdesudo/debian/postinst index 9164f9d4a..5269ffae5 100644 --- a/ubuntu/maverick/applications/tdesudo/debian/postinst +++ b/ubuntu/maverick/applications/tdesudo/debian/postinst @@ -11,8 +11,6 @@ fi case "$1" in configure) - dpkg-divert --package $package_name --rename --remove \ - /usr/trinity/bin/tdesu || true ;; abort-upgrade) ;; diff --git a/ubuntu/maverick/applications/tdesudo/debian/preinst b/ubuntu/maverick/applications/tdesudo/debian/preinst index a13492559..770dfaacb 100644 --- a/ubuntu/maverick/applications/tdesudo/debian/preinst +++ b/ubuntu/maverick/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) ;; diff --git a/ubuntu/maverick/tdeadmin/debian/knetworkconf-trinity.postinst b/ubuntu/maverick/tdeadmin/debian/knetworkconf-trinity.postinst index bcb12994d..94012bd76 100644 --- a/ubuntu/maverick/tdeadmin/debian/knetworkconf-trinity.postinst +++ b/ubuntu/maverick/tdeadmin/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/tdebase/debian/kappfinder-trinity.postinst b/ubuntu/maverick/tdebase/debian/kappfinder-trinity.postinst index 81ff28f5c..24b3e6df3 100644 --- a/ubuntu/maverick/tdebase/debian/kappfinder-trinity.postinst +++ b/ubuntu/maverick/tdebase/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/tdebase/debian/kfind-trinity.postinst b/ubuntu/maverick/tdebase/debian/kfind-trinity.postinst index 7b6f6850a..1020c703e 100644 --- a/ubuntu/maverick/tdebase/debian/kfind-trinity.postinst +++ b/ubuntu/maverick/tdebase/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/tdebase/debian/konqueror-trinity.postinst b/ubuntu/maverick/tdebase/debian/konqueror-trinity.postinst index 17e89b8f9..ea83963d9 100644 --- a/ubuntu/maverick/tdebase/debian/konqueror-trinity.postinst +++ b/ubuntu/maverick/tdebase/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/tdebase/debian/ksmserver-trinity.postrm b/ubuntu/maverick/tdebase/debian/ksmserver-trinity.postrm index 3ebe49de7..424143ebe 100644 --- a/ubuntu/maverick/tdebase/debian/ksmserver-trinity.postrm +++ b/ubuntu/maverick/tdebase/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/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) diff --git a/ubuntu/maverick/tdebase/debian/ksmserver-trinity.prerm b/ubuntu/maverick/tdebase/debian/ksmserver-trinity.prerm index e9be94522..a885c6d4c 100644 --- a/ubuntu/maverick/tdebase/debian/ksmserver-trinity.prerm +++ b/ubuntu/maverick/tdebase/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/starttde - dpkg-divert --rename --remove /usr/share/autostart/plasma.desktop ;; upgrade|deconfigure) diff --git a/ubuntu/maverick/tdebase/debian/rules b/ubuntu/maverick/tdebase/debian/rules index 374542a38..96f73eb06 100755 --- a/ubuntu/maverick/tdebase/debian/rules +++ b/ubuntu/maverick/tdebase/debian/rules @@ -263,5 +263,5 @@ binary-install/tdebase-trinity-bin:: binary-install/ksmserver-trinity:: install -p -D -m644 debian/tmp/opt/trinity/share/apps/tdm/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 |