[Reproducible-commits] [wheel] 03/03: Added patch to make whl files reproducible

Holger Levsen holger at moszumanska.debian.org
Mon Mar 23 12:57:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch pu/reproducible_builds
in repository wheel.

commit 7bf924f1536cd0edab18f2ce487ae64d3c93b073
Author: Reiner Herrmann <reiner at reiner-h.de>
Date:   Mon Mar 23 13:56:24 2015 +0100

    Added patch to make whl files reproducible
---
 debian/changelog                            |  6 ++++
 debian/patches/reproducible_whl_files.patch | 44 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 3 files changed, 51 insertions(+)

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 <reiner at reiner-h.de>  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 <reiner at reiner-h.de>
+
+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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/wheel.git



More information about the Reproducible-commits mailing list