Fix archive script to set timestamps properly for .tar.gz
By default they are set to Jan 1 1970 which breaks homebrew. Fixes #124.
This commit is contained in:
parent
91bf70231a
commit
d2deb420bc
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import os.path
|
||||
import sys
|
||||
import tarfile
|
||||
import time
|
||||
import zipfile
|
||||
import StringIO
|
||||
|
||||
|
@ -29,6 +30,7 @@ def write_tar(target, arcprefix, sources, compression):
|
|||
path = os.path.join(arcprefix, source)
|
||||
info = tarfile.TarInfo(path)
|
||||
info.size = len(data)
|
||||
info.mtime = time.time()
|
||||
archive.addfile(info, StringIO.StringIO(data))
|
||||
|
||||
if len(sys.argv) < 4:
|
||||
|
@ -43,4 +45,4 @@ if target.endswith('.zip'):
|
|||
elif target.endswith('.tar.gz') or target.endswith('.tar.bz2'):
|
||||
write_tar(target, arcprefix, sources, compression = os.path.splitext(target)[1][1:])
|
||||
else:
|
||||
raise NotImplementedError('File type not supported: ' + target)
|
||||
raise NotImplementedError('File type not supported: ' + target)
|
||||
|
|
Loading…
Add table
Reference in a new issue