]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Follow gnulib-tool changes, part 64.
authorCollin Funk <collin.funk1@gmail.com>
Mon, 18 Mar 2024 03:09:12 +0000 (20:09 -0700)
committerBruno Haible <bruno@clisp.org>
Mon, 18 Mar 2024 10:50:47 +0000 (11:50 +0100)
Follow gnulib-tool change
2021-12-25  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Respect applicability 'all' without --single-configure.

* pygnulib/GLModuleSystem.py (GLModule.isTests): Treat modules with
applicability 'all' like 'tests' modules, not like 'main' modules.
(GLModule.isNonTests): Treat all modules not ending in '-tests' as
non-test modules.
(GLModule.getApplicability): Don't use GLModule.isTests(). Because it
depends on the result of this function, using it would cause a
RecursionError exception.
(GLModule.getDependencies): Respect the difference between
module.isTests(), module.isNonTests(), and
module.getName().endswith('-tests').
(GLModule.getAutomakeSnippet_Unconditional, GLModule.getLicense)
(GLModuleTable.add_dummy): Likewise.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Likewise.

ChangeLog
gnulib-tool.py.TODO
pygnulib/GLEmiter.py
pygnulib/GLModuleSystem.py

index a54938bcc8c538cfc468683dd0eb7b46cbf5dded..a545806fdacbe3b9f93be177a31834367fb81a37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2024-03-18  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Follow gnulib-tool changes, part 64.
+       Follow gnulib-tool change
+       2021-12-25  Bruno Haible  <bruno@clisp.org>
+       gnulib-tool: Respect applicability 'all' without --single-configure.
+       * pygnulib/GLModuleSystem.py (GLModule.isTests): Treat modules with
+       applicability 'all' like 'tests' modules, not like 'main' modules.
+       (GLModule.isNonTests): Treat all modules not ending in '-tests' as
+       non-test modules.
+       (GLModule.getApplicability): Don't use GLModule.isTests(). Because it
+       depends on the result of this function, using it would cause a
+       RecursionError exception.
+       (GLModule.getDependencies): Respect the difference between
+       module.isTests(), module.isNonTests(), and
+       module.getName().endswith('-tests').
+       (GLModule.getAutomakeSnippet_Unconditional, GLModule.getLicense)
+       (GLModuleTable.add_dummy): Likewise.
+       * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Likewise.
+
 2024-03-17  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Handle empty lists of lines consistently.
index 8178b2fbfd95f99d4d475fe3f9c00d67ef91d812..976439e2beb7d5602f350a48e353ae08b813f2d9 100644 (file)
@@ -88,17 +88,6 @@ Date:   Sat Dec 25 14:30:57 2021 +0100
 
 --------------------------------------------------------------------------------
 
-commit 83948c64d10c77fb964e6523a9524729d6a66f32
-Author: Bruno Haible <bruno@clisp.org>
-Date:   Sat Dec 25 12:19:13 2021 +0100
-
-    gnulib-tool: Respect applicability 'all' without --single-configure.
-
-    * gnulib-tool (func_verify_tests_module): Treat modules with
-    applicability 'all' like 'tests' modules, not like 'main' modules.
-
---------------------------------------------------------------------------------
-
 commit 4bdc327dbda59dcdbfa0f983a4f35c4a4ec3578c
 Author: Bruno Haible <bruno@clisp.org>
 Date:   Sun Dec 19 12:49:16 2021 +0100
index 97a5b5f62e8a291e14909f7a833e858f250ce764..f4db15481f0317b81fc11ac3196733e1690b7592 100644 (file)
@@ -797,7 +797,7 @@ AC_DEFUN([%V1%_LIBSOURCES], [
         # Compute allsnippets variable.
         allsnippets = ''
         for module in modules:
-            if not module.isTests():
+            if module.isNonTests():
                 # Get conditional snippet, edit it and save to amsnippet1.
                 amsnippet1 = module.getAutomakeSnippet_Conditional()
                 amsnippet1 = amsnippet1.replace('lib_LIBRARIES', 'lib%_LIBRARIES')
@@ -985,7 +985,7 @@ AC_DEFUN([%V1%_LIBSOURCES], [
             # the link dependencies of all modules.
             links = [ module.getLink()
                       for module in modules
-                      if not module.isTests() ]
+                      if module.isNonTests() ]
             lines = [ line
                       for link in links
                       for line in link.split('\n')
index 13d03d3af8ba4ab8e3b11c42964a51315a5a95d5..2c5f36b6b09b80f3b423f961e51ee3e17e83eccb 100644 (file)
@@ -308,14 +308,14 @@ class GLModule(object):
         '''GLModule.isTests() -> bool
 
         Check whether module is a -tests version of module.'''
-        result = self.getName().endswith('-tests')
+        result = self.getApplicability() != 'main'
         return result
 
     def isNonTests(self):
         '''GLModule.isTests() -> bool
 
         Check whether module is not a -tests version of module.'''
-        result = not self.isTests()
+        result = not self.getName().endswith('-tests')
         return result
 
     def getTestsName(self):
@@ -498,7 +498,7 @@ class GLModule(object):
             result = result.strip()
             if not result:
                 # The default is 'main' or 'tests', depending on the module's name.
-                if self.isTests():
+                if self.getName().endswith('-tests'):
                     result = 'tests'
                 else:
                     result = 'main'
@@ -529,7 +529,7 @@ class GLModule(object):
         if 'dependencies' not in self.cache:
             result = ''
             # ${module}-tests implicitly depends on ${module}, if that module exists.
-            if self.isTests():
+            if self.getName().endswith('-tests'):
                 main_module = subend('-tests', '', self.getName())
                 if self.modulesystem.exists(main_module):
                     result += '%s\n' % main_module
@@ -631,7 +631,7 @@ class GLModule(object):
         ac_version = self.config['ac_version']
         result = ''
         if 'makefile-unconditional' not in self.cache:
-            if self.isTests():
+            if self.getName().endswith('-tests'):
                 files = self.getFiles()
                 extra_files = filter_filelist(constants.NL, files,
                                               'tests/', '', 'tests/', '').split(constants.NL)
@@ -713,7 +713,7 @@ class GLModule(object):
         if 'license' not in self.cache:
             license = self.getLicense_Raw().strip()
             # Warn if the License field is missing.
-            if not self.isTests():
+            if not self.getName().endswith('-tests'):
                 if not license:
                     if self.config['errors']:
                         raise GLError(18, str(self))
@@ -1076,7 +1076,7 @@ class GLModuleTable(object):
         # Determine whether any module provides a lib_SOURCES augmentation.
         have_lib_sources = False
         for module in modules:
-            if not module.isTests():
+            if module.isNonTests():
                 if conddeps and self.isConditional(module):
                     # Ignore conditional modules, since they are not guaranteed to
                     # contribute to lib_SOURCES.