]> Cypherpunks repositories - gostls13.git/commitdiff
misc/ios: more predictable zoneinfo.zip location
authorDavid Crawshaw <crawshaw@golang.org>
Mon, 2 Mar 2015 21:05:11 +0000 (16:05 -0500)
committerDavid Crawshaw <crawshaw@golang.org>
Tue, 3 Mar 2015 01:49:56 +0000 (01:49 +0000)
See golang.org/cl/6511.

Change-Id: I2145a42877ed6b78400f29c2ef18969870dab5c3
Reviewed-on: https://go-review.googlesource.com/6512
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
misc/ios/go_darwin_arm_exec.go

index 27e6b329e8ba1ff0080c297a050ac018d039ce28..bca8f16e508305f87bea5b01a9de3857d8a77e23 100644 (file)
@@ -406,10 +406,17 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
        }
 
        // Copy timezone file.
+       //
+       // Typical apps have the zoneinfo.zip in the root of their app bundle,
+       // read by the time package as the working directory at initialization.
+       // As we move the working directory to the GOROOT pkg directory, we
+       // install the zoneinfo.zip file in the pkgpath.
        if underGoRoot {
-               dst := filepath.Join(dstbase, "lib", "time")
-               os.MkdirAll(dst, 0755)
-               if err := cp(dst, filepath.Join(cwd, "lib", "time", "zoneinfo.zip")); err != nil {
+               err := cp(
+                       filepath.Join(dstbase, pkgpath),
+                       filepath.Join(cwd, "lib", "time", "zoneinfo.zip"),
+               )
+               if err != nil {
                        return "", err
                }
        }