m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-23 05:11:08 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-23 05:11:08 +0200
commit6901013b90775d3148be339ef32390f07180e67f (patch)
treeb0524ea8ddd8ee43f72fa84575ff20f891f5422c
parentede28a13a0bc092d5ff4de20f69e1eac68394334 (diff)
tests: better group resolution
-rwxr-xr-xtests/setup.sh9
1 files changed, 7 insertions, 2 deletions
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: <group>
-# 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