summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-03-20 21:53:27 +0100
committerLudovic Courtès <ludo@gnu.org>2021-03-20 22:29:14 +0100
commit1710e8cb59e2ef6f1e0eb19235b6a4f1b8158bc4 (patch)
tree416df3a2672b7c72a1a606b7a4e6a5268a0be131
parent52e64b21be50e2c5febd7bf1accd88ffdc05a4bb (diff)
downloadguix-1710e8cb59e2ef6f1e0eb19235b6a4f1b8158bc4.tar.gz
gnu-maintenance: Accept underscores as package/version separators.
Fixes <https://bugs.gnu.org/47256>.
Reported by Léo Le Bouter <lle-bout@zaclys.net>.

* guix/gnu-maintenance.scm (%tarball-rx, %package-name-rx): Accept
underscore as the package/version separator in tarball names.
* tests/gnu-maintenance.scm ("release-file?"): Add "mediainfo" test.
-rw-r--r--guix/gnu-maintenance.scm5
-rw-r--r--tests/gnu-maintenance.scm5
2 files changed, 6 insertions, 4 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index d9c97beb29..7bd08c1208 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -241,7 +241,8 @@ network to check in GNU's database."
   ;; The .zip extensions is notably used for freefont-ttf.
   ;; 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".
-  (make-regexp "^([^.]+)-([0-9]|[^-])+(-(src|gnu[0-9]))?\\.(tar\\.|zip$)"))
+  ;; Accept underscores as in "PKG_1.2.tar.gz" for some non-GNU packages.
+  (make-regexp "^([^.]+)[-_]([0-9]|[^-])+(-(src|gnu[0-9]))?\\.(tar\\.|zip$)"))
 
 (define %alpha-tarball-rx
   (make-regexp "^.*-.*[0-9](-|~)?(alpha|beta|rc|RC|cvs|svn|git)-?[0-9\\.]*\\.tar\\."))
@@ -594,7 +595,7 @@ list available from %GNU-FILE-LIST-URI over HTTP(S)."
 (define %package-name-rx
   ;; Regexp for a package name, e.g., "foo-X.Y".  Since TeXmacs uses
   ;; "TeXmacs-X.Y-src", the `-src' suffix is allowed.
-  (make-regexp "^(.*)-(([0-9]|\\.)+)(-src)?"))
+  (make-regexp "^(.*)[-_](([0-9]|\\.)+)(-src)?"))
 
 (define (gnu-package-name->name+version name+version)
   "Return the package name and version number extracted from NAME+VERSION."
diff --git a/tests/gnu-maintenance.scm b/tests/gnu-maintenance.scm
index 4f2f1ae943..a3e48a0933 100644
--- a/tests/gnu-maintenance.scm
+++ b/tests/gnu-maintenance.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,7 +29,8 @@
               '(("gcc" "gcc-5.3.0.tar.bz2")
                 ("texmacs" "TeXmacs-1.0.7.9-src.tar.gz")
                 ("icecat" "icecat-38.4.0-gnu1.tar.bz2")
-                ("mit-scheme" "mit-scheme-9.2.tar.gz")))
+                ("mit-scheme" "mit-scheme-9.2.tar.gz")
+                ("mediainfo" "mediainfo_20.09.tar.xz")))
        (every (lambda (project+file)
                 (not (apply release-file? project+file)))
               '(("guile" "guile-www-1.1.1.tar.gz")