]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: use "command -v" instead of "which"
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Feb 2020 13:42:33 +0000 (14:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Feb 2020 13:45:22 +0000 (14:45 +0100)
Ilya reported that the "which" utility is not that much portable and is
absent from Fedora. "type -p" is not portable either, and the correct
solution appears to be "command -v", so let's use this for now, we can
change it again in the future in case of problems.

Link: https://www.mail-archive.com/haproxy@formilux.org/msg36332.html
reg-tests/compression/lua_validation.vtc

index 6e8c1e879609fbdbbab45cc2b5b709da2201385a..91a41a02ca29f3677708f81ad9b5b89edd0c8dda 100644 (file)
@@ -40,7 +40,7 @@ shell {
         HOST="\[::1\]"
     fi
 
-    md5=$(which md5 || which md5sum)
+    md5=$(command -v md5 || command -v md5sum)
 
     if [ -z $md5 ] ; then
         echo "MD5 checksum utility not found"