diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2015-02-19 15:23:01 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-02-19 15:30:53 -0500 |
commit | 43b44d59d820ecec9866fe2447f3ace1078a372b (patch) | |
tree | 143622661f1a6a34d52226e68dc9648358379dbd | |
parent | modules/generic_stage_target.py: handle USE_EXPAND flags (diff) | |
download | catalyst-43b44d59d820ecec9866fe2447f3ace1078a372b.tar.gz catalyst-43b44d59d820ecec9866fe2447f3ace1078a372b.tar.bz2 catalyst-43b44d59d820ecec9866fe2447f3ace1078a372b.zip |
targets/stage1/stage1-chroot.sh: don't quote ${clst_HOSTUSEEXPAND}
Remove the quotes on ${clst_HOSTUSEEXPAND} so the for loops skip
any iterations when clst_HOSTUSEEXPAND is unset. Otherwise a
spurious line is introduced in the make.conf file which causes
a syntax error.
To illustrate the problem, run the follow two lines of bash:
unset A ; for i in $A; do echo x${i}x ; done #line 1
unset A ; for i in "$A"; do echo x${i}x ; done #line 2
Line 1 leads to no output, while line 2 leads to "xx".
We also fix a typo in the sed line.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rwxr-xr-x | targets/stage1/stage1-chroot.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index f79f360b..63aa5633 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -57,7 +57,7 @@ sed -i '/USE="${USE} -build"/d' /etc/portage/make.conf if [ -e /etc/portage/make.conf ]; then echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" \ >> /etc/portage/make.conf - for useexpand in "${clst_HOSTUSEEXPAND}"; do + for useexpand in ${clst_HOSTUSEEXPAND}; do x="clst_${useexpand}" echo "${useexpand}=\"${!x}\"" \ >> /etc/portage/make.conf @@ -66,8 +66,8 @@ fi run_merge "--oneshot ${clst_buildpkgs}" sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \ /etc/portage/make.conf -for useexpand in "${clst_HOSTUSEEXPAND}"; do +for useexpand in ${clst_HOSTUSEEXPAND}; do x="clst_${useexpand}" - sed -i "${useexpand}=\"${!x}\"" \ + sed -i "/${useexpand}=\"${!x}\"/d" \ /etc/portage/make.conf done |