pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/url2pkg/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sun Oct  6 05:53:00 UTC 2019

Modified Files:
        pkgsrc/pkgtools/url2pkg/files: url2pkg.py url2pkg_test.py

Log Message:
pkgtools/url2pkg: fix version tag detection


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 pkgsrc/pkgtools/url2pkg/files/url2pkg.py
cvs rdiff -u -r1.14 -r1.15 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.15 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.16
--- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.15       Sat Oct  5 22:02:32 2019
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py    Sun Oct  6 05:53:00 2019
@@ -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]

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.14 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.15
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.14  Sat Oct  5 22:02:32 2019
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py       Sun Oct  6 05:53:00 2019
@@ -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_els
     ]
 
 
-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__v
         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_mo
 
     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