diff mbox series

test_summary: handle single quotes

Message ID CAKdteOZyU9=13aS+QOC-u+Rw7JbLsvNNg=p2tiuGxyoQCGL+-Q@mail.gmail.com
State Accepted
Commit 1e4573c0b7f0980097e6b9bd516bc32347a7856c
Headers show
Series test_summary: handle single quotes | expand

Commit Message

Christophe Lyon Feb. 28, 2018, 9:30 a.m. UTC
Hi,

We happen to build GCC with '~' in the src and build dirs, leading to
single quotes around the configure path in config.status. For example:
[...]
S["TOPLEVEL_CONFIGURE_ARGUMENTS"]="'/home/christophe.lyon/src/Linaro/abe/abe-contrib-summary/mybuild/snapshots/gcc.git~linaro~gcc-7-branch/configure'
SHELL=/bin/bash --with-mpc=/home/"\
[...]

This confuses contrib/test_summary which matches "/configure .* in its
awk script, which fails to match when we have "/configure' XXX"
instead.

This patch fixes that by adding matches for the optional single
quotes. I use \047 to match the ascii "'", because I couldn't find how
to quote this properly in the awk script.

OK for trunk?

Thanks,

Christophe
contrib/ChangeLog:

2018-02-28  Christophe Lyon  <christophe.lyon@linaro.org>

	* test_summary: Match possible single quotes in configure path.

Comments

Christophe Lyon March 12, 2018, 2:17 p.m. UTC | #1
ping?

On 28 February 2018 at 10:30, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
> Hi,

>

> We happen to build GCC with '~' in the src and build dirs, leading to

> single quotes around the configure path in config.status. For example:

> [...]

> S["TOPLEVEL_CONFIGURE_ARGUMENTS"]="'/home/christophe.lyon/src/Linaro/abe/abe-contrib-summary/mybuild/snapshots/gcc.git~linaro~gcc-7-branch/configure'

> SHELL=/bin/bash --with-mpc=/home/"\

> [...]

>

> This confuses contrib/test_summary which matches "/configure .* in its

> awk script, which fails to match when we have "/configure' XXX"

> instead.

>

> This patch fixes that by adding matches for the optional single

> quotes. I use \047 to match the ascii "'", because I couldn't find how

> to quote this properly in the awk script.

>

> OK for trunk?

>

> Thanks,

>

> Christophe
Jeff Law March 20, 2018, 10:17 p.m. UTC | #2
On 02/28/2018 02:30 AM, Christophe Lyon wrote:
> Hi,

> 

> We happen to build GCC with '~' in the src and build dirs, leading to

> single quotes around the configure path in config.status. For example:

> [...]

> S["TOPLEVEL_CONFIGURE_ARGUMENTS"]="'/home/christophe.lyon/src/Linaro/abe/abe-contrib-summary/mybuild/snapshots/gcc.git~linaro~gcc-7-branch/configure'

> SHELL=/bin/bash --with-mpc=/home/"\

> [...]

> 

> This confuses contrib/test_summary which matches "/configure .* in its

> awk script, which fails to match when we have "/configure' XXX"

> instead.

> 

> This patch fixes that by adding matches for the optional single

> quotes. I use \047 to match the ascii "'", because I couldn't find how

> to quote this properly in the awk script.

> 

> OK for trunk?

OK.
jeff
diff mbox series

Patch

diff --git a/contrib/test_summary b/contrib/test_summary
index 5fc49f5..3560a64 100755
--- a/contrib/test_summary
+++ b/contrib/test_summary
@@ -103,14 +103,15 @@  BEGIN {
 NR == 1 {
     configflags = $0 " ";
     srcdir = configflags;
-    sub(/\/configure .*/, "", srcdir);
+    sub(/\/configure\047? .*/, "", srcdir);
+    sub(/^\047/, "", srcdir);
     if ( system("test -f " srcdir "/LAST_UPDATED") == 0 ) {
         printf "LAST_UPDATED: ";
         system("tail -1 " srcdir "/LAST_UPDATED");
         print "";
     }
 
-    sub(/^[^ ]*\/configure */, " ", configflags);
+    sub(/^[^ ]*\/configure\047? */, " ", configflags);
     sub(/,;t t $/, " ", configflags);
     sub(/ --with-gcc-version-trigger=[^ ]* /, " ", configflags);
     sub(/ --norecursion /, " ", configflags);