summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorArun Isaac <arunisaac@systemreboot.net>2017-05-17 21:30:12 +0530
committerArun Isaac <arunisaac@systemreboot.net>2017-05-23 04:35:06 +0530
commit5ae59eb6d99b7ac6e3334418781b0559bf604a23 (patch)
tree3fc3a0c7d1a2dac872bb6b3cd715d017794cc409 /guix
parentad25e9962eee6827bc25f996734cddb6a1742f2e (diff)
guix: lint: Slightly simplify `check-source-file-name'.
* guix/scripts/lint.scm (check-source-file-name): Implement file name matching with regular expression.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/lint.scm9
1 files changed, 4 insertions, 5 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 46989e3a17..04ab852999 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -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))))))
+ ;; Common in many projects is for the filename to start
+ ;; with a "v" followed by the version,
+ ;; e.g. "v3.2.0.tar.gz".
+ (not (string-match (string-append "^v?" version) file-name)))))
(let ((origin (package-source package)))
(unless (or (not origin) (origin-file-name-valid? origin))