diff --git a/tests/libtest.sh b/tests/libtest.sh index 2c2a33f0..dd5752de 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -107,7 +107,7 @@ export TEST_GPG_KEYHOME=${test_tmpdir}/gpghome export OSTREE_GPG_HOME=${test_tmpdir}/gpghome/trusted assert_has_setfattr() { - if ! which setfattr 2>/dev/null; then + if ! command -v setfattr 2>/dev/null; then fatal "no setfattr available to determine xattr support" fi } @@ -727,9 +727,9 @@ which_gpg () { local opt # Prefer gpg2 in case gpg refers to gpg1 - if which gpg2 &>/dev/null; then + if command -v gpg2 &>/dev/null; then gpg=gpg2 - elif which gpg &>/dev/null; then + elif command -v gpg &>/dev/null; then gpg=gpg else # Succeed but don't return anything. diff --git a/tests/test-delta-ed25519.sh b/tests/test-delta-ed25519.sh index 9cd22286..21ce7bc1 100755 --- a/tests/test-delta-ed25519.sh +++ b/tests/test-delta-ed25519.sh @@ -34,7 +34,7 @@ ostree_repo_init repo --mode=archive mkdir files for bin in ${bindatafiles}; do - cp $(which ${bin}) files + cp $(command -v ${bin}) files done ${CMD_PREFIX} ostree --repo=repo commit -b test -s test --tree=dir=files diff --git a/tests/test-delta-sign.sh b/tests/test-delta-sign.sh index c6e9e57c..632b1c79 100755 --- a/tests/test-delta-sign.sh +++ b/tests/test-delta-sign.sh @@ -35,7 +35,7 @@ ostree_repo_init repo --mode=archive mkdir files for bin in ${bindatafiles}; do - cp $(which ${bin}) files + cp $(command -v ${bin}) files done ${CMD_PREFIX} ostree --repo=repo commit -b test -s test --tree=dir=files diff --git a/tests/test-delta.sh b/tests/test-delta.sh index 4c9e2e2d..5b2658aa 100755 --- a/tests/test-delta.sh +++ b/tests/test-delta.sh @@ -33,7 +33,7 @@ ostree_repo_init repo --mode=archive mkdir files for bin in ${bindatafiles}; do - cp $(which ${bin}) files + cp $(command -v ${bin}) files done ${CMD_PREFIX} ostree --repo=repo commit -b test -s test --tree=dir=files