summaryrefslogtreecommitdiff
path: root/guix/scripts/lint.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/scripts/lint.scm')
-rw-r--r--guix/scripts/lint.scm11
1 files changed, 5 insertions, 6 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 6f30d371a2..04ab852999 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -668,16 +668,15 @@ descriptions maintained upstream."
(define (check-source-file-name package)
"Emit a warning if PACKAGE's origin has no meaningful file name."
(define (origin-file-name-valid? origin)
- ;; Return #t if the source file name contains only a version or is #f;
+ ;; Return #f if the source file name contains only a version or is #f;
;; indicates that the origin needs a 'file-name' field.
(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))