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 Oct  3 16:43:58 UTC 2019

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

Log Message:
pkgtools/url2pkg: use filenames relative to WRKSRC

Before this change, the Python implementation had written absolute paths
to PKGCONFIG_OVERRIDE, which didn't make sense.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/url2pkg/files/url2pkg.py
cvs rdiff -u -r1.3 -r1.4 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.4 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.5
--- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.4        Thu Oct  3 16:32:47 2019
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py    Thu Oct  3 16:43:58 2019
@@ -1,5 +1,5 @@
 #! @PYTHONBIN@
-# $NetBSD: url2pkg.py,v 1.4 2019/10/03 16:32:47 rillig Exp $
+# $NetBSD: url2pkg.py,v 1.5 2019/10/03 16:43:58 rillig Exp $
 
 # Copyright (c) 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -812,12 +812,16 @@ class Adjuster:
 
     def adjust_package_from_extracted_distfiles(self, url: str):
 
+        def scan(basedir: str, pattern: str) -> List[str]:
+            full_paths = glob.glob(f'{basedir}/{pattern}', recursive=True)
+            return list(f[len(basedir) + 1:] for f in full_paths)
+
         debug('Adjusting the Makefile')
 
         self.abs_wrkdir = show_var('WRKDIR')
         self.determine_wrksrc()
-        self.wrksrc_files = glob.glob(f'{self.abs_wrksrc}/**', recursive=True)
-        self.wrksrc_dirs = glob.glob(f'{self.abs_wrksrc}/**/', recursive=True)
+        self.wrksrc_files = scan(self.abs_wrksrc, '**')
+        self.wrksrc_dirs = scan(self.abs_wrksrc, '**/')
 
         self.makefile_lines = Lines.read_from(config.pkgdir + '/Makefile')
 

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.3 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.4
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.3   Thu Oct  3 16:32:47 2019
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py       Thu Oct  3 16:43:58 2019
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.3 2019/10/03 16:32:47 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.4 2019/10/03 16:43:58 rillig Exp $
 
 from url2pkg import *
 



Home | Main Index | Thread Index | Old Index