| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | #! @PYTHONBIN@ | | 1 | #! @PYTHONBIN@ |
2 | # $NetBSD: url2pkg.py,v 1.4 2019/10/03 16:32:47 rillig Exp $ | | 2 | # $NetBSD: url2pkg.py,v 1.5 2019/10/03 16:43:58 rillig Exp $ |
3 | | | 3 | |
4 | # Copyright (c) 2019 The NetBSD Foundation, Inc. | | 4 | # Copyright (c) 2019 The NetBSD Foundation, Inc. |
5 | # All rights reserved. | | 5 | # All rights reserved. |
6 | # | | 6 | # |
7 | # This code is derived from software contributed to The NetBSD Foundation | | 7 | # This code is derived from software contributed to The NetBSD Foundation |
8 | # by Roland Illig. | | 8 | # by Roland Illig. |
9 | # | | 9 | # |
10 | # Redistribution and use in source and binary forms, with or without | | 10 | # Redistribution and use in source and binary forms, with or without |
11 | # modification, are permitted provided that the following conditions | | 11 | # modification, are permitted provided that the following conditions |
12 | # are met: | | 12 | # are met: |
13 | # 1. Redistributions of source code must retain the above copyright | | 13 | # 1. Redistributions of source code must retain the above copyright |
14 | # notice, this list of conditions and the following disclaimer. | | 14 | # notice, this list of conditions and the following disclaimer. |
15 | # 2. Redistributions in binary form must reproduce the above copyright | | 15 | # 2. Redistributions in binary form must reproduce the above copyright |
| @@ -802,32 +802,36 @@ class Adjuster: | | | @@ -802,32 +802,36 @@ class Adjuster: |
802 | | | 802 | |
803 | lines.append('CATEGORIES', ' '.join(self.categories)) | | 803 | lines.append('CATEGORIES', ' '.join(self.categories)) |
804 | | | 804 | |
805 | self.adjust_lines_python_module(lines, url) | | 805 | self.adjust_lines_python_module(lines, url) |
806 | | | 806 | |
807 | for varname in self.update_vars: | | 807 | for varname in self.update_vars: |
808 | debug('update_var {0} {1}', varname, self.update_vars[varname]) | | 808 | debug('update_var {0} {1}', varname, self.update_vars[varname]) |
809 | lines.set(varname, self.update_vars[varname]) | | 809 | lines.set(varname, self.update_vars[varname]) |
810 | | | 810 | |
811 | return lines | | 811 | return lines |
812 | | | 812 | |
813 | def adjust_package_from_extracted_distfiles(self, url: str): | | 813 | def adjust_package_from_extracted_distfiles(self, url: str): |
814 | | | 814 | |
| | | 815 | def scan(basedir: str, pattern: str) -> List[str]: |
| | | 816 | full_paths = glob.glob(f'{basedir}/{pattern}', recursive=True) |
| | | 817 | return list(f[len(basedir) + 1:] for f in full_paths) |
| | | 818 | |
815 | debug('Adjusting the Makefile') | | 819 | debug('Adjusting the Makefile') |
816 | | | 820 | |
817 | self.abs_wrkdir = show_var('WRKDIR') | | 821 | self.abs_wrkdir = show_var('WRKDIR') |
818 | self.determine_wrksrc() | | 822 | self.determine_wrksrc() |
819 | self.wrksrc_files = glob.glob(f'{self.abs_wrksrc}/**', recursive=True) | | 823 | self.wrksrc_files = scan(self.abs_wrksrc, '**') |
820 | self.wrksrc_dirs = glob.glob(f'{self.abs_wrksrc}/**/', recursive=True) | | 824 | self.wrksrc_dirs = scan(self.abs_wrksrc, '**/') |
821 | | | 825 | |
822 | self.makefile_lines = Lines.read_from(config.pkgdir + '/Makefile') | | 826 | self.makefile_lines = Lines.read_from(config.pkgdir + '/Makefile') |
823 | | | 827 | |
824 | self.adjust_configure() | | 828 | self.adjust_configure() |
825 | self.adjust_cmake() | | 829 | self.adjust_cmake() |
826 | self.adjust_meson() | | 830 | self.adjust_meson() |
827 | self.adjust_gconf2_schemas() | | 831 | self.adjust_gconf2_schemas() |
828 | self.adjust_libtool() | | 832 | self.adjust_libtool() |
829 | self.adjust_perl_module(url) | | 833 | self.adjust_perl_module(url) |
830 | self.adjust_python_module() | | 834 | self.adjust_python_module() |
831 | self.adjust_cargo() | | 835 | self.adjust_cargo() |
832 | self.adjust_pkg_config() | | 836 | self.adjust_pkg_config() |
833 | self.adjust_po() | | 837 | self.adjust_po() |