From c887198a53d938a07d06268990fc3ef162b4ab74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20COUDERC?= Date: Mon, 30 Jan 2017 21:26:17 +0000 Subject: [PATCH] Fix minor problems with maintainer scripts (Closes: #853224) --- debian/changelog | 7 ++++ debian/preinst | 104 +++++++++++++++++++++++------------------------ debian/prerm | 23 ++--------- 3 files changed, 61 insertions(+), 73 deletions(-) diff --git a/debian/changelog b/debian/changelog index e0fb049..8a2d31c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +desktop-base (9.0.3) UNRELEASED; urgency=medium + + * Fix minor problems with maintainer scripts, thanks Raphaël Hertzog for the + detailed review. (Closes: #853224) + + -- Aurélien COUDERC Mon, 30 Jan 2017 22:21:40 +0100 + desktop-base (9.0.2) unstable; urgency=medium [ Aurélien COUDERC ] diff --git a/debian/preinst b/debian/preinst index e7d4e2d..9fa1e6b 100644 --- a/debian/preinst +++ b/debian/preinst @@ -6,6 +6,39 @@ set -e 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 \ @@ -50,69 +83,32 @@ joy-grub.png spacefun-grub.png spacefun-grub-widescreen.png EOF - if dpkg --compare-versions ${2} ge "9.0.0~exp1"; then - echo "ge 9.0.0~exp1" - # Remove alternatives shipped in 9.0.0~exp1 but now integrated - # into the theme pack system. - # Joy old theme structure + 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/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 + /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 - - if dpkg --compare-versions ${2} lt "9.0.0~"; 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 + # *Last* remove *highest priority* alternative for active theme 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 + desktop-login-background \ + /usr/share/desktop-base/active-theme/login/background.svg fi - fi diff --git a/debian/prerm b/debian/prerm index 4f40120..321c38c 100644 --- a/debian/prerm +++ b/debian/prerm @@ -9,7 +9,7 @@ if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then while read theme filename; do update-alternatives --remove \ desktop-background \ - /usr/share/desktop-base/$theme-theme/wallpaper/contents/images/$filename $priority + /usr/share/desktop-base/$theme-theme/wallpaper/contents/images/$filename done << EOF softwaves 1024x768.svg softwaves 1280x720.svg @@ -48,7 +48,7 @@ EOF while read theme; do update-alternatives --remove \ desktop-background.xml \ - /usr/share/desktop-base/$theme-theme/wallpaper/gnome-background.xml $priority + /usr/share/desktop-base/$theme-theme/wallpaper/gnome-background.xml done << EOF softwaves lines @@ -66,7 +66,7 @@ EOF while read theme; do update-alternatives --remove \ desktop-lockscreen.xml \ - /usr/share/desktop-base/$theme-theme/lockscreen/gnome-background.xml $priority + /usr/share/desktop-base/$theme-theme/lockscreen/gnome-background.xml done << EOF softwaves lines @@ -115,23 +115,8 @@ EOF desktop-login-background \ /usr/share/desktop-base/active-theme/login/background.svg - # Remove GRUB alternatives - # Remove alternative for the GRUB background/colors config - while read theme priority; do - update-alternatives --remove \ - desktop-grub.sh \ - /usr/share/desktop-base/$theme-theme/grub/grub_background.sh - done << EOF -softwaves -lines -joy -spacefun -EOF - # Remove background alternatives + # Remove GRUB background alternatives while read theme ratio; do - update-alternatives --remove \ - desktop-grub.sh \ - /usr/share/desktop-base/$theme-theme/grub/grub_background.sh update-alternatives --remove \ desktop-grub \ /usr/share/desktop-base/$theme-theme/grub/grub-$ratio.png