[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: refresh: Support comma-separated updater types.
From: |
Alex Kost |
Subject: |
01/01: refresh: Support comma-separated updater types. |
Date: |
Wed, 28 Oct 2015 18:53:46 +0000 |
alezost pushed a commit to branch master
in repository guix.
commit 7191adc5cf864d75debcc618937b7a6292491445
Author: Alex Kost <address@hidden>
Date: Tue Oct 27 21:13:05 2015 +0300
refresh: Support comma-separated updater types.
* guix/scripts/refresh.scm (%options): Handle comma-separated types for
'--type' option.
(guix-refresh): Adjust accordingly.
(show-help): Likewise.
* doc/guix.texi (Invoking guix refresh): Document it.
---
doc/guix.texi | 6 +++---
guix/scripts/refresh.scm | 18 +++++++++++-------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 9878b93..4fbe057 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4276,8 +4276,8 @@ inconvenient.
@item address@hidden
@itemx -t @var{updater}
-Select only packages handled by @var{updater}. Currently, @var{updater}
-may be one of:
+Select only packages handled by @var{updater} (may be a comma-separated
+list of updaters). Currently, @var{updater} may be one of:
@table @code
@item gnu
@@ -4292,7 +4292,7 @@ For instance, the following commands only checks for
updates of Emacs
packages hosted at @code{elpa.gnu.org} and updates of CRAN packages:
@example
-$ guix refresh -t elpa -t cran
+$ guix refresh --type=elpa,cran
gnu/packages/statistics.scm:819:13: r-testthat would be upgraded from 0.10.0
to 0.11.0
gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to
11.88.9
@end example
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index a66b3f9..04f6b76 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -69,10 +69,13 @@
arg)))))
(option '(#\t "type") #t #f
(lambda (opt name arg result)
- (alist-cons 'updater (string->symbol arg) result)))
+ (let* ((not-comma (char-set-complement (char-set #\,)))
+ (names (map string->symbol
+ (string-tokenize arg not-comma))))
+ (alist-cons 'updaters names result))))
(option '(#\L "list-updaters") #f #f
(lambda args
- (list-updaters-and-exit)))
+ (list-updaters-and-exit)))
(option '(#\l "list-dependent") #f #f
(lambda (opt name arg result)
(alist-cons 'list-dependent? #t result)))
@@ -114,7 +117,8 @@ specified with `--select'.\n"))
-s, --select=SUBSET select all the packages in SUBSET, one of
`core' or `non-core'"))
(display (_ "
- -t, --type=UPDATER restrict to updates from UPDATER--e.g., 'gnu'"))
+ -t, --type=UPDATER,... restrict to updates from the specified updaters
+ (e.g., 'gnu')"))
(display (_ "
-L, --list-updaters list available updaters and exit"))
(display (_ "
@@ -209,15 +213,15 @@ downloaded and authenticated; not updating~%")
(define (options->updaters opts)
;; Return the list of updaters to use.
(match (filter-map (match-lambda
- (('updater . name)
- (lookup-updater name))
+ (('updaters . names)
+ (map lookup-updater names))
(_ #f))
opts)
(()
;; Use the default updaters.
%updaters)
- (lst
- lst)))
+ (lists
+ (concatenate lists))))
(define (keep-newest package lst)
;; If a newer version of PACKAGE is already in LST, return LST; otherwise