pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg/files pkgtools/url2pkg: fix version t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cb1d26da219e
branches:  trunk
changeset: 341696:cb1d26da219e
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Oct 06 05:53:00 2019 +0000

description:
pkgtools/url2pkg: fix version tag detection

diffstat:

 pkgtools/url2pkg/files/url2pkg.py      |  7 +++----
 pkgtools/url2pkg/files/url2pkg_test.py |  9 ++-------
 2 files changed, 5 insertions(+), 11 deletions(-)

diffs (60 lines):

diff -r 8cdb7fa1cc53 -r cb1d26da219e pkgtools/url2pkg/files/url2pkg.py
--- a/pkgtools/url2pkg/files/url2pkg.py Sun Oct 06 03:25:42 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.py Sun Oct 06 05:53:00 2019 +0000
@@ -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 @@
             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 -r 8cdb7fa1cc53 -r cb1d26da219e pkgtools/url2pkg/files/url2pkg_test.py
--- a/pkgtools/url2pkg/files/url2pkg_test.py    Sun Oct 06 03:25:42 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg_test.py    Sun Oct 06 05:53:00 2019 +0000
@@ -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_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 @@
         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 @@
 
     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,
         '',



Home | Main Index | Thread Index | Old Index