mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
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'.
This commit is contained in:
parent
7864504feb
commit
ded1012f3c
2 changed files with 9 additions and 6 deletions
11
guix/pki.scm
11
guix/pki.scm
|
@ -30,6 +30,7 @@ (define-module (guix pki)
|
|||
public-keys->acl
|
||||
acl->public-keys
|
||||
authorized-key?
|
||||
write-acl
|
||||
|
||||
signature-sexp
|
||||
signature-subject
|
||||
|
@ -83,9 +84,13 @@ (define (ensure-acl)
|
|||
(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."
|
||||
|
|
|
@ -288,9 +288,7 @@ (define (read-key)
|
|||
(let ((acl (public-keys->acl (cons key (acl->public-keys acl)))))
|
||||
(mkdir-p (dirname %acl-file))
|
||||
(with-atomic-file-output %acl-file
|
||||
(lambda (port)
|
||||
(display (canonical-sexp->string (sexp->canonical-sexp acl))
|
||||
port))))))
|
||||
(cut write-acl acl <>)))))
|
||||
|
||||
(define (guix-archive . args)
|
||||
(define (parse-options)
|
||||
|
|
Loading…
Reference in a new issue