pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/pkgtools/url2pkg
Module Name: pkgsrc
Committed By: rillig
Date: Sun Nov 14 09:20:15 UTC 2021
Modified Files:
pkgsrc/pkgtools/url2pkg: Makefile
pkgsrc/pkgtools/url2pkg/files: url2pkg.py url2pkg_test.py
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 pkgsrc/pkgtools/url2pkg/Makefile
cvs rdiff -u -r1.32 -r1.33 pkgsrc/pkgtools/url2pkg/files/url2pkg.py \
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.
Modified files:
Index: pkgsrc/pkgtools/url2pkg/Makefile
diff -u pkgsrc/pkgtools/url2pkg/Makefile:1.120 pkgsrc/pkgtools/url2pkg/Makefile:1.121
--- pkgsrc/pkgtools/url2pkg/Makefile:1.120 Sun Nov 14 08:57:15 2021
+++ pkgsrc/pkgtools/url2pkg/Makefile Sun Nov 14 09:20:15 2021
@@ -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
Index: pkgsrc/pkgtools/url2pkg/files/url2pkg.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.32 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.33
--- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.32 Tue May 25 17:56:24 2021
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py Sun Nov 14 09:20:15 2021
@@ -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 @@ class Generator:
org, proj, tag, distname, ext = m.groups()
- self.github_project = proj
- self.github_tag = tag
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
if proj not in tag:
self.pkgname_prefix = '${GITHUB_PROJECT}-'
self.dist_subdir = '${GITHUB_PROJECT}'
Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.32 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.33
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.32 Sun Nov 14 08:57:15 2021
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py Sun Nov 14 09:20:15 2021
@@ -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 @@ 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'
@@ -467,13 +463,10 @@ def test_Generator_adjust_site_GitHub_ar
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