From ded1012f3c9f5d5e60481274c5b3280acc277b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 4 Apr 2014 00:23:17 +0200 Subject: pki: Introduce 'write-acl', and fix wrong conversion in 'ensure-acl'. * guix/pki.scm (write-acl): New procedure. (ensure-acl): Use it. Fixes a regression introduced in 39831f1, whereby 'ensure-acl' would yield a wrong-type-arg error. * guix/scripts/archive.scm (authorize-key): Use 'write-acl'. --- guix/pki.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'guix/pki.scm') diff --git a/guix/pki.scm b/guix/pki.scm index 6f5e95b0ab..3cd9763fdf 100644 --- a/guix/pki.scm +++ b/guix/pki.scm @@ -30,6 +30,7 @@ public-keys->acl acl->public-keys authorized-key? + write-acl signature-sexp signature-subject @@ -83,9 +84,13 @@ element in KEYS must be a canonical sexp with type 'public-key'." (mkdir-p (dirname %acl-file)) (with-atomic-file-output %acl-file (lambda (port) - (display (canonical-sexp->string - (public-keys->acl (list public-key))) - port))))))) + (write-acl (public-keys->acl (list public-key)) + port))))))) + +(define (write-acl acl port) + "Write ACL to PORT in canonical-sexp format." + (let ((sexp (sexp->canonical-sexp acl))) + (display (canonical-sexp->string sexp) port))) (define (current-acl) "Return the current ACL." -- cgit v1.2.3