[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#775989: live-build: Disable chroot_archive remove early exit



Package: live-build
Version: 5.0~a2-1
Tags: patch

Patch attached to disable the early exit in chroot_archives removal when
chroot and binary mirrors are identical, which incorrectly prevents some
of the removal code being executed.

I've had this sitting around in my WIP 'restructuring' branch for a
while, and a mailing list discussion just prompted me to extract and
submit it.

As noted in the fixme comment it introduces, the implementation of the
patch is just a quick fix and there are additional issues to be
addressed in this script, which I intend to resolve as part of the
restructuring work.
commit cfb644e22512dc693e682d52532d57e4d3064edc
Author: jnqnfe <jnqnfe@gmail.com>
Date:   Sat Nov 29 02:22:25 2014 +0000

    Temporarily disable early exit in 'chroot_archives remove'.

diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives
index 4c51cd7..8c2e192 100755
--- a/scripts/build/chroot_archives
+++ b/scripts/build/chroot_archives
@@ -551,17 +551,30 @@ then
 	Chroot_unbind_path chroot "$(echo ${LB_PARENT_MIRROR_CHROOT} | sed -e 's|file:||')"
 fi
 
-		# Configure generic indices
-		# Don't do anything if it's not required
-		if [ "${LB_PARENT_MIRROR_CHROOT}" = "${LB_PARENT_MIRROR_BINARY}" ] && \
-		[ "${LB_PARENT_MIRROR_CHROOT_SECURITY}" = "${LB_PARENT_MIRROR_BINARY_SECURITY}" ] && \
-		[ ! -d chroot/root/packages ]
-		then
-			# Removing stage file
-			rm -f .build/chroot_archives
-
-			exit 0
-		fi
+# FIXME:
+# Temporarily disabling this early-exit code that was put here for efficiency,
+# but which causes a lot of code to be skipped that really shouldn't be skipped.
+# To elaborate, the regeneration of the archive source file isn't needed if the
+# mirrors are the same, however blocking the rest causes the following issues:
+#  - Small bits of code towards the end, such as that needed to honor the
+#    --apt-indices parameter when set to false, are not executed.
+#  - This script is executed multiple times throughout the process, and should
+#    toggle the apt config cleanly between chroot and binary modes. It does not
+#    do this perfectly though. Part of the problem is this early exit, however
+#    the issue also extends into the install (chroot config) code above not
+#    removing the remove (binary) config components correctly, and neither
+#    removing the keys each other installs.
+	#	# Configure generic indices
+	#	# Don't do anything if it's not required
+	#	if [ "${LB_PARENT_MIRROR_CHROOT}" = "${LB_PARENT_MIRROR_BINARY}" ] && \
+	#	[ "${LB_PARENT_MIRROR_CHROOT_SECURITY}" = "${LB_PARENT_MIRROR_BINARY_SECURITY}" ] && \
+	#	[ ! -d chroot/root/packages ]
+	#	then
+	#		# Removing stage file
+	#		rm -f .build/chroot_archives
+
+	#		exit 0
+	#	fi
 
 		# Cleaning apt list cache
 		rm -rf chroot/var/lib/apt/lists

Reply to: