[PATCH 1/2] Match only the public key in reencryption tests

Colin Watson cjwatson at debian.org
Tue May 9 12:24:25 CEST 2017


This is the same fix as in a09d6685e609f9a11fa2b9b5904d39ef8966b3b7, but
in one more place.  gpg2 might need to start an agent in the context of
this test, for example if running the test in isolation.
---
 tests/t0300-reencryption.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh
index 6d5811d..15c20d8 100755
--- a/tests/t0300-reencryption.sh
+++ b/tests/t0300-reencryption.sh
@@ -10,7 +10,7 @@ canonicalize_gpg_keys() {
 	$GPG --list-keys --with-colons "$@" | sed -n 's/sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u
 }
 gpg_keys_from_encrypted_file() {
-	$GPG -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$1" 2>&1 | cut -d ' ' -f 5 | LC_ALL=C sort -u
+	LC_ALL=C $GPG -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$1" 2>&1 | sed -n 's/^gpg: public key is \([A-F0-9]\+\)$/\1/p' | LC_ALL=C sort -u
 }
 gpg_keys_from_group() {
 	local output="$($GPG --list-config --with-colons | sed -n "s/^cfg:group:$1:\\(.*\\)/\\1/p" | head -n 1)"
-- 
2.7.4


More information about the Password-Store mailing list