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

Bug#490114: live-helper: Please detect buggy LH_BOOTSTRAP_{IN, EX}CLUDE variables



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

Hi,

currently, if one sets one of the LH_BOOTSTRAP_{IN,EX}CLUDE variables to
something space-separated, that leads to:
| $ sudo lh_build 
| P: Begin caching bootstrap stage...
| P: Begin bootstrapping system...
| E: No such script: lenny

With the attached patch:
| $ sudo lh_build 
| P: Begin caching bootstrap stage...
| P: Begin bootstrapping system...
| E: LH_BOOTSTRAP_EXCLUDE is comma-separed, not space-separated

One might also want to echo the contents of the offending variable at
that moment.

One might even want to fix this by running a sed command on the
variable, but I'm not sure it's a nice thing to do.

The same might apply for cdebootstrap, but I didn't check.

Cheers,

-- 
Cyril Brulebois
-------------- next part --------------
Check LH_BOOTSTRAP_{IN,EX}CLUDE are a single word, and specify they have to be comma-separated.

Signed-off-by: Cyril Brulebois <cyril.brulebois at kerlabs.com>
---
 helpers/lh_bootstrap_debootstrap |   10 ++++++++++
 helpers/lh_config                |    4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap
index 12b9743..304a84a 100755
--- a/helpers/lh_bootstrap_debootstrap
+++ b/helpers/lh_bootstrap_debootstrap
@@ -74,11 +74,21 @@ fi
 
 if [ -n "${LH_BOOTSTRAP_INCLUDE}" ]
 then
+	if [ $(echo $LH_BOOTSTRAP_INCLUDE | wc -w) != 1 ]
+	then
+		Echo_error "LH_BOOTSTRAP_INCLUDE is comma-separed, not space-separated"
+		exit 1
+	fi
 	DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --include=${LH_BOOTSTRAP_INCLUDE}"
 fi
 
 if [ -n "${LH_BOOTSTRAP_EXCLUDE}" ]
 then
+	if [ $(echo $LH_BOOTSTRAP_EXCLUDE | wc -w) != 1 ]
+	then
+		Echo_error "LH_BOOTSTRAP_EXCLUDE is comma-separed, not space-separated"
+		exit 1
+	fi
 	DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --exclude=${LH_BOOTSTRAP_EXCLUDE}"
 fi
 
diff --git a/helpers/lh_config b/helpers/lh_config
index 310c7ca..d2f2a92 100755
--- a/helpers/lh_config
+++ b/helpers/lh_config
@@ -825,11 +825,11 @@ LH_ARCHITECTURE="${LH_ARCHITECTURE}"
 # (Default: empty)
 LH_BOOTSTRAP_CONFIG="${LH_BOOTSTRAP_CONFIG}"
 
-# \$LH_BOOTSTRAP_INCLUDE: include packages on base
+# \$LH_BOOTSTRAP_INCLUDE: include packages on base (comma-separated)
 # (Default: empty)
 LH_BOOTSTRAP_INCLUDE="${LH_BOOTSTRAP_INCLUDE}"
 
-# \$LH_BOOTSTRAP_EXCLUDE: exclude packages on base
+# \$LH_BOOTSTRAP_EXCLUDE: exclude packages on base (comma-separated)
 # (Default: empty)
 LH_BOOTSTRAP_EXCLUDE="${LH_BOOTSTRAP_EXCLUDE}"
 


Reply to: