pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/url2pkg/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Thu Jan 23 05:23:01 UTC 2025

Modified Files:
        pkgsrc/pkgtools/url2pkg/files: url2pkg.py url2pkg_test.py

Log Message:
url2pkg: don't use "refs/tags" as WRKSRC for packages hosted on GitHub

Suggested by Greg Troxel via private mail.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 pkgsrc/pkgtools/url2pkg/files/url2pkg.py
cvs rdiff -u -r1.53 -r1.54 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/files/url2pkg.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.60 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.61
--- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.60       Thu Jan 23 05:10:43 2025
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py    Thu Jan 23 05:23:01 2025
@@ -1,5 +1,5 @@
 #! @PYTHONBIN@
-# $NetBSD: url2pkg.py,v 1.60 2025/01/23 05:10:43 rillig Exp $
+# $NetBSD: url2pkg.py,v 1.61 2025/01/23 05:23:01 rillig Exp $
 
 # Copyright (c) 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -345,6 +345,7 @@ class PackageVars:
     maintainer: str
     distname: str
     pkgname: str
+    wrksrc: str
 
     def __init__(self, url: str, pkgsrcdir: Path) -> None:
         self.url = url
@@ -362,6 +363,7 @@ class PackageVars:
         self.maintainer = ''
         self.distname = ''
         self.pkgname = ''
+        self.wrksrc = ''
 
         self.adjust_site_SourceForge()
         self.adjust_site_GitHub_archive()
@@ -505,6 +507,7 @@ class PackageVars:
             version = m.group(1)
             self.distfile = f'{proj}-{version}{ext}'
             self.github_tag = f'refs/tags/v${{PKGVERSION_NOREV}}'
+            self.wrksrc = '${GITHUB_TAG:T}'
             return
 
         self.github_project = proj
@@ -628,6 +631,10 @@ class Generator:
             Var('#LICENSE', '=', '# TODO: (see mk/license.mk)'),
         )
 
+        lines.add_vars(
+            Var('WRKSRC', '=', vars.wrksrc),
+        )
+
         lines.add('# url2pkg-marker (please do not remove this line.)')
         lines.add('.include "../../mk/bsd.pkg.mk"')
 

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.53 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.54
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.53  Sat Nov 23 22:30:30 2024
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py       Thu Jan 23 05:23:01 2025
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.53 2024/11/23 22:30:30 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.54 2025/01/23 05:23:01 rillig Exp $
 
 # URLs for manual testing:
 #
@@ -482,6 +482,8 @@ def test_PackageVars_adjust_site_GitHub_
         'COMMENT=        TODO: Short description of the package',
         '#LICENSE=       # TODO: (see mk/license.mk)',
         '',
+        'WRKSRC= ${GITHUB_TAG:T}',
+        '',
         '# url2pkg-marker (please do not remove this line.)',
         ".include \"../../mk/bsd.pkg.mk\"",
     ]



Home | Main Index | Thread Index | Old Index