diff options
author | Bruno Haible <bruno@clisp.org> | 2022-08-04 12:48:56 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2022-08-04 12:48:56 +0200 |
commit | aaeb4b0161bed1f4a87fb02625ee98d1d736d11c (patch) | |
tree | 29abf70a32575f2d4eac79cd8d73d0da6e35f028 /pygnulib/GLTestDir.py | |
parent | 353460b98e53e4244379d5526a2de5f42301e227 (diff) | |
download | gnulib-aaeb4b0161bed1f4a87fb02625ee98d1d736d11c.tar.gz |
gnulib-tool.py: Respect the specified module list.
* pygnulib/GLTestDir.py (GLTestDir.execute): Don't remove specific
modules (ftruncate, mountlist, etc.) from the specified module list.
Diffstat (limited to 'pygnulib/GLTestDir.py')
-rw-r--r-- | pygnulib/GLTestDir.py | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py index 384b5f3aeb..fcf8809837 100644 --- a/pygnulib/GLTestDir.py +++ b/pygnulib/GLTestDir.py @@ -162,28 +162,29 @@ class GLTestDir(object): macro_prefix = self.config['macro_prefix'] verbose = self.config['verbosity'] - base_modules = [self.modulesystem.find( - m) for m in self.config['modules']] - if not base_modules: - base_modules = self.modulesystem.list() - base_modules = [self.modulesystem.find(m) for m in base_modules] - # All modules together. - # Except config-h, which breaks all modules which use HAVE_CONFIG_H. - # Except non-recursive-gnulib-prefix-hack, which represents a - # nonstandard way of using Automake. - # Except ftruncate, mountlist, which abort the configuration on mingw. - # Except lib-ignore, which leads to link errors when Sun C++ is used. - base_modules = sorted(set(base_modules)) - base_modules = [module - for module in base_modules - if str(module) not in ['config-h', 'non-recursive-gnulib-prefix-hack', 'ftruncate', 'mountlist', 'lib-ignore']] + specified_modules = self.config['modules'] + if len(specified_modules) == 0: + # All modules together. + # Except config-h, which breaks all modules which use HAVE_CONFIG_H. + # Except non-recursive-gnulib-prefix-hack, which represents a + # nonstandard way of using Automake. + # Except ftruncate, mountlist, which abort the configuration on mingw. + # Except lib-ignore, which leads to link errors when Sun C++ is used. + specified_modules = self.modulesystem.list() + specified_modules = [module + for module in specified_modules + if module not in ['config-h', 'non-recursive-gnulib-prefix-hack', 'ftruncate', 'mountlist', 'lib-ignore']] + + # Canonicalize the list of specified modules. + specified_modules = sorted(set(specified_modules)) + specified_modules = [self.modulesystem.find(m) for m in specified_modules] # When computing transitive closures, don't consider $module to depend on # $module-tests. Need this because tests are implicitly GPL and may depend # on GPL modules - therefore we don't want a warning in this case. saved_inctests = self.config.checkInclTestCategory(TESTS['tests']) self.config.disableInclTestCategory(TESTS['tests']) - for requested_module in base_modules: + for requested_module in specified_modules: requested_licence = requested_module.getLicense() if requested_licence != 'GPL': # Here we use self.moduletable.transitive_closure([module]), not @@ -217,7 +218,7 @@ class GLTestDir(object): self.config.setInclTestCategory(TESTS['tests'], saved_inctests) # Determine final module list. - modules = self.moduletable.transitive_closure(base_modules) + modules = self.moduletable.transitive_closure(specified_modules) final_modules = list(modules) # Show final module list. @@ -240,7 +241,7 @@ class GLTestDir(object): # Determine main module list and tests-related module list separately. main_modules, tests_modules = \ self.moduletable.transitive_closure_separately( - base_modules, final_modules) + specified_modules, final_modules) # Print main_modules and tests_modules. if verbose >= 1: print('Main module list:') |