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: update to 21.3.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d04530e2aefe
branches:  trunk
changeset: 769386:d04530e2aefe
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Nov 14 09:20:15 2021 +0000

description:
pkgtools/url2pkg: update to 21.3.0

Changes since 21.1.0:

When creating a package from a GitHub archive URL, make the generated
package simpler and place the distfile in the main directory instead of
using DIST_SUBDIR.

diffstat:

 pkgtools/url2pkg/Makefile              |   5 ++---
 pkgtools/url2pkg/files/url2pkg.py      |  14 +++++++++++---
 pkgtools/url2pkg/files/url2pkg_test.py |  13 +++----------
 3 files changed, 16 insertions(+), 16 deletions(-)

diffs (80 lines):

diff -r a97989b8decd -r d04530e2aefe pkgtools/url2pkg/Makefile
--- a/pkgtools/url2pkg/Makefile Sun Nov 14 09:07:05 2021 +0000
+++ b/pkgtools/url2pkg/Makefile Sun Nov 14 09:20:15 2021 +0000
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.120 2021/11/14 08:57:15 rillig Exp $
+# $NetBSD: Makefile,v 1.121 2021/11/14 09:20:15 rillig Exp $
 
-PKGNAME=       url2pkg-21.1.0
-PKGREVISION=   1
+PKGNAME=       url2pkg-21.3.0
 CATEGORIES=    pkgtools
 
 MAINTAINER=    rillig%NetBSD.org@localhost
diff -r a97989b8decd -r d04530e2aefe pkgtools/url2pkg/files/url2pkg.py
--- a/pkgtools/url2pkg/files/url2pkg.py Sun Nov 14 09:07:05 2021 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.py Sun Nov 14 09:20:15 2021 +0000
@@ -1,5 +1,5 @@
 #! @PYTHONBIN@
-# $NetBSD: url2pkg.py,v 1.32 2021/05/25 17:56:24 rillig Exp $
+# $NetBSD: url2pkg.py,v 1.33 2021/11/14 09:20:15 rillig Exp $
 
 # Copyright (c) 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -431,10 +431,18 @@
 
         org, proj, tag, distname, ext = m.groups()
 
+        self.master_sites = f'${{MASTER_SITE_GITHUB:={org}/}}'
+        self.homepage = f'https://github.com/{org}/{proj}/'
+
+        m = re.search(r'^refs/tags/v(\d[\d.]*)$', tag)
+        if m:
+            version = m.group(1)
+            self.distfile = f'{proj}-{version}{ext}'
+            self.github_tag = f'refs/tags/v${{PKGVERSION_NOREV}}'
+            return
+
         self.github_project = proj
         self.github_tag = tag
-        self.master_sites = f'${{MASTER_SITE_GITHUB:={org}/}}'
-        self.homepage = f'https://github.com/{org}/{proj}/'
         if proj not in tag:
             self.pkgname_prefix = '${GITHUB_PROJECT}-'
             self.dist_subdir = '${GITHUB_PROJECT}'
diff -r a97989b8decd -r d04530e2aefe pkgtools/url2pkg/files/url2pkg_test.py
--- a/pkgtools/url2pkg/files/url2pkg_test.py    Sun Nov 14 09:07:05 2021 +0000
+++ b/pkgtools/url2pkg/files/url2pkg_test.py    Sun Nov 14 09:20:15 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.32 2021/11/14 08:57:15 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.33 2021/11/14 09:20:15 rillig Exp $
 
 import pytest
 from url2pkg import *
@@ -456,10 +456,6 @@
     ]
 
 
-# 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'
 
@@ -467,13 +463,10 @@
     assert detab(lines) == [
         mkcvsid,
         '',
-        'GITHUB_PROJECT= proj',
-        'GITHUB_TAG=     refs/tags/v1.0.0',
-        'DISTNAME=       v1.0.0',
-        'PKGNAME=        ${GITHUB_PROJECT}-${DISTNAME:S,^v,,}',
+        'GITHUB_TAG=     refs/tags/v${PKGVERSION_NOREV}',
+        'DISTNAME=       proj-1.0.0',
         '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/',



Home | Main Index | Thread Index | Old Index