[Reproducible-builds] Bug#831779: python-docutils: please make the output of rst2man reproducible

Chris Lamb lamby at debian.org
Tue Jul 19 10:39:32 UTC 2016


Source: python-docutils
Version: 0.12+dfsg-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: toolchain
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org

Hi,

Whilst working on the "reproducible builds" effort [0], we noticed
that python-docutils generates non-reproducible output via rst2man.

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/docutils/parsers/rst/directives/misc.py b/docutils/parsers/rst/directives/misc.py
index 643bc70..33194d5 100644
--- a/docutils/parsers/rst/directives/misc.py
+++ b/docutils/parsers/rst/directives/misc.py
@@ -477,7 +477,10 @@ class Date(Directive):
             except UnicodeEncodeError:
                 raise self.warning(u'Cannot encode date format string '
                     u'with locale encoding "%s".' % locale_encoding)
-        text = time.strftime(format_str)
+        text = time.strftime(
+            format_str,
+            time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))),
+        )
         if sys.version_info< (3, 0):
             # `text` is a byte string that may contain non-ASCII characters:
             try:


More information about the Reproducible-builds mailing list