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 /debian/wheezy/tdebase | |
parent | cbfc487458706037e61278c9b5263685619d47f0 (diff) | |
download | tde-packaging-683152f3b286a04a76f31ee1eed839bbdb2ab307.tar.gz tde-packaging-683152f3b286a04a76f31ee1eed839bbdb2ab307.zip |
Fix handling of diverts on Debian and Ubuntu
Diffstat (limited to 'debian/wheezy/tdebase')
7 files changed, 132 insertions, 42 deletions
diff --git a/debian/wheezy/tdebase/debian/kappfinder-trinity.postinst b/debian/wheezy/tdebase/debian/kappfinder-trinity.postinst index 81ff28f5c..24b3e6df3 100644 --- a/debian/wheezy/tdebase/debian/kappfinder-trinity.postinst +++ b/debian/wheezy/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/debian/wheezy/tdebase/debian/kfind-trinity.postinst b/debian/wheezy/tdebase/debian/kfind-trinity.postinst index 7b6f6850a..1020c703e 100644 --- a/debian/wheezy/tdebase/debian/kfind-trinity.postinst +++ b/debian/wheezy/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/debian/wheezy/tdebase/debian/konqueror-trinity.postinst b/debian/wheezy/tdebase/debian/konqueror-trinity.postinst index 17e89b8f9..ea83963d9 100644 --- a/debian/wheezy/tdebase/debian/konqueror-trinity.postinst +++ b/debian/wheezy/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/debian/wheezy/tdebase/debian/ksmserver-trinity.postrm b/debian/wheezy/tdebase/debian/ksmserver-trinity.postrm index 3ebe49de7..424143ebe 100644 --- a/debian/wheezy/tdebase/debian/ksmserver-trinity.postrm +++ b/debian/wheezy/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/debian/wheezy/tdebase/debian/ksmserver-trinity.preinst b/debian/wheezy/tdebase/debian/ksmserver-trinity.preinst index 884257d03..f4443b487 100644 --- a/debian/wheezy/tdebase/debian/ksmserver-trinity.preinst +++ b/debian/wheezy/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/debian/wheezy/tdebase/debian/ksmserver-trinity.prerm b/debian/wheezy/tdebase/debian/ksmserver-trinity.prerm index e9be94522..a885c6d4c 100644 --- a/debian/wheezy/tdebase/debian/ksmserver-trinity.prerm +++ b/debian/wheezy/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/debian/wheezy/tdebase/debian/rules b/debian/wheezy/tdebase/debian/rules index 089e47858..2e12a8d03 100755 --- a/debian/wheezy/tdebase/debian/rules +++ b/debian/wheezy/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 |