~ruther/guix-local

fba607b12919b254d75b1e7e9223d712fe2ac32c — Ludovic Courtès 10 years ago e3cc793
refresh: Bail out when asked for a nonexistent updater.

* guix/scripts/refresh.scm (lookup-updater): Call 'leave' when 'find'
returns #f.
1 files changed, 4 insertions(+), 3 deletions(-)

M guix/scripts/refresh.scm
M guix/scripts/refresh.scm => guix/scripts/refresh.scm +4 -3
@@ 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."