Skip to content

Commit f10cbd1

Browse files
committed
use command -v instead which command
Minimize build requirement. Use standard POSIX sh `command -v` instead separated external which command. Fixes ostreedev#2825 Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
1 parent 7404131 commit f10cbd1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

tests/libtest.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export TEST_GPG_KEYHOME=${test_tmpdir}/gpghome
107107
export OSTREE_GPG_HOME=${test_tmpdir}/gpghome/trusted
108108

109109
assert_has_setfattr() {
110-
if ! which setfattr 2>/dev/null; then
110+
if ! command -v setfattr 2>/dev/null; then
111111
fatal "no setfattr available to determine xattr support"
112112
fi
113113
}
@@ -725,9 +725,9 @@ which_gpg () {
725725
local opt
726726

727727
# Prefer gpg2 in case gpg refers to gpg1
728-
if which gpg2 &>/dev/null; then
728+
if command -v gpg2 &>/dev/null; then
729729
gpg=gpg2
730-
elif which gpg &>/dev/null; then
730+
elif command -v gpg &>/dev/null; then
731731
gpg=gpg
732732
else
733733
# Succeed but don't return anything.

tests/test-delta-ed25519.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ostree_repo_init repo --mode=archive
3434

3535
mkdir files
3636
for bin in ${bindatafiles}; do
37-
cp $(which ${bin}) files
37+
cp $(command -v ${bin}) files
3838
done
3939

4040
${CMD_PREFIX} ostree --repo=repo commit -b test -s test --tree=dir=files

tests/test-delta-sign.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ostree_repo_init repo --mode=archive
3535

3636
mkdir files
3737
for bin in ${bindatafiles}; do
38-
cp $(which ${bin}) files
38+
cp $(command -v ${bin}) files
3939
done
4040

4141
${CMD_PREFIX} ostree --repo=repo commit -b test -s test --tree=dir=files

tests/test-delta.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ostree_repo_init repo --mode=archive
3333

3434
mkdir files
3535
for bin in ${bindatafiles}; do
36-
cp $(which ${bin}) files
36+
cp $(command -v ${bin}) files
3737
done
3838

3939
${CMD_PREFIX} ostree --repo=repo commit -b test -s test --tree=dir=files

0 commit comments

Comments
 (0)