Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id CDF501A9239 for ; Sun, 14 Nov 2021 08:57:17 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id 28E3784E5B; Sun, 14 Nov 2021 08:57:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 612C584DA9 for ; Sun, 14 Nov 2021 08:57:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id snS34WHNCMxd for ; Sun, 14 Nov 2021 08:57:15 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id BDDF984DA4 for ; Sun, 14 Nov 2021 08:57:15 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id B0130FAEC; Sun, 14 Nov 2021 08:57:15 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_163688023575370" MIME-Version: 1.0 Date: Sun, 14 Nov 2021 08:57:15 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/pkgtools/url2pkg To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20211114085715.B0130FAEC@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_163688023575370 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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. --_----------=_163688023575370 Content-Disposition: inline Content-Length: 2888 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii 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', + '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' --_----------=_163688023575370--