From 770051777637f2026bcc56a57d30272e082099e6 Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Wed, 10 Jun 2020 00:01:50 -0700 Subject: [PATCH 2/2] 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 6271894360..627016fae0 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; Copyright © 2017, 2018, 2020 Efraim Flashner ;;; Copyright © 2018, 2019 Arun Isaac +;;; Copyright © 2020 Chris Marusich ;;; ;;; 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 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 -- 2.26.2