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

Bug#603114: live-build: be more careful in passing arguments to debootstrap



Package: live-build
Version: 2.0~a21-1ubuntu1~linaro4ubuntu4
Severity: normal
Tags: patch

Hi, as part of experiementing with having live-build automatically invoke
qemu-deboostrap when cross building, I found that live-build was a little
careless about the way it passed arguments to debootstrap.

In particular, it passes some options with values as --option value rather than
the documented --option=value, and it passes an empty string as the script
argument when it would be more appropriate to pass no argument at all.

The patch attached fixes both these problems.

-- Package-specific info:

-- System Information:
Debian Release: squeeze/sid
  APT prefers maverick-updates
  APT policy: (500, 'maverick-updates'), (500, 'maverick-security'), (500, 'maverick')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35-22-generic (SMP w/2 CPU cores)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages live-build depends on:
ii  cdebootstrap               0.5.6ubuntu1  Bootstrap a Debian system
ii  debootstrap                1.0.23ubuntu1 Bootstrap a basic Debian system

Versions of packages live-build recommends:
ii  cpio                   2.11-4ubuntu1     GNU cpio -- a program to manage ar
ii  gettext-base           0.18.1.1-1ubuntu2 GNU Internationalization utilities
ii  gnu-fdisk              1.2.4-3           Linux fdisk replacement based on l

Versions of packages live-build suggests:
ii  dosfstools          3.0.9-1              utilities for making and checking 
ii  fakeroot            1.14.4-1ubuntu1      Gives a fake root environment
ii  genext2fs           1.4.1-2.2            ext2 filesystem generator for embe
ii  genisoimage         9:1.1.10-1ubuntu3    Creates ISO-9660 CD-ROM filesystem
ii  grub                0.97-29ubuntu60      GRand Unified Bootloader (Legacy v
ii  memtest86+          4.10-1ubuntu2        thorough real-mode memory tester
ii  mtools              4.0.12-1             Tools for manipulating MSDOS files
ii  parted              2.3-2ubuntu1         The GNU Parted disk partition resi
ii  sudo                1.7.2p7-1ubuntu2     Provide limited super user privile
ii  syslinux            2:4.01+dfsg-3ubuntu1 collection of boot loaders
ii  uuid-runtime        2.17.2-0ubuntu1      runtime components for the Univers
pn  win32-loader        <none>               (no description available)

-- no debconf information
=== modified file 'scripts/build/lb_bootstrap_debootstrap'
--- scripts/build/lb_bootstrap_debootstrap	2010-09-26 13:03:13 +0000
+++ scripts/build/lb_bootstrap_debootstrap	2010-11-10 22:53:34 +0000
@@ -55,13 +55,13 @@
 # Setting debootstrap options
 if [ -n "${LB_ARCHITECTURE}" ]
 then
-	DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --arch ${LB_ARCHITECTURE}"
+	DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --arch=${LB_ARCHITECTURE}"
 fi
 
 if [ "${LB_ARCHIVE_AREAS}" != "main" ]
 then
 	# Modify archive areas to remove leading/trailing whitespaces and replace other whitepspace with commas
-	DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --components $(echo ${LB_ARCHIVE_AREAS} | sed -e 's| |,|g')"
+	DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --components=$(echo ${LB_ARCHIVE_AREAS} | sed -e 's| |,|g')"
 fi
 
 if [ -n "${LB_BOOTSTRAP_CONFIG}" ]
@@ -124,7 +124,7 @@
 		fi
 
 		Echo_breakage "Running debootstrap (download-only)... "
-		${LB_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LB_DISTRIBUTION}" chroot "${LB_MIRROR_BOOTSTRAP}" "${LB_DEBOOTSTRAP_SCRIPT}"
+		${LB_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LB_DISTRIBUTION}" chroot "${LB_MIRROR_BOOTSTRAP}" ${LH_DEBOOTSTRAP_SCRIPT:+"$LH_DEBOOTSTRAP_SCRIPT"}
 
 		if [ -n "${LB_ROOT_COMMAND}" ]
 		then
@@ -140,7 +140,7 @@
 	fi
 
 	Echo_breakage "Running debootstrap... "
-	${LB_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} "${LB_DISTRIBUTION}" chroot "${LB_MIRROR_BOOTSTRAP}" "${LB_DEBOOTSTRAP_SCRIPT}"
+	${LB_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} "${LB_DISTRIBUTION}" chroot "${LB_MIRROR_BOOTSTRAP}" ${LH_DEBOOTSTRAP_SCRIPT:+"$LH_DEBOOTSTRAP_SCRIPT"}
 
 	if [ -n "${LB_ROOT_COMMAND}" ]
 	then


Reply to: