From fba607b12919b254d75b1e7e9223d712fe2ac32c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 7 Dec 2015 23:10:02 +0100 Subject: [PATCH] refresh: Bail out when asked for a nonexistent updater. * guix/scripts/refresh.scm (lookup-updater): Call 'leave' when 'find' returns #f. --- guix/scripts/refresh.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index a94bb22a91..2341ae6777 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -197,9 +197,10 @@ (define %updaters (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."