]> Cypherpunks.ru repositories - gostls13.git/commitdiff
buildall.bash: clarify target selection
authorIan Lance Taylor <iant@golang.org>
Wed, 23 Nov 2016 16:45:15 +0000 (08:45 -0800)
committerIan Lance Taylor <iant@golang.org>
Sat, 4 Feb 2017 04:34:36 +0000 (04:34 +0000)
Avoid confusing use of $(( in non-arithmetic context.

Permit added targets linux-386-387 linux-arm-arm5 to be correctly
matched against pattern argument.

Change-Id: Ib004c926457acb760c7e270fdd2f4095b1787a6d
Reviewed-on: https://go-review.googlesource.com/33492
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/buildall.bash

index a322fe537a17c631eb1329c88c7fc409746b5abd..57bee8d6a5db8cc546467102dec884d8b1f80853 100755 (executable)
@@ -35,9 +35,27 @@ fi
 ./make.bash || exit 1
 GOROOT="$(cd .. && pwd)"
 
+gettargets() {
+    ../bin/go tool dist list | sed -e 's|/|-|'
+    echo linux-386-387
+    echo linux-arm-arm5
+}
+
+selectedtargets() {
+    gettargets | egrep -v 'android-arm|darwin-arm' | egrep "$pattern"
+}
+
 # put linux, nacl first in the target list to get all the architectures up front.
-targets="$((../bin/go tool dist list | sed -n 's/^\(.*\)\/\(.*\)/\1-\2/p'; echo linux-386-387 linux-arm-arm5) | sort | egrep -v android-arm | egrep "$pattern" | egrep 'linux|nacl')
-$(../bin/go tool dist list | sed -n 's/^\(.*\)\/\(.*\)/\1-\2/p' | egrep -v 'android-arm|darwin-arm' | egrep "$pattern" | egrep -v 'linux|nacl')"
+linux_nacl_targets() {
+    selectedtargets | egrep 'linux|nacl' | sort
+}
+
+non_linux_nacl_targets() {
+    selectedtargets | egrep -v 'linux|nacl' | sort
+}
+
+# Note words in $targets are separated by both newlines and spaces.
+targets="$(linux_nacl_targets) $(non_linux_nacl_targets)"
 
 failed=false
 for target in $targets