]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
toolchain-shar-extract.sh: replace which with "command -v"
authorMing Liu <liu.ming50@gmail.com>
Sun, 27 Oct 2024 10:43:16 +0000 (11:43 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 28 Oct 2024 11:57:26 +0000 (11:57 +0000)
Command 'which' is not POSIX or even universally installed on Linux
systems, replace it with 'command -v'.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/files/toolchain-shar-extract.sh

index 3b4647fca7b35794e6db94a068feca94f28f5e46..7e40c673742220a10dfd8edf5bef4a7e290e54d5 100644 (file)
@@ -2,8 +2,8 @@
 
 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)
+INIT_PYTHON=$(command -v python3 2>/dev/null )
+[ -z "$INIT_PYTHON" ] && INIT_PYTHON=$(command -v 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
@@ -229,7 +229,7 @@ if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; the
                exit 1
        fi
 
-       SUDO_EXEC=$(which "sudo")
+       SUDO_EXEC=$(command -v "sudo")
        if [ -z $SUDO_EXEC ]; then
                echo "No command 'sudo' found, please install sudo first. Abort!"
                exit 1