guix-commits
[Top][All Lists]
Advanced

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

branch master updated: guix: lint: Support origins in check-patch-file-n


From: guix-commits
Subject: branch master updated: guix: lint: Support origins in check-patch-file-names.
Date: Fri, 12 Jun 2020 01:39:29 -0400

This is an automated email from the git hooks/post-receive script.

marusich pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 2188702  guix: lint: Support origins in check-patch-file-names.
2188702 is described below

commit 21887021b9acf60157b1b0a39c16f2ec6498021b
Author: Chris Marusich <cmmarusich@gmail.com>
AuthorDate: Wed Jun 10 00:01:50 2020 -0700

    guix: lint: Support origins in check-patch-file-names.
    
    * guix/lint.scm (check-patch-file-names)[starts-with-package-name?]: New
    procedure, extracted from the existing logic.  Using it, add a clause to
    the match-lambda to handle origin records.
---
 guix/lint.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 6271894..627016f 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -669,13 +670,17 @@ patch could not be found."
       (or (and=> (package-source package) origin-patches)
           '()))
 
+    (define (starts-with-package-name? file-name)
+      (and=> (string-contains file-name (package-name package))
+             zero?))
+
     (append
      (if (every (match-lambda        ;patch starts with package name?
                   ((? string? patch)
-                   (and=> (string-contains (basename patch)
-                                           (package-name package))
-                          zero?))
-                  (_  #f))     ;must be an <origin> or something like that.
+                   (starts-with-package-name? (basename patch)))
+                  ((? origin? patch)
+                   (starts-with-package-name? (origin-file-name patch)))
+                  (_  #f))     ;must be some other file-like object
                 patches)
          '()
          (list



reply via email to

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