aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-03-08 11:48:21 +0100
committerLudovic Courtès <ludo@gnu.org>2016-03-08 11:48:21 +0100
commitefb107e0cd34fa0ed656441bf6e2414253c0344a (patch)
tree298d7fc6967eaa8158a86af89bee59914ce7799c /gnu
parent95cd4971d07fe312a4e0d21b72e7bf1bba493753 (diff)
downloadguix-efb107e0cd34fa0ed656441bf6e2414253c0344a.tar
guix-efb107e0cd34fa0ed656441bf6e2414253c0344a.tar.gz
packages: Gracefully report packages not found.
Fixes a thinko introduced in 1b846da8c372bee78851439fd9e72b2499115e5a that would lead to a backtrace when looking for an unknown package. * gnu/packages.scm (%find-package): Correct logic when checking for FALLBACK?.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index 5a76e9b9ef..bbd460a083 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -300,13 +300,15 @@ use NAME@VERSION instead~%")))
(_
(if version
(leave (_ "~A: package not found for version ~a~%") name version)
- (or fallback?
+ (if (not fallback?)
;; XXX: Fallback to the older specification style with an hyphen
;; between NAME and VERSION, for backward compatibility.
(call-with-values
(lambda ()
(hyphen-separated-name->name+version name))
(cut %find-package spec <> <> #:fallback? #t))
+
+ ;; The fallback case didn't find anything either, so bail out.
(leave (_ "~A: unknown package~%") name))))))
(define (specification->package spec)