From 322b9d710a4429c1ea838c836bdb923ece84de2a Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sat, 18 Mar 2017 22:44:30 -0700 Subject: [PATCH] cmd/toolstash: use 'go tool dist list' to get platforms This fixes several issues: * The ls sed hackery generates GOARCH values mipsx and mipsxle, instead of mips, mips64, mipsle, and mips64le. * It removes the dependence on the 9 command. * It marginally increases readability. Change-Id: Ie46abc289c2c9923eed693dcf1194f4fd3ea9bd2 Reviewed-on: https://go-review.googlesource.com/38347 Reviewed-by: Matthew Dempsky --- cmd/toolstash/buildall | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/toolstash/buildall b/cmd/toolstash/buildall index 65c68464..d8ec2210 100755 --- a/cmd/toolstash/buildall +++ b/cmd/toolstash/buildall @@ -37,9 +37,12 @@ if [ "$pattern" = "" ]; then pattern=. fi +targets="$(go tool dist list; echo linux/386/387)" +targets="$(echo "$targets" | tr '/' '-' | sort | egrep "$pattern" | egrep -v 'android-arm|darwin-arm')" + # put linux, nacl first in the target list to get all the architectures up front. -targets="$((ls runtime | 9 sed -n 's/^rt0_(.*)_(.*)\.s/\1-\2/p'; echo linux-386-387) | sort | egrep -v android-arm | egrep "$pattern" | egrep 'linux|nacl') - $(ls runtime | 9 sed -n 's/^rt0_(.*)_(.*)\.s/\1-\2/p' | egrep -v 'android-arm|darwin-arm' | egrep "$pattern" | egrep -v 'linux|nacl')" +targets="$(echo "$targets" | egrep 'linux|nacl') $(echo "$targets" | egrep -v 'linux|nacl')" + if [ "$sete" = true ]; then set -e fi