Skip to content

Commit 3189708

Browse files
committed
Improve parsing of Gitlab URLs
Strip the optional leading character matching "[vVrR]" from a version extracted from a Gitlab URL. Update a packageurl test case to accommodate. Signed-off-by: Patrick McCarty <[email protected]>
1 parent edef7aa commit 3189708

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

autospec/tarball.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def name_and_version(self, filemanager):
375375

376376
if "gitlab.com" in self.url:
377377
# https://gitlab.com/leanlabsio/kanban/-/archive/1.7.1/kanban-1.7.1.tar.gz
378-
m = re.search(r"gitlab\.com/.*/(.*)/-/archive/(.*)/", self.url)
378+
m = re.search(r"gitlab\.com/.*/(.*)/-/archive/[vVrR]?(.*)/", self.url)
379379
if m:
380380
name = m.group(1).strip()
381381
version = convert_version(m.group(2), name)

tests/packageurls

+1-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ https://www.libssh2.org/download/libssh2-1.8.0.tar.gz,libssh2,1.8.0
622622
https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.12.tar.gz,libtasn1,4.12
623623
ftp://linux.thai.net/pub/thailinux/software/libthai/libthai-0.1.26.tar.xz,libthai,0.1.26
624624
http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2,libtheora,1.1.1
625-
https://gitlab.com/libtiff/libtiff/-/archive/v4.0.10/libtiff-v4.0.10.tar.gz,libtiff,v4.0.10
625+
https://gitlab.com/libtiff/libtiff/-/archive/v4.0.10/libtiff-v4.0.10.tar.gz,libtiff,4.0.10
626626
https://sourceforge.net/projects/libtirpc/files/libtirpc/1.0.2/libtirpc-1.0.2.tar.bz2,libtirpc,1.0.2
627627
https://mirrors.kernel.org/gnu/libtool/libtool-2.4.6.tar.xz,libtool,2.4.6
628628
https://github.com/archlinux/libudev0-shim/archive/v1.tar.gz,libudev0-shim,1

0 commit comments

Comments
 (0)