]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: use "command" instead of "which" for better POSIX compatibility
authorIlya Shipitsin <chipitsine@gmail.com>
Sat, 26 Sep 2020 06:54:27 +0000 (11:54 +0500)
committerWilly Tarreau <w@1wt.eu>
Sat, 26 Sep 2020 08:12:48 +0000 (10:12 +0200)
for example, "which" is not installed by default in Fedora docker image.

scripts/run-regtests.sh

index af25a60753e949bde9289d757913f74deb024996..7bcc394cfc605fef94b2c19d56bd3974f7991df2 100755 (executable)
@@ -191,8 +191,8 @@ _findtests() {
     done
 
     for requiredbin in $require_binaries; do
-      which $requiredbin >/dev/null 2>&1
-      if [ "$?" -eq "1" ]; then
+      if ! command -v $requiredbin >/dev/null 2>&1
+      then
         echo "  Skip $i because '"$requiredbin"' is not installed"
         skiptest=1
       fi