From 71fd35c1d55988c413a37c7d15006b4d38d7dde7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 4 May 2023 09:09:03 +0200 Subject: lint: archival: Warn against non-origin package sources. Suggested by Maxim Cournoyer and Simon Tournier . * guix/lint.scm (check-archival): Add 'local-file?' clause. Clarify message in case (package-source package) is not an origin. * tests/lint.scm ("archival: not an origin"): New test. --- guix/lint.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'guix/lint.scm') diff --git a/guix/lint.scm b/guix/lint.scm index 0ed5b8dc98..72b3f4e7b1 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -1610,11 +1610,11 @@ try again later") (parameterize ((%allow-request? skip-when-limit-reached)) (catch #t (lambda () - (match (and (origin? (package-source package)) - (package-source package)) + (match (package-source package) (#f ;no source '()) - ((= origin-uri (? git-reference? reference)) + ((and (? origin?) + (= origin-uri (? git-reference? reference))) (define url (git-reference-url reference)) (define commit @@ -1680,9 +1680,12 @@ Disarchive entry refers to non-existent SWH directory '~a'") ((? content?) '()))) '())) + ((? local-file?) + '()) (_ (list (make-warning package - (G_ "unsupported source type") + (G_ "\ +source is not an origin, it cannot be archived") #:field 'source))))) (match-lambda* (('swh-error url method response) -- cgit v1.2.3