From f52d4a7b78be73060cf01640b40ebc88193c12e8 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Sat, 2 Mar 2024 18:43:26 -0800 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ pygnulib/GLEmiter.py | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fc4425325..098868de10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-03-03 Collin Funk + Bruno Haible + + 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 gnulib-tool.py: Make output of test Makefile.am match gnulib-tool. diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 2a8ede9335..8939917a0a 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -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: -- 2.39.5