diff mbox

[BUILDROBOT] config-list.mk: Extract target name correctly

Message ID 88380a061d941fc087e45b9bf0b8e0a49ff8490e.1419879683.git.jbglaw@lug-owl.de
State New
Headers show

Commit Message

Jan-Benedict Glaw Dec. 29, 2014, 8:02 p.m. UTC
Hi!

With my last change, `sed' is used to cut out the target name from a listed
target. Since there may be additional OPTions encoded in the "target", I tried
to get only the first submatch before an `OPT'. However, `sed' uses longest
match, so I'm re-writing this using awk.

  If anybody is like using `gawk' or anything different, please feel free to
drop another patch. Since this is usually called by hand or by robots under
review, I don't see much of a problem here.

2014-12-29  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

contrib/
       * config-list.mk: Use shortest match for OPT to find the actual
       target name.
---
 contrib/ChangeLog      | 5 +++++
 contrib/config-list.mk | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Jeff Law Jan. 5, 2015, 5:34 p.m. UTC | #1
On 12/29/14 13:02, Jan-Benedict Glaw wrote:
> Hi!
>
> With my last change, `sed' is used to cut out the target name from a listed
> target. Since there may be additional OPTions encoded in the "target", I tried
> to get only the first submatch before an `OPT'. However, `sed' uses longest
> match, so I'm re-writing this using awk.
>
>    If anybody is like using `gawk' or anything different, please feel free to
> drop another patch. Since this is usually called by hand or by robots under
> review, I don't see much of a problem here.
>
> 2014-12-29  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
>
> contrib/
>         * config-list.mk: Use shortest match for OPT to find the actual
>         target name.
OK.

Jeff
diff mbox

Patch

diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index f2d21db..d49f3e2 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,8 @@ 
+2014-12-29  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
+
+	* config-list.mk: Use shortest match for OPT to find the actual
+	target name.
+
 2014-12-17  Sergio Durigan Junior  <sergiodj@redhat.com>
 
 	* dg-extract-results.sh: Use --text with grep to avoid issues with
diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index 16900e1..db2bad0 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -97,8 +97,7 @@  $(LIST): make-log-dir
 	-mkdir $@
 	(											\
 		cd $@ &&									\
-		echo $@ &&									\
-		TGT=`echo $@ | sed -e 's/^\(.*\)OPT.*$$/\1/'` &&				\
+		TGT=`echo $@ | awk 'BEGIN { FS = "OPT" }; { print $$1 }'` &&			\
 		TGT=`../../gcc/config.sub $$TGT` &&						\
 		case $$TGT in									\
 			*-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*)			\