diff options
author | rillig <rillig@pkgsrc.org> | 2019-10-03 16:43:58 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2019-10-03 16:43:58 +0000 |
commit | 79c50b51c422c236c4291950fc4bc9f18d85e5dc (patch) | |
tree | 227116f0c82f6888af59072f1b8658f050ae6acb /pkgtools | |
parent | 13cb4604cddd932d3ed461778de93f418c3f2e08 (diff) | |
download | pkgsrc-79c50b51c422c236c4291950fc4bc9f18d85e5dc.tar.gz |
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.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/url2pkg/files/url2pkg.py | 10 | ||||
-rw-r--r-- | pkgtools/url2pkg/files/url2pkg_test.py | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg.py b/pkgtools/url2pkg/files/url2pkg.py index 0dbd5b801e7..ffdd692b10b 100644 --- a/pkgtools/url2pkg/files/url2pkg.py +++ b/pkgtools/url2pkg/files/url2pkg.py @@ -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') diff --git a/pkgtools/url2pkg/files/url2pkg_test.py b/pkgtools/url2pkg/files/url2pkg_test.py index 675cf6cec78..92e0bb8e0be 100644 --- a/pkgtools/url2pkg/files/url2pkg_test.py +++ b/pkgtools/url2pkg/files/url2pkg_test.py @@ -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 * |