diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-07 13:43:44 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-11 11:44:28 +0000 |
commit | 6d78b84029d0717354bf39e5c355fba1c14d8347 (patch) | |
tree | 7a2e2b689561c8eb4624c44e451e673e00e5db30 /meta/files | |
parent | f6bea5487e516a03caa7c1d517916508c071a8c3 (diff) | |
download | poky-6d78b84029d0717354bf39e5c355fba1c14d8347.tar.gz |
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)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files')
-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 4c4b4deb4c..2e0fe94963 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh | |||
@@ -1,13 +1,8 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | [ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 HOME="$HOME" \ | 3 | export LC_ALL=en_US.UTF-8 |
4 | LC_ALL=en_US.UTF-8 \ | 4 | # Remove invalid PATH elements first (maybe from a previously setup toolchain now deleted |
5 | TERM=$TERM \ | 5 | PATH=`python3 -c 'import os; print(":".join(e for e in os.environ["PATH"].split(":") if os.path.exists(e)))'` |
6 | ICECC_PATH="$ICECC_PATH" \ | ||
7 | http_proxy="$http_proxy" https_proxy="$https_proxy" ftp_proxy="$ftp_proxy" \ | ||
8 | no_proxy="$no_proxy" all_proxy="$all_proxy" GIT_PROXY_COMMAND="$GIT_PROXY_COMMAND" "$0" "$@" | ||
9 | [ -f /etc/environment ] && . /etc/environment | ||
10 | export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'` | ||
11 | 6 | ||
12 | tweakpath () { | 7 | tweakpath () { |
13 | case ":${PATH}:" in | 8 | case ":${PATH}:" in |