Received: by mail.netbsd.org (Postfix, from userid 605) id BD38F84D53; Sun, 23 May 2021 16:20:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 01CDF84D51 for ; Sun, 23 May 2021 16:20:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id MDb7GA4HH1ny for ; Sun, 23 May 2021 16:20:46 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 7C83784D50 for ; Sun, 23 May 2021 16:20:46 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 708A9FA95; Sun, 23 May 2021 16:20:46 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1621786846144400" MIME-Version: 1.0 Date: Sun, 23 May 2021 16:20:46 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/pkgtools/url2pkg/files To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20210523162046.708A9FA95@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1621786846144400 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Sun May 23 16:20:46 UTC 2021 Modified Files: pkgsrc/pkgtools/url2pkg/files: url2pkg_test.py Log Message: url2pkg: add test for GitHub URL that leads to wrong DISTNAME Reported by Brook Milligan via private mail. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 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. --_----------=_1621786846144400 Content-Disposition: inline Content-Length: 1775 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.27 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.28 --- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.27 Sat Oct 17 22:39:01 2020 +++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py Sun May 23 16:20:46 2021 @@ -1,4 +1,4 @@ -# $NetBSD: url2pkg_test.py,v 1.27 2020/10/17 22:39:01 rillig Exp $ +# $NetBSD: url2pkg_test.py,v 1.28 2021/05/23 16:20:46 rillig Exp $ import pytest from url2pkg import * @@ -431,6 +431,32 @@ def test_Generator_adjust_site_GitHub_ar ] +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() + assert detab(lines) == [ + mkcvsid, + '', + 'GITHUB_PROJECT= proj', + 'GITHUB_TAG= refs/tags/1.0.0', + # FIXME: DISTNAME must not contain slashes + 'DISTNAME= refs/tags/1.0.0', + 'PKGNAME= ${GITHUB_PROJECT}-${DISTNAME}', + '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' --_----------=_1621786846144400--