bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] gnulib-tool: avoid 'if ! ...' in conditional dependencies.


From: Nick Bowler
Subject: [PATCH] gnulib-tool: avoid 'if ! ...' in conditional dependencies.
Date: Tue, 9 Mar 2021 21:29:23 -0500

When using the conditional dependencies feature of Gnulib, several
functions are emitted into configure scripts that use 'if ! ...'.

This syntax is not portable in practice, as discussed in the Autoconf
manual[1].  Because in this instance the construct is emitted into
configure scripts, this has minor shell portability implications on
downstream projects.  It is usually very easy to work around this
problem, so let's do so here.

[1] 
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/autoconf.html#index-_0021

* gnulib-tool (func_emit_autoconf_snippets): Avoid outputting
'if ! ...' constructs into downstream configure scrips.
---
 gnulib-tool | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnulib-tool b/gnulib-tool
index 2ba5dec65d..e7185958ff 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -4480,7 +4480,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"`
-- 
2.26.2




reply via email to

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