packages: 'package-field-location' handles missing source properties.
authorLudovic Courtès <ludo@gnu.org>
Sun, 22 Mar 2020 11:31:07 +0000 (12:31 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 22 Mar 2020 11:42:52 +0000 (12:42 +0100)
This is a followup to f2b24f01f42c1bad3ddffd140194de1aec38a5f8.

* guix/packages.scm (package-field-location): Check whether
'source-properties->location' returns #f.  This fixes the case where
'source-properties' returns the empty list.

guix/packages.scm

index 4ab8650..70b1478 100644 (file)
@@ -363,12 +363,12 @@ object."
                 (let ((field (assoc field inits)))
                   (match field
                     ((_ value)
-                     (let ((props (source-properties value)))
-                       (and props
+                     (let ((loc (and=> (source-properties value)
+                                       source-properties->location)))
+                       (and loc
                             ;; Preserve the original file name, which may be a
                             ;; relative file name.
-                            (let ((loc (source-properties->location props)))
-                              (set-field loc (location-file) file)))))
+                            (set-field loc (location-file) file))))
                     (_
                      #f))))
                (_