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: add test for overly...
details: https://anonhg.NetBSD.org/pkgsrc/rev/ed4de504d075
branches: trunk
changeset: 769383:ed4de504d075
user: rillig <rillig%pkgsrc.org@localhost>
date: Sun Nov 14 08:57:15 2021 +0000
description:
pkgtools/url2pkg: add test for overly complicated package definition
Seen in wip/netmask.
diffstat:
pkgtools/url2pkg/Makefile | 4 ++--
pkgtools/url2pkg/files/url2pkg_test.py | 33 +++++++++++++++++++++++++++++++--
2 files changed, 33 insertions(+), 4 deletions(-)
diffs (72 lines):
diff -r 5ad3d1d48d1e -r ed4de504d075 pkgtools/url2pkg/Makefile
--- a/pkgtools/url2pkg/Makefile Sun Nov 14 08:50:03 2021 +0000
+++ b/pkgtools/url2pkg/Makefile Sun Nov 14 08:57:15 2021 +0000
@@ -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-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"
diff -r 5ad3d1d48d1e -r ed4de504d075 pkgtools/url2pkg/files/url2pkg_test.py
--- a/pkgtools/url2pkg/files/url2pkg_test.py Sun Nov 14 08:50:03 2021 +0000
+++ b/pkgtools/url2pkg/files/url2pkg_test.py Sun Nov 14 08:57:15 2021 +0000
@@ -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_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 @@
]
+# 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