summaryrefslogtreecommitdiff
path: root/pygnulib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-03 15:51:35 +0200
committerBruno Haible <bruno@clisp.org>2022-08-03 16:15:12 +0200
commit65301e0739f8c86cf96403d6426551df3c3f3ac3 (patch)
treef0c04441a49b37393659d178f0414bead968f053 /pygnulib
parent65349591fb099e8076f477d16704b05ef8233e1c (diff)
downloadgnulib-65301e0739f8c86cf96403d6426551df3c3f3ac3.tar.gz
gnulib-tool.py: Fix unjustified "incompatible license" warnings.
* pygnulib/GLTestDir.py (GLTestDir.execute): Don't emit a warning when the dependency module has a license such as "public domain" or "unlimited".
Diffstat (limited to 'pygnulib')
-rw-r--r--pygnulib/GLTestDir.py35
1 files changed, 19 insertions, 16 deletions
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index f0a1a43883..83555faad7 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -184,25 +184,28 @@ class GLTestDir(object):
self.config.disableTestFlag(TESTS['tests'])
for requested_module in base_modules:
requested_licence = requested_module.getLicense()
- # Here we use self.moduletable.transitive_closure([module]), not just
- # module.getDependencies, so that we also detect weird situations like
- # an LGPL module which depends on a GPLed build tool module which depends
- # on a GPL module.
if requested_licence != 'GPL':
- modules = self.moduletable.transitive_closure(
- [requested_module])
+ # Here we use self.moduletable.transitive_closure([module]), not
+ # just module.getDependencies, so that we also detect weird
+ # situations like an LGPL module which depends on a GPLed build
+ # tool module which depends on a GPL module.
+ modules = self.moduletable.transitive_closure([requested_module])
for module in modules:
license = module.getLicense()
- errormsg = 'module %s depends on a module ' % requested_module
- errormsg += 'with an incompatible license: %s\n' % module
- if requested_licence == 'GPLv2+':
- if license not in ['GPLv2+', 'LGPLv2+']:
- sys.stderr.write(errormsg)
- elif requested_licence in ['LGPL']:
- if license not in ['LGPL', 'LGPLv2+']:
- sys.stderr.write(errormsg)
- elif requested_licence in ['LGPLv2+']:
- if license not in ['LGPLv2+']:
+ if license not in ['GPLv2+ build tool', 'GPLed build tool',
+ 'public domain', 'unlimited', 'unmodifiable license text']:
+ incompatible = False
+ if requested_licence == 'GPLv2+':
+ if license not in ['GPLv2+', 'LGPLv2+']:
+ incompatible = True
+ elif requested_licence in ['LGPL']:
+ if license not in ['LGPL', 'LGPLv2+']:
+ incompatible = True
+ elif requested_licence in ['LGPLv2+']:
+ if license not in ['LGPLv2+']:
+ incompatible = True
+ if incompatible:
+ errormsg = 'module %s depends on a module with an incompatible license: %s\n' % (requested_module, module)
sys.stderr.write(errormsg)
self.config.setTestFlags(saved_testflags)