diff options
author | 2020-03-07 13:43:44 +0000 | |
---|---|---|
committer | 2020-09-16 13:34:53 +0100 | |
commit | 9d28748d85f0efcb057f93d6f1cee25d6b260458 (patch) | |
tree | e353076185232445081a30e39d637e0161f04c82 | |
parent | ddfd5cf2ae6c6acdd9d2c97fd23fcddb30a752fd (diff) | |
download | poky-9d28748d85f0efcb057f93d6f1cee25d6b260458.tar.gz poky-9d28748d85f0efcb057f93d6f1cee25d6b260458.tar.bz2 poky-9d28748d85f0efcb057f93d6f1cee25d6b260458.zip |
files/toolchain-shar-extract.sh: Rework PATH cleaning
Trying to create a clean PATH breaks cases where we install a buildtools tarball
on hosts to provide newer versions of gcc. Rework the fix for #8698 to clean up
directories in PATH which don't exist isntead. Do it with python as the shell
version was too fraught with corner cases.
(From OE-Core rev: 7674b63819aa7ca95ca5ca5477a5cce32e9691eb)
(From OE-Core rev: 9825236deacf6eb311121d233435a46288c02cdb)
(From OE-Core rev: dac6cc21bbd29e55399b71a3e359a935776118de)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/files/toolchain-shar-extract.sh | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh index 156085b500..d9112eab72 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh @@ -1,13 +1,8 @@ #!/bin/sh -[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 HOME="$HOME" \ - LC_ALL=en_US.UTF-8 \ - TERM=$TERM \ - ICECC_PATH="$ICECC_PATH" \ - http_proxy="$http_proxy" https_proxy="$https_proxy" ftp_proxy="$ftp_proxy" \ - no_proxy="$no_proxy" all_proxy="$all_proxy" GIT_PROXY_COMMAND="$GIT_PROXY_COMMAND" "$0" "$@" -[ -f /etc/environment ] && . /etc/environment -export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'` +export LC_ALL=en_US.UTF-8 +# Remove invalid PATH elements first (maybe from a previously setup toolchain now deleted +PATH=`python3 -c 'import os; print(":".join(e for e in os.environ["PATH"].split(":") if os.path.exists(e)))'` tweakpath () { case ":${PATH}:" in |