File: preinst

package info (click to toggle)
desktop-base 13.0.4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 23,808 kB
  • sloc: sh: 622; makefile: 519; xml: 428; javascript: 5
file content (114 lines) | stat: -rw-r--r-- 3,969 bytes parent folder | download | duplicates (5)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/sh
set -e

# Tag to allow some debhelper commands to inject relevant code
#DEBHELPER#

if [ "${1}" = "upgrade" ]; then
    if dpkg --compare-versions ${2} le "9.0.0~exp1"; then
        # Remove alternative for desktop splash we don’t ship anymore
        update-alternatives --remove-all desktop-splash

        # Remove alternatives for themes we now ship elsewhere as a theme pack
        ## Wallpaper
        for background in \
              lines-wallpaper_1280x1024.svg \
              lines-wallpaper_1600x1200.svg \
              lines-wallpaper_1920x1200.svg \
              lines-wallpaper_2560x1080.svg \
              lines-wallpaper_1920x1080.svg \
              ; do
            update-alternatives --remove desktop-background /usr/share/images/desktop-base/$background
        done
        update-alternatives --remove \
            desktop-background.xml \
            /usr/share/images/desktop-base/lines.xml
        ## Login background
        update-alternatives --remove desktop-login-background \
            /usr/share/desktop-base/lines-theme/login-background.svg
        update-alternatives --remove desktop-login-background \
            /usr/share/desktop-base/lines-theme/login-background-with-logo.svg

        ## Grub background
        while read background; do
            update-alternatives --remove \
                desktop-grub \
                /usr/share/images/desktop-base/$background
        done << EOF
lines-grub.png
lines-grub-1920x1080.png
EOF

        # Remove alternatives for moreblue wallpapers we don’t ship anymore
        while read background; do
            update-alternatives --remove \
                desktop-background \
                /usr/share/images/desktop-base/$background
        done << EOF
moreblue-orbit-wallpaper.svg
moreblue-orbit-wallpaper-widescreen.svg
EOF

        # Remove alternatives for Joy/Spacefun we now ship elsewhere as a theme
        # pack.
        # Wallpapers
        while read background; do
            update-alternatives --remove \
                desktop-background \
                /usr/share/images/desktop-base/$background
        done << EOF
joy-wallpaper_1600x1200.svg
joy-wallpaper_1280x1024.svg
joy-wallpaper_1920x1080.svg
joy-wallpaper_1920x1200.svg
joy-inksplat-wallpaper_1920x1080.svg
spacefun-wallpaper.svg
spacefun-wallpaper-widescreen.svg
EOF
        # Wallpaper XML descriptions (for GNOME)
        while read desktopbackground; do
            update-alternatives --remove \
                desktop-background.xml \
                /usr/share/images/desktop-base/$desktopbackground
        done << EOF
joy.xml
EOF
        # GRUB backgrounds
        while read background; do
            update-alternatives --remove \
                desktop-grub \
                /usr/share/images/desktop-base/$background
        done << EOF
joy-grub.png
spacefun-grub.png
spacefun-grub-widescreen.png
EOF
    fi

    if dpkg --compare-versions ${2} eq "9.0.0~exp1"; then
        # Remove alternatives shipped in 9.0.0~exp1 but now integrated
        # into the theme pack system.
        # Joy old theme structure
        update-alternatives --remove \
            desktop-login-background \
            /usr/share/desktop-base/joy-theme/login-background.svg
        # Remove login theme alternatives for theme packages
        # because we’re dropping the secondary link for SDDM preview
        while read theme background; do
            update-alternatives --remove \
                desktop-login-background \
                /usr/share/desktop-base/$theme-theme/login/$background
        done << EOF
softwaves background.svg
lines background.svg
lines background-nologo.svg
joy background.svg
spacefun background.svg
EOF
        # *Last* remove *highest priority* alternative for active theme
        update-alternatives --remove \
            desktop-login-background \
            /usr/share/desktop-base/active-theme/login/background.svg
    fi

fi