summaryrefslogtreecommitdiff
path: root/poky/meta/files/toolchain-shar-extract.sh
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/files/toolchain-shar-extract.sh')
-rw-r--r--poky/meta/files/toolchain-shar-extract.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/poky/meta/files/toolchain-shar-extract.sh b/poky/meta/files/toolchain-shar-extract.sh
index ccc4f4e1a..04527f891 100644
--- a/poky/meta/files/toolchain-shar-extract.sh
+++ b/poky/meta/files/toolchain-shar-extract.sh
@@ -1,13 +1,13 @@
#!/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
+#Make sure at least one python is installed
+INIT_PYTHON=$(which python3 2>/dev/null )
+[ -z "$INIT_PYTHON" ] && INIT_PYTHON=$(which python2 2>/dev/null)
+[ -z "$INIT_PYTHON" ] && echo "Error: The SDK needs a python installed" && exit 1
+
+# Remove invalid PATH elements first (maybe from a previously setup toolchain now deleted
+PATH=`$INIT_PYTHON -c 'import os; print(":".join(e for e in os.environ["PATH"].split(":") if os.path.exists(e)))'`
tweakpath () {
case ":${PATH}:" in
@@ -249,7 +249,7 @@ if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then
rm sdk.zip && exit 1
fi
else
- tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1
+ tail -n +$payload_offset $0| $SUDO_EXEC tar mxJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1
fi
echo "done"