From 9eb45af16e8cce018ebddeaa4d89c205f587b695 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Thu, 26 Mar 2026 19:57:31 +0100 Subject: [PATCH] tools/mkrelease: prefer `type -P command` over `which command` (#15190) The former is a bash builtin, the later is an external executable that may not be installed (e.g. in openSUZE Tumbleweed Docker image). --- tools/mkrelease.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/mkrelease.sh b/tools/mkrelease.sh index 631413e84..34359a83a 100755 --- a/tools/mkrelease.sh +++ b/tools/mkrelease.sh @@ -118,7 +118,7 @@ fi # }}} -if command -v pv >/dev/null; then +if type -P pv >/dev/null; then write_to_file() { pv --interval=0.25 --bytes --timer --rate --output="$1" } @@ -134,7 +134,7 @@ export LC_ALL=C # We need to use the full path to the executable to avoid # a weird issue when using the p7zip project pre-built # binary (`Can't load './7z.dll' (7z.so)...`). -if ! sevenzip="$(which 7z)"; then +if ! sevenzip="$(type -P 7z)"; then echo "ERROR: 7z executable not found!" 1>&2 exit 2 fi @@ -155,7 +155,7 @@ fi rm -f "${tmpdir}/symlink" # Prefer `pigz` over `gzip` (faster). -gzip="$(command -v pigz || command -v gzip)" +gzip="$(type -P pigz || type -P gzip)" gzip_cmd=("${gzip}") # Jobs.