summaryrefslogtreecommitdiff
path: root/scripts/oe-buildenv-internal
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2016-03-15 17:53:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-20 22:57:59 +0000
commit516b63fd9dea6fcc304fca920206467d2565dede (patch)
tree02d962f21bdbf9683e78abc75ece7e832c8d86e2 /scripts/oe-buildenv-internal
parent5b9e91a3b1d4f56c8646d7d7937ab453cc9c40a0 (diff)
downloadopenembedded-core-516b63fd9dea6fcc304fca920206467d2565dede.tar.gz
openembedded-core-516b63fd9dea6fcc304fca920206467d2565dede.tar.bz2
openembedded-core-516b63fd9dea6fcc304fca920206467d2565dede.zip
oe-buildenv-internal: Add variables individually to BB_ENV_EXTRAWHITE
Instead of adding all variables to BB_ENV_EXTRAWHITE as one, treat them separately and add them one by one as needed. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/oe-buildenv-internal')
-rwxr-xr-xscripts/oe-buildenv-internal26
1 files changed, 21 insertions, 5 deletions
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 85f82f1b31..354501ed4b 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -108,13 +108,29 @@ unset BITBAKEDIR newpath
export BUILDDIR
export PATH
-BB_ENV_EXTRAWHITE_OE="MACHINE DISTRO TCMODE TCLIBC HTTP_PROXY http_proxy \
+add_extrawhite() {
+ # If the current shell is zsh, then temporarily set it to emulate sh in this
+ # function so that the for and case statements below work as expected.
+ [ -z "$ZSH_NAME" ] || emulate -L sh
+
+ local extrawhite="MACHINE DISTRO TCMODE TCLIBC HTTP_PROXY http_proxy \
HTTPS_PROXY https_proxy FTP_PROXY ftp_proxy FTPS_PROXY ftps_proxy ALL_PROXY \
all_proxy NO_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY \
SDKMACHINE BB_NUMBER_THREADS BB_NO_NETWORK PARALLEL_MAKE GIT_PROXY_COMMAND \
SOCKS5_PASSWD SOCKS5_USER SCREENDIR STAMPS_DIR"
-echo "$BB_ENV_EXTRAWHITE" | grep -q "${BB_ENV_EXTRAWHITE_OE}"
-if [ $? != 0 ]; then
- export BB_ENV_EXTRAWHITE="${BB_ENV_EXTRAWHITE_OE} $BB_ENV_EXTRAWHITE"
-fi
+ local var
+ for var in $extrawhite; do
+ case " $BB_ENV_EXTRAWHITE " in
+ *[[:blank:]]$var[[:blank:]]*)
+ ;;
+ *)
+ BB_ENV_EXTRAWHITE="${BB_ENV_EXTRAWHITE:+$BB_ENV_EXTRAWHITE }$var"
+ ;;
+ esac
+ done
+}
+
+add_extrawhite
+unset -f add_extrawhite
+export BB_ENV_EXTRAWHITE