mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-23 11:09:41 -05:00
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.
This commit is contained in:
parent
9c6ea3cb56
commit
21887021b9
1 changed files with 9 additions and 4 deletions
|
@ -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 @@ (define patches
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue