summaryrefslogtreecommitdiffstats
path: root/ubuntu/raring/tdebase/debian/ksmserver-trinity.preinst
blob: f4443b487ca42927898899a21faee5e8e33ebec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#! /bin/sh -e

package_name=ksmserver-trinity

case "$1" in

    upgrade)
	rm -f /etc/gdm/Sessions/KDE
	rm -f /etc/trinity/debian/starttde
	/usr/sbin/update-alternatives --remove x-session-manager /usr/bin/kde2
	/usr/sbin/update-alternatives --remove x-session-manager /usr/bin/trinity
	mkdir -p /usr/share/autostart

	# Intrepid 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
	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
	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
	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)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;

esac

#DEBHELPER#

exit 0