pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg pkgtools/url2pkg: update to 19.3.2



details:   https://anonhg.NetBSD.org/pkgsrc/rev/987198ba9a93
branches:  trunk
changeset: 415365:987198ba9a93
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Oct 05 22:02:32 2019 +0000

description:
pkgtools/url2pkg: update to 19.3.2

Changes since 19.3.1 (only to the Python implementation):

* In Python packages, the variables LICENSE, HOMEPAGE and COMMENT are
  filled from their counterparts in setup.py, no matter whether
  the package uses setuptools or distutils.core.

* For buildlink3 dependencies, the variables BUILDLINK_DEPENDS and
  BUILDLINK_API_DEPENDS are added to the package Makefile.

* The DESCR and PLIST files are only created if they are missing.
  Existing files are not overwritten.

* Packages that contain .po files will set USE_PKGLOCALEDIR=yes.
  Before, only packages that contained .mo or .gmo did that.

* More download URLs from SourceForge can be handled.

* SourceForge packages get their HOMEPAGE set correctly.

* When matching the URL against the MASTER_SITE_* variables, the
  protocol is ignored. This allows https URLs to use the
  MASTER_SITE_GNU, which still uses http.

* Python packages from GitHub only get their MASTER_SITES converted to
  PyPI if they can be actually downloaded from there as well. This
  check was missing before.

diffstat:

 pkgtools/url2pkg/Makefile              |   6 ++++--
 pkgtools/url2pkg/PLIST                 |   4 +++-
 pkgtools/url2pkg/files/setuptools.py   |   3 ++-
 pkgtools/url2pkg/files/url2pkg.py      |   6 +++---
 pkgtools/url2pkg/files/url2pkg_test.py |  15 ++++++++++-----
 5 files changed, 22 insertions(+), 12 deletions(-)

diffs (141 lines):

diff -r dd5b4a2b3102 -r 987198ba9a93 pkgtools/url2pkg/Makefile
--- a/pkgtools/url2pkg/Makefile Sat Oct 05 21:39:25 2019 +0000
+++ b/pkgtools/url2pkg/Makefile Sat Oct 05 22:02:32 2019 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.104 2019/10/05 19:24:35 rillig Exp $
+# $NetBSD: Makefile,v 1.105 2019/10/05 22:02:32 rillig Exp $
 
-PKGNAME=       url2pkg-19.3.1
+PKGNAME=       url2pkg-19.3.2
 CATEGORIES=    pkgtools
 
 MAINTAINER=    rillig%NetBSD.org@localhost
@@ -41,6 +41,8 @@
        ${INSTALL_DATA} ${WRKSRC}/Build.pm ${DESTDIR}${PREFIX}/lib/url2pkg/Module/
        ${INSTALL_DATA} ${WRKSRC}/MakeMaker.pm ${DESTDIR}${PREFIX}/lib/url2pkg/ExtUtils/
        ${INSTALL_DATA} ${WRKSRC}/setuptools.py ${DESTDIR}${PREFIX}/lib/url2pkg/
+       ${INSTALL_DATA} /dev/null ${DESTDIR}${PREFIX}/lib/url2pkg/distutils/__init__.py
+       ${INSTALL_DATA} ${WRKSRC}/setuptools.py ${DESTDIR}${PREFIX}/lib/url2pkg/distutils/core.py
 
 .include "../../lang/python/application.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r dd5b4a2b3102 -r 987198ba9a93 pkgtools/url2pkg/PLIST
--- a/pkgtools/url2pkg/PLIST    Sat Oct 05 21:39:25 2019 +0000
+++ b/pkgtools/url2pkg/PLIST    Sat Oct 05 22:02:32 2019 +0000
@@ -1,7 +1,9 @@
-@comment $NetBSD: PLIST,v 1.6 2019/10/03 09:37:40 rillig Exp $
+@comment $NetBSD: PLIST,v 1.7 2019/10/05 22:02:32 rillig Exp $
 bin/url2pkg
 bin/url2pkg-py
 lib/url2pkg/ExtUtils/MakeMaker.pm
 lib/url2pkg/Module/Build.pm
+lib/url2pkg/distutils/__init__.py
+lib/url2pkg/distutils/core.py
 lib/url2pkg/setuptools.py
 man/man8/url2pkg.8
diff -r dd5b4a2b3102 -r 987198ba9a93 pkgtools/url2pkg/files/setuptools.py
--- a/pkgtools/url2pkg/files/setuptools.py      Sat Oct 05 21:39:25 2019 +0000
+++ b/pkgtools/url2pkg/files/setuptools.py      Sat Oct 05 22:02:32 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: setuptools.py,v 1.4 2019/10/03 16:32:47 rillig Exp $
+# $NetBSD: setuptools.py,v 1.5 2019/10/05 22:02:32 rillig Exp $
 
 # This is a drop-in replacement for the setuptools Python module. Instead
 # of actually searching for the dependencies, it extracts the dependency
