summaryrefslogtreecommitdiff
path: root/guix/scripts/system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-07-22 23:22:13 +0200
committerLudovic Courtès <ludo@gnu.org>2020-08-03 17:18:37 +0200
commit898e6d0a07e4260600d0876d8d1f551ac8b647f9 (patch)
treef29d0dd2fa23aee53af3f8828b1d4b32571b55a6 /guix/scripts/system.scm
parenta55d83b5460407fe1d5c828dddbb7de0cf749e2b (diff)
downloadguix-patches-898e6d0a07e4260600d0876d8d1f551ac8b647f9.tar
guix-patches-898e6d0a07e4260600d0876d8d1f551ac8b647f9.tar.gz
scripts: Pass #:verbosity to 'build-notifier'.
* guix/scripts/archive.scm (guix-archive): Pass #:verbosity to 'build-notifier'. * guix/scripts/build.scm (guix-build): Likewise. * guix/scripts/copy.scm (guix-copy): Likewise. * guix/scripts/deploy.scm (guix-deploy): Likewise. * guix/scripts/environment.scm (guix-environment): Likewise. * guix/scripts/pack.scm (guix-pack): Likewise. * guix/scripts/package.scm (guix-package*): Likewise. * guix/scripts/pull.scm (guix-pull): Likewise. * guix/scripts/system.scm (verbosity-level): New procedure. (process-action): Pass #:verbosity to 'build-notifier'. (guix-system): Use 'verbosity-level' for 'with-status-verbosity'.
Diffstat (limited to 'guix/scripts/system.scm')
-rw-r--r--guix/scripts/system.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index bfd50c7a79..f6d20382b6 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -1067,6 +1067,12 @@ Some ACTIONS support additional ARGS.\n"))
(image-size . guess)
(install-bootloader? . #t)))
+(define (verbosity-level opts)
+ "Return the verbosity level based on OPTS, the alist of parsed options."
+ (or (assoc-ref opts 'verbosity)
+ (if (eq? (assoc-ref opts 'action) 'build)
+ 2 1)))
+
;;;
;;; Entry point.
@@ -1126,6 +1132,8 @@ resulting from command-line parsing."
(with-build-handler (build-notifier #:use-substitutes?
(assoc-ref opts 'substitutes?)
+ #:verbosity
+ (verbosity-level opts)
#:dry-run?
(assoc-ref opts 'dry-run?))
(run-with-store store
@@ -1282,8 +1290,7 @@ argument list and OPTS is the option alist."
(args (option-arguments opts))
(command (assoc-ref opts 'action)))
(parameterize ((%graft? (assoc-ref opts 'graft?)))
- (with-status-verbosity (or (assoc-ref opts 'verbosity)
- (if (eq? command 'build) 2 1))
+ (with-status-verbosity (verbosity-level opts)
(process-command command args opts))))))
;;; Local Variables: