autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH v2] Simplify handling of autotest tracing


From: Eric Blake
Subject: Re: [PATCH v2] Simplify handling of autotest tracing
Date: Mon, 13 Jul 2009 15:18:26 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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

> >     (at_check_filter_trace, at_trace_echo): New shell variables.
> >     Initialize them if tracing is requested.
> >     (_AT_DECIDE_TRACEABLE): Adjust call to at_fn_check_prepare_notrace.
> 
> Looks like this can shave off some size from the testsuite.  Other than
> the other nits in this mail, this is ready to commit.

Oops; spoke too soon.  Now that it is actually committed, I was able to compare 
a diff of the generated testsuite before and after, and we need the following 
touchups.

|  at_fn_check_prepare_notrace ()
|  {
| -  $as_echo "$1" >"$at_check_line_file"
| +  $at_trace_echo "Not enabling shell tracing (command contains )"
| +  $as_echo "$2" >"$at_check_line_file"

Missing m4 quoting ate the $1.

| -{ $at_traceoff
| +{ set +x
|  $as_echo "$at_srcdir/tools.at:98: autom4te --language=m4sugar script.4s -o 
script "
| -at_fn_check_prepare_trace "tools.at:98"
| +at_fn_check_prepare_dynamic "autom4te --language=m4sugar script.4s -o 
script " "tools.at:98"

Ouch - we lost the fact that this is known at m4 time to be safe to trace.  It 
turns out that using dnl was the culprit; that meant we were comparing [    -1] 
to [-1], instead of m4 eating the leading whitespace and comparing [-1] to [-1].

Here's the fix (although I'm not in a position to push this for a few more 
hours):


From: Eric Blake <address@hidden>
Date: Mon, 13 Jul 2009 09:16:06 -0600
Subject: [PATCH] Fix previous patch.

* lib/autotest/general.m4 (at_fn_check_prepare_notrace): Use
proper m4 quoting.
(_AT_DECIDE_TRACEABLE): Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog               |    7 +++++++
 lib/autotest/general.m4 |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 440e936..f5434bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-13  Eric Blake  <address@hidden>
+
+       Fix previous patch.
+       * lib/autotest/general.m4 (at_fn_check_prepare_notrace): Use
+       proper m4 quoting.
+       (_AT_DECIDE_TRACEABLE): Likewise.
+
 2009-07-13  Paolo Bonzini  <address@hidden>

        * lib/autotest/general.m4 (at_fn_check_prepare_notrace): Use
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 59cce95..6032796 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -268,7 +268,7 @@ AS_FUNCTION_DESCRIBE([at_fn_check_prepare_notrace], [REASON 
LINE],
 untraceable command; REASON is the reason for disabling tracing.])
 at_fn_check_prepare_notrace ()
 {
-  $at_trace_echo "Not enabling shell tracing (command contains $1)"
+  $at_trace_echo "Not enabling shell tracing (command contains $[1])"
   AS_ECHO(["$[2]"]) >"$at_check_line_file"
   at_check_trace=: at_check_filter=:
   : >"$at_stdout"; : >"$at_stderr"
@@ -2015,7 +2015,7 @@ m4_cond([m4_eval(m4_index([$1], [`]) >= 0)], [1],
        []))]dnl No reason.
 [m4_if(m4_index(_m4_defn([at_reason]), [a]), [0],]dnl
 dnl We know at build time that tracing COMMANDS is never safe.
-[[at_fn_check_prepare_notrace 'm4_defn([at_reason])'],dnl
+[[at_fn_check_prepare_notrace '_m4_defn([at_reason])'],
        m4_index([$1], [$]), [-1],]dnl
 dnl We know at build time that tracing COMMANDS is always safe.
 [[at_fn_check_prepare_trace],]dnl
-- 
1.6.3.2







reply via email to

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