Commit 18f273ff authored by Mikio Hara's avatar Mikio Hara

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/4944Reviewed-by: default avatarMinux Ma <minux@golang.org>
parent 194ad16b
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment