summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/build.scm14
1 files changed, 10 insertions, 4 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index debf7c2848..a6596d0a82 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -404,10 +404,16 @@ must be one of 'package', 'all', or 'transitive'~%")
(define (options->things-to-build opts)
"Read the arguments from OPTS and return a list of high-level objects to
build---packages, gexps, derivations, and so on."
- (define ensure-list
- (match-lambda
- ((x ...) x)
- (x (list x))))
+ (define (validate-type x)
+ (unless (or (package? x) (derivation? x) (gexp? x) (procedure? x))
+ (leave (_ "~s: not something we can build~%") x)))
+
+ (define (ensure-list x)
+ (let ((lst (match x
+ ((x ...) x)
+ (x (list x)))))
+ (for-each validate-type lst)
+ lst))
(append-map (match-lambda
(('argument . (? string? spec))