Source: python-docutils
Version: 0.12+dfsg-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: toolchain
X-Debbugs-Cc: reproducible-builds@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
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
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:
_______________________________________________
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