guix: lint: Slightly simplify `check-source-file-name'.

* guix/scripts/lint.scm (check-source-file-name): Implement file name matching
  with regular expression.
This commit is contained in:
Arun Isaac 2017-05-17 21:30:12 +05:30
parent ad25e9962e
commit 5ae59eb6d9
No known key found for this signature in database
GPG Key ID: 2E25EE8B61802BB3
1 changed files with 4 additions and 5 deletions

View File

@ -673,11 +673,10 @@ descriptions maintained upstream."
(let ((file-name (origin-actual-file-name origin))
(version (package-version package)))
(and file-name
(not (or (string-prefix? version file-name)
;; Common in many projects is for the filename to start
;; with a "v" followed by the version,
;; e.g. "v3.2.0.tar.gz".
(string-prefix? (string-append "v" version) file-name))))))
(not (string-match (string-append "^v?" version) file-name)))))
(let ((origin (package-source package)))
(unless (or (not origin) (origin-file-name-valid? origin))