[Reproducible-builds] [strip-nondeterminism] 01/01: Add a zip handler
Andrew Ayer
agwa-guest at moszumanska.debian.org
Fri Aug 29 16:43:15 UTC 2014
This is an automated email from the git hooks/post-receive script.
agwa-guest pushed a commit to branch master
in repository strip-nondeterminism.
commit bab6eabd7da51af6a3e0aedb021812d22ee17d51
Author: Andrew Ayer <agwa at andrewayer.name>
Date: Fri Aug 29 09:40:00 2014 -0700
Add a zip handler
---
handlers/zip | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/handlers/zip b/handlers/zip
new file mode 100755
index 0000000..7a1dba0
--- /dev/null
+++ b/handlers/zip
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+
+from zipfile import ZipFile
+import sys
+
+with ZipFile(sys.stdout, 'w') as outzip:
+ with ZipFile(sys.stdin, 'r') as inzip:
+ for info in sorted(inzip.infolist(), key=lambda info: info.filename):
+ # 1980-01-01 is the earliest date that the zip format supports
+ info.date_time = (1980, 1, 1, 0, 0, 0)
+ content = inzip.read(info.filename)
+ outzip.writestr(info, content)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/strip-nondeterminism.git
More information about the Reproducible-builds
mailing list