Subject: [bug#69328] [PATCH 02/12] lint: archival: Fix crash in non-Git case.

From: Ludovic Courtès <[email-masked]>
Date: Fri, 23 Feb 2024 16:48:06 +0100

Fixes a bug introduced in 29f3089c841f00144f24f5c32296aebf22d752cc where
‘guix lint -c archival guile-wisp’ (for instance) would crash with a
match error because ‘lookup-by-nar-hash’ returns a string.

* guix/lint.scm (check-archival): Add SWHID case in the non-Git case.

Change-Id: I66fb060172d372041df47d90a14df168b0fa762d
---
 guix/lint.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/lint.scm b/guix/lint.scm
index 84df171045..ad84048660 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -1736,6 +1736,8 @@ (define (check-archival package)
                                               (list id)
                                               #:field 'source)))))))
                    ((? content?)
+                    '())
+                   ((? string? swhid)
                     '())))
                '()))
           ((? local-file?)
-- 
2.41.0