From 0091bae1adf06cf8443bf10fe2c7eea972be47df Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Tue, 3 Oct 2017 16:31:18 -0400 Subject: [PATCH] Don't add empty entry to PATH. When ANDROID_TOOLCHAIN_2ND_ARCH is unset (all arches except ARM64) the PATH was being extended with an empty entry, which is interpreted as the current directory (rarely desirable). Test: lunch aosp_arm-eng; echo $PATH; lunch aosp_arm64-eng; echo $PATH Change-Id: I31661241c10b06165dcf555c8b3e799fe54cc0dc --- envsetup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index a8bef9216..9bb0d240a 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -231,7 +231,12 @@ function setpaths() fi export ANDROID_DEV_SCRIPTS=$T/development/scripts:$T/prebuilts/devtools/tools:$T/external/selinux/prebuilts/bin - export ANDROID_BUILD_PATHS=$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_TOOLCHAIN:$ANDROID_TOOLCHAIN_2ND_ARCH:$ANDROID_DEV_SCRIPTS: + 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_DEV_SCRIPTS: + export ANDROID_BUILD_PATHS # If prebuilts/android-emulator// exists, prepend it to our PATH # to ensure that the corresponding 'emulator' binaries are used.