Commits

Ronald Oussoren committed afbab0a

Ensure that preserve_mtime=True actually works

  • Participants
  • Parent commits 40090c7
  • Branches branch-0.7

Comments (0)

Files changed (1)

             if not os.path.exists(destination):
                 os.mkdir(destination)
         for fn in zipio.listdir(source):
-            copy_resource(os.path.join(source, fn), 
+            copy_resource(os.path.join(source, fn),
                     os.path.join(destination, fn), dry_run=dry_run, symlink=symlink)
 
     else:
                 pass
 
             if preserve_times:
-                # XXX: copy current times
-                pass
+                mtime = zipio.getmtime(source)
+                os.utime(destination, (mtime, mtime))
 
 
 def newer(source, target):
             if force or newer(mod.filename, cfile):
                 if verbose:
                     print("byte-compiling %s to %s" % (mod.filename, dfile))
-                    
+
                 if not dry_run:
                     mkpath(os.path.dirname(cfile))
                     suffix = os.path.splitext(mod.filename)[1]
                               ("Don't know how to handle %r" % mod.filename)
             else:
                 if verbose:
-                    print("skipping byte-compilation of %s to %s" % 
+                    print("skipping byte-compilation of %s to %s" %
                           (mod.filename, dfile))
 
 SCMDIRS = ['CVS', '.svn', '.hg', '.git']
             for fn in choices:
                 if os.path.exists(fn):
                     _tools[toolname] = fn
-                    break 
+                    break
             else:
                 raise IOError("Tool %r not found"%(toolname,))