[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/11: weather: '--display-missing' shows the system type of missing ite
From: |
guix-commits |
Subject: |
06/11: weather: '--display-missing' shows the system type of missing items. |
Date: |
Sat, 8 May 2021 09:08:58 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 5b0afe2420fcc9542328da4347f9e79490625d99
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed May 5 21:46:44 2021 +0200
weather: '--display-missing' shows the system type of missing items.
* guix/scripts/weather.scm (store-item-system): New procedure.
(report-server-coverage): Use it to print the system type of each
missing item.
---
guix/scripts/weather.scm | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm
index 5164fe0..6d925d4 100644
--- a/guix/scripts/weather.scm
+++ b/guix/scripts/weather.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
@@ -171,6 +171,16 @@ about the derivations queued, as is the case with Hydra."
#f ;no derivation information
(lset-intersection string=? queued items)))
+(define (store-item-system store item)
+ "Return the system (a string such as \"aarch64-linux\")) ITEM targets,
+or #f if it could not be determined."
+ (match (valid-derivers store item)
+ ((drv . _)
+ (and=> (false-if-exception (read-derivation-from-file drv))
+ derivation-system))
+ (()
+ #f)))
+
(define* (report-server-coverage server items
#:key display-missing?)
"Report the subset of ITEMS available as substitutes on SERVER.
@@ -270,7 +280,22 @@ are queued~%")
(when (and display-missing? (not (null? missing)))
(newline)
(format #t (G_ "Substitutes are missing for the following items:~%"))
- (format #t "~{ ~a~%~}" missing))
+
+ ;; Display two columns: store items, and their system type.
+ (format #t "~:{ ~a ~a~%~}"
+ (zip (map (let ((width (max (- (current-terminal-columns)
+ 20)
+ 0)))
+ (lambda (item)
+ (if (> (string-length item) width)
+ item
+ (string-pad-right item width))))
+ missing)
+ (with-store store
+ (map (lambda (item)
+ (or (store-item-system store item)
+ (G_ "unknown system")))
+ missing)))))
;; Return the coverage ratio.
(let ((total (length items)))
- branch master updated (e118348 -> f903bb7), guix-commits, 2021/05/08
- 02/11: gnu: Add font-montserrat., guix-commits, 2021/05/08
- 01/11: gnu: ocaml: Depend on libiberty., guix-commits, 2021/05/08
- 04/11: gnu: Add volctl., guix-commits, 2021/05/08
- 03/11: gnu: xfce4-session: Allow xflock4 to use xset., guix-commits, 2021/05/08
- 06/11: weather: '--display-missing' shows the system type of missing items.,
guix-commits <=
- 11/11: services: configuration: Export 'no-serialization' syntactic keyword., guix-commits, 2021/05/08
- 05/11: gnu: volctl: Comment on the license., guix-commits, 2021/05/08
- 07/11: store: 'open-connection' never returns #f., guix-commits, 2021/05/08
- 08/11: ssh: 'connect-to-remote-daemon' raises a nicer message upon error., guix-commits, 2021/05/08
- 10/11: ssh: Honor GUIX_DAEMON_SOCKET on the target machine., guix-commits, 2021/05/08
- 09/11: store: Export 'connect-to-daemon'., guix-commits, 2021/05/08