##// END OF EJS Templates
retar correctly xz
Matthias Bussonnier -
Show More
@@ -58,7 +58,7 b' classifiers ='
58 58 Programming Language :: Python
59 59 Programming Language :: Python :: 3
60 60 Programming Language :: Python :: 3 :: Only
61 Topic :: System :: Shell
61 Topic :: System :: Shells
62 62
63 63
64 64 [options]
@@ -17,6 +17,7 b' def build_release():'
17 17 sh(sdists)
18 18 buildwheels()
19 19 sh(' '.join([sys.executable, 'tools/retar.py', 'dist/*.gz']))
20 sh(' '.join([sys.executable, 'tools/retar.py', 'dist/*.xz']))
20 21
21 22 if __name__ == '__main__':
22 23 build_release()
@@ -63,7 +63,7 b" if 'upload' in sys.argv:"
63 63 # Make target dir if it doesn't exist
64 64 print('1. Uploading IPython to archive.ipython.org')
65 65 sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version))
66 sh('scp *.tar.gz *.whl %s' % release_site)
66 sh('scp *.tar.gz *.tar.xz *.whl %s' % release_site)
67 67
68 68 print('2. Uploading backup files...')
69 69 cd(ipbackupdir)
@@ -35,7 +35,11 b' old_buf = io.BytesIO()'
35 35 with open(path, "rb") as f:
36 36 old_buf.write(f.read())
37 37 old_buf.seek(0)
38 old = tarfile.open(fileobj=old_buf, mode="r:gz")
38 if path.name.endswith("gz"):
39 r_mode = "r:gz"
40 if path.name.endswith(("xz", "xz2")):
41 r_mode = "r:xz"
42 old = tarfile.open(fileobj=old_buf, mode=r_mode)
39 43
40 44 buf = io.BytesIO()
41 45 new = tarfile.open(fileobj=buf, mode="w", format=tarfile.GNU_FORMAT)
@@ -46,6 +50,7 b' for i, m in enumerate(old):'
46 50 continue
47 51 m2 = tarfile.TarInfo(m.name)
48 52 m2.mtime = min(timestamp, m.mtime)
53 m2.pax_headers["mtime"] = m2.mtime
49 54 m2.size = m.size
50 55 m2.type = m.type
51 56 m2.linkname = m.linkname
@@ -59,9 +64,19 b' new.close()'
59 64 old.close()
60 65
61 66 buf.seek(0)
62 with open(path, "wb") as f:
63 with gzip.GzipFile('', "wb", fileobj=f, mtime=timestamp) as gzf:
64 gzf.write(buf.read())
67
68 if r_mode == "r:gz":
69 with open(path, "wb") as f:
70 with gzip.GzipFile("", "wb", fileobj=f, mtime=timestamp) as gzf:
71 gzf.write(buf.read())
72 elif r_mode == "r:xz":
73 import lzma
74
75 with lzma.open(path, "wb") as f:
76 f.write(buf.read())
77
78 else:
79 assert False
65 80
66 81 # checks the archive is valid.
67 82 archive = tarfile.open(path)
@@ -18,7 +18,7 b" archive = '%s:%s' % (archive_user, archive_dir)"
18 18
19 19 # Build commands
20 20 # Source dists
21 sdists = "{python} setup.py sdist --formats=xztar".format(python=sys.executable)
21 sdists = "{python} setup.py sdist --formats=xztar,gztar".format(python=sys.executable)
22 22 # Binary dists
23 23 def buildwheels():
24 24 sh("{python} setup.py bdist_wheel".format(python=sys.executable))
General Comments 0
You need to be logged in to leave comments. Login now