libgo: don't use wc in gotest
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 26 Oct 2018 02:43:35 +0000 (02:43 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 26 Oct 2018 02:43:35 +0000 (02:43 +0000)
    The wc command is not in the GNU approved list of Makefile utilities
    (https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html#Utilities-in-Makefiles).

    Reviewed-on: https://go-review.googlesource.com/c/144897

From-SVN: r265515

gcc/go/gofrontend/MERGE
libgo/testsuite/gotest

index 188ada01a3c637f162575c2a4292b66f888c6307..ada5f3f731dc520c484021d3a065c55e7fd65ef3 100644 (file)
@@ -1,4 +1,4 @@
-407a59831ea4fbfe03f0887c40497b73939e7c44
+0a58bd7d820dac8931e8da5b291f19c3c7e6bee3
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index f1309aba39a3db359282755de7420ed5a881245d..0b2e572a90562b86057e18e9c503ca1042a0d24a 100755 (executable)
@@ -518,10 +518,9 @@ symtogo() {
   local ndots=""
   for tp in $*
   do
-    s=$(echo $tp | sed -e 's/\.\.z2f/%/g' | sed -e 's/.*%//')
+    s=$(echo "$tp" | sed -e 's/\.\.z2f/%/g' | sed -e 's/.*%//')
     # screen out methods (X.Y.Z)
-    ndots=$(echo $s | sed -e 's/\./ /g' | wc -w)
-    if [ $ndots -ne 2 ]; then
+    if ! expr "$s" : '^[^.]*\.[^.]*$' >/dev/null 2>&1; then
       continue
     fi
     if [ -z "${result}" ]; then