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.

(From OE-Core rev: 516b63fd9dea6fcc304fca920206467d2565dede)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter Kjellerstedt 2016-03-15 17:53:31 +01:00 committed by Richard Purdie
parent 39ac332f66
commit 4d1efc38ca
1 changed files with 21 additions and 5 deletions

View File

@ -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