autoconf-patches
[Top][All Lists]
Advanced

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

Re: Add and document AS_VAR_COPY, speed up configure


From: Eric Blake
Subject: Re: Add and document AS_VAR_COPY, speed up configure
Date: Mon, 20 Oct 2008 20:09:09 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> +## ---------- ##
> +## AS_VAR_*.  ##
> +## ---------- ##
> +
> +AT_SETUP([AS@&t <at> _VAR])
...
> +AS_VAR_SET([foo], ['\a  "weird" `value` with; $fun '\''characters
> +']) # 'font-lock
> +AS_VAR_COPY([bar], [foo])
> +echo "$bar-"

I should know better.  Shells where echo interprets \a (such as /bin/sh on 
OpenBSD) failed this test.  Committing this obvious followup:

From: Eric Blake <address@hidden>
Date: Mon, 20 Oct 2008 22:03:36 +0200
Subject: [PATCH] Avoid unportable use of echo in testsuite.

* tests/m4sh.at (AS@&address@hidden basics): Use AS_ECHO, since string
contains backslash.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog     |    6 ++++++
 tests/m4sh.at |   12 ++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5380a50..81a1f5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-20  Eric Blake  <address@hidden>
+
+       Avoid unportable use of echo in testsuite.
+       * tests/m4sh.at (AS@&address@hidden basics): Use AS_ECHO, since string
+       contains backslash.
+
 2008-10-18  Paolo Bonzini  <address@hidden>
 
        Make sure that nested AS_REQUIRE do not lose the desired diversion.
diff --git a/tests/m4sh.at b/tests/m4sh.at
index 75da8a4..b0ddafd 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -939,8 +939,8 @@ AS_VAR_SET_IF([foo], [echo oops], [echo ok])
 AS_VAR_SET([foo], ['\a  "weird" `value` with; $fun '\''characters
 ']) # 'font-lock
 AS_VAR_COPY([bar], [foo])
-echo "$bar-"
-echo "AS_VAR_GET([foo])-"
+AS_ECHO(["$bar-"])
+AS_ECHO(["AS_VAR_GET([foo])-"])
 AS_VAR_SET_IF([foo], [echo ok], [echo oops])
 AS_VAR_IF([foo], [string], [echo oops], [echo ok])
 AS_VAR_PUSHDEF([tmp], [foo])
@@ -958,8 +958,8 @@ AS_VAR_SET([foo$num], ['\a  "weird" `value` with; 
$fun '\''characters
 AS_VAR_COPY([bar], [foo$num])
 num=2
 AS_VAR_COPY([foo$num], [bar])
-echo "$foo2-"
-echo "AS_VAR_GET([foo$num])-"
+AS_ECHO(["$foo2-"])
+AS_ECHO(["AS_VAR_GET([foo$num])-"])
 AS_VAR_SET_IF([foo$num], [echo ok], [echo oops])
 AS_VAR_IF([foo$num], [string], [echo oops], [echo ok])
 AS_VAR_PUSHDEF([tmp], [foo$num])
@@ -976,8 +976,8 @@ AS_VAR_SET([`echo foo3`], ['\a  "weird" `value` with; 
$fun '\''characters
 AS_VAR_COPY([bar], [`echo foo3`])
 num=2
 AS_VAR_COPY([`echo foo4`], [bar])
-echo "$foo4-"
-echo "AS_VAR_GET([`echo foo4`])-"
+AS_ECHO(["$foo4-"])
+AS_ECHO(["AS_VAR_GET([`echo foo4`])-"])
 AS_VAR_SET_IF([`echo foo4`], [echo ok], [echo oops])
 AS_VAR_IF([`echo foo4`], [string], [echo oops], [echo ok])
 AS_VAR_PUSHDEF([tmp], [`echo foo4`])
-- 
1.6.0.2








reply via email to

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