[OE-core] [PATCH] oe-buildenv-internal: simplify derivation of BB_ENV_EXTRAWHITE

Christopher Larson clarson at kergoth.com
Thu Mar 24 18:03:25 UTC 2016


On Thu, Mar 24, 2016 at 10:49 AM Andre McCurdy <armccurdy at gmail.com> wrote:

> Use 'sort --unique' to combine the two lists and remove duplicates.
>
> Signed-off-by: Andre McCurdy <armccurdy at gmail.com>
> ---
>  scripts/oe-buildenv-internal | 23 +++--------------------
>  1 file changed, 3 insertions(+), 20 deletions(-)
>
> diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
> index 8eee008..be212f2 100755
> --- a/scripts/oe-buildenv-internal
> +++ b/scripts/oe-buildenv-internal
> @@ -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)
>

You could use this instead of sed here: tr ' ' '\n'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160324/37b848fe/attachment-0002.html>


More information about the Openembedded-core mailing list