]> Cypherpunks repositories - gostls13.git/commitdiff
misc/dist: fix Windows breakage
authorJoe Poirier <jdpoirier@gmail.com>
Sun, 17 Mar 2013 21:56:38 +0000 (08:56 +1100)
committerAndrew Gerrand <adg@golang.org>
Sun, 17 Mar 2013 21:56:38 +0000 (08:56 +1100)
The files could use some attention on the
Windows side but better to wait until after
the upcoming release.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7621044

misc/dist/bindist.go

index 29454c73cf05881a4331c1498994a2a530aaa99a..2d633bef97227479e94f226a5affcc62811001c5 100644 (file)
@@ -386,9 +386,13 @@ func (b *Build) tour() error {
        }
 
        // Copy gotour binary to tool directory as "tour"; invoked as "go tool tour".
+       gotour := "gotour"
+       if runtime.GOOS == "windows" {
+               gotour = "gotour.exe"
+       }
        return cp(
                filepath.Join(b.root, "pkg", "tool", b.OS+"_"+b.Arch, "tour"),
-               filepath.Join(b.gopath, "bin", "gotour"),
+               filepath.Join(b.gopath, "bin", gotour),
        )
 }
 
@@ -620,8 +624,11 @@ func cp(dst, src string) error {
                return err
        }
        defer df.Close()
-       if err := df.Chmod(fi.Mode()); err != nil {
-               return err
+       // Windows doesn't currently implement Fchmod
+       if runtime.GOOS != "windows" {
+               if err := df.Chmod(fi.Mode()); err != nil {
+                       return err
+               }
        }
        _, err = io.Copy(df, sf)
        return err