guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/05: lint: Do not assume that a package's source is an origin.


From: guix-commits
Subject: 01/05: lint: Do not assume that a package's source is an origin.
Date: Fri, 3 Jul 2020 17:54:11 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 37c3e0bbaf2efe137b434f866ca431803d33e0a9
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Jul 3 21:18:07 2020 +0200

    lint: Do not assume that a package's source is an origin.
    
    * guix/lint.scm (check-source-file-name): Ensure ORIGIN is an origin.
    (check-patch-file-names)[patches]: Likewise.
    (check-source): Likewise.
---
 guix/lint.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 8a4d27c..445c06f 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -670,8 +670,9 @@ patch could not be found."
               (%make-warning package (condition-message c)
                              #:field 'patch-file-names))))
     (define patches
-      (or (and=> (package-source package) origin-patches)
-          '()))
+      (match (package-source package)
+        ((? origin? origin) (origin-patches origin))
+        (_ '())))
 
     (define (starts-with-package-name? file-name)
       (and=> (string-contains file-name (package-name package))
@@ -792,7 +793,7 @@ descriptions maintained upstream."
             (loop rest (cons warning warnings))))))))
 
   (let ((origin (package-source package)))
-    (if (and origin
+    (if (and (origin? origin)
              (eqv? (origin-method origin) url-fetch))
         (let* ((uris     (append-map (cut maybe-expand-mirrors <> %mirrors)
                                      (map string->uri (origin-uris origin))))
@@ -828,7 +829,7 @@ descriptions maintained upstream."
            (not (string-match (string-append "^v?" version) file-name)))))
 
   (let ((origin (package-source package)))
-    (if (or (not origin) (origin-file-name-valid? origin))
+    (if (or (not (origin? origin)) (origin-file-name-valid? origin))
         '()
         (list
          (make-warning package



reply via email to

[Prev in Thread] Current Thread [Next in Thread]