From 91601790d00bbfcdc943b974779cb3d153341ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 22 Mar 2020 12:31:07 +0100 Subject: packages: 'package-field-location' handles missing source properties. 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index 4ab8650340..70b1478c91 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -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)))) (_ -- cgit v1.2.3