[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: guix build: Gracefully handle packages without source for '-S'.
From: |
Ludovic Courtès |
Subject: |
02/02: guix build: Gracefully handle packages without source for '-S'. |
Date: |
Tue, 27 Sep 2016 09:46:35 +0000 (UTC) |
civodul pushed a commit to branch master
in repository guix.
commit 8a54c0ec694ad6e22b155d167552b8fd0914e82d
Author: Ludovic Courtès <address@hidden>
Date: Tue Sep 27 11:44:56 2016 +0200
guix build: Gracefully handle packages without source for '-S'.
Fixes <http://bugs.gnu.org/22836>.
Reported by Ricardo Wurmus <address@hidden>.
* 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 a9f649d..b64138e 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -595,8 +595,16 @@ build."
(#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))))))