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.
This commit is contained in:
Ludovic Courtès 2020-03-12 18:30:05 +01:00
parent 71bb485541
commit 2843fed0e9
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 15 additions and 10 deletions

View file

@ -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 with the @code{-m} option of @command{guix package} (@pxref{Invoking
guix package}). guix package}).
This option can be repeated several times, in which case the manifests
are concatenated.
@item --coverage[=@var{count}] @item --coverage[=@var{count}]
@itemx -c [@var{count}] @itemx -c [@var{count}]
Report on substitute coverage for packages: list packages with at least Report on substitute coverage for packages: list packages with at least

View file

@ -499,17 +499,19 @@ (define* (report-package-coverage server packages systems
(define (guix-weather . args) (define (guix-weather . args)
(define (package-list opts) (define (package-list opts)
;; Return the package list specified by OPTS. ;; Return the package list specified by OPTS.
(let ((file (assoc-ref opts 'manifest)) (let ((files (filter-map (match-lambda
(base (filter-map (match-lambda (('manifest . file) file)
(('argument . spec) (_ #f))
(specification->package spec)) opts))
(_ (base (filter-map (match-lambda
#f)) (('argument . spec)
opts))) (specification->package spec))
(if (and (not file) (null? base)) (_
#f))
opts)))
(if (and (null? files) (null? base))
(all-packages) (all-packages)
(append base (append base (append-map load-manifest files)))))
(if file (load-manifest file) '())))))
(with-error-handling (with-error-handling
(parameterize ((current-terminal-columns (terminal-columns)) (parameterize ((current-terminal-columns (terminal-columns))