diff options
author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-05-16 00:08:42 +0700 |
---|---|---|
committer | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-08-17 01:49:12 +0000 |
commit | a8d39f151d10209bca94c7533786dcc9c55c9517 (patch) | |
tree | cea910dda3c0276609155b1b15a3c380bbbf9223 /src/race.bash | |
parent | 1951afc9193f8e197cb7dfaf6afed70ea02404cb (diff) | |
download | go-a8d39f151d10209bca94c7533786dcc9c55c9517.tar.gz go-a8d39f151d10209bca94c7533786dcc9c55c9517.zip |
src: simplify race.bash checking condition
By using "uname -s -m" to get the OS name and hardware name,
then using it to match supported platform in case command.
Change-Id: I5161a29c6f3fe34dcda9e7bd477fa3b772b9e041
Reviewed-on: https://go-review.googlesource.com/c/go/+/320250
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/race.bash')
-rwxr-xr-x | src/race.bash | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/src/race.bash b/src/race.bash index 81fb4be606..f795ec9b7b 100755 --- a/src/race.bash +++ b/src/race.bash @@ -13,35 +13,16 @@ function usage { exit 1 } -case $(uname) in -"Darwin") - if [ $(uname -m) != "x86_64" ] && [ $(uname -m) != "arm64" ]; then - usage - fi - ;; -"Linux") - if [ $(uname -m) != "x86_64" ] && [ $(uname -m) != "ppc64le" ] && [ $(uname -m) != "aarch64" ]; then - usage - fi - ;; -"FreeBSD") - if [ $(uname -m) != "amd64" ]; then - usage - fi - ;; -"NetBSD") - if [ $(uname -m) != "amd64" ]; then - usage - fi - ;; -"OpenBSD") - if [ $(uname -m) != "amd64" ]; then - usage - fi - ;; -*) - usage - ;; +case $(uname -s -m) in + "Darwin x86_64") ;; + "Darwin arm64") ;; + "Linux x86_64") ;; + "Linux ppc64le") ;; + "Linux aarch64") ;; + "FreeBSD amd64") ;; + "NetBSD amd64") ;; + "OpenBSD amd64") ;; + *) usage ;; esac if [ ! -f make.bash ]; then |