guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/05: weather: Allow for multiple '--manifest' options.


From: guix-commits
Subject: 05/05: weather: Allow for multiple '--manifest' options.
Date: Thu, 12 Mar 2020 13:33:21 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 2843fed0e973145f01fb2004c99aca8e8837b332
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu Mar 12 18:30:05 2020 +0100

    weather: Allow for multiple '--manifest' options.
    
    * guix/scripts/weather.scm (guix-weather)[package-list]: Account for all
    the 'manifest entries in OPTS.
    * doc/guix.texi (Invoking guix weather): Document it.
---
 doc/guix.texi            |  3 +++
 guix/scripts/weather.scm | 22 ++++++++++++----------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ca21857..9a5b5f7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10830,6 +10830,9 @@ specified in @var{file}.  @var{file} must contain a 
@dfn{manifest}, as
 with the @code{-m} option of @command{guix package} (@pxref{Invoking
 guix package}).
 
+This option can be repeated several times, in which case the manifests
+are concatenated.
+
 @item --coverage[=@var{count}]
 @itemx -c [@var{count}]
 Report on substitute coverage for packages: list packages with at least
diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm
index 60915d3..733986b 100644
--- a/guix/scripts/weather.scm
+++ b/guix/scripts/weather.scm
@@ -499,17 +499,19 @@ SERVER.  Display information for packages with at least 
THRESHOLD dependents."
 (define (guix-weather . args)
   (define (package-list opts)
     ;; Return the package list specified by OPTS.
-    (let ((file (assoc-ref opts 'manifest))
-          (base (filter-map (match-lambda
-                              (('argument . spec)
-                               (specification->package spec))
-                              (_
-                               #f))
-                            opts)))
-      (if (and (not file) (null? base))
+    (let ((files (filter-map (match-lambda
+                               (('manifest . file) file)
+                               (_ #f))
+                             opts))
+          (base  (filter-map (match-lambda
+                               (('argument . spec)
+                                (specification->package spec))
+                               (_
+                                #f))
+                             opts)))
+      (if (and (null? files) (null? base))
           (all-packages)
-          (append base
-                  (if file (load-manifest file) '())))))
+          (append base (append-map load-manifest files)))))
 
   (with-error-handling
     (parameterize ((current-terminal-columns (terminal-columns))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]