From: Jacob Bachmeyer Date: Wed, 26 Oct 2022 02:13:41 +0000 (-0500) Subject: Fix bug in testing mock X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a0b65e22103b41fb80c9966edbaac3090dd0a993;p=gatekeeper.git Fix bug in testing mock If nonexistent files appear in the keyring list, grep will return an error even if a later keyring contains a match; this will cause the mock tool to incorrectly report not finding a key. This bug was hidden by the main gatekeeper only using one keyring on each gpgv run. --- diff --git a/testsuite/lib/exec/mockgpgv b/testsuite/lib/exec/mockgpgv index a700199..7e5343c 100755 --- a/testsuite/lib/exec/mockgpgv +++ b/testsuite/lib/exec/mockgpgv @@ -30,10 +30,11 @@ while :; do --keyring) case "$2" in */*) - Keyrings="$Keyrings \"$2\"" + [ -f "$2" ] && Keyrings="$Keyrings \"$2\"" ;; *) - Keyrings="$Keyrings \"${GNUPGHOME}/$2\"" + [ -f "${GNUPGHOME}/$2" ] \ + && Keyrings="$Keyrings \"${GNUPGHOME}/$2\"" ;; esac shift 2