]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix unjustified "incompatible license" warnings.
authorBruno Haible <bruno@clisp.org>
Wed, 3 Aug 2022 13:51:35 +0000 (15:51 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 3 Aug 2022 14:15:12 +0000 (16:15 +0200)
* pygnulib/GLTestDir.py (GLTestDir.execute): Don't emit a warning when
the dependency module has a license such as "public domain" or
"unlimited".

ChangeLog
gnulib-tool.py
pygnulib/GLTestDir.py

index 2f88a72f901734f81690cee20160abb2175d0260..c334581d4b15c6845f91bb4e110ce394b0c8c7a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2022-08-03  Bruno Haible  <bruno@clisp.org>
 
+       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".
+
        gnulib-tool.py: Follow gnulib-tool changes, part 22.
        Follow gnulib-tool change
        2016-10-15  Bruno Haible  <bruno@clisp.org>
index 2ac522aa05758e3a953bdbb9c16dae048736d1fd..0e5914a402793918771d5701b1e8da228f9e67c9 100755 (executable)
@@ -24,7 +24,7 @@
 # - Line length is not limited to 79 characters.
 # - Line breaking before or after binary operators? Better before, like in GNU.
 # You can use this command to check the style:
-#   $ pycodestyle --max-line-length=128 --ignore=E265,W503,E241,E711,E712,E201,E202 gnulib-tool.py pygnulib/*.py
+#   $ pycodestyle --max-line-length=136 --ignore=E265,W503,E241,E711,E712,E201,E202 gnulib-tool.py pygnulib/*.py
 
 
 #===============================================================================
index f0a1a43883ec458614f325957a89097c73792abf..83555faad77f833e37b364e5aa3f4108ca558e0f 100644 (file)
@@ -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)