From 6a012266a18cdf89d4e94a3ce7aa15a9c462a448 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Wed, 24 Nov 2021 14:56:15 +0000 Subject: [PATCH] Ensure there are no empty paths in ANDROID_BUILD_PATHS and PATH. Test: lunch armv8 - Check that PATH has no "::". - Check that an executable script in CWD doesn't get executed. Change-Id: I3a97eb661c614ff2e09723e9ccca0bdeb63dbdc5 --- envsetup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/envsetup.sh b/envsetup.sh index 16873095aa..a23bbad9c0 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -252,9 +252,7 @@ function setpaths() esac ANDROID_BUILD_PATHS=$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_TOOLCHAIN - if [ -n "$ANDROID_TOOLCHAIN_2ND_ARCH" ]; then - ANDROID_BUILD_PATHS=$ANDROID_BUILD_PATHS:$ANDROID_TOOLCHAIN_2ND_ARCH - fi + ANDROID_BUILD_PATHS=$ANDROID_BUILD_PATHS:$ANDROID_TOOLCHAIN_2ND_ARCH ANDROID_BUILD_PATHS=$ANDROID_BUILD_PATHS:$ANDROID_DEV_SCRIPTS # Append llvm binutils prebuilts path to ANDROID_BUILD_PATHS. @@ -287,8 +285,9 @@ function setpaths() local ACLOUD_PATH="$T/prebuilts/asuite/acloud/$os_arch" local AIDEGEN_PATH="$T/prebuilts/asuite/aidegen/$os_arch" local ATEST_PATH="$T/prebuilts/asuite/atest/$os_arch" - export ANDROID_BUILD_PATHS=$ANDROID_BUILD_PATHS:$ACLOUD_PATH:$AIDEGEN_PATH:$ATEST_PATH: + ANDROID_BUILD_PATHS=$ANDROID_BUILD_PATHS:$ACLOUD_PATH:$AIDEGEN_PATH:$ATEST_PATH + export ANDROID_BUILD_PATHS=$(tr -s : <<<"${ANDROID_BUILD_PATHS}:") export PATH=$ANDROID_BUILD_PATHS$PATH # out with the duplicate old