summaryrefslogtreecommitdiff
path: root/pkgtools/url2pkg
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2019-10-06 05:53:00 +0000
committerrillig <rillig@pkgsrc.org>2019-10-06 05:53:00 +0000
commit8d6e439a47458029c476253ff0786d7d18645b29 (patch)
treefba54eab1c473c17c9d6b7340cc53c3848cb54f1 /pkgtools/url2pkg
parent863123b807ec565e7d9f416d3cfb713803b0d1e8 (diff)
downloadpkgsrc-8d6e439a47458029c476253ff0786d7d18645b29.tar.gz
pkgtools/url2pkg: fix version tag detection
Diffstat (limited to 'pkgtools/url2pkg')
-rw-r--r--pkgtools/url2pkg/files/url2pkg.py7
-rw-r--r--pkgtools/url2pkg/files/url2pkg_test.py9
2 files changed, 5 insertions, 11 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg.py b/pkgtools/url2pkg/files/url2pkg.py
index d107c52f1c2..8aa77407636 100644
--- a/pkgtools/url2pkg/files/url2pkg.py
+++ b/pkgtools/url2pkg/files/url2pkg.py
@@ -1,5 +1,5 @@
#! @PYTHONBIN@
-# $NetBSD: url2pkg.py,v 1.15 2019/10/05 22:02:32 rillig Exp $
+# $NetBSD: url2pkg.py,v 1.16 2019/10/06 05:53:00 rillig Exp $
# Copyright (c) 2019 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -376,10 +376,9 @@ class Generator:
distname, extract_sufx = self.distfile, '# none'
self.distname = distname
- m = re.search(r'^v\d', distname)
- if m:
+ if re.search(r'^v\d+\.', distname):
self.pkgname_transform = ':S,^v,,'
- elif re.search(r'-v\d', distname) and not re.search(r'-v.*-v\d', distname):
+ elif re.search(r'-v\d+\.', distname) and not re.search(r'-v.*-v\d+\.', distname):
self.pkgname_transform = ':S,-v,-,'
main_category = Path.cwd().parts[-2]
diff --git a/pkgtools/url2pkg/files/url2pkg_test.py b/pkgtools/url2pkg/files/url2pkg_test.py
index a377acb00f2..586f620781f 100644
--- a/pkgtools/url2pkg/files/url2pkg_test.py
+++ b/pkgtools/url2pkg/files/url2pkg_test.py
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.14 2019/10/05 22:02:32 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.15 2019/10/06 05:53:00 rillig Exp $
import pytest
from url2pkg import *
@@ -589,7 +589,7 @@ def test_Generator_adjust_everything_else__distfile_without_extension():
]
-def test_Generator_determine_distname__v8():
+def test_Generator_adjust_everything_else__v8():
generator = Generator('https://example.org/v8-1.0.zip')
lines = generator.generate_Makefile()
@@ -598,7 +598,6 @@ def test_Generator_determine_distname__v8():
mkcvsid,
'',
'DISTNAME= v8-1.0',
- 'PKGNAME= ${DISTNAME:S,^v,,}', # FIXME: v8 is part of the PKGBASE
'CATEGORIES= pkgtools',
'MASTER_SITES= https://example.org/',
'EXTRACT_SUFX= .zip',
@@ -1311,10 +1310,6 @@ def test_Adjuster_adjust_lines_python_module(tmp_path: Path):
lines = adjuster.generate_lines()
- # FIXME: Currently url2pkg assumes that all Python modules that are on
- # GitHub are also available from PyPI. That is wrong. Probably url2pkg
- # should try to fetch the file from PyPI, and only switch to PyPI if
- # they are the same.
assert detab(lines) == [
mkcvsid,
'',