aboutsummaryrefslogtreecommitdiffstats
path: root/tests/openpgp/defs.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/openpgp/defs.scm')
-rw-r--r--tests/openpgp/defs.scm11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm
index 6fdb95580..4257b286e 100644
--- a/tests/openpgp/defs.scm
+++ b/tests/openpgp/defs.scm
@@ -82,12 +82,13 @@
(define (pipe:gpg args)
(pipe:spawn `(,@GPG --output - ,@args -)))
+(define (gpg-with-colons args)
+ (let ((s (call-popen `(,@GPG --with-colons ,@args) "")))
+ (map (lambda (line) (string-split line #\:))
+ (string-split s #\newline))))
+
(define (get-config what)
- (let* ((config-string
- (call-popen `(,@GPG --with-colons --list-config ,what) ""))
- (config (string-splitn
- (string-rtrim char-whitespace? config-string) #\: 2)))
- (string-split (caddr config) #\;)))
+ (string-split (caddar (gpg-with-colons `(--list-config ,what))) #\;))
(define all-pubkey-algos (get-config "pubkeyname"))
(define all-hash-algos (get-config "digestname"))