From d7e4664169f7a0ac1ac80f0c07d2d74125a6d12f Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Sun, 27 Oct 2024 11:43:16 +0100 Subject: [PATCH] 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 Signed-off-by: Richard Purdie --- meta/files/toolchain-shar-extract.sh | 6 +++--- 1 file 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 @@ 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