Debian Codegraph @

debian/preinst

raw
1 #!/bin/sh
2 set -e
3
4 # Tag to allow some debhelper commands to inject relevant code
5 #DEBHELPER#
6
7 if [ "${1}" = "upgrade" ]; then
8 if dpkg --compare-versions ${2} le "9.0.0~exp1"; then
9 # Remove alternative for desktop splash we don’t ship anymore
10 update-alternatives --remove-all desktop-splash
11
12 # Remove alternatives for themes we now ship elsewhere as a theme pack
13 ## Wallpaper
14 for background in \
15 lines-wallpaper_1280x1024.svg \
16 lines-wallpaper_1600x1200.svg \
17 lines-wallpaper_1920x1200.svg \
18 lines-wallpaper_2560x1080.svg \
19 lines-wallpaper_1920x1080.svg \
20 ; do
21 update-alternatives --remove desktop-background /usr/share/images/desktop-base/$background
22 done
23 update-alternatives --remove \
24 desktop-background.xml \
25 /usr/share/images/desktop-base/lines.xml
26 ## Login background
27 update-alternatives --remove desktop-login-background \
28 /usr/share/desktop-base/lines-theme/login-background.svg
29 update-alternatives --remove desktop-login-background \
30 /usr/share/desktop-base/lines-theme/login-background-with-logo.svg
31
32 ## Grub background
33 while read background; do
34 update-alternatives --remove \
35 desktop-grub \
36 /usr/share/images/desktop-base/$background
37 done << EOF
38 lines-grub.png
39 lines-grub-1920x1080.png
40 EOF
41
42 # Remove alternatives for moreblue wallpapers we don’t ship anymore
43 while read background; do
44 update-alternatives --remove \
45 desktop-background \
46 /usr/share/images/desktop-base/$background
47 done << EOF
48 moreblue-orbit-wallpaper.svg
49 moreblue-orbit-wallpaper-widescreen.svg
50 EOF
51
52 # Remove alternatives for Joy/Spacefun we now ship elsewhere as a theme
53 # pack.
54 # Wallpapers
55 while read background; do
56 update-alternatives --remove \
57 desktop-background \
58 /usr/share/images/desktop-base/$background
59 done << EOF
60 joy-wallpaper_1600x1200.svg
61 joy-wallpaper_1280x1024.svg
62 joy-wallpaper_1920x1080.svg
63 joy-wallpaper_1920x1200.svg
64 joy-inksplat-wallpaper_1920x1080.svg
65 spacefun-wallpaper.svg
66 spacefun-wallpaper-widescreen.svg
67 EOF
68 # Wallpaper XML descriptions (for GNOME)
69 while read desktopbackground; do
70 update-alternatives --remove \
71 desktop-background.xml \
72 /usr/share/images/desktop-base/$desktopbackground
73 done << EOF
74 joy.xml
75 EOF
76 # GRUB backgrounds
77 while read background; do
78 update-alternatives --remove \
79 desktop-grub \
80 /usr/share/images/desktop-base/$background
81 done << EOF
82 joy-grub.png
83 spacefun-grub.png
84 spacefun-grub-widescreen.png
85 EOF
86 fi
87
88 if dpkg --compare-versions ${2} eq "9.0.0~exp1"; then
89 # Remove alternatives shipped in 9.0.0~exp1 but now integrated
90 # into the theme pack system.
91 # Joy old theme structure
92 update-alternatives --remove \
93 desktop-login-background \
94 /usr/share/desktop-base/joy-theme/login-background.svg
95 # Remove login theme alternatives for theme packages
96 # because we’re dropping the secondary link for SDDM preview
97 while read theme background; do
98 update-alternatives --remove \
99 desktop-login-background \
100 /usr/share/desktop-base/$theme-theme/login/$background
101 done << EOF
102 softwaves background.svg
103 lines background.svg
104 lines background-nologo.svg
105 joy background.svg
106 spacefun background.svg
107 EOF
108 # *Last* remove *highest priority* alternative for active theme
109 update-alternatives --remove \
110 desktop-login-background \
111 /usr/share/desktop-base/active-theme/login/background.svg
112 fi
113
114 fi