@@ -41,6 +41,7 @@
 
 
 def setup(**kwargs):
+    url2pkg_print_depends('DEPENDS', kwargs.get('requires', []))  # for distutils.core
     url2pkg_print_depends('DEPENDS', kwargs.get('install_requires', []))
     url2pkg_print_depends('TEST_DEPENDS', kwargs.get('tests_require', []))
     url2pkg_print_depends('BUILD_DEPENDS', kwargs.get('extras_require', {}).get('dev', []))
diff -r dd5b4a2b3102 -r 987198ba9a93 pkgtools/url2pkg/files/url2pkg.py
--- a/pkgtools/url2pkg/files/url2pkg.py Sat Oct 05 21:39:25 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.py Sat Oct 05 22:02:32 2019 +0000
@@ -1,5 +1,5 @@
 #! @PYTHONBIN@
-# $NetBSD: url2pkg.py,v 1.14 2019/10/05 21:05:50 rillig Exp $
+# $NetBSD: url2pkg.py,v 1.15 2019/10/05 22:02:32 rillig Exp $
 
 # Copyright (c) 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -146,7 +146,7 @@
                 $
                 '''
             m = re.search(pattern, line)
-            if m and m[1].lstrip('#') == varname:
+            if m and m[1].lstrip('#') == varname.lstrip('#'):
                 varassigns.append(Varassign(i, *m.groups()))
         return varassigns
 
@@ -454,7 +454,7 @@
 
         subprocess.check_call([up.editor, makefile])
 
-        up.bmake('distinfo', 'extract')
+        up.bmake('clean', 'distinfo', 'extract')
 
         return initial_lines
 
diff -r dd5b4a2b3102 -r 987198ba9a93 pkgtools/url2pkg/files/url2pkg_test.py
--- a/pkgtools/url2pkg/files/url2pkg_test.py    Sat Oct 05 21:39:25 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg_test.py    Sat Oct 05 22:02:32 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.13 2019/10/05 21:05:50 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.14 2019/10/05 22:02:32 rillig Exp $
 
 import pytest
 from url2pkg import *
@@ -640,6 +640,7 @@
         'A line that is not a dependency at all',
         '',
         'var\tHOMEPAGE\thttps://homepage.example.org/',
+        'var\t#LICENSE\tBSD # TODO: too unspecific',
         ''
     ]
     env = {'URL2PKG_DEPENDENCIES': '\n'.join(child_process_output)}
@@ -659,7 +660,10 @@
         '# TODO: does-not-exist>=1.0',
     ]
     assert adjuster.test_depends == ['pkglint>=0:../../pkgtools/pkglint']
-    assert adjuster.update_vars == {'HOMEPAGE': 'https://homepage.example.org/'}
+    assert adjuster.update_vars == {
+        'HOMEPAGE': 'https://homepage.example.org/',
+        '#LICENSE': 'BSD # TODO: too unspecific',
+    }
 
 
 def test_Adjuster_read_dependencies__lookup_with_prefix():
@@ -1184,11 +1188,12 @@
     assert str_vars(adjuster.extra_vars) == ['PKGCONFIG_OVERRIDE+=library.pc.in']
 
 
-def test_Adjuster__adjust_homepage():
+def test_Adjuster_generate_lines():
     url = 'https://dummy.example.org/package-1.0.tar.gz'
     adjuster = Adjuster(up, url, Lines())
     adjuster.makefile_lines = Generator(url).generate_Makefile()
     adjuster.update_vars['HOMEPAGE'] = 'https://example.org/'
+    adjuster.update_vars['#LICENSE'] = 'BSD # TODO: too unspecific'
     adjuster.depends.append('dependency>=0:../../category/dependency')
     adjuster.todos.append('Run pkglint')
 
@@ -1204,7 +1209,7 @@
         'MAINTAINER=     INSERT_YOUR_MAIL_ADDRESS_HERE # or use pkgsrc-users%NetBSD.org@localhost',
         'HOMEPAGE=       https://example.org/',
         'COMMENT=        TODO: Short description of the package',
-        '#LICENSE=       # TODO: (see mk/license.mk)',
+        '#LICENSE=       BSD # TODO: too unspecific',
         '',
         '# TODO: Run pkglint',
         '',
@@ -1395,7 +1400,7 @@
         '',
     ]
     assert up.err.written() == [
-        f'url2pkg: running bmake (\'distinfo\', \'extract\') in \'{up.pkgdir}\'',
+        f'url2pkg: running bmake (\'clean\', \'distinfo\', \'extract\') in \'{up.pkgdir}\'',
         'url2pkg: Adjusting the Makefile',
     ]
 



Home | Main Index | Thread Index | Old Index