diff options
author | Ming Liu <liu.ming50@gmail.com> | 2024-10-27 11:43:16 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-28 11:58:22 +0000 |
commit | d7e4664169f7a0ac1ac80f0c07d2d74125a6d12f (patch) | |
tree | 48bc32205cf08896b7004ce2c41c7a6ff280db0e | |
parent | a147293ed6d9c1387610f6cf9542ffa3aff50b61 (diff) | |
download | poky-d7e4664169f7a0ac1ac80f0c07d2d74125a6d12f.tar.gz |
toolchain-shar-extract.sh: replace which with "command -v"
Command 'which' is not POSIX or even universally installed on Linux
systems, replace it with 'command -v'.
(From OE-Core rev: f604e059bdf0ebd23f4b9c6af3f6249c9acdc551)
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/files/toolchain-shar-extract.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh index 3b4647fca7..7e40c67374 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh | |||
@@ -2,8 +2,8 @@ | |||
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 | 4 | #Make sure at least one python is installed |
5 | INIT_PYTHON=$(which python3 2>/dev/null ) | 5 | INIT_PYTHON=$(command -v python3 2>/dev/null ) |
6 | [ -z "$INIT_PYTHON" ] && INIT_PYTHON=$(which python2 2>/dev/null) | 6 | [ -z "$INIT_PYTHON" ] && INIT_PYTHON=$(command -v python2 2>/dev/null) |
7 | [ -z "$INIT_PYTHON" ] && echo "Error: The SDK needs a python installed" && exit 1 | 7 | [ -z "$INIT_PYTHON" ] && echo "Error: The SDK needs a python installed" && exit 1 |
8 | 8 | ||
9 | # 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 |
@@ -229,7 +229,7 @@ if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; the | |||
229 | exit 1 | 229 | exit 1 |
230 | fi | 230 | fi |
231 | 231 | ||
232 | SUDO_EXEC=$(which "sudo") | 232 | SUDO_EXEC=$(command -v "sudo") |
233 | if [ -z $SUDO_EXEC ]; then | 233 | if [ -z $SUDO_EXEC ]; then |
234 | echo "No command 'sudo' found, please install sudo first. Abort!" | 234 | echo "No command 'sudo' found, please install sudo first. Abort!" |
235 | exit 1 | 235 | exit 1 |