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. --- tests/lint.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/lint.scm') diff --git a/tests/lint.scm b/tests/lint.scm index ce22e2355a..b91bd053c5 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013 Cyril Roelandt ;;; Copyright © 2014, 2015, 2016 Eric Bavier -;;; Copyright © 2014-2022 Ludovic Courtès +;;; Copyright © 2014-2023 Ludovic Courtès ;;; Copyright © 2015, 2016 Mathieu Lirzin ;;; Copyright © 2016 Hartmut Goebel ;;; Copyright © 2017 Alex Kost @@ -43,7 +43,8 @@ #:use-module (guix lint) #:use-module (guix ui) #:use-module (guix swh) - #:use-module ((guix gexp) #:select (gexp local-file gexp?)) + #:use-module ((guix gexp) + #:select (gexp local-file computed-file gexp?)) #:use-module ((guix utils) #:select (call-with-temporary-directory)) #:use-module ((guix import hackage) #:select (%hackage-url)) #:use-module ((guix import stackage) #:select (%stackage-url)) @@ -1298,6 +1299,12 @@ '() (check-formatting (dummy-package "x"))) +(test-assert "archival: not an origin" + (warning-contains? "not an origin" + (check-archival + (dummy-package + "x" (source (computed-file "x-src" #t)))))) + (test-assert "archival: missing content" (let* ((origin (origin (method url-fetch) -- cgit 1.4.1