From 8a54c0ec694ad6e22b155d167552b8fd0914e82d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 27 Sep 2016 11:44:56 +0200 Subject: guix build: Gracefully handle packages without source for '-S'. Fixes . Reported by Ricardo Wurmus . * guix/scripts/build.scm (options->derivations): Gracefully handle (package-source p) = #f. --- guix/scripts/build.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index a9f649d2ee..b64138ec0e 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -595,8 +595,16 @@ (define graft? (assoc-ref opts 'graft?)) (#f (list (package->derivation store p system))) (#t - (let ((s (package-source p))) - (list (package-source-derivation store s)))) + (match (package-source p) + (#f + (format (current-error-port) + (_ "~a: warning: \ +package '~a' has no source~%") + (location->string (package-location p)) + (package-name p)) + '()) + (s + (list (package-source-derivation store s))))) (proc (map (cut package-source-derivation store <>) (proc p)))))) -- cgit v1.2.3