[Reproducible-builds] Bug#792988: xbs: please make the build reproducible

Maria Valentina Marin marivalenm at gmail.com
Mon Jul 20 11:41:48 UTC 2015


Source: xbs
Version: 0-9
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that xbs could not be built reproducibly.

The attached patch sets the mtimes of all files which are modified
during the built to the date of the last changelog entry in order to
produce files with reproducible metadata. Once applied, xbs can be built
reproducibly in our current experimental framework.


Cheers,
akira

[1]: https://wiki.debian.org/ReproducibleBuilds



-------------- next part --------------
diff -Nru xbs-0/debian/changelog xbs-0/debian/changelog
--- xbs-0/debian/changelog	2015-03-07 23:59:59.000000000 +0100
+++ xbs-0/debian/changelog	2015-07-14 15:14:23.000000000 +0200
@@ -1,3 +1,10 @@
+xbs (0-9.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages
+
+ -- akira <marivalenm at gmail.com>  Tue, 14 Jul 2015 15:13:30 +0200
+
 xbs (0-9) unstable; urgency=low
 
   * patch from Sylvestre Ledru <sylvestre at debian.org> to make this build
diff -Nru xbs-0/debian/rules xbs-0/debian/rules
--- xbs-0/debian/rules	2015-03-07 23:58:40.000000000 +0100
+++ xbs-0/debian/rules	2015-07-14 15:13:21.000000000 +0200
@@ -7,6 +7,8 @@
 
 ddir=`pwd`/debian/tmp
 
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+
 build:
 	$(checkdir)
 	make 
@@ -70,6 +72,8 @@
 # clean permissions and build
 	chown -R root:root debian/tmp
 	chmod -R go=rX debian/tmp
+	find debian/tmp -newermt '$(BUILD_DATE)' -print0 | \
+		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 	dpkg --build debian/tmp ..
 
 define checkdir


More information about the Reproducible-builds mailing list