From b3ecb2c550886196140db34866810e26db42f3ba Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 18 Aug 2014 14:27:43 -0700 Subject: [PATCH] toolchain_util: fix bash syntax when running as root Apparently expanding an empty string before a variable assignment forces that assignment to be interpreted as a command instead. Instead of an empty string use env as our sudo alternative when running as root. --- build_library/toolchain_util.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_library/toolchain_util.sh b/build_library/toolchain_util.sh index 9c2754e02b..07947c2123 100644 --- a/build_library/toolchain_util.sh +++ b/build_library/toolchain_util.sh @@ -192,7 +192,7 @@ _configure_sysroot() { local profile="$1" # may be called from either catalyst (root) or setup_board (user) - local sudo= + local sudo="env" if [[ $(id -u) -ne 0 ]]; then sudo="sudo -E" fi @@ -234,7 +234,7 @@ install_cross_toolchain() { cross_flags+=( --portage "${safe_flags[*]}" ) # may be called from either catalyst (root) or upgrade_chroot (user) - local sudo= + local sudo="env" if [[ $(id -u) -ne 0 ]]; then sudo="sudo -E" fi @@ -273,7 +273,7 @@ install_cross_libs() { local package_provided="$ROOT/etc/portage/profile/package.provided" # may be called from either catalyst (root) or setup_board (user) - local sudo= + local sudo="env" if [[ $(id -u) -ne 0 ]]; then sudo="sudo -E" fi