Edgewall Software

Opened 11 years ago

Closed 11 years ago

#11162 closed defect (fixed)

Zip archive with wrong timestamp on non-GMT timezone — at Version 2

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: version control/changeset view Version: 0.12-stable
Severity: normal Keywords: zip
Cc: Branch:
Release Notes:

Add "extended-timestamp" extra field for zip archive of a changeset.

API Changes:
Internal Changes:

Description

Trac creates zip archive with wrong timestamp on non-GMT timezone.

The last modified time for entry in zip archive has no timezone. Trac creates the time as UTC in the archive. Also most unzip utilities extract the last modified time as localtime. As a result, the both times are different.

The issue can be solved by the "extended-timestamp" extra field which is for last modified time of the entry in unix time. Zip utility extracts correct time with the field. The field is defined in http://www.opensource.apple.com/source/zip/zip-6/unzip/unzip/proginfo/extra.fld.

Mercurial had the same issue in hg archive. It is already fixed. See http://bz.selenic.com/show_bug.cgi?id=3600.

$ TZ=GMT-2 svn log -r9 file:///home/jun66j5/var/svn/svnrepos.dump
------------------------------------------------------------------------
r9 | Administrator | 2005-04-22 10:59:24 +0200 (Fri, 22 Apr 2005) | 1 line

Now that's the fix
------------------------------------------------------------------------
$ TZ=GMT-2 unzip -l changeset_9.zip
Archive:  changeset_9.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       16  04-22-2005 08:59   branches/v1x/README.txt
---------                     -------
       16                     1 file
$ TZ=GMT-2 unzip -x changeset_9.zip -d tmp
Archive:  changeset_9.zip
  inflating: tmp/branches/v1x/README.txt
$ TZ=GMT-2 ls -l --full-time tmp/branches/v1x/README.txt
-rw-r--r-- 1 jun66j5 groove 16 2005-04-22 08:59:24.000000000 +0200 tmp/branches/v1x/README.txt

2005-04-22 10:59:24 +0200 (committed time) != 2005-04-22 08:59:24.000000000 +0200 (last modified time).

Change History (2)

comment:1 by Jun Omae, 11 years ago

Component: generalversion control/changeset view
Owner: set to Jun Omae
Status: newassigned

After log:jomae.git:ticket11162/0.12 and log:jomae.git:ticket11162/1.0, unzip utility extracts correct times.

log:jomae.git:ticket11162/0.12

$ TZ=GMT-2 unzip -l changeset_9_trac0.12.zip
Archive:  changeset_9_trac0.12.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
       16  04-22-05 10:59   branches/v1x/README.txt
 --------                   -------
       16                   1 file
$ TZ=GMT-2 unzip -x changeset_9_trac0.12.zip -d tmp_trac0.12
Archive:  changeset_9_trac0.12.zip
  inflating: tmp_trac0.12/branches/v1x/README.txt
$ TZ=GMT-2 ls -l --full-time tmp_trac0.12/branches/v1x/README.txt
-rw-r--r-- 1 jun66j5 groove 16 2005-04-22 10:59:24.000000000 +0200 tmp_trac0.12/branches/v1x/README.txt

log:jomae.git:ticket11162/1.0

$ TZ=GMT-2 unzip -l changeset_9_trac1.0.zip
Archive:  changeset_9_trac1.0.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
       16  04-22-05 10:59   branches/v1x/README.txt
 --------                   -------
       16                   1 file
$ TZ=GMT-2 unzip -x changeset_9_trac1.0.zip -d tmp_trac1.0
Archive:  changeset_9_trac1.0.zip
  inflating: tmp_trac1.0/branches/v1x/README.txt
$ TZ=GMT-2 ls -l --full-time tmp_trac1.0/branches/v1x/README.txt
-rw-r--r-- 1 jun66j5 groove 16 2005-04-22 10:59:24.000000000 +0200 tmp_trac1.0/branches/v1x/README.txt

comment:2 by Jun Omae, 11 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [11811-11813].

Note: See TracTickets for help on using tickets.