[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/17: ui: 'show-what-to-build' highlights "The following [...] will be
From: |
guix-commits |
Subject: |
03/17: ui: 'show-what-to-build' highlights "The following [...] will be built". |
Date: |
Fri, 18 Mar 2022 11:05:28 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 9e0f0123a018f7fb81779d858942ba01150a12ee
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Mar 9 10:36:28 2022 +0100
ui: 'show-what-to-build' highlights "The following [...] will be built".
* guix/colors.scm (highlight/warn): New procedure.
* guix/ui.scm (show-what-to-build): Use 'highlight/warn' when displaying
what would/will be built.
---
guix/colors.scm | 4 +++-
guix/ui.scm | 24 ++++++++++++++----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/guix/colors.scm b/guix/colors.scm
index 3031f54799..ae0a583d94 100644
--- a/guix/colors.scm
+++ b/guix/colors.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2013, 2014 Free Software Foundation, Inc.
;;; Copyright © 2018 Sahithi Yarlagadda <sahi@swecha.net>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2019, 2022 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -31,6 +31,7 @@
colorize-string
highlight
+ highlight/warn
dim
color-rules
@@ -143,6 +144,7 @@ that subsequent output will not have any colors in effect."
str)))
(define highlight (coloring-procedure (color BOLD)))
+(define highlight/warn (coloring-procedure (color BOLD MAGENTA)))
(define dim (coloring-procedure (color DARK)))
(define (colorize-matches rules)
diff --git a/guix/ui.scm b/guix/ui.scm
index 238952723e..8e4e3e2dfc 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1031,12 +1031,14 @@ summary, and level 0 shows nothing."
;; Unfortunately, this is hardly avoidable for proper i18n.
(if dry-run?
(begin
- (unless (zero? verbosity)
+ (unless (or (zero? verbosity) (null? build))
(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)))
+ (highlight/warn
+ (N_ "The following derivation would be built:~%"
+ "The following derivations would be built:~%"
+ (length build))))
+ (format (current-error-port) "~{ ~a~%~}"
+ (map colorized-store-item build)))
(cond ((>= verbosity 2)
(if display-download-size?
(format (current-error-port)
@@ -1082,12 +1084,14 @@ summary, and level 0 shows nothing."
(null? download) (length download))))))
(begin
- (unless (zero? verbosity)
+ (unless (or (zero? verbosity) (null? build))
(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)))
+ (highlight/warn
+ (N_ "The following derivation will be built:~%"
+ "The following derivations will be built:~%"
+ (length build))))
+ (format (current-error-port) "~{ ~a~%~}"
+ (map colorized-store-item build)))
(cond ((>= verbosity 2)
(if display-download-size?
(format (current-error-port)
- 09/17: gnu: Add emacs-osm., (continued)
- 09/17: gnu: Add emacs-osm., guix-commits, 2022/03/18
- 04/17: ui: 'show-what-to-build' highlights "would be downloaded" headings., guix-commits, 2022/03/18
- 06/17: home: services: Export record type accessors., guix-commits, 2022/03/18
- 05/17: graph: Factorize 'lookup-backend'., guix-commits, 2022/03/18
- 10/17: gnu: emacs-osm: Fetch source over Git., guix-commits, 2022/03/18
- 08/17: guix system: Call 'export-graph' with the right port argument., guix-commits, 2022/03/18
- 07/17: guix home: Implement the 'extension-graph' and 'shepherd-graph' actions., guix-commits, 2022/03/18
- 12/17: home: services: Fix bash aliases without guix-defaults., guix-commits, 2022/03/18
- 14/17: gnu: feh, newsboat: Inline top-level reference to 'curl'., guix-commits, 2022/03/18
- 02/17: gnu: petsc-openmpi: Remove input labels., guix-commits, 2022/03/18
- 03/17: ui: 'show-what-to-build' highlights "The following [...] will be built".,
guix-commits <=
- 15/17: gnu: Add ckb-next., guix-commits, 2022/03/18
- 17/17: gnu: bitlbee-purple: Use 'modify-inputs'., guix-commits, 2022/03/18
- 16/17: gnu: bitlbee-purple: Add search path for "PURPLE_PLUGIN_PATH"., guix-commits, 2022/03/18
- 13/17: gnu: ghc-optparse-applicative@0.15.1.0: Avoid circular top-level references., guix-commits, 2022/03/18