Always add the missing diversions on upgrade
This commit is contained in:
parent
7b5ef398f5
commit
6897753ba5
@ -34,6 +34,4 @@ target location by the postinst script (see debian/kali-themes.postinst).
|
||||
|
||||
When you add a new file that needs to be diverted, you can update
|
||||
the list in "files-to-divert" and run "debian/update-maintainer-scripts"
|
||||
to update the list of files in the 3 maintainer scripts. But you also
|
||||
need to add a snippet in debian/kali-themes.preinst to setup the new
|
||||
diversion on upgrade.
|
||||
to update the list of files in the 3 maintainer scripts.
|
||||
|
||||
18
debian/kali-themes.preinst
vendored
18
debian/kali-themes.preinst
vendored
@ -16,15 +16,6 @@ FILES_TO_DIVERT="
|
||||
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
|
||||
" # END FILES_TO_DIVERT
|
||||
|
||||
setup_diversion_on_upgrade() {
|
||||
local prev_version="$1"
|
||||
local ref_version="$2"
|
||||
local file="$3"
|
||||
if dpkg --compare-versions "$prev_version" lt "$ref_version"; then
|
||||
setup_diversion "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
setup_diversion() {
|
||||
local file="$1"
|
||||
dpkg-divert --rename --package kali-themes \
|
||||
@ -49,10 +40,11 @@ case "$1" in
|
||||
;;
|
||||
upgrade)
|
||||
# Dynamically add new diversions when required on upgrade
|
||||
# Example to divert /etc/xdg/xfce4/panel/default.xml when you
|
||||
# upgrade from a version older than 2019.4.6:
|
||||
# setup_diversion_on_upgrade "$2" 2019.4.6 /etc/xdg/xfce4/panel/default.xml
|
||||
setup_diversion_on_upgrade "$2" 2019.4.9 /etc/plymouth/plymouthd.conf
|
||||
for file in $FILES_TO_DIVERT; do
|
||||
if [ -z "$(dpkg-divert --listpackage "$file")" ]; then
|
||||
setup_diversion "$file"
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user