diff mbox series

libgo: Fix non-portable sed commands

Message ID 20220419180602.1155345-1-jwakely@redhat.com
State New
Headers show
Series libgo: Fix non-portable sed commands | expand

Commit Message

Jonathan Wakely April 19, 2022, 6:06 p.m. UTC
This fixes the libgo build if /usr/bin/sed is found before
/usr/xpg4/bin/sed on Solaris.

Tested sparc-sun-solaris2.11, OK for trunk?

-- >8 --

Solaris sed does not allow '^' and '$' anchors inside groups, and does
not support the '+' meta-character.

ChangeLog:

	* libgo/Makefile.am (check-tail): Fix non-portable sed command.
	* libgo/Makefile.in: Regenerate.
	* libgo/match.sh (gobuild): Fix non-portable sed command.
---
 libgo/Makefile.am | 2 +-
 libgo/Makefile.in | 2 +-
 libgo/match.sh    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Ian Lance Taylor April 19, 2022, 7:53 p.m. UTC | #1
On Tue, Apr 19, 2022 at 11:06 AM Jonathan Wakely <jwakely@redhat.com> wrote:
>
> This fixes the libgo build if /usr/bin/sed is found before
> /usr/xpg4/bin/sed on Solaris.
>
> Tested sparc-sun-solaris2.11, OK for trunk?

Thanks, already committed based on your earlier e-mail.

Ian
diff mbox series

Patch

diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index e0a1eec52a2..a5d4b6a3525 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -1305,7 +1305,7 @@  check-tail: check-recursive check-multi
 	if test "$$untested" -ne "0"; then \
 	  echo "# of untested testcases		$$untested" >> libgo.sum; \
 	fi; \
-	echo `echo $(GOC) | sed -e 's/ .*//'`  `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \
+	echo `echo $(GOC) | sed -e 's/ .*//'`  `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*\)$$/\1/p'` >> libgo.sum; \
 	echo >> libgo.log; \
 	echo "runtest completed at `date`" >> libgo.log; \
 	if test "$$fail" -ne "0"; then \
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 7bef5df90d1..22f48a52938 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -3189,7 +3189,7 @@  check-tail: check-recursive check-multi
 	if test "$$untested" -ne "0"; then \
 	  echo "# of untested testcases		$$untested" >> libgo.sum; \
 	fi; \
-	echo `echo $(GOC) | sed -e 's/ .*//'`  `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \
+	echo `echo $(GOC) | sed -e 's/ .*//'`  `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*\)$$/\1/p'` >> libgo.sum; \
 	echo >> libgo.log; \
 	echo "runtest completed at `date`" >> libgo.log; \
 	if test "$$fail" -ne "0"; then \
diff --git a/libgo/match.sh b/libgo/match.sh
index 139d0cdbe64..7ed587ff794 100755
--- a/libgo/match.sh
+++ b/libgo/match.sh
@@ -100,7 +100,7 @@  fi
 
 gobuild() {
     line=$(echo "$1" | sed -e 's|//go:build ||')
-    line=$(echo "$line" | sed -e 's/go1\.[0-9]\+/1/g' -e 's/goexperiment\./goexperiment/')
+    line=$(echo "$line" | sed -e 's/go1\.[0-9][0-9]*/1/g' -e 's/goexperiment\./goexperiment/')
     line=" $line "
     wrap='[ ()!&|]'
     for ones in $goarch $goos $cgotag $cmdlinetag gccgo goexperimentfieldtrack; do