1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:04:43 -07:00

cmd/dist: don't use "uname -v" to recognize GOHOSTARCH

We can use processor architecture or hardware platform as part of
hostname and it leads to misconfiguration of GOHOSARCH.

For example,

$ uname -m -v
FreeBSD 10.1-RELEASE-p5 #0: Tue Jan 27 08:52:50 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386

Change-Id: I499efd98338beff6a27c03f03273331ecb6fd698
Reviewed-on: https://go-review.googlesource.com/4944
Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
Mikio Hara 2015-02-16 23:14:34 +09:00
parent 194ad16b83
commit 18f273ff92

View File

@ -376,7 +376,7 @@ func main() {
if gohostarch == "" {
// Default Unix system.
out := run("", CheckExit, "uname", "-m", "-v")
out := run("", CheckExit, "uname", "-m")
switch {
case strings.Contains(out, "x86_64"), strings.Contains(out, "amd64"):
gohostarch = "amd64"
@ -389,7 +389,7 @@ func main() {
case strings.Contains(out, "ppc64"):
gohostarch = "ppc64"
case gohostos == "darwin":
if strings.Contains(out, "RELEASE_ARM_") {
if strings.Contains(run("", CheckExit, "uname", "-v"), "RELEASE_ARM_") {
gohostarch = "arm"
}
default: