summaryrefslogtreecommitdiffstats
path: root/debian/wheezy
diff options
context:
space:
mode:
Diffstat (limited to 'debian/wheezy')
-rw-r--r--debian/wheezy/metapackages/rename-meta/debian/kdesudo-trinity.preinst13
-rw-r--r--debian/wheezy/metapackages/rename-meta/debian/kdm-trinity.preinst (renamed from debian/wheezy/metapackages/rename-meta/debian/kdm-trinity.postinst)59
-rw-r--r--debian/wheezy/metapackages/rename-meta/debian/kio-umountwrapper-trinity.preinst22
3 files changed, 93 insertions, 1 deletions
diff --git a/debian/wheezy/metapackages/rename-meta/debian/kdesudo-trinity.preinst b/debian/wheezy/metapackages/rename-meta/debian/kdesudo-trinity.preinst
new file mode 100644
index 000000000..12e16e22d
--- /dev/null
+++ b/debian/wheezy/metapackages/rename-meta/debian/kdesudo-trinity.preinst
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+set -e
+
+package_name=kdesudo-trinity
+
+divert=`dpkg-divert --listpackage "/opt/trinity/bin/kdesu"`
+if [ -n "$divert" ] && [ "$divert" = $package_name ]; then
+ dpkg-divert --package $package_name --rename --remove \
+ /opt/trinity/bin/kdesu
+fi
+
+exit 0
diff --git a/debian/wheezy/metapackages/rename-meta/debian/kdm-trinity.postinst b/debian/wheezy/metapackages/rename-meta/debian/kdm-trinity.preinst
index e026f2bfe..391d99542 100644
--- a/debian/wheezy/metapackages/rename-meta/debian/kdm-trinity.postinst
+++ b/debian/wheezy/metapackages/rename-meta/debian/kdm-trinity.preinst
@@ -1,5 +1,5 @@
#! /bin/sh
-# postinst script for kdm-trinity
+# preinst script for kdm-trinity
#
# see: dh_installdeb(1)
@@ -12,6 +12,63 @@ if [ -e /usr/share/debconf/confmodule ]; then
HAVE_DEBCONF=yes
fi
+# remove former service
+if [ -e /etc/init.d/kdm-trinity ]; then
+ REMOVING=yes
+ rm -f /etc/init.d/kdm-trinity
+fi
+
+if [ -n "$REMOVING" ]; then
+ # is there an kdm process running?
+ if start-stop-daemon --stop --quiet --signal 0 --name kdm-trinity; then
+ # any children?
+ PARENTS=$(pidof /usr/bin/kdm-trinity || true)
+ CHILDREN=
+ if [ -n "$PARENTS" ]; then
+ for PROCESS in $PARENTS; do
+ # make sure we got numbers back
+ [ $PROCESS -eq $PROCESS ] 2> /dev/null ||
+ exit
+ # FIXME - redo this part uses shell-lib.sh from xfree86
+ # die "pidof returned non-numeric value"
+ # we could use grep -q here if ps would ignore SIGPIPE :-P
+ if (ps axj | grep "^ *$PROCESS" > /dev/null 2>&1); then
+ CHILDREN=yes
+ fi
+ done
+ if [ -n "$CHILDREN" ]; then
+ if [ -n "$HAVE_DEBCONF" ]; then
+ # ask the question
+ db_input high kdm/stop_running_server_with_children || true
+ db_go
+ # what did the user say?
+ ANSWER=
+ if db_get kdm/stop_running_server_with_children; then
+ ANSWER="$RET"
+ fi
+ if [ "$ANSWER" = "true" ]; then
+ STOP=yes
+ fi
+ # forget that we have seen the question; this is the sort of
+ # non-configuration question that should be asked every time
+ db_fset kdm/stop_running_server_with_children seen false
+ fi
+ else
+ STOP=yes
+ fi
+ fi
+ fi
+fi
+
+if [ -n "$STOP" ]; then
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d kdm-trinity stop || true
+ else
+ /etc/init.d/kdm-trinity stop || true
+ fi
+fi
+
+
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
if [ -n "$HAVE_DEBCONF" ]; then
diff --git a/debian/wheezy/metapackages/rename-meta/debian/kio-umountwrapper-trinity.preinst b/debian/wheezy/metapackages/rename-meta/debian/kio-umountwrapper-trinity.preinst
new file mode 100644
index 000000000..b7af2273b
--- /dev/null
+++ b/debian/wheezy/metapackages/rename-meta/debian/kio-umountwrapper-trinity.preinst
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+set -e
+
+package_name=kio-umountwrapper-trinity
+
+divert=`dpkg-divert --listpackage "/opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop"`
+if [ -n "$divert" ] && [ "$divert" = $package_name ]; then
+ dpkg-divert --package $package_name --remove --rename /opt/trinity/share/apps/konqueror/servicemenus/media_safelyremove.desktop
+fi
+
+divert=`dpkg-divert --listpackage "/opt/trinity/share/apps/dolphin/servicemenus/media_safelyremove.desktop"`
+if [ -n "$divert" ] && [ "$divert" = $package_name ]; then
+ dpkg-divert --package $package_name --remove --rename /opt/trinity/share/apps/dolphin/servicemenus/media_safelyremove.desktop
+fi
+
+divert=`dpkg-divert --listpackage "/opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop"`
+if [ -n "$divert" ] && [ "$divert" = $package_name ]; then
+ dpkg-divert --package $package_name --remove --rename /opt/trinity/share/apps/d3lphin/servicemenus/media_safelyremove.desktop
+fi
+
+exit 0