diff options
author | Jeremy Puhlman <jpuhlman@mvista.com> | 2020-03-19 11:20:48 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-21 22:39:01 +0000 |
commit | 2298791719a0c94755737e44776191fa64e41523 (patch) | |
tree | 65621be71aad8e2537bb26fb02965898d2276b8a | |
parent | d566448b3d7b2fe3e9743795a2ef4bdc2b4d06a4 (diff) | |
download | poky-2298791719a0c94755737e44776191fa64e41523.tar.gz |
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>
-rw-r--r-- | meta/files/toolchain-shar-extract.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh index 2e0fe94963..04527f891f 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh | |||
@@ -1,8 +1,13 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | export LC_ALL=en_US.UTF-8 | 3 | export LC_ALL=en_US.UTF-8 |
4 | #Make sure at least one python is installed | ||
5 | INIT_PYTHON=$(which python3 2>/dev/null ) | ||
6 | [ -z "$INIT_PYTHON" ] && INIT_PYTHON=$(which python2 2>/dev/null) | ||
7 | [ -z "$INIT_PYTHON" ] && echo "Error: The SDK needs a python installed" && exit 1 | ||
8 | |||
4 | # Remove invalid PATH elements first (maybe from a previously setup toolchain now deleted | 9 | # Remove invalid PATH elements first (maybe from a previously setup toolchain now deleted |
5 | PATH=`python3 -c 'import os; print(":".join(e for e in os.environ["PATH"].split(":") if os.path.exists(e)))'` | 10 | PATH=`$INIT_PYTHON -c 'import os; print(":".join(e for e in os.environ["PATH"].split(":") if os.path.exists(e)))'` |
6 | 11 | ||
7 | tweakpath () { | 12 | tweakpath () { |
8 | case ":${PATH}:" in | 13 | case ":${PATH}:" in |