substitute-binary: Avoid reloading the ACL repeatedly.

* guix/scripts/substitute-binary.scm (guix-substitute-binary) <--query>:
  Cache the result of (current-acl); pass it to 'valid-narinfo?' calls.
  This saves 12% wall-clock time for "guix build emacs -n".
This commit is contained in:
Ludovic Courtès 2014-04-01 22:56:33 +02:00
parent a7e59c50d2
commit c6e9485924

View file

@ -630,9 +630,10 @@ (define (guix-substitute-binary . args)
(with-error-handling ; for signature errors
(match args
(("--query")
(let ((cache (delay (open-cache %cache-url))))
(let ((cache (delay (open-cache %cache-url)))
(acl (current-acl)))
(define (valid? obj)
(and (narinfo? obj) (valid-narinfo? obj)))
(and (narinfo? obj) (valid-narinfo? obj acl)))
(let loop ((command (read-line)))
(or (eof-object? command)