From 5e2e27345f60c5f572e3a50a5ff97a6b3a90ba1d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 22 Aug 2012 17:18:36 -0400 Subject: [PATCH] update_chroot: fix clobbering of initial toolchain flags with --nousepkg The current logic accidentally sets TOOLCHAIN_FLAGS when the --nousepkg flag is used rather than appending it leading to possible flag loss. While we're at it, use arrays. BUG=None TEST=`./setup_board --board=x32-generic --nousepkg` works now Change-Id: I33627ec088afb649b4fdde42b933a4af1521675b Reviewed-on: https://gerrit.chromium.org/gerrit/31150 Reviewed-by: Zdenek Behan Commit-Ready: Mike Frysinger Tested-by: Mike Frysinger --- update_chroot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update_chroot b/update_chroot index 5b04ae9670..f3897c8832 100755 --- a/update_chroot +++ b/update_chroot @@ -89,13 +89,13 @@ if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_FALSE}" ]; then # First update crossdev. sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} crossdev - TOOLCHAIN_FLAGS="--include-boards=${FLAGS_toolchain_boards}" + TOOLCHAIN_FLAGS=( "--include-boards=${FLAGS_toolchain_boards}" ) # This should really only be skipped while bootstrapping. if [ "${FLAGS_usepkg}" -eq "${FLAGS_FALSE}" ]; then - TOOLCHAIN_FLAGS="--nousepkg" + TOOLCHAIN_FLAGS+=( --nousepkg ) fi # Expand the path before sudo, as root doesn't have the same path magic. - sudo $(type -p cros_setup_toolchains) ${TOOLCHAIN_FLAGS} + sudo $(type -p cros_setup_toolchains) "${TOOLCHAIN_FLAGS[@]}" fi # Build cros_workon packages when they are changed.