From 6901013b90775d3148be339ef32390f07180e67f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 23 Apr 2014 05:11:08 +0200 Subject: tests: better group resolution --- tests/setup.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/setup.sh b/tests/setup.sh index 56fba4d..0400acc 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -192,9 +192,14 @@ gpg_keys_from_encrypted_file() { # Finds keys used in gpg.conf group # # Arguments: -# Returns: 0, and echos keys on new lines, which might be non-canonical +# Returns: 0, and echos keys on new lines gpg_keys_from_group() { - $GPG --list-config --with-colons | sed -n "s/^cfg:group:$1:\\(.*\\)/\\1/p" | tr ';' '\n' + local output="$($GPG --list-config --with-colons | sed -n "s/^cfg:group:$1:\\(.*\\)/\\1/p" | head -n 1)" + local saved_ifs="$IFS" + IFS=";" + local keys=( $output ) + IFS="$saved_ifs" + canonicalize_gpg_keys "${keys[@]}" } # Initialize the test harness -- cgit v1.2.3