]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix output of gnulib-comp.m4.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 3 Mar 2024 02:43:26 +0000 (18:43 -0800)
committerBruno Haible <bruno@clisp.org>
Sun, 3 Mar 2024 10:27:35 +0000 (11:27 +0100)
* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Fix indentation.
Don't print nonstring values into gnulib-comp.m4.

ChangeLog
pygnulib/GLEmiter.py

index 1fc442532515c5c09d2d6e69c84a759e497591fc..098868de10a144ff40bf4ebac34c216ec771db77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-03-03  Collin Funk  <collin.funk1@gmail.com>
+            Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool.py: Fix output of gnulib-comp.m4.
+       * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Fix indentation.
+       Don't print nonstring values into gnulib-comp.m4.
+
 2024-03-03  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Make output of test Makefile.am match gnulib-tool.
index 2a8ede93354a6b64a69b7c1e036bb98daea5b0c5..8939917a0afb22c0513ebe2d6acd6757c1f6ada2 100644 (file)
@@ -297,12 +297,12 @@ class GLEmiter(object):
                             if moduletable.isConditional(depmodule):
                                 shellfunc = depmodule.getShellFunc()
                                 condition = moduletable.getCondition(module, depmodule)
-                                if condition != None:
-                                    emit += '  if %s; then\n' % condition
-                                    emit += '    %s\n' % shellfunc
-                                    emit += '  fi\n'
-                                else:  # if condition == None
-                                    emit += '  %s\n' % shellfunc
+                                if condition != None and condition != True:
+                                    emit += '      if %s; then\n' % condition
+                                    emit += '        %s\n' % shellfunc
+                                    emit += '      fi\n'
+                                else:  # if condition == None or condition == True
+                                    emit += '      %s\n' % shellfunc
                             # if not moduletable.isConditional(depmodule)
                             else:
                                 # The autoconf code for $dep has already been emitted above and
@@ -329,11 +329,11 @@ class GLEmiter(object):
                             if moduletable.isConditional(depmodule):
                                 shellfunc = depmodule.getShellFunc()
                                 condition = moduletable.getCondition(module, depmodule)
-                                if condition != None:
+                                if condition != None and condition != True:
                                     emit += '  if %s; then\n' % condition
                                     emit += '    %s\n' % shellfunc
                                     emit += '  fi\n'
-                                else:  # if condition == None
+                                else:  # if condition == None or condition == True
                                     emit += '  %s\n' % shellfunc
                             # if not moduletable.isConditional(depmodule)
                             else: