From 6106e81b856f0247dceac096c778350593ac991f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 9 Apr 2013 05:54:22 +0200 Subject: Using dpkg-divert for other diversions too to handle upgrades of the diverted stuff during build. --- scripts/build/chroot_sysv-rc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts/build/chroot_sysv-rc') diff --git a/scripts/build/chroot_sysv-rc b/scripts/build/chroot_sysv-rc index ed78bdbcf..685775989 100755 --- a/scripts/build/chroot_sysv-rc +++ b/scripts/build/chroot_sysv-rc @@ -40,10 +40,10 @@ case "${1}" in # Creating lock file Create_lockfile .lock - if [ -f chroot/usr/sbin/policy-rc.d ] + if [ -e chroot/usr/sbin/policy-rc.d ] then # Save policy-rc.d file - mv chroot/usr/sbin/policy-rc.d chroot/usr/sbin/policy-rc.d.orig + Chroot chroot dpkg-divert --rename --quiet --add /usr/sbin/policy-rc.d fi # Create policy-rc.d file @@ -68,13 +68,13 @@ EOF # Creating lock file Create_lockfile .lock - if [ -f chroot/usr/sbin/policy-rc.d.orig ] + # Remove custom policy-rc.d file + rm -f chroot/usr/sbin/policy-rc.d + + if [ -e chroot/usr/sbin/policy-rc.d.distrib ] then # Restore policy-rc.d file - mv chroot/usr/sbin/policy-rc.d.orig chroot/usr/sbin/policy-rc.d - else - # Remove policy-rc.d file - rm -f chroot/usr/sbin/policy-rc.d + Chroot chroot dpkg-divert --rename --quiet --remove /usr/sbin/policy-rc.d fi # Removing stage file -- cgit v1.2.3