pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/url2pkg



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sun Nov 14 08:57:15 UTC 2021

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

Log Message:
pkgtools/url2pkg: add test for overly complicated package definition

Seen in wip/netmask.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 pkgsrc/pkgtools/url2pkg/Makefile
cvs rdiff -u -r1.31 -r1.32 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/Makefile
diff -u pkgsrc/pkgtools/url2pkg/Makefile:1.119 pkgsrc/pkgtools/url2pkg/Makefile:1.120
--- pkgsrc/pkgtools/url2pkg/Makefile:1.119      Mon May 24 19:53:43 2021
+++ pkgsrc/pkgtools/url2pkg/Makefile    Sun Nov 14 08:57:15 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.119 2021/05/24 19:53:43 wiz Exp $
+# $NetBSD: Makefile,v 1.120 2021/11/14 08:57:15 rillig Exp $
 
 PKGNAME=       url2pkg-21.1.0
 PKGREVISION=   1
@@ -23,7 +23,7 @@ do-extract:
 
 do-test:
        ${RUN} cd ${WRKSRC} && env PKGSRCDIR=${PKGSRCDIR} MAKE=${MAKE:Q} \
-               ${PREFIX}/bin/pytest-${PYVERSSUFFIX}
+               ${PREFIX}/bin/pytest-${PYVERSSUFFIX} ${PY_TEST_FLAGS:U}
 
 .include "../../mk/bsd.prefs.mk"
 

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.31 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.32
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.31  Tue May 25 17:56:24 2021
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py       Sun Nov 14 08:57:15 2021
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.31 2021/05/25 17:56:24 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.32 2021/11/14 08:57:15 rillig Exp $
 
 import pytest
 from url2pkg import *
@@ -431,7 +431,7 @@ def test_Generator_adjust_site_GitHub_ar
     ]
 
 
-def test_Generator_adjust_site_GitHub_archive_tag():
+def test_Generator_adjust_site_GitHub_archive__tag():
     url = 'https://github.com/org/proj/archive/refs/tags/1.0.0.tar.gz'
 
     lines = Generator(url).generate_Makefile()
@@ -456,6 +456,35 @@ def test_Generator_adjust_site_GitHub_ar
     ]
 
 
+# TODO: There is a simpler package definition for this scenario, see
+# wip/netmask.  That package only defines:
+#      DISTNAME=proj-version
+#      GITHUB_TAG=v${PKGVERSION_NOREV}
+def test_Generator_adjust_site_GitHub_archive__tag_v():
+    url = 'https://github.com/org/proj/archive/refs/tags/v1.0.0.tar.gz'
+
+    lines = Generator(url).generate_Makefile()
+    assert detab(lines) == [
+        mkcvsid,
+        '',
+        'GITHUB_PROJECT= proj',
+        'GITHUB_TAG=     refs/tags/v1.0.0',
+        'DISTNAME=       v1.0.0',
+        'PKGNAME=        ${GITHUB_PROJECT}-${DISTNAME:S,^v,,}',
+        'CATEGORIES=     pkgtools',
+        'MASTER_SITES=   ${MASTER_SITE_GITHUB:=org/}',
+        'DIST_SUBDIR=    ${GITHUB_PROJECT}',
+        '',
+        'MAINTAINER=     INSERT_YOUR_MAIL_ADDRESS_HERE # or use pkgsrc-users%NetBSD.org@localhost',
+        'HOMEPAGE=       https://github.com/org/proj/',
+        'COMMENT=        TODO: Short description of the package',
+        '#LICENSE=       # TODO: (see mk/license.mk)',
+        '',
+        '# url2pkg-marker (please do not remove this line.)',
+        ".include \"../../mk/bsd.pkg.mk\"",
+    ]
+
+
 def test_Generator_adjust_site_GitHub_release__containing_project_name():
     url = 'https://github.com/org/proj/releases/download/1.0.0/proj.zip'
 



Home | Main Index | Thread Index | Old Index