guix build: Gracefully handle packages without source for '-S'.

Fixes <http://bugs.gnu.org/22836>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/scripts/build.scm (options->derivations): Gracefully
handle (package-source p) = #f.
master
Ludovic Courtès 2016-09-27 11:44:56 +02:00
parent 3c185b24f5
commit 8a54c0ec69
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 10 additions and 2 deletions

View File

@ -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))))))