Hi,

Another small issue was found, which is fixed by the attached patch.
Please use this one instead of the previously submitted.

Regards,
 Reiner
diff --git a/debian/changelog b/debian/changelog
index 7023d20..c6881b4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+wheel (0.24.0-1.0~reproducible2) UNRELEASED; urgency=low
+
+  * Added patch to make whl files reproducible
+
+ -- Reiner Herrmann <[email protected]>  Fri, 23 Jan 2015 19:25:31 +0100
+
 wheel (0.24.0-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/reproducible_whl_files.patch b/debian/patches/reproducible_whl_files.patch
new file mode 100644
index 0000000..9ce3729
--- /dev/null
+++ b/debian/patches/reproducible_whl_files.patch
@@ -0,0 +1,44 @@
+Description: Generate reproducible wheel files
+ - Sort the entries of metadata.json
+ - Use fixed timestamps for files in archive
+Author: Reiner Herrmann <[email protected]>
+
+Index: wheel-0.24.0/wheel/archive.py
+===================================================================
+--- wheel-0.24.0.orig/wheel/archive.py
++++ wheel-0.24.0/wheel/archive.py
+@@ -39,6 +39,8 @@ def make_wheelfile_inner(base_name, base
+     deferred = []
+ 
+     def writefile(path):
++        tstamp = 315576060  # earliest supported date by zip (1.1.1980)
++        os.utime(path, (tstamp, tstamp))
+         zip.write(path, path)
+         log.info("adding '%s'" % path)
+ 
+Index: wheel-0.24.0/wheel/bdist_wheel.py
+===================================================================
+--- wheel-0.24.0.orig/wheel/bdist_wheel.py
++++ wheel-0.24.0/wheel/bdist_wheel.py
+@@ -409,7 +409,7 @@ class bdist_wheel(Command):
+             pymeta['extensions']['python.details']['document_names']['license'] = license_filename
+ 
+         with open(metadata_json_path, "w") as metadata_json:
+-            json.dump(pymeta, metadata_json)
++            json.dump(pymeta, metadata_json, sort_keys=True)
+ 
+         adios(egginfo_path)
+ 
+Index: wheel-0.24.0/wheel/metadata.py
+===================================================================
+--- wheel-0.24.0.orig/wheel/metadata.py
++++ wheel-0.24.0/wheel/metadata.py
+@@ -69,7 +69,7 @@ def handle_requires(metadata, pkg_info,
+ 
+     if may_requires:
+         metadata['run_requires'] = []
+-        for key, value in may_requires.items():
++        for key, value in sorted(may_requires.items()):
+             may_requirement = {'requires':value}
+             if key.extra:
+                 may_requirement['extra'] = key.extra
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a435ba8
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+reproducible_whl_files.patch

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to