unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 42481@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#42481] [PATCH 2/2] scripts: Pass #:verbosity to 'build-notifier'.
Date: Wed, 22 Jul 2020 23:46:57 +0200	[thread overview]
Message-ID: <20200722214657.32591-2-ludo@gnu.org> (raw)
In-Reply-To: <20200722214657.32591-1-ludo@gnu.org>

* 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'.
---
 guix/scripts/archive.scm     |  2 ++
 guix/scripts/build.scm       |  2 ++
 guix/scripts/copy.scm        |  2 ++
 guix/scripts/deploy.scm      |  4 +++-
 guix/scripts/environment.scm |  2 ++
 guix/scripts/pack.scm        |  2 ++
 guix/scripts/package.scm     |  2 ++
 guix/scripts/pull.scm        |  2 ++
 guix/scripts/system.scm      | 11 +++++++++--
 9 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm
index 41a2a42c21..f3b86fba14 100644
--- a/guix/scripts/archive.scm
+++ b/guix/scripts/archive.scm
@@ -380,6 +380,8 @@ output port."
                    (with-build-handler
                        (build-notifier #:use-substitutes?
                                        (assoc-ref opts 'substitutes?)
+                                       #:verbosity
+                                       (assoc-ref opts 'verbosity)
                                        #:dry-run?
                                        (assoc-ref opts 'dry-run?))
                      (cond ((assoc-ref opts 'export)
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 8ff2fd1910..6286a43c02 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -961,6 +961,8 @@ needed."
 
         (with-build-handler (build-notifier #:use-substitutes?
                                             (assoc-ref opts 'substitutes?)
+                                            #:verbosity
+                                            (assoc-ref opts 'verbosity)
                                             #:dry-run?
                                             (assoc-ref opts 'dry-run?))
           (parameterize ((current-terminal-columns (terminal-columns))
diff --git a/guix/scripts/copy.scm b/guix/scripts/copy.scm
index f6f64d0a11..16d2de30f7 100644
--- a/guix/scripts/copy.scm
+++ b/guix/scripts/copy.scm
@@ -175,6 +175,8 @@ Copy ITEMS to or from the specified host over SSH.\n"))
         (set-build-options-from-command-line store opts)
         (with-build-handler (build-notifier #:use-substitutes?
                                             (assoc-ref opts 'substitutes?)
+                                            #:verbosity
+                                            (assoc-ref opts 'verbosity)
                                             #:dry-run?
                                             (assoc-ref opts 'dry-run?))
           (with-status-verbosity (assoc-ref opts 'verbosity)
diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index 4466a0c632..524067e989 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -150,7 +150,9 @@ Perform the deployment specified by FILE.\n"))
       (with-store store
         (set-build-options-from-command-line store opts)
         (with-build-handler (build-notifier #:use-substitutes?
-                                            (assoc-ref opts 'substitutes?))
+                                            (assoc-ref opts 'substitutes?)
+                                            #:verbosity
+                                            (assoc-ref opts 'verbosity))
           (parameterize ((%graft? (assq-ref opts 'graft?)))
             (map/accumulate-builds store
                                    (cut deploy-machine* store <>)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index d3b8b57ccc..b8979cac19 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -708,6 +708,8 @@ message if any test fails."
       (with-store store
         (with-build-handler (build-notifier #:use-substitutes?
                                             (assoc-ref opts 'substitutes?)
+                                            #:verbosity
+                                            (assoc-ref opts 'verbosity)
                                             #:dry-run?
                                             (assoc-ref opts 'dry-run?))
           (with-status-verbosity (assoc-ref opts 'verbosity)
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 13ade37515..8d9733d911 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -1133,6 +1133,8 @@ Create a bundle of PACKAGE.\n"))
 
         (with-build-handler (build-notifier #:dry-run?
                                             (assoc-ref opts 'dry-run?)
+                                            #:verbosity
+                                            (assoc-ref opts 'verbosity)
                                             #:use-substitutes?
                                             (assoc-ref opts 'substitutes?))
           (parameterize ((%graft? (assoc-ref opts 'graft?))
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 1246147798..ac8dedb5f3 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -965,6 +965,8 @@ option processing with 'parse-command-line'."
             (set-build-options-from-command-line (%store) opts)
             (with-build-handler (build-notifier #:use-substitutes?
                                                 (assoc-ref opts 'substitutes?)
+                                                #:verbosity
+                                                (assoc-ref opts 'verbosity)
                                                 #:dry-run?
                                                 (assoc-ref opts 'dry-run?))
               (parameterize ((%guile-for-build
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 807daec593..5b4ccf13fe 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -773,6 +773,8 @@ Use '~/.config/guix/channels.scm' instead."))
                                  (%graft? (assoc-ref opts 'graft?)))
                     (with-build-handler (build-notifier #:use-substitutes?
                                                         substitutes?
+                                                        #:verbosity
+                                                        (assoc-ref opts 'verbosity)
                                                         #:dry-run? dry-run?)
                       (set-build-options-from-command-line store opts)
                       (ensure-default-profile)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index f2b4367094..3a8443b86c 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -1057,6 +1057,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)))
+
 \f
 ;;;
 ;;; Entry point.
@@ -1116,6 +1122,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
@@ -1270,8 +1278,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:
-- 
2.27.0





  reply	other threads:[~2020-07-22 21:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 21:40 [bug#42481] [PATCH 0/2] Printing a more concise build plan Ludovic Courtès
2020-07-22 21:46 ` [bug#42481] [PATCH 1/2] ui: Add #:verbosity to 'show-what-to-build' Ludovic Courtès
2020-07-22 21:46   ` Ludovic Courtès [this message]
2020-07-31 16:34 ` [bug#42481] [PATCH 0/2] Printing a more concise build plan Ludovic Courtès
2020-07-31 18:18   ` Mathieu Othacehe
2020-08-03 15:49     ` Ludovic Courtès
2020-07-31 19:03   ` Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200722214657.32591-2-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=42481@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).