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:           Wed Jan 17 18:33:43 UTC 2024

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

Log Message:
pkgtools/url2pkg: skip p5-Module-Build for Module::Build Perl packages

That dependency is added implicitly whenever PERL5_MODULE_TYPE is
Module::Build.

Suggested by gdt@.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 pkgsrc/pkgtools/url2pkg/files/url2pkg.py
cvs rdiff -u -r1.48 -r1.49 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.52 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.53
--- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.52       Wed Jan 17 17:18:14 2024
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py    Wed Jan 17 18:33:43 2024
@@ -1,5 +1,5 @@
 #! @PYTHONBIN@
-# $NetBSD: url2pkg.py,v 1.52 2024/01/17 17:18:14 rillig Exp $
+# $NetBSD: url2pkg.py,v 1.53 2024/01/17 18:33:43 rillig Exp $
 
 # Copyright (c) 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -970,6 +970,8 @@ class Adjuster:
 
         cmd = f'{self.g.perl5} -I{self.g.libdir} -I. Build.PL'
         self.read_dependencies(cmd, {}, self.abs_wrksrc)
+        self.tool_depends = [d for d in self.tool_depends
+                             if not d.startswith('p5-Module-Build')]
         self.build_vars.append(Var('PERL5_MODULE_TYPE', '=', 'Module::Build'))
 
     def adjust_perl_module_Makefile_PL(self):

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.48 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.49
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.48  Wed Jan 17 17:18:14 2024
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py       Wed Jan 17 18:33:43 2024
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.48 2024/01/17 17:18:14 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.49 2024/01/17 18:33:43 rillig Exp $
 
 # URLs for manual testing:
 #
@@ -1177,18 +1177,23 @@ def test_Adjuster_adjust_meson(tmp_path:
 
 
 def test_Adjuster_adjust_perl_module_Build_PL(tmp_path: Path):
-    g.perl5 = 'echo perl5'
+    g.perl5 = "cat dependencies #"
     g.libdir = '/libdir'
-    g.verbose = True
+    g.verbose = False
     adjuster = Adjuster(g, '', Lines())
     adjuster.abs_wrksrc = tmp_path
+    (tmp_path / 'dependencies').write_text(
+        'TOOL_DEPENDS\tdep>=0:../../devel/dep\n'
+        'TOOL_DEPENDS\tp5-Module-Build>=0:../../devel/p5-Module-Build\n'
+    )
 
     adjuster.adjust_perl_module_Build_PL()
 
     assert str_vars(adjuster.build_vars) == ['PERL5_MODULE_TYPE=Module::Build']
-    assert g.err.written() == [
-        f'url2pkg: reading dependencies: cd \'{tmp_path}\' && env {{}} \'echo perl5 -I/libdir -I. Build.PL\'',
-        'url2pkg: unknown dependency line: \'perl5 -I/libdir -I. Build.PL\''
+    assert g.err.written() == []
+    assert adjuster.tool_depends == [
+        '# TODO: dep>=0',
+        # p5-Build-Module is added implicitly.
     ]
 
 



Home | Main Index | Thread Index | Old Index