Avoid using the nonstandard "which" command

This command isn't a standard tool; different distributions have
different implementations, and e.g. Fedora doesn't ship it by
default.

Settle on using "command -v $tool >/dev/null" for tests about whether
a tool is available. (We could also use "hash $tool 2>/dev/null" as we
already had in build-all.sh, but settling on using "command -v"
everywhere, for consistency and simplicity.)
This commit is contained in:
Martin Storsjö committed 2022-08-02 15:17:24 +03:00
1 parent f2ebd644ae
commit 3d4e36806a
11 files changed
+15 -15

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ PREFIX="$(cd "$PREFIX" && pwd)"
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
download() {
if [ -n "$(which wget)" ]; then
if command -v wget >/dev/null; then
wget "$1"
else
curl -LO "$1"