From patchwork Wed Jul 22 21:46:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 23323 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A5EE127BBE3; Wed, 22 Jul 2020 22:48:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D505327BBE1 for ; Wed, 22 Jul 2020 22:48:08 +0100 (BST) Received: from localhost ([::1]:45594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyMau-0000PQ-Ed for patchwork@mira.cbaines.net; Wed, 22 Jul 2020 17:48:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyMao-0000P8-QX for guix-patches@gnu.org; Wed, 22 Jul 2020 17:48:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyMao-00086u-HH for guix-patches@gnu.org; Wed, 22 Jul 2020 17:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jyMao-0006pz-Fp for guix-patches@gnu.org; Wed, 22 Jul 2020 17:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42481] [PATCH 1/2] ui: Add #:verbosity to 'show-what-to-build'. References: <20200722214018.32353-1-ludo@gnu.org> In-Reply-To: <20200722214018.32353-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Jul 2020 21:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42481 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42481@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 42481-submit@debbugs.gnu.org id=B42481.159545443726210 (code B ref 42481); Wed, 22 Jul 2020 21:48:02 +0000 Received: (at 42481) by debbugs.gnu.org; 22 Jul 2020 21:47:17 +0000 Received: from localhost ([127.0.0.1]:43281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyMa4-0006og-Q9 for submit@debbugs.gnu.org; Wed, 22 Jul 2020 17:47:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyMa2-0006oK-CD for 42481@debbugs.gnu.org; Wed, 22 Jul 2020 17:47:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56758) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyMZw-00082c-Jl; Wed, 22 Jul 2020 17:47:08 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59932 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jyMZv-0001mO-D7; Wed, 22 Jul 2020 17:47:07 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 22 Jul 2020 23:46:56 +0200 Message-Id: <20200722214657.32591-1-ludo@gnu.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/ui.scm (%default-verbosity): New variable. (show-what-to-build): Add #:verbosity and honor it. (build-notifier): Add #:verbosity and pass it to 'show-what-to-build'. --- guix/ui.scm | 175 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 109 insertions(+), 66 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 27bcade9dd..b8376c11a1 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -931,17 +931,25 @@ that the rest." (color DARK)) (string-drop file prefix))))) +(define %default-verbosity + ;; Default verbosity level for 'show-what-to-build'. + 2) + (define* (show-what-to-build store drv #:key dry-run? (use-substitutes? #t) + (verbosity %default-verbosity) (mode (build-mode normal))) "Show what will or would (depending on DRY-RUN?) be built in realizing the derivations listed in DRV using MODE, a 'build-mode' value. The elements of DRV can be either derivations or derivation inputs. Return two values: a Boolean indicating whether there's something to build, -and a Boolean indicating whether there's something to download. When -USE-SUBSTITUTES?, check and report what is prerequisites are available for -download." +and a Boolean indicating whether there's something to download. + +When USE-SUBSTITUTES?, check and report what is prerequisites are available +for download. VERBOSITY is an integer indicating the level of details to be +shown: level 2 and higher provide all the details, level 1 shows a high-level +summary, and level 0 shows nothing." (define inputs (map (match-lambda ((? derivation? drv) (derivation-input drv)) @@ -1000,71 +1008,104 @@ download." ;; display when we have information for all of DOWNLOAD. (not (any (compose zero? substitutable-download-size) download))) + ;; Combinatorial explosion ahead along two axes: DRY-RUN? and VERBOSITY. + ;; Unfortunately, this is hardly avoidable for proper i18n. (if dry-run? (begin - (format (current-error-port) - (N_ "~:[The following derivation would be built:~%~{ ~a~%~}~;~]" - "~:[The following derivations would be built:~%~{ ~a~%~}~;~]" - (length build)) - (null? build) (map colorized-store-item build)) - (if display-download-size? - (format (current-error-port) - ;; TRANSLATORS: "MB" is for "megabyte"; it should be - ;; translated to the corresponding abbreviation. - (G_ "~:[~,1h MB would be downloaded:~%~{ ~a~%~}~;~]") - (null? download) - download-size - (map (compose colorized-store-item substitutable-path) - download)) - (format (current-error-port) - (N_ "~:[The following file would be downloaded:~%~{ ~a~%~}~;~]" - "~:[The following files would be downloaded:~%~{ ~a~%~}~;~]" - (length download)) - (null? download) - (map (compose colorized-store-item substitutable-path) - download))) - (format (current-error-port) - (N_ "~:[The following graft would be made:~%~{ ~a~%~}~;~]" - "~:[The following grafts would be made:~%~{ ~a~%~}~;~]" - (length graft)) - (null? graft) (map colorized-store-item graft)) - (format (current-error-port) - (N_ "~:[The following profile hook would be built:~%~{ ~a~%~}~;~]" - "~:[The following profile hooks would be built:~%~{ ~a~%~}~;~]" - (length hook)) - (null? hook) (map colorized-store-item hook))) + (unless (zero? verbosity) + (format (current-error-port) + (N_ "~:[The following derivation would be built:~%~{ ~a~%~}~;~]" + "~:[The following derivations would be built:~%~{ ~a~%~}~;~]" + (length build)) + (null? build) (map colorized-store-item build))) + (cond ((>= verbosity 2) + (if display-download-size? + (format (current-error-port) + ;; TRANSLATORS: "MB" is for "megabyte"; it should be + ;; translated to the corresponding abbreviation. + (G_ "~:[~,1h MB would be downloaded:~%~{ ~a~%~}~;~]") + (null? download) + download-size + (map (compose colorized-store-item substitutable-path) + download)) + (format (current-error-port) + (N_ "~:[The following file would be downloaded:~%~{ ~a~%~}~;~]" + "~:[The following files would be downloaded:~%~{ ~a~%~}~;~]" + (length download)) + (null? download) + (map (compose colorized-store-item substitutable-path) + download))) + (format (current-error-port) + (N_ "~:[The following graft would be made:~%~{ ~a~%~}~;~]" + "~:[The following grafts would be made:~%~{ ~a~%~}~;~]" + (length graft)) + (null? graft) (map colorized-store-item graft)) + (format (current-error-port) + (N_ "~:[The following profile hook would be built:~%~{ ~a~%~}~;~]" + "~:[The following profile hooks would be built:~%~{ ~a~%~}~;~]" + (length hook)) + (null? hook) (map colorized-store-item hook))) + ((= verbosity 1) + ;; Display the bare minimum; don't mention grafts and hooks. + (if display-download-size? + (format (current-error-port) + ;; TRANSLATORS: "MB" is for "megabyte"; it should be + ;; translated to the corresponding abbreviation. + (G_ "~:[~,1h MB would be downloaded~%~;~]") + (null? download) download-size) + (format (current-error-port) + (N_ "~:[~h item would be downloaded~%~;~]" + "~:[~h items would be downloaded~%~;~]" + (length download)) + (null? download) (length download)))))) + (begin - (format (current-error-port) - (N_ "~:[The following derivation will be built:~%~{ ~a~%~}~;~]" - "~:[The following derivations will be built:~%~{ ~a~%~}~;~]" - (length build)) - (null? build) (map colorized-store-item build)) - (if display-download-size? - (format (current-error-port) - ;; TRANSLATORS: "MB" is for "megabyte"; it should be - ;; translated to the corresponding abbreviation. - (G_ "~:[~,1h MB will be downloaded:~%~{ ~a~%~}~;~]") - (null? download) - download-size - (map (compose colorized-store-item substitutable-path) - download)) - (format (current-error-port) - (N_ "~:[The following file will be downloaded:~%~{ ~a~%~}~;~]" - "~:[The following files will be downloaded:~%~{ ~a~%~}~;~]" - (length download)) - (null? download) - (map (compose colorized-store-item substitutable-path) - download))) - (format (current-error-port) - (N_ "~:[The following graft will be made:~%~{ ~a~%~}~;~]" - "~:[The following grafts will be made:~%~{ ~a~%~}~;~]" - (length graft)) - (null? graft) (map colorized-store-item graft)) - (format (current-error-port) - (N_ "~:[The following profile hook will be built:~%~{ ~a~%~}~;~]" - "~:[The following profile hooks will be built:~%~{ ~a~%~}~;~]" - (length hook)) - (null? hook) (map colorized-store-item hook)))) + (unless (zero? verbosity) + (format (current-error-port) + (N_ "~:[The following derivation will be built:~%~{ ~a~%~}~;~]" + "~:[The following derivations will be built:~%~{ ~a~%~}~;~]" + (length build)) + (null? build) (map colorized-store-item build))) + (cond ((>= verbosity 2) + (if display-download-size? + (format (current-error-port) + ;; TRANSLATORS: "MB" is for "megabyte"; it should be + ;; translated to the corresponding abbreviation. + (G_ "~:[~,1h MB will be downloaded:~%~{ ~a~%~}~;~]") + (null? download) + download-size + (map (compose colorized-store-item substitutable-path) + download)) + (format (current-error-port) + (N_ "~:[The following file will be downloaded:~%~{ ~a~%~}~;~]" + "~:[The following files will be downloaded:~%~{ ~a~%~}~;~]" + (length download)) + (null? download) + (map (compose colorized-store-item substitutable-path) + download))) + (format (current-error-port) + (N_ "~:[The following graft will be made:~%~{ ~a~%~}~;~]" + "~:[The following grafts will be made:~%~{ ~a~%~}~;~]" + (length graft)) + (null? graft) (map colorized-store-item graft)) + (format (current-error-port) + (N_ "~:[The following profile hook will be built:~%~{ ~a~%~}~;~]" + "~:[The following profile hooks will be built:~%~{ ~a~%~}~;~]" + (length hook)) + (null? hook) (map colorized-store-item hook))) + ((= verbosity 1) + ;; Display the bare minimum; don't mention grafts and hooks. + (if display-download-size? + (format (current-error-port) + ;; TRANSLATORS: "MB" is for "megabyte"; it should be + ;; translated to the corresponding abbreviation. + (G_ "~:[~,1h MB will be downloaded~%~;~]") + (null? download) download-size) + (format (current-error-port) + (N_ "~:[~h item will be downloaded~%~;~]" + "~:[~h items will be downloaded~%~;~]" + (length download)) + (null? download) (length download))))))) (check-available-space installed-size) @@ -1073,7 +1114,8 @@ download." (define show-what-to-build* (store-lift show-what-to-build)) -(define* (build-notifier #:key (dry-run? #f) (use-substitutes? #t)) +(define* (build-notifier #:key (dry-run? #f) (use-substitutes? #t) + (verbosity %default-verbosity)) "Return a procedure suitable for 'with-build-handler' that, when 'build-things' is called, invokes 'show-what-to-build' to display the build plan. When DRY-RUN? is true, the 'with-build-handler' form returns without @@ -1107,6 +1149,7 @@ any build happening." (show-what-to-build store inputs #:dry-run? dry-run? #:use-substitutes? use-substitutes? + #:verbosity verbosity #:mode mode))) (unless (and (or build? download?) From patchwork Wed Jul 22 21:46:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 23324 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BB52E27BBE3; Wed, 22 Jul 2020 22:48:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 24FF027BBE1 for ; Wed, 22 Jul 2020 22:48:14 +0100 (BST) Received: from localhost ([::1]:45816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyMaz-0000Vq-NB for patchwork@mira.cbaines.net; Wed, 22 Jul 2020 17:48:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyMap-0000PE-66 for guix-patches@gnu.org; Wed, 22 Jul 2020 17:48:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyMao-00086y-Td for guix-patches@gnu.org; Wed, 22 Jul 2020 17:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jyMao-0006q6-SI for guix-patches@gnu.org; Wed, 22 Jul 2020 17:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42481] [PATCH 2/2] scripts: Pass #:verbosity to 'build-notifier'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Jul 2020 21:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42481 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42481@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 42481-submit@debbugs.gnu.org id=B42481.159545443926220 (code B ref 42481); Wed, 22 Jul 2020 21:48:02 +0000 Received: (at 42481) by debbugs.gnu.org; 22 Jul 2020 21:47:19 +0000 Received: from localhost ([127.0.0.1]:43283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyMa7-0006op-9g for submit@debbugs.gnu.org; Wed, 22 Jul 2020 17:47:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyMa3-0006oM-GJ for 42481@debbugs.gnu.org; Wed, 22 Jul 2020 17:47:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56759) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyMZy-00082q-6r; Wed, 22 Jul 2020 17:47:10 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59932 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jyMZw-0001mO-Pv; Wed, 22 Jul 2020 17:47:09 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 22 Jul 2020 23:46:57 +0200 Message-Id: <20200722214657.32591-2-ludo@gnu.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200722214657.32591-1-ludo@gnu.org> References: <20200722214657.32591-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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))) + ;;; ;;; 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: