Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix issue where start-stop-daemon and upstart's initctl are replaced

with olders versions when the package is upgraded during the installation.
  • Loading branch information...
commit 483352fd9d1d9485675d0ec1f807a835dd8da96d 1 parent bb69c17
@utlemming authored
Showing with 18 additions and 11 deletions.
  1. +11 −5 scripts/build/chroot_dpkg
  2. +7 −6 scripts/build/chroot_upstart
View
16 scripts/build/chroot_dpkg
@@ -40,8 +40,8 @@ case "${1}" in
# Creating lock file
Create_lockfile .lock
- # Save start-stop-daemon program
- mv chroot/sbin/start-stop-daemon chroot/sbin/start-stop-daemon.orig
+ # Create diversion for start-stop-daemon
+ Chroot chroot dpkg-divert --quiet --rename --add /sbin/start-stop-daemon
# Create start-stop-daemon program
@@ -103,10 +103,16 @@ EOF
${LB_ROOT_COMMAND} rmdir --ignore-fail-on-non-empty /var/state/samhain || true
fi
- # Restore start-stop-daemon program
- if [ -e chroot/sbin/start-stop-daemon.orig ]
+ # Remove live-build start-stop-daemon
+ if [ -e chroot/sbin/start-stop-daemon ]
then
- mv chroot/sbin/start-stop-daemon.orig chroot/sbin/start-stop-daemon
+ rm -f chroot/sbin/start-stop-daemon
+ fi
+
+ # Restore dpkg diversion
+ if [ -e chroot/sbin/start-stop-daemon.distrib ]
+ then
+ Chroot chroot dpkg-divert --quiet --rename --remove /sbin/start-stop-daemon
fi
# Remove dpkg sync configuration
View
13 scripts/build/chroot_upstart
@@ -43,7 +43,7 @@ case "${1}" in
if [ -f chroot/sbin/initctl ]
then
# Save initctl file
- mv chroot/sbin/initctl chroot/sbin/initctl.orig
+ Chroot chroot dpkg-divert --quiet --rename --add /sbin/initctl
fi
# Create initctl file
@@ -68,15 +68,16 @@ EOF
# Creating lock file
Create_lockfile .lock
- if [ -f chroot/sbin/initctl.orig ]
- then
- # Restore initctl file
- mv chroot/sbin/initctl.orig chroot/sbin/initctl
- else
+ if [ -f chroot/sbin/initctl ]
# Remove initctl file
rm -f chroot/sbin/initctl
fi
+ if [ -f chroot/sbin/initctl.distrib ]
+ # Remove the diversion
+ Chroot chroot dpkg-divert --quiet --rename --remove /sbin/initctl
+ fi
+
# Removing stage file
rm -f .build/chroot_upstart
;;
Please sign in to comment.
Something went wrong with that request. Please try again.