automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recrea


From: Ralf Wildenhues
Subject: Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation.
Date: Sun, 22 Mar 2009 09:43:11 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Akim,

thanks for working through this with me!

* Akim Demaille wrote on Sat, Mar 14, 2009 at 01:39:07PM CET:
>
> For the records, here is the version I use currently, some of bugs you  
> mentioned being fixed.

Thanks.  I am applying this improvement:

Cheers,
Ralf

    Minor optimization in parallel-tests text box creation.
    
    * lib/am/check.am [PARALLEL-TESTS] (am__text_box): Use only one
    awk invocation, rather than several tools, to create a text box.
    Suggestion from Akim Demaille.

diff --git a/lib/am/check.am b/lib/am/check.am
index 14df1e5..28af2ee 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -75,13 +75,15 @@ am__rst_title   = sed 's/.*/   &   
/;h;s/./=/g;p;x;p;g;p;s/.*//'
 am__rst_section = sed 'p;s/./=/g;p;g'
 
 # Put stdin (possibly several lines separated by ".  ") in a box.
-am__text_box = { nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
-  sed "s/\\.  /\\$$nl/g"; } | sed '/^$$/d' |                   \
-$(AWK) '{ if (final) final = final "\n" $$0; else final = $$0; }\
-max < length($$0) { max = length($$0); }                       \
-END {                                                          \
-  for (i = 0; i < max; ++i) line = line "=";                   \
-  print line; print final; print line;                         \
+am__text_box = $(AWK) '{                               \
+  n = split($$0, lines, "\\.  "); max = 0;             \
+  for (i = 1; i <= n; ++i)                             \
+    if (max < length(lines[i]))                                \
+      max = length(lines[i]);                          \
+  for (i = 0; i < max; ++i) line = line "=";           \
+  print line;                                          \
+  for (i = 1; i <= n; ++i) if (lines[i]) print lines[i];\
+  print line;                                          \
 }'
 
 # Solaris 10 'make', and several other traditional 'make' implementations,





reply via email to

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