]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] check: fix incompatibility with Solaris nawk
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 25 May 2012 15:52:35 +0000 (17:52 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 25 May 2012 15:52:35 +0000 (17:52 +0200)
On Solaris 10, the parallel testsuite harness could fail with errors
like this when /usr/bin/nawk was the selected awk program.

  nawk: next is illegal inside a function at source line 1 in \
  function input_error; context is:
      function input_error(file) { ... close_current(); next; >>> } <<<

* lib/am/parallel-tests.am (am__create_global_log): In the awk script
defined by this function, avoid use of the 'next' directive inside a
function.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/parallel-tests.am

index 0c3e9ff52a464ba5fca77351fcdbc5e9ea5ba3aa..819b4e2c0c0e702445b47f4f19f4c6623dcb443a 100644 (file)
@@ -189,7 +189,6 @@ function input_error(file) \
 { \
   error("awk" ": cannot read \"" file "\""); \
   close_current(); \
-  next; \
 } \
 function rst_section(header) \
 { \
@@ -209,7 +208,10 @@ BEGIN { exit_status = 0; } \
   while ((rc = (getline line < ($$0 ".trs"))) != 0) \
     { \
       if (rc < 0) \
-        input_error($$0 ".trs"); \
+        { \
+          input_error($$0 ".trs"); \
+          next; \
+        } \
       if (line ~ /$(am__global_test_result_rx)/) \
         { \
           sub("$(am__global_test_result_rx)", "", line); \
@@ -225,7 +227,10 @@ BEGIN { exit_status = 0; } \
       while ((rc = (getline line < ($$0 ".log"))) != 0) \
       { \
         if (rc < 0) \
-          input_error($$0 ".log"); \
+          { \
+            input_error($$0 ".log"); \
+            next; \
+          } \
         print line; \
       }; \
       printf "\n"; \