From: Joel Rosdahl Date: Wed, 5 Aug 2020 18:26:53 +0000 (+0200) Subject: Don’t depend on which(1) to detect commands X-Git-Tag: v4.0~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c99b07fc3bf507fc31b7e454ddfda5a767972bed;p=thirdparty%2Fccache.git Don’t depend on which(1) to detect commands --- diff --git a/test/run b/test/run index ca8e3097c..c0214659a 100755 --- a/test/run +++ b/test/run @@ -195,7 +195,7 @@ expect_different_files() { is_equal_object_files() { if $HOST_OS_LINUX && $COMPILER_TYPE_CLANG; then - if ! which eu-elfcmp >/dev/null 2>&1; then + if ! command -v eu-elfcmp >/dev/null; then test_failed "Please install elfutils to get eu-elfcmp" fi eu-elfcmp -q "$1" "$2" diff --git a/test/suites/profiling.bash b/test/suites/profiling.bash index 553f90865..e1ea00cd1 100644 --- a/test/suites/profiling.bash +++ b/test/suites/profiling.bash @@ -3,7 +3,7 @@ SUITE_profiling_PROBE() { if ! $COMPILER -fprofile-generate -c test.c 2>/dev/null; then echo "compiler does not support profiling" fi - if $COMPILER_TYPE_CLANG && ! which llvm-profdata$CLANG_VERSION_SUFFIX >/dev/null 2>/dev/null; then + if $COMPILER_TYPE_CLANG && ! command -v llvm-profdata$CLANG_VERSION_SUFFIX >/dev/null; then echo "llvm-profdata$CLANG_VERSION_SUFFIX tool not found" fi } diff --git a/test/suites/profiling_clang.bash b/test/suites/profiling_clang.bash index 039a5d943..332fbc7db 100644 --- a/test/suites/profiling_clang.bash +++ b/test/suites/profiling_clang.bash @@ -1,7 +1,7 @@ SUITE_profiling_clang_PROBE() { if ! $COMPILER_TYPE_CLANG; then echo "compiler is not Clang" - elif ! which llvm-profdata$CLANG_VERSION_SUFFIX >/dev/null 2>/dev/null; then + elif ! command -v llvm-profdata$CLANG_VERSION_SUFFIX >/dev/null; then echo "llvm-profdata$CLANG_VERSION_SUFFIX tool not found" fi }