diff options
Diffstat (limited to 'guix/scripts')
-rwxr-xr-x | guix/scripts/substitute.scm | 12 | ||||
-rw-r--r-- | guix/scripts/system.scm | 25 |
2 files changed, 16 insertions, 21 deletions
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 21e0613a8a..8f50477801 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -391,7 +391,7 @@ No authentication and authorization checks are performed here!" (define* (assert-valid-narinfo narinfo #:optional (acl (current-acl)) - #:key (verbose? #t)) + #:key verbose?) "Raise an exception if NARINFO lacks a signature, has an invalid signature, or is signed by an unauthorized key." (let ((hash (narinfo-sha256 narinfo))) @@ -404,9 +404,8 @@ or is signed by an unauthorized key." (unless %allow-unauthenticated-substitutes? (assert-valid-signature narinfo signature hash acl) (when verbose? - ;; Visually separate substitutions with a newline. (format (current-error-port) - (_ "~%Found valid signature for ~a~%") + (_ "Found valid signature for ~a~%") (narinfo-path narinfo)) (format (current-error-port) (_ "From ~a~%") @@ -893,7 +892,7 @@ DESTINATION as a nar file. Verify the substitute against ACL." ;; "(4.1MiB installed)"; it shows the size of the package once ;; installed. (_ "Downloading ~a~:[~*~; (~a installed)~]...~%") - (store-path-abbreviation store-item) + (uri->string uri) ;; Use the Nar size as an estimate of the installed size. (narinfo-size narinfo) (and=> (narinfo-size narinfo) @@ -921,8 +920,9 @@ DESTINATION as a nar file. Verify the substitute against ACL." ;; Unpack the Nar at INPUT into DESTINATION. (restore-file input destination) - ;; Skip a line after what 'progress-proc' printed. - (newline (current-error-port)) + ;; Skip a line after what 'progress-proc' printed, and another one to + ;; visually separate substitutions. + (display "\n\n" (current-error-port)) (every (compose zero? cdr waitpid) pids)))) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index a2cd97ac1f..0519ab8c0b 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -227,25 +227,20 @@ BODY..., and restore them." (set! %load-path path) (set! %load-compiled-path cpath))))) -(define-syntax-rule (warn-on-system-error body ...) - (catch 'system-error - (lambda () - body ...) - (lambda (key proc format-string format-args errno . rest) - (warning (_ "while talking to shepherd: ~a~%") - (apply format #f format-string format-args)) - (with-monad %store-monad - (return #f))))) - (define-syntax-rule (with-shepherd-error-handling mbody ...) "Catch and report Shepherd errors that arise when binding MBODY, a monadic expression in %STORE-MONAD." (lambda (store) - (warn-on-system-error - (guard (c ((shepherd-error? c) - (values (report-shepherd-error c) store))) - (values (run-with-store store (begin mbody ...)) - store))))) + (catch 'system-error + (lambda () + (guard (c ((shepherd-error? c) + (values (report-shepherd-error c) store))) + (values (run-with-store store (begin mbody ...)) + store))) + (lambda (key proc format-string format-args errno . rest) + (warning (_ "while talking to shepherd: ~a~%") + (apply format #f format-string format-args)) + (values #f store))))) (define (report-shepherd-error error) "Report ERROR, a '&shepherd-error' error condition object." |