Revert: "archive/zip: handle mtime in NTFS/UNIX/ExtendedTS extra fields"

This change reverts the following CLs:
	CL/18274: handle mtime in NTFS/UNIX/ExtendedTS extra fields
	CL/30811: only use Extended Timestamp on non-zero MS-DOS timestamps

We are reverting support for extended timestamps since the support was not
not complete. CL/18274 added full support for reading extended timestamp fields
and minimal support for writing them. CL/18274 is incomplete because it made
no changes to the FileHeader struct, so timezone information was lost when
reading and/or writing.

While CL/18274 was a step in the right direction, we should provide full
support for high precision timestamps in both the reader and writer.
This will probably require that we add a new field of type time.Time.
The complete fix is too involved to add in the time remaining for Go 1.8
and will be completed in Go 1.9.

Updates #10242
Updates #17403
Updates #18359
Fixes #18378

Change-Id: Icf6d028047f69379f7979a29bfcb319a02f4783e
Reviewed-on: https://go-review.googlesource.com/34651
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Joe Tsai 2016-12-19 17:18:45 -08:00 committed by Joe Tsai
parent 7eee512773
commit 5df59a4fc9
7 changed files with 12 additions and 154 deletions

View file

@ -65,13 +65,13 @@ var tests = []ZipTest{
{
Name: "test.txt",
Content: []byte("This is a test text file.\n"),
Mtime: "09-05-10 02:12:00",
Mtime: "09-05-10 12:12:02",
Mode: 0644,
},
{
Name: "gophercolor16x16.png",
File: "gophercolor16x16.png",
Mtime: "09-05-10 05:52:58",
Mtime: "09-05-10 15:52:58",
Mode: 0644,
},
},
@ -83,13 +83,13 @@ var tests = []ZipTest{
{
Name: "test.txt",
Content: []byte("This is a test text file.\n"),
Mtime: "09-05-10 02:12:00",
Mtime: "09-05-10 12:12:02",
Mode: 0644,
},
{
Name: "gophercolor16x16.png",
File: "gophercolor16x16.png",
Mtime: "09-05-10 05:52:58",
Mtime: "09-05-10 15:52:58",
Mode: 0644,
},
},
@ -144,17 +144,6 @@ var tests = []ZipTest{
Name: "unix.zip",
File: crossPlatform,
},
{
Name: "extra-timestamp.zip",
File: []ZipTestFile{
{
Name: "hello.txt",
Content: []byte(""),
Mtime: "01-06-16 12:25:56",
Mode: 0666,
},
},
},
{
// created by Go, before we wrote the "optional" data
// descriptor signatures (which are required by OS X)
@ -163,13 +152,13 @@ var tests = []ZipTest{
{
Name: "foo.txt",
Content: []byte("foo\n"),
Mtime: "03-09-12 00:59:10",
Mtime: "03-08-12 16:59:10",
Mode: 0644,
},
{
Name: "bar.txt",
Content: []byte("bar\n"),
Mtime: "03-09-12 00:59:12",
Mtime: "03-08-12 16:59:12",
Mode: 0644,
},
},
@ -216,13 +205,13 @@ var tests = []ZipTest{
{
Name: "foo.txt",
Content: []byte("foo\n"),
Mtime: "03-09-12 00:59:10",
Mtime: "03-08-12 16:59:10",
Mode: 0644,
},
{
Name: "bar.txt",
Content: []byte("bar\n"),
Mtime: "03-09-12 00:59:12",
Mtime: "03-08-12 16:59:12",
Mode: 0644,
},
},
@ -236,14 +225,14 @@ var tests = []ZipTest{
{
Name: "foo.txt",
Content: []byte("foo\n"),
Mtime: "03-09-12 00:59:10",
Mtime: "03-08-12 16:59:10",
Mode: 0644,
ContentErr: ErrChecksum,
},
{
Name: "bar.txt",
Content: []byte("bar\n"),
Mtime: "03-09-12 00:59:12",
Mtime: "03-08-12 16:59:12",
Mode: 0644,
},
},