refresh: Bail out when asked for a nonexistent updater.

* guix/scripts/refresh.scm (lookup-updater): Call 'leave' when 'find'
returns #f.
master
Ludovic Courtès 2015-12-07 23:10:02 +01:00
parent e3cc793e7c
commit fba607b129
1 changed files with 4 additions and 3 deletions

View File

@ -197,9 +197,10 @@ unavailable optional dependencies such as Guile-JSON."
(define (lookup-updater name)
"Return the updater called NAME."
(find (lambda (updater)
(eq? name (upstream-updater-name updater)))
%updaters))
(or (find (lambda (updater)
(eq? name (upstream-updater-name updater)))
%updaters)
(leave (_ "~a: no such updater~%") name)))
(define (list-updaters-and-exit)
"Display available updaters and exit."