]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgo: use POSIX shell arithmetic expansion
authorIan Lance Taylor <iant@golang.org>
Fri, 22 Jul 2022 18:38:20 +0000 (11:38 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 22 Jul 2022 18:57:18 +0000 (11:57 -0700)
Avoid bash-specific ((expression)) syntax.  As the bash syntax
converts a non-zero value to a zero status (and a zero value to a 1
status), and POSIX arithmetic expansion does not, we have to negate
the result.

Based on patch by Sören Tempel.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/419154

gcc/go/gofrontend/MERGE
libgo/match.sh
libgo/testsuite/gotest

index 5ea0406cd8ea4dbf7ff42efc737b46cc937c71d8..2f2fafde1f19ce2788d15f4fbe2e31bab45f3be9 100644 (file)
@@ -1,4 +1,4 @@
-ff68b1a147eb60082fd60c198db0ef5477ade938
+a62f20ae78ddd41be682dde8cab075ca4f5dbb2a
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 7ed587ff79423dde0208ca40b4de4b54ae84c0f1..e5ed98de422fa8006a15fc58af73ea7b93a1cdc5 100755 (executable)
@@ -111,7 +111,7 @@ gobuild() {
     if test "$goarch" != "386"; then
        line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
     fi
-    (($line))
+    return $((!($line)))
 }
 
 matched=
index 04e4267fbba26ed001424b8158dc05f104dc4f97..0a0a7e14d7442084e36b3a623743754e1cef4cd0 100755 (executable)
@@ -302,7 +302,7 @@ gobuild() {
     if test "$goarch" != "386"; then
        line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
     fi
-    (($line))
+    return $((!($line)))
 }
 
 case "x$gofiles" in