From 90f37ee9b5e61fe326a91a5b69d1f8cc3acf7359 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 26 Apr 2023 04:57:31 +0200 Subject: [PATCH] gnulib-tool: For conditional dependencies, generate portable sh code. * gnulib-tool (func_emit_autoconf_snippets): Avoid sh syntax 'if ! variable', that does not work with Solaris /bin/sh. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Likewise. --- ChangeLog | 8 ++++++++ gnulib-tool | 4 ++-- pygnulib/GLEmiter.py | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 834606fdfb..f28a8952c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2023-04-26 Po Lu (tiny change) + Bruno Haible + + gnulib-tool: For conditional dependencies, generate portable sh code. + * gnulib-tool (func_emit_autoconf_snippets): Avoid sh syntax + 'if ! variable', that does not work with Solaris /bin/sh. + * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Likewise. + 2023-04-25 Bruno Haible expm1 tests: Avoid test failure on 32-bit mingw. diff --git a/gnulib-tool b/gnulib-tool index 2a971de9ea..0955333c4f 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2002-2022 Free Software Foundation, Inc. +# Copyright (C) 2002-2023 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -4714,7 +4714,7 @@ func_emit_autoconf_snippets () func_module_shellvar_name "$module" echo " $shellfunc ()" echo ' {' - echo " if ! \$$shellvar; then" + echo " if \$$shellvar; then :; else" func_emit_autoconf_snippet " " echo " $shellvar=true" deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"` diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 6d523bda3c..884c3cb8c6 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -315,7 +315,7 @@ add AM_GNU_GETTEXT([external]) or similar to configure.ac.') shellvar = module.getShellVar() emit += ' %s ()\n' % shellfunc emit += ' {\n' - emit += ' if ! $%s; then\n' % shellvar + emit += ' if $%s; then :; else\n' % shellvar emit += self.autoconfSnippet(module, fileassistant, toplevel, disable_libtool, disable_gettext, replace_auxdir, ' ') emit += ' %s=true\n' % shellvar -- 2.39.5