mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
test: Replace uses of which with command -v
The `which` command isn't guaranteed to be available, it is just extremely common; `command -v` is the standard way to do find an executable program. See https://lwn.net/Articles/874049/ for more details. This patch replaces the uses of `which` with `command -v`, which only appears in a couple of tests.
This commit is contained in:
@@ -10,7 +10,7 @@ init
|
|||||||
check_hostaliases
|
check_hostaliases
|
||||||
|
|
||||||
for binary in dkimsign dkimverify dkimkeygen; do
|
for binary in dkimsign dkimverify dkimkeygen; do
|
||||||
if ! which $binary > /dev/null; then
|
if ! command -v $binary > /dev/null; then
|
||||||
skip "$binary binary not found"
|
skip "$binary binary not found"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ function run_msmtp() {
|
|||||||
# msmtp binary is often g+s, which causes $HOSTALIASES to not be
|
# msmtp binary is often g+s, which causes $HOSTALIASES to not be
|
||||||
# honoured, which breaks the tests. Copy the binary to remove the
|
# honoured, which breaks the tests. Copy the binary to remove the
|
||||||
# setgid bit as a workaround.
|
# setgid bit as a workaround.
|
||||||
cp -u "`which msmtp`" "${UTILDIR}/.msmtp-bin"
|
cp -u "`command -v msmtp`" "${UTILDIR}/.msmtp-bin"
|
||||||
|
|
||||||
HOSTALIASES=${TBASE}/hosts \
|
HOSTALIASES=${TBASE}/hosts \
|
||||||
${UTILDIR}/.msmtp-bin -C msmtprc "$@"
|
${UTILDIR}/.msmtp-bin -C msmtprc "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user