[PATCH] tests/start-stop-agent: use 'command -v' instead of 'which'

Sam James sam at gentoo.org
Mon Aug 15 20:38:15 CEST 2022


`which` is an external command which isn't required by POSIX.

Debian and other distributions (like Gentoo!) are looking
to drop it from their base set of packages.

Switch to `command -v` which should always work instead.

Note we already use `command -v` at the start of this test anyway.

Signed-off-by: Sam James <sam at gentoo.org>
---
 tests/start-stop-agent | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/start-stop-agent b/tests/start-stop-agent
index 9b08b55b..ac5ca87d 100755
--- a/tests/start-stop-agent
+++ b/tests/start-stop-agent
@@ -15,7 +15,7 @@ fi
 
 GPG_AGENT_INFO=
 export GPG_AGENT_INFO
-GPG_AGENT=$(which gpg-agent)
+GPG_AGENT=$(command -v gpg-agent)
 
 token=$(echo "gpgme-$(pwd)" | tr ' ' '_')
 
-- 
2.37.2




More information about the Gnupg-devel mailing list