mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 05:09:24 +00:00
toolchain-shar-extract: check for available python
centos7 doesn't have python3 intalled by default, so running the script errors in novel ways if it is not installed. (From OE-Core rev: 1e6061a4d223dc104039728ba169dbe63e74f750) Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d566448b3d
commit
2298791719
@@ -1,8 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
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=`python3 -c 'import os; print(":".join(e for e in os.environ["PATH"].split(":") if os.path.exists(e)))'`
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user