[Reproducible-commits] [epydoc] 03/03: Added patch to honour SOURCE_DATE_EPOCH

Reiner Herrmann reiner at reiner-h.de
Thu Jul 2 18:56:46 UTC 2015


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

deki-guest pushed a commit to branch pu/reproducible_builds
in repository epydoc.

commit bd345a047be59691cd9a53103442c45728428788
Author: Reiner Herrmann <reiner at reiner-h.de>
Date:   Thu Jul 2 20:52:59 2015 +0200

    Added patch to honour SOURCE_DATE_EPOCH
---
 debian/changelog                              |  7 +++
 debian/patches/honour_source_date_epoch.patch | 72 +++++++++++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 80 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index c7d03c1..64302be 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+epydoc (3.0.1+dfsg-7.0~reproducible1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Added patch to honour SOURCE_DATE_EPOCH.
+
+ -- Reiner Herrmann <reiner at reiner-h.de>  Thu, 02 Jul 2015 20:51:39 +0200
+
 epydoc (3.0.1+dfsg-7) unstable; urgency=medium
 
   * Update Recommends and Suggests for both python-epydoc and epydoc-doc.
diff --git a/debian/patches/honour_source_date_epoch.patch b/debian/patches/honour_source_date_epoch.patch
new file mode 100644
index 0000000..31118f0
--- /dev/null
+++ b/debian/patches/honour_source_date_epoch.patch
@@ -0,0 +1,72 @@
+Author: Reiner Herrmann <reiner at reiner-h.de>
+Description: Honour SOURCE_DATE_EPOCH if available
+ Using the current date for timestamps will produce unreproducible
+ manpages. If the environment variable SOURCE_DATE_EPOCH is set,
+ as proposed by the Reproducible Builds effort [1], a deterministic
+ timestamp is avilable that can be used to embed dates.
+ .
+ [1]: https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal
+
+Index: epydoc-3.0.1+dfsg/epydoc/docwriter/html.py
+===================================================================
+--- epydoc-3.0.1+dfsg.orig/epydoc/docwriter/html.py
++++ epydoc-3.0.1+dfsg/epydoc/docwriter/html.py
+@@ -433,6 +433,14 @@ class HTMLWriter:
+                                       and d.container == doc]
+         self.indexed_docs.sort()
+ 
++        # set build time
++        self._build_time = time.gmtime()
++        if os.environ.has_key('SOURCE_DATE_EPOCH'):
++            try:
++                self._build_time = time.gmtime(int(os.environ['SOURCE_DATE_EPOCH']))
++            except ValueError:
++                pass
++
+         # Figure out the url for the top page.
+         self._top_page_url = self._find_top_page(self._top_page)
+ 
+@@ -1780,7 +1788,7 @@ class HTMLWriter:
+         >>>   #endif
+             Generated by Epydoc $epydoc.__version__$
+         >>>     if self._include_build_time:
+-            on $time.asctime()$
++            on $time.asctime(self._build_time)$
+         >>>     #endif
+         >>>   if self._include_log:
+             </a>
+Index: epydoc-3.0.1+dfsg/epydoc/docwriter/latex.py
+===================================================================
+--- epydoc-3.0.1+dfsg.orig/epydoc/docwriter/latex.py
++++ epydoc-3.0.1+dfsg/epydoc/docwriter/latex.py
+@@ -14,7 +14,7 @@ this module is the L{LatexWriter} class.
+ """
+ __docformat__ = 'epytext en'
+ 
+-import os.path, sys, time, re, textwrap, codecs
++import os.path, os, sys, time, re, textwrap, codecs
+ 
+ from epydoc.apidoc import *
+ from epydoc.compat import *
+@@ -1099,6 +1099,12 @@ class LatexWriter:
+     #////////////////////////////////////////////////////////////
+ 
+     def write_header(self, out, where):
++        build_time = time.gmtime()
++        if os.environ.has_key('SOURCE_DATE_EPOCH'):
++            try:
++                build_time = time.gmtime(int(os.environ['SOURCE_DATE_EPOCH']))
++            except ValueError:
++                pass
+         out('%\n% API Documentation')
+         if self._prj_name: out(' for %s' % self._prj_name)
+         if isinstance(where, APIDoc):
+@@ -1106,7 +1112,7 @@ class LatexWriter:
+         else:
+             out('\n%% %s' % where)
+         out('\n%%\n%% Generated by epydoc %s\n' % epydoc.__version__)
+-        out('%% [%s]\n%%\n' % time.asctime(time.localtime(time.time())))
++        out('%% [%s]\n%%\n' % time.asctime(build_time))
+ 
+     def write_start_of(self, out, section_name):
+         out('\n' + 75*'%' + '\n')
diff --git a/debian/patches/series b/debian/patches/series
index 569c18b..582d009 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ python26-tokenizer.patch
 special-latex-entries.patch
 lintian.patch
 build-time.patch
+honour_source_date_epoch.patch

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



More information about the Reproducible-commits mailing list