Received: by mail.netbsd.org (Postfix, from userid 605) id 0D42384DAE; Sun, 6 Oct 2019 05:53:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 8514C84D94 for ; Sun, 6 Oct 2019 05:53:01 +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 uerwRBDcL7CC for ; Sun, 6 Oct 2019 05:53:01 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id F072284CD5 for ; Sun, 6 Oct 2019 05:53:00 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id E5762FBF4; Sun, 6 Oct 2019 05:53:00 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1570341180174500" MIME-Version: 1.0 Date: Sun, 6 Oct 2019 05:53:00 +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: <20191006055300.E5762FBF4@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1570341180174500 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Sun Oct 6 05:53:00 UTC 2019 Modified Files: pkgsrc/pkgtools/url2pkg/files: url2pkg.py url2pkg_test.py Log Message: pkgtools/url2pkg: fix version tag detection To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 pkgsrc/pkgtools/url2pkg/files/url2pkg.py cvs rdiff -u -r1.14 -r1.15 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. --_----------=_1570341180174500 Content-Disposition: inline Content-Length: 2641 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/pkgtools/url2pkg/files/url2pkg.py diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.15 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.16 --- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.15 Sat Oct 5 22:02:32 2019 +++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py Sun Oct 6 05:53:00 2019 @@ -1,5 +1,5 @@ #! @PYTHONBIN@ -# $NetBSD: url2pkg.py,v 1.15 2019/10/05 22:02:32 rillig Exp $ +# $NetBSD: url2pkg.py,v 1.16 2019/10/06 05:53:00 rillig Exp $ # Copyright (c) 2019 The NetBSD Foundation, Inc. # All rights reserved. @@ -376,10 +376,9 @@ class Generator: distname, extract_sufx = self.distfile, '# none' self.distname = distname - m = re.search(r'^v\d', distname) - if m: + if re.search(r'^v\d+\.', distname): self.pkgname_transform = ':S,^v,,' - elif re.search(r'-v\d', distname) and not re.search(r'-v.*-v\d', distname): + elif re.search(r'-v\d+\.', distname) and not re.search(r'-v.*-v\d+\.', distname): self.pkgname_transform = ':S,-v,-,' main_category = Path.cwd().parts[-2] Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.14 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.15 --- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.14 Sat Oct 5 22:02:32 2019 +++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py Sun Oct 6 05:53:00 2019 @@ -1,4 +1,4 @@ -# $NetBSD: url2pkg_test.py,v 1.14 2019/10/05 22:02:32 rillig Exp $ +# $NetBSD: url2pkg_test.py,v 1.15 2019/10/06 05:53:00 rillig Exp $ import pytest from url2pkg import * @@ -589,7 +589,7 @@ def test_Generator_adjust_everything_els ] -def test_Generator_determine_distname__v8(): +def test_Generator_adjust_everything_else__v8(): generator = Generator('https://example.org/v8-1.0.zip') lines = generator.generate_Makefile() @@ -598,7 +598,6 @@ def test_Generator_determine_distname__v mkcvsid, '', 'DISTNAME= v8-1.0', - 'PKGNAME= ${DISTNAME:S,^v,,}', # FIXME: v8 is part of the PKGBASE 'CATEGORIES= pkgtools', 'MASTER_SITES= https://example.org/', 'EXTRACT_SUFX= .zip', @@ -1311,10 +1310,6 @@ def test_Adjuster_adjust_lines_python_mo lines = adjuster.generate_lines() - # FIXME: Currently url2pkg assumes that all Python modules that are on - # GitHub are also available from PyPI. That is wrong. Probably url2pkg - # should try to fetch the file from PyPI, and only switch to PyPI if - # they are the same. assert detab(lines) == [ mkcvsid, '', --_----------=_1570341180174500--