]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: don't use "uname -v" to recognize GOHOSTARCH
authorMikio Hara <mikioh.mikioh@gmail.com>
Mon, 16 Feb 2015 14:14:34 +0000 (23:14 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Mon, 16 Feb 2015 18:58:34 +0000 (18:58 +0000)
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>
src/cmd/dist/util.go

index e686e42fe1ead68d0d821e3f85d7cab6578f6e55..f6f0b42e9eb9fb855a490eb25ba417e3f4c64205 100644 (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: