bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnulib-tool.py: Implement --no-libtool option correctly


From: Bruno Haible
Subject: gnulib-tool.py: Implement --no-libtool option correctly
Date: Fri, 12 Apr 2024 22:13:20 +0200

The unit test failure

$ ./test-cache-2-29.sh
Files ./test-cache-2-29.result/lib/Makefile.gnulib and 
tmp1966494-result/lib/Makefile.gnulib differ
Files ./test-cache-2-29.result/m4/gnulib-cache.m4 and 
tmp1966494-result/m4/gnulib-cache.m4 differ
Files ./test-cache-2-29.result/m4/gnulib-comp.m4 and 
tmp1966494-result/m4/gnulib-comp.m4 differ
Files ./test-cache-2-29.result/tests/Makefile.gnulib and 
tmp1966494-result/tests/Makefile.gnulib differ
FAIL: gnulib-tool's result has unexpected differences.
FAIL: test-cache-2-29.sh
$ diff -u test-cache-2-29.result/m4/gnulib-cache.m4 
tmp1966494-result/m4/gnulib-cache.m4
--- test-cache-2-29.result/m4/gnulib-cache.m4   2024-04-12 13:43:37.960059958 
+0200
+++ tmp1966494-result/m4/gnulib-cache.m4        2024-04-12 17:59:51.721942626 
+0200
@@ -47,7 +47,7 @@
 #  --makefile-name=Makefile.gnulib \
 #  --automake-subdir \
 #  --no-conditional-dependencies \
-#  --no-libtool \
+#  --libtool \
 #  --macro-prefix=gl \
 #  --po-domain=prog \
 #  --witness-c-macro=IN_PROG \
@@ -77,6 +77,7 @@
 gl_LGPL
 gl_MAKEFILE_NAME([Makefile.gnulib])
 gl_AUTOMAKE_SUBDIR
+gl_LIBTOOL
 gl_MACRO_PREFIX([gl])
 gl_PO_DOMAIN([prog])
 gl_WITNESS_C_MACRO([IN_PROG])

is fixed by this patch:


2024-04-12  Bruno Haible  <bruno@clisp.org>

        gnulib-tool.py: Implement --no-libtool option correctly.
        * pygnulib/GLConfig.py (GLConfig.default): For 'libtool', return None,
        not False.
        (GLConfig.checkLibtool): Update result type.
        (resetLibtool): Reset to return None, not False.
        * pygnulib/GLImport.py (GLImport.actioncmd): Update.

diff --git a/pygnulib/GLConfig.py b/pygnulib/GLConfig.py
index 90b7bd984a..1ac40207a3 100644
--- a/pygnulib/GLConfig.py
+++ b/pygnulib/GLConfig.py
@@ -318,13 +318,13 @@ class GLConfig:
             elif key in ['localpath', 'modules', 'avoids', 'tests',
                          'incl_test_categories', 'excl_test_categories']:
                 return []
-            elif key in ['incobsolete', 'libtool', 'gnu_make',
+            elif key in ['incobsolete', 'gnu_make',
                          'automake_subdir', 'automake_subdir_tests', 
'conddeps',
                          'libtests', 'dryrun']:
                 return False
             elif key in ['copymode', 'lcopymode']:
                 return CopyAction.Copy
-            elif key in ['lgpl', 'vc_files']:
+            elif key in ['lgpl', 'libtool', 'vc_files']:
                 return None
             elif key == 'errors':
                 return True
@@ -788,7 +788,7 @@ class GLConfig:
         self.table['libname'] = 'libgnu'
 
     # Define libtool methods.
-    def checkLibtool(self) -> bool:
+    def checkLibtool(self) -> bool | None:
         '''Check if user enabled libtool rules.'''
         return self.table['libtool']
 
@@ -802,7 +802,7 @@ class GLConfig:
 
     def resetLibtool(self) -> None:
         '''Reset libtool rules.'''
-        self.table['libtool'] = False
+        self.table['libtool'] = None
 
     # Define conddeps methods.
     def checkCondDeps(self) -> bool:
diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 31380a0108..5f95706fc7 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -448,9 +448,9 @@ class GLImport:
             actioncmd += ' \\\n#  --conditional-dependencies'
         else:  # if not conddeps
             actioncmd += ' \\\n#  --no-conditional-dependencies'
-        if libtool:
+        if libtool == True:
             actioncmd += ' \\\n#  --libtool'
-        else:  # if not libtool
+        else:  # if libtool == False or libtool == None
             actioncmd += ' \\\n#  --no-libtool'
         actioncmd += ' \\\n#  --macro-prefix=%s' % macro_prefix
         if podomain:






reply via email to

[Prev in Thread] Current Thread [Next in Thread]