[deng] 03/03: Make the build reproducible.

Markus Koschany apo at moszumanska.debian.org
Thu Jun 1 22:43:28 UTC 2017


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

apo pushed a commit to branch master
in repository deng.

commit ee4308d0e20dbc01dbce919587c776179b955e05
Author: Markus Koschany <apo at debian.org>
Date:   Fri Jun 2 00:24:05 2017 +0200

    Make the build reproducible.
    
    Thanks: Chris Lamb for the report and patch.
    Closes: #858333
---
 debian/changelog                        |  2 ++
 debian/patches/reproducible-build.patch | 38 +++++++++++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 3 files changed, 41 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6275430..1f4d202 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ doomsday (1.15.8-5) unstable; urgency=medium
   * Add mo-thinker-NULL-pointer.patch and fix another segfault.
     Thanks to Hans Joachim Desserud for the report and Bernhard Übelacker for
     the patch. (Closes: #863536)
+  * Make the build reproducible. Thanks to Chris Lamb for the report and patch.
+    (Closes: #858333)
 
  -- Markus Koschany <apo at debian.org>  Thu, 01 Jun 2017 23:42:23 +0200
 
diff --git a/debian/patches/reproducible-build.patch b/debian/patches/reproducible-build.patch
new file mode 100644
index 0000000..3a25656
--- /dev/null
+++ b/debian/patches/reproducible-build.patch
@@ -0,0 +1,38 @@
+From: Chris Lamb <lamby at debian.org>
+Date: Fri, 2 Jun 2017 00:22:54 +0200
+Subject: reproducible build
+
+Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858333
+Forwarded: https://github.com/skyjake/Doomsday-Engine/pull/16
+---
+ doomsday/build/scripts/buildpackage.py | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/doomsday/build/scripts/buildpackage.py b/doomsday/build/scripts/buildpackage.py
+index 5e76928..133384d 100755
+--- a/doomsday/build/scripts/buildpackage.py
++++ b/doomsday/build/scripts/buildpackage.py
+@@ -7,7 +7,7 @@
+ #   buildpackage (pack-dir) (output-dir)
+ #
+ 
+-import sys, os, os.path, zipfile
++import sys, os, os.path, zipfile, time
+ 
+ if len(sys.argv) < 2:
+     print "Usage: %s (pack-dir) (output-dir)" % sys.argv[0]
+@@ -58,9 +58,12 @@ class Package:
+             sys.exit(1)
+         
+         # Write entries in alphabetical order.
++        date_time = time.localtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
+         for full, internal in sorted(contents):
+-            os.chmod(full, 0644)
+-            pack.write(full, internal)
++            info = zipfile.ZipInfo(internal, date_time)
++            info.external_attr = 0644 << 16L
++            with open(full, 'rb') as f:
++                pack.writestr(info, f.read())
+             
+         # Write it out.
+         print "Wrote %s (contains %i files)." % (outputName, len(pack.namelist()))
diff --git a/debian/patches/series b/debian/patches/series
index 30c1b9d..cbd6709 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@ no-timestamps.patch
 no-shlibexits.patch
 Node-parent-NULL-pointer.patch
 mo-thinker-NULL-pointer.patch
+reproducible-build.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/deng.git



More information about the Pkg-games-commits mailing list