[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/13: lint: archival: Warn against non-origin package sources.
From: |
guix-commits |
Subject: |
06/13: lint: archival: Warn against non-origin package sources. |
Date: |
Sat, 6 May 2023 12:21:17 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 71fd35c1d55988c413a37c7d15006b4d38d7dde7
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu May 4 09:09:03 2023 +0200
lint: archival: Warn against non-origin package sources.
Suggested by Maxim Cournoyer <maxim.cournoyer@gmail.com>
and Simon Tournier <zimon.toutoune@gmail.com>.
* 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 +++++++----
tests/lint.scm | 11 +++++++++--
2 files changed, 16 insertions(+), 6 deletions(-)
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)
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 <tipecaml@gmail.com>
;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
@@ -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)
- branch master updated (1cb0dee3a3 -> c625e5b64d), guix-commits, 2023/05/06
- 01/13: tests: Add missing module imports for marionette-evaluated code., guix-commits, 2023/05/06
- 04/13: gnu: python-ldap: Update to 3.4.3., guix-commits, 2023/05/06
- 10/13: doc: cookbook: Remove outdated section about GUIX_PACKAGE_PATH., guix-commits, 2023/05/06
- 02/13: services: dbus-service, secret-service: Do not cause (fibers) to be loaded., guix-commits, 2023/05/06
- 03/13: gnu: mod-wsgi: Update to 4.9.4., guix-commits, 2023/05/06
- 09/13: gnu: glances: Update to 3.3.1.1., guix-commits, 2023/05/06
- 06/13: lint: archival: Warn against non-origin package sources.,
guix-commits <=
- 05/13: gnu: gitile: Fix build., guix-commits, 2023/05/06
- 11/13: gnu: hostapd: Add ACS and full dynamic vlan support, guix-commits, 2023/05/06
- 07/13: gnu: msmtp: Install old msmtpqueue scripts, guix-commits, 2023/05/06
- 12/13: doc: Use G-Expressions for package definition example., guix-commits, 2023/05/06
- 08/13: gnu: python-ujson: Update to 5.7.0., guix-commits, 2023/05/06
- 13/13: download: Refer to the 'guile-gnutls' package and not 'gnutls'., guix-commits, 2023/05/06