debian: postinst: use dpkg-divert

dpkg-divert is not ideal for config files but should work better than
direct cp/mv.
This commit is contained in:
HW42 2015-01-24 22:41:05 +01:00 committed by Marek Marczykowski-Górecki
parent 4faece9e89
commit 8a9d2378f6
2 changed files with 12 additions and 6 deletions

View File

@ -208,9 +208,7 @@ case "${1}" in
splash-manager \
start-ttys \
tty ; do
if [ -e /etc/init/${init}.conf ]; then
mv -f /etc/init/${init}.conf /etc/init/${init}.conf.disabled
fi
dpkg-divert --divert /etc/init/${init}.conf.qubes-disabled --package qubes-core-agent --rename --add /etc/init/${init}.conf
done
# Stops Qt form using the MIT-SHM X11 Shared Memory Extension
@ -267,9 +265,7 @@ case "${1}" in
# exit 0
#fi
if [ -e /etc/init/serial.conf ] && ! [ -f /var/lib/qubes/serial.orig ] ; then
cp /etc/init/serial.conf /var/lib/qubes/serial.orig
fi
dpkg-divert --divert /etc/init/serial.conf.qubes-orig --package qubes-core-agent --rename --add /etc/init/serial.conf
# Remove most of the udev scripts to speed up the VM boot time
# Just leave the xen* scripts, that are needed if this VM was

View File

@ -42,6 +42,16 @@ if [ "$1" = "remove" ] ; then
if [ -e /var/lib/qubes/serial.orig ] ; then
mv /var/lib/qubes/serial.orig /etc/init/serial.conf
fi
for init in plymouth-shutdown \
prefdm \
splash-manager \
start-ttys \
tty ; do
dpkg-divert --divert /etc/init/${init}.conf.qubes-disabled --package qubes-core-agent --remove /etc/init/${init}.conf
done
dpkg-divert --divert /etc/init/serial.conf.qubes-orig --package qubes-core-agent --remove /etc/init/serial.conf
fi
# dh_installdeb will replace this with shell code automatically