aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts/refresh.scm
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-10-27 21:13:05 +0300
committerAlex Kost <alezost@gmail.com>2015-10-28 21:51:59 +0300
commit7191adc5cf864d75debcc618937b7a6292491445 (patch)
treeaf8f1da0cc3f7d98422639ab9455b04bafdcb08b /guix/scripts/refresh.scm
parent9a067efdb2076293e505c29a51a9819ff025b056 (diff)
downloadgnu-guix-7191adc5cf864d75debcc618937b7a6292491445.tar
gnu-guix-7191adc5cf864d75debcc618937b7a6292491445.tar.gz
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.
Diffstat (limited to 'guix/scripts/refresh.scm')
-rw-r--r--guix/scripts/refresh.scm18
1 files changed, 11 insertions, 7 deletions
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index a66b3f9ea8..04f6b76edc 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