Package: live-helper
Version: 1.0~a29-1
Severity: wishlist
Tags: patch

I'm using live-helper to create filesystems for machines which are hard
to maintain directly.  These are dedicated machines, which only have one
purpose.  What I always need, is a minimal Debian system plus one or two
extra packages (plus dependencies).  For this purpose, I need to give
live-helper two mirrors; one Debian mirror and one mirror on my machine
(which isn't really a "mirror", but contains my own packages).

I've attached a patch which implements this feature.  It allows using
--mirror-{bootstrap,binary} multiple times.  It uses array variables to
accomplish this, and I'm not sure if that may be a bash-only feature.

Thanks,
Bas

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://pcbcn10.phys.rug.nl/e-mail.html
--- lh_bootstrap_cdebootstrap	2007-09-23 16:18:28.000000000 +0200
+++ /usr/bin/lh_bootstrap_cdebootstrap	2007-09-25 22:44:32.000000000 +0200
@@ -107,7 +107,7 @@
 		fi
 
 		# Executing cdebootstrap (download-only)
-		${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP}"
+		${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP[0]}"
 
 		if [ -n "${LH_ROOT_COMMAND}" ]
 		then
@@ -127,7 +127,7 @@
 	fi
 
 	# Executing cdebootstrap (regular run)
-	${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP}"
+	${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP[0]}"
 
 	if [ -n "${LH_ROOT_COMMAND}" ]
 	then
--- lh_bootstrap_debootstrap	2007-09-23 16:18:28.000000000 +0200
+++ /usr/bin/lh_bootstrap_debootstrap	2007-09-25 22:44:48.000000000 +0200
@@ -85,7 +85,7 @@
 		fi
 
 		# Executing debootstrap (download-only)
-		${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP}" "${LH_DEBOOTSTRAP_SCRIPT}"
+		${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP[0]}" "${LH_DEBOOTSTRAP_SCRIPT}"
 
 		if [ -n "${LH_ROOT_COMMAND}" ]
 		then
@@ -105,7 +105,7 @@
 	fi
 
 	# Executing debootstrap (regular run)
-	${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP}" "${LH_DEBOOTSTRAP_SCRIPT}"
+	${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP[0]}" "${LH_DEBOOTSTRAP_SCRIPT}"
 
 	if [ -n "${LH_ROOT_COMMAND}" ]
 	then
--- lh_chroot_sources	2007-09-23 16:18:29.000000000 +0200
+++ /usr/bin/lh_chroot_sources	2007-09-26 12:35:21.000000000 +0200
@@ -50,12 +50,15 @@
 		Create_lockfile .lock
 
 		# Configure custom sources.list
-		echo "deb ${LH_MIRROR_BOOTSTRAP} ${LH_DISTRIBUTION} ${LH_SECTIONS}" > chroot/etc/apt/sources.list
+		> chroot/etc/apt/sources.list
+		for mirror in "[EMAIL PROTECTED]" ; do
+			echo "deb ${mirror} ${LH_DISTRIBUTION} ${LH_SECTIONS}" >> chroot/etc/apt/sources.list
 
-		if [ "${LH_SOURCE}" = "enabled" ]
-		then
-			echo "deb-src ${LH_MIRROR_BOOTSTRAP} ${LH_DISTRIBUTION} ${LH_SECTIONS}" >> chroot/etc/apt/sources.list
-		fi
+			if [ "${LH_SOURCE}" = "enabled" ]
+			then
+				echo "deb-src ${mirror} ${LH_DISTRIBUTION} ${LH_SECTIONS}" >> chroot/etc/apt/sources.list
+			fi
+		done
 
 		if [ "${LH_SECURITY}" = "enabled" ]
 		then
@@ -228,12 +231,15 @@
 			rm -rf chroot/var/lib/apt/lists
 			mkdir -p chroot/var/lib/apt/lists/partial
 
-			echo "deb ${LH_MIRROR_BINARY} ${LH_DISTRIBUTION} ${LH_SECTIONS}" > chroot/etc/apt/sources.list
+			> chroot/etc/apt/sources.list
+			for mirror in "[EMAIL PROTECTED]" ; do
+				echo "deb ${mirror} ${LH_DISTRIBUTION} ${LH_SECTIONS}" >> chroot/etc/apt/sources.list
 
-			if [ "${LH_SOURCE}" = "enabled" ]
-			then
-				echo "deb-src ${LH_MIRROR_BINARY} ${LH_DISTRIBUTION} ${LH_SECTIONS}" >> chroot/etc/apt/sources.list
-			fi
+				if [ "${LH_SOURCE}" = "enabled" ]
+				then
+					echo "deb-src ${mirror} ${LH_DISTRIBUTION} ${LH_SECTIONS}" >> chroot/etc/apt/sources.list
+				fi
+			done
 
 			if [ "${LH_SECURITY}" = "enabled" ]
 			then
--- lh_config	2007-09-23 16:18:29.000000000 +0200
+++ /usr/bin/lh_config	2007-09-26 09:11:43.000000000 +0200
@@ -287,7 +287,11 @@
 				;;
 
 			-m|--mirror-bootstrap)
-				LH_MIRROR_BOOTSTRAP="${2}"
+				if test -z "$has_mirror_bootstrap" ; then
+					unset LH_MIRROR_BOOTSTRAP
+					has_mirror_bootstrap=1
+				fi
+				LH_MIRROR_BOOTSTRAP=( "[EMAIL PROTECTED]" "${2}" )
 				shift 2
 				;;
 
@@ -297,7 +301,11 @@
 				;;
 
 			--mirror-binary)
-				LH_MIRROR_BINARY="${2}"
+				if test -z "$has_mirror_binary" ; then
+					unset LH_MIRROR_BINARY
+					has_mirror_binary=1
+				fi
+				LH_MIRROR_BINARY=( "[EMAIL PROTECTED]" "${2}" )
 				shift 2
 				;;
 
@@ -735,16 +743,16 @@
 LH_DISTRIBUTION="${LH_DISTRIBUTION}"
 
 # \$LH_MIRROR_BOOTSTRAP: set mirror to fetch packages from
-# (Default: ${LH_MIRROR_BOOTSTRAP})
-LH_MIRROR_BOOTSTRAP="${LH_MIRROR_BOOTSTRAP}"
+# (Default: `set | grep ^LH_MIRROR_BOOTSTRAP= | cut -d= -f2-` )
+`set | grep ^LH_MIRROR_BOOTSTRAP=`
 
 # \$LH_MIRROR_BOOTSTRAP_SECURITY: set security mirror to fetch packages from
 # (Default: ${LH_MIRROR_BOOTSTRAP_SECURITY})
 LH_MIRROR_BOOTSTRAP_SECURITY="${LH_MIRROR_BOOTSTRAP_SECURITY}"
 
 # \$LH_MIRROR_BINARY: set mirror which ends up in the image
-# (Default: ${LH_MIRROR_BINARY})
-LH_MIRROR_BINARY="${LH_MIRROR_BINARY}"
+# (Default: `set | grep ^LH_MIRROR_BINARY= | cut -d= -f2-` )
+`set | grep ^LH_MIRROR_BINARY=`
 
 # \$LH_MIRROR_BINARY_SECURITY: set security mirror which ends up in the image
 # (Default: ${LH_MIRROR_BINARY_SECURITY})

Attachment: signature.asc
Description: Digital signature

Reply via email to