oe-buildenv-internal: simplify derivation of BB_ENV_EXTRAWHITE
PATCH 1/1 oe-buildenv-internal: simplify derivation of BB_ENV_EXTRAWHITE
Use 'sort --unique' to combine the two lists and remove duplicates.
Signed-off-by Andre McCurdy <[email protected]>
--- scripts/oe-buildenv-internal | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-)
scripts/oe-buildenv-internal +3 -20
@@ -110,29 +110,12 @@ unset BITBAKEDIR newpath export BUILDDIR export PATH -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 \ +BB_ENV_EXTRAWHITE_OE="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" - 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 +BB_ENV_EXTRAWHITE=$(echo $BB_ENV_EXTRAWHITE $BB_ENV_EXTRAWHITE_OE | sed 's/ /\n/g' | LC_ALL=C sort --unique) + export BB_ENV_EXTRAWHITE
Signature · 1 line
1.9.1
Quoted 46 lines · Andre McCurdy
Use 'sort --unique' to combine the two lists and remove duplicates.
Signed-off-by Andre McCurdy <[email protected]>--- scripts/oe-buildenv-internal | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-)scripts/oe-buildenv-internal +0
-2@@ -110,29 +110,12 @@ unset BITBAKEDIR newpath export BUILDDIR export PATH -add_extrawhite() { - # If the current shell is zsh, then temporarily set it to emulate shin this
scripts/oe-buildenv-internal +1
-4- # 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 \ +BB_ENV_EXTRAWHITE_OE="MACHINE DISTRO TCMODE TCLIBC HTTP_PROXY http_proxy \ HTTPS_PROXY https_proxy FTP_PROXY ftp_proxy FTPS_PROXY ftps_proxy
ALL_PROXY\
all_proxyNO_PROXYno_proxySSH_AGENT_PIDSSH_AUTH_SOCKBB_SRCREV_POLICY\
SDKMACHINEBB_NUMBER_THREADSBB_NO_NETWORKPARALLEL_MAKEGIT_PROXY_COMMAND\
SOCKS5_PASSWDSOCKS5_USERSCREENDIRSTAMPS_DIR"scripts/oe-buildenv-internal +0
-7- 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"
scripts/oe-buildenv-internal +1
-7- ;; - esac - done -} - -add_extrawhite -unset -f add_extrawhite +BB_ENV_EXTRAWHITE=$(echo $BB_ENV_EXTRAWHITE $BB_ENV_EXTRAWHITE_OE | sed
Quoted 2 lines
's/ /\n/g' | LC_ALL=C sort --unique)
You could use this instead of sed here: tr ' ' '\n'