Source: kmod
Version: 20-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps

Hi!

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

The attached patch sets a revision date for each manpage to avoid the
current date to be captured. Once applied, kmod can be built
reproducibly in our current experimental framework.

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

-- 
Lunar                                .''`. 
lu...@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
From b99468b0ed53641128430843b036870ce59eae8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lu...@debian.org>
Date: Wed, 22 Apr 2015 22:07:40 +0000
Subject: [PATCH] Make the package build reproducibly

Add revision date extracted from Git to manpages in order to make them stable
one build to another.
---
 debian/changelog                      |   8 +++
 debian/patches/manpages_revision_date | 127 ++++++++++++++++++++++++++++++++++
 debian/patches/series                 |   1 +
 3 files changed, 136 insertions(+)
 create mode 100644 debian/patches/manpages_revision_date

diff --git a/debian/changelog b/debian/changelog
index 085d6bd..4686cbc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+kmod (20-1.0~reproducible1) UNRELEASED; urgency=low
+
+  * Make the package build reproducibly:
+    - Add revision date extracted from Git to manpages in order
+      to make them stable one build to another.
+
+ -- Jérémy Bobbio <lu...@debian.org>  Wed, 22 Apr 2015 22:06:45 +0000
+
 kmod (20-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/manpages_revision_date b/debian/patches/manpages_revision_date
new file mode 100644
index 0000000..601d9d2
--- /dev/null
+++ b/debian/patches/manpages_revision_date
@@ -0,0 +1,127 @@
+Magic command to add revision date:
+
+    for i in $(git grep -L '<date>' -- 'man/*.xml'); do
+        revdate=$(git log -1 --date=short --pretty='%cd' $i);
+        sed -e "s,^  </refentryinfo>,    <date>$revdate</date>\n\0," -i $i;
+    done
+
+diff --git a/man/depmod.d.xml b/man/depmod.d.xml
+index c30c06c..9844be2 100644
+--- a/man/depmod.d.xml
++++ b/man/depmod.d.xml
+@@ -26,6 +26,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-01-02</date>
+   </refentryinfo>
+ 
+   <refmeta>
+diff --git a/man/depmod.xml b/man/depmod.xml
+index 0668aea..76b29c8 100644
+--- a/man/depmod.xml
++++ b/man/depmod.xml
+@@ -27,6 +27,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-09-20</date>
+   </refentryinfo>
+ 
+   <refmeta>
+diff --git a/man/insmod.xml b/man/insmod.xml
+index 8ff4e20..e3fada2 100644
+--- a/man/insmod.xml
++++ b/man/insmod.xml
+@@ -21,6 +21,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-01-24</date>
+   </refentryinfo>
+ 
+   <refmeta>
+diff --git a/man/kmod.xml b/man/kmod.xml
+index 0706ad5..1089078 100644
+--- a/man/kmod.xml
++++ b/man/kmod.xml
+@@ -15,6 +15,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-09-22</date>
+   </refentryinfo>
+ 
+   <refmeta>
+diff --git a/man/lsmod.xml b/man/lsmod.xml
+index 8815a7e..c6037c8 100644
+--- a/man/lsmod.xml
++++ b/man/lsmod.xml
+@@ -21,6 +21,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-01-02</date>
+   </refentryinfo>
+ 
+   <refmeta>
+diff --git a/man/modinfo.xml b/man/modinfo.xml
+index 9fe0324..23b47d4 100644
+--- a/man/modinfo.xml
++++ b/man/modinfo.xml
+@@ -21,6 +21,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-01-02</date>
+   </refentryinfo>
+ 
+   <refmeta>
+diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml
+index 47878e2..0686d83 100644
+--- a/man/modprobe.d.xml
++++ b/man/modprobe.d.xml
+@@ -26,6 +26,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-05-13</date>
+   </refentryinfo>
+ 
+ 
+diff --git a/man/modprobe.xml b/man/modprobe.xml
+index 9cb4476..ce77ebe 100644
+--- a/man/modprobe.xml
++++ b/man/modprobe.xml
+@@ -27,6 +27,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-03-06</date>
+   </refentryinfo>
+ 
+   <refmeta>
+diff --git a/man/modules.dep.xml b/man/modules.dep.xml
+index e53293a..327abef 100644
+--- a/man/modules.dep.xml
++++ b/man/modules.dep.xml
+@@ -20,6 +20,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-03-06</date>
+   </refentryinfo>
+ 
+   <refmeta>
+diff --git a/man/rmmod.xml b/man/rmmod.xml
+index 14c94dd..532bd2e 100644
+--- a/man/rmmod.xml
++++ b/man/rmmod.xml
+@@ -21,6 +21,7 @@
+         <email>lucas.de.mar...@gmail.com</email>
+       </author>
+     </authorgroup>
++    <date>2014-01-26</date>
+   </refentryinfo>
+ 
+   <refmeta>
diff --git a/debian/patches/series b/debian/patches/series
index a136e4a..283f6f2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,7 @@
 # fixes to be pushed upstream
 verbose_missing_bin
 check_builtin_kver
+manpages_revision_date
 
 # features to be pushed upstream
 
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to