gnu-maintenance: 'release-file?' accepts 'v' prefix as in "PKG-v1.2.tgz".

* guix/gnu-maintenance.scm (%tarball-rx, %package-name-rx): Accept 'v'
and 'V' prefixes.  Accept ".tgz" extension.
* tests/gnu-maintenance.scm ("release-file?"): Add test.
This commit is contained in:
Ludovic Courtès 2021-05-28 22:43:21 +02:00
parent 803be0975d
commit d7c356edb9
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
2 changed files with 5 additions and 3 deletions

View File

@ -243,7 +243,8 @@ network to check in GNU's database."
;; The "-src" pattern is for "TeXmacs-1.0.7.9-src.tar.gz". ;; The "-src" pattern is for "TeXmacs-1.0.7.9-src.tar.gz".
;; The "-gnu[0-9]" pattern is for "icecat-38.4.0-gnu1.tar.bz2". ;; The "-gnu[0-9]" pattern is for "icecat-38.4.0-gnu1.tar.bz2".
;; Accept underscores as in "PKG_1.2.tar.gz" for some non-GNU packages. ;; Accept underscores as in "PKG_1.2.tar.gz" for some non-GNU packages.
(make-regexp "^([^.]+)[-_]([0-9]|[^-])+(-(src|[sS]ource|gnu[0-9]))?\\.(tar\\.|zip$)")) ;; Accept 'v' or 'V' prefix as in 'PKG-v2.3.tgz'.
(make-regexp "^([^.]+)[-_][vV]?([0-9]|[^-])+(-(src|[sS]ource|gnu[0-9]))?\\.(tar\\.|tgz|zip$)"))
(define %alpha-tarball-rx (define %alpha-tarball-rx
(make-regexp "^.*-.*[0-9](-|~)?(alpha|beta|rc|RC|cvs|svn|git)-?[0-9\\.]*\\.tar\\.")) (make-regexp "^.*-.*[0-9](-|~)?(alpha|beta|rc|RC|cvs|svn|git)-?[0-9\\.]*\\.tar\\."))
@ -596,7 +597,7 @@ list available from %GNU-FILE-LIST-URI over HTTP(S)."
(define %package-name-rx (define %package-name-rx
;; Regexp for a package name, e.g., "foo-X.Y". Since TeXmacs uses ;; Regexp for a package name, e.g., "foo-X.Y". Since TeXmacs uses
;; "TeXmacs-X.Y-src", the `-src' suffix is allowed. ;; "TeXmacs-X.Y-src", the `-src' suffix is allowed.
(make-regexp "^(.*)[-_](([0-9]|\\.)+)(-src|\\.src|\\.orig)?")) (make-regexp "^(.*)[-_][vV]?(([0-9]|\\.)+)(-src|\\.src|\\.orig)?"))
(define (gnu-package-name->name+version name+version) (define (gnu-package-name->name+version name+version)
"Return the package name and version number extracted from NAME+VERSION." "Return the package name and version number extracted from NAME+VERSION."

View File

@ -34,7 +34,8 @@
("mediainfo" "mediainfo_20.09.tar.xz") ("mediainfo" "mediainfo_20.09.tar.xz")
("exiv2" "exiv2-0.27.3-Source.tar.gz") ("exiv2" "exiv2-0.27.3-Source.tar.gz")
("mpg321" "mpg321_0.3.2.orig.tar.gz") ("mpg321" "mpg321_0.3.2.orig.tar.gz")
("bvi" "bvi-1.4.1.src.tar.gz"))) ("bvi" "bvi-1.4.1.src.tar.gz")
("hostscope" "hostscope-V2.1.tgz")))
(every (lambda (project+file) (every (lambda (project+file)
(not (apply release-file? project+file))) (not (apply release-file? project+file)))
'(("guile" "guile-www-1.1.1.tar.gz") '(("guile" "guile-www-1.1.1.tar.gz")