~ruther/guix-local

8a54c0ec694ad6e22b155d167552b8fd0914e82d — Ludovic Courtès 9 years ago 3c185b2
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.
1 files changed, 10 insertions(+), 2 deletions(-)

M guix/scripts/build.scm
M guix/scripts/build.scm => guix/scripts/build.scm +10 -2
@@ 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))))))