Skip to content
Snippets Groups Projects
Unverified Commit 7c515a43 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

substitute: Make download messages more concise.

'guix substitute' now displays 2 lines per download instead of 4.
Suggested by Ricardo Wurmus.

* guix/scripts/substitute.scm (assert-valid-narinfo): Have #:verbose?
default to #f.  Remove leading newline in message.
(process-substitution): Display the URI rather than the store file name.
Display two newlines after the substitution.
parent 99a61dad
No related branches found
No related tags found
No related merge requests found
...@@ -391,7 +391,7 @@ (define (narinfo-sha256 narinfo) ...@@ -391,7 +391,7 @@ (define (narinfo-sha256 narinfo)
(define* (assert-valid-narinfo narinfo (define* (assert-valid-narinfo narinfo
#:optional (acl (current-acl)) #:optional (acl (current-acl))
#:key (verbose? #t)) #:key verbose?)
"Raise an exception if NARINFO lacks a signature, has an invalid signature, "Raise an exception if NARINFO lacks a signature, has an invalid signature,
or is signed by an unauthorized key." or is signed by an unauthorized key."
(let ((hash (narinfo-sha256 narinfo))) (let ((hash (narinfo-sha256 narinfo)))
...@@ -404,9 +404,8 @@ (define* (assert-valid-narinfo narinfo ...@@ -404,9 +404,8 @@ (define* (assert-valid-narinfo narinfo
(unless %allow-unauthenticated-substitutes? (unless %allow-unauthenticated-substitutes?
(assert-valid-signature narinfo signature hash acl) (assert-valid-signature narinfo signature hash acl)
(when verbose? (when verbose?
;; Visually separate substitutions with a newline.
(format (current-error-port) (format (current-error-port)
(_ "~%Found valid signature for ~a~%") (_ "Found valid signature for ~a~%")
(narinfo-path narinfo)) (narinfo-path narinfo))
(format (current-error-port) (format (current-error-port)
(_ "From ~a~%") (_ "From ~a~%")
...@@ -893,7 +892,7 @@ (define* (process-substitution store-item destination ...@@ -893,7 +892,7 @@ (define* (process-substitution store-item destination
;; "(4.1MiB installed)"; it shows the size of the package once ;; "(4.1MiB installed)"; it shows the size of the package once
;; installed. ;; installed.
(_ "Downloading ~a~:[~*~; (~a installed)~]...~%") (_ "Downloading ~a~:[~*~; (~a installed)~]...~%")
(store-path-abbreviation store-item) (uri->string uri)
;; Use the Nar size as an estimate of the installed size. ;; Use the Nar size as an estimate of the installed size.
(narinfo-size narinfo) (narinfo-size narinfo)
(and=> (narinfo-size narinfo) (and=> (narinfo-size narinfo)
...@@ -921,8 +920,9 @@ (define* (process-substitution store-item destination ...@@ -921,8 +920,9 @@ (define* (process-substitution store-item destination
;; Unpack the Nar at INPUT into DESTINATION. ;; Unpack the Nar at INPUT into DESTINATION.
(restore-file input destination) (restore-file input destination)
;; Skip a line after what 'progress-proc' printed. ;; Skip a line after what 'progress-proc' printed, and another one to
(newline (current-error-port)) ;; visually separate substitutions.
(display "\n\n" (current-error-port))
(every (compose zero? cdr waitpid) pids)))) (every (compose zero? cdr waitpid) pids))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment