Your message dated Tue, 17 May 2016 16:29:41 +0000
with message-id <[email protected]>
and subject line Bug#820895: fixed in sphinx 1.4.1-1
has caused the Debian Bug report #820895,
regarding sphinx: please extend SOURCE_DATE_EPOCH support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
820895: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820895
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: sphinx
Version: 1.3.6-2
Severity: wishlist
Tags: patch upstream
User: [email protected]
Usertags: toolchain
X-Debbugs-Cc: [email protected]

Dear Maintainer,

While working on the “reproducible builds” effort [1], we have noticed
that, even though sphinx honours the SOURCE_DATE_EPOCH environment
variable [2], this support is still incomplete: default copyright year
and gettext don't use it.

Various packages (eg. fabric, guidata) that build-depend on sphinx use a
conf.py that sets the copyright year from current time, like

  copyright = u'2006-%s, Author' % time.strftime('%Y')

This also breaks reproducibility of the building process.

The attached patch extends the SOURCE_DATE_EPOCH support in copyright
year and gettext, and corrects copyright strings that does not
corresponds to SOURCE_DATE_EPOCH, so that affected packages can be built
reproducibly without any change.

Regards,
Alexis Bienvenüe.

[1] https://wiki.debian.org/ReproducibleBuilds
[2] https://reproducible-builds.org/specs/source-date-epoch/


diff -Nru sphinx-1.3.6/debian/changelog sphinx-1.3.6/debian/changelog
--- sphinx-1.3.6/debian/changelog	2016-03-03 18:22:21.000000000 +0100
+++ sphinx-1.3.6/debian/changelog	2016-04-13 14:05:28.000000000 +0200
@@ -1,3 +1,9 @@
+sphinx (1.3.6-2.0~reproducible1) unstable; urgency=medium
+
+  * Extends SOURCE_DATE_EPOCH support to copyright year.
+
+ -- Alexis Bienvenüe <[email protected]>  Wed, 13 Apr 2016 09:45:47 +0200
+
 sphinx (1.3.6-2) unstable; urgency=medium
 
   * Use implementation of jstest from Iain Lane in hope it succeeds on
diff -Nru sphinx-1.3.6/debian/patches/correct_copyright_year_from_source_date_epoch.patch sphinx-1.3.6/debian/patches/correct_copyright_year_from_source_date_epoch.patch
--- sphinx-1.3.6/debian/patches/correct_copyright_year_from_source_date_epoch.patch	1970-01-01 01:00:00.000000000 +0100
+++ sphinx-1.3.6/debian/patches/correct_copyright_year_from_source_date_epoch.patch	2016-04-13 14:36:48.000000000 +0200
@@ -0,0 +1,45 @@
+Description: Correct copyright year from SOURCE_DATE_EPOCH
+ If the environment variable SOURCE_DATE_EPOCH is set, use it to correct
+ uncoherent copyright years that are set using strftime, which don't honour
+ SOURCE_DATE_EPOCH.
+ This helps reproducibility of packages that build-depends on sphinx.
+Author: Alexis Bienvenüe <[email protected]>
+
+Index: sphinx-1.3.6/sphinx/config.py
+===================================================================
+--- sphinx-1.3.6.orig/sphinx/config.py
++++ sphinx-1.3.6/sphinx/config.py
+@@ -10,14 +10,14 @@
+ """
+ 
+ import re
+-from os import path, environ
++from os import path, environ, getenv
+ import shlex
+ 
+ from six import PY3, iteritems, string_types, binary_type, integer_types
+ 
+ from sphinx.errors import ConfigError
+ from sphinx.locale import l_
+-from sphinx.util.osutil import make_filename, cd
++from sphinx.util.osutil import make_filename, cd, ustrftime
+ from sphinx.util.pycompat import execfile_
+ 
+ nonascii_re = re.compile(br'[\x80-\xff]')
+@@ -286,6 +286,16 @@ class Config(object):
+         self.setup = config.get('setup', None)
+         self.extensions = config.get('extensions', [])
+ 
++        # correct values of copyright year that are not coherent with
++        # the SOURCE_DATE_EPOCH environment variable:
++        source_date_epoch = getenv('SOURCE_DATE_EPOCH')
++        if source_date_epoch is not None:
++            for k in ['copyright','epub_copyright']:
++                if k in config:
++                    config[k] = re.sub('^((\d{4}-)?)(\d{4})(?=[ ,])',
++                                       '\g<1>%s' % ustrftime('%Y'),
++                                       config[k])
++
+     def check_types(self, warn):
+         # check all values for deviation from the default value's type, since
+         # that can result in TypeErrors all over the place
diff -Nru sphinx-1.3.6/debian/patches/series sphinx-1.3.6/debian/patches/series
--- sphinx-1.3.6/debian/patches/series	2016-03-03 18:22:21.000000000 +0100
+++ sphinx-1.3.6/debian/patches/series	2016-04-13 14:02:26.000000000 +0200
@@ -7,3 +7,4 @@
 reproducible_inventory.diff
 reproducible_js_locale.diff
 reproducible_searchindex.diff
+correct_copyright_year_from_source_date_epoch.patch
diff -Nru sphinx-1.3.6/debian/patches/source_date_epoch.diff sphinx-1.3.6/debian/patches/source_date_epoch.diff
--- sphinx-1.3.6/debian/patches/source_date_epoch.diff	2016-03-03 18:22:21.000000000 +0100
+++ sphinx-1.3.6/debian/patches/source_date_epoch.diff	2016-04-13 10:03:43.000000000 +0200
@@ -11,10 +11,10 @@
  sphinx/util/osutil.py | 15 +++++++++++----
  1 file changed, 11 insertions(+), 4 deletions(-)
 
-diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
-index 70d5cf5..e1d29a9 100644
---- a/sphinx/util/osutil.py
-+++ b/sphinx/util/osutil.py
+Index: sphinx-1.3.6/sphinx/util/osutil.py
+===================================================================
+--- sphinx-1.3.6.orig/sphinx/util/osutil.py
++++ sphinx-1.3.6/sphinx/util/osutil.py
 @@ -151,15 +151,22 @@ no_fn_re = re.compile(r'[^a-zA-Z0-9_-]')
  def make_filename(string):
      return no_fn_re.sub('', string) or 'sphinx'
@@ -42,3 +42,102 @@
          # On Windows, time.strftime() and Unicode characters will raise UnicodeEncodeError.
          # http://bugs.python.org/issue8304
          try:
+Index: sphinx-1.3.6/sphinx/builders/epub.py
+===================================================================
+--- sphinx-1.3.6.orig/sphinx/builders/epub.py
++++ sphinx-1.3.6/sphinx/builders/epub.py
+@@ -29,7 +29,7 @@ from docutils import nodes
+ 
+ from sphinx import addnodes
+ from sphinx.builders.html import StandaloneHTMLBuilder
+-from sphinx.util.osutil import ensuredir, copyfile, EEXIST
++from sphinx.util.osutil import ensuredir, copyfile, EEXIST, ustrftime
+ from sphinx.util.smartypants import sphinx_smarty_pants as ssp
+ from sphinx.util.console import brown
+ 
+@@ -511,7 +511,7 @@ class EpubBuilder(StandaloneHTMLBuilder)
+         metadata['copyright'] = self.esc(self.config.epub_copyright)
+         metadata['scheme'] = self.esc(self.config.epub_scheme)
+         metadata['id'] = self.esc(self.config.epub_identifier)
+-        metadata['date'] = self.esc(time.strftime('%Y-%m-%d'))
++        metadata['date'] = self.esc(ustrftime('%Y-%m-%d'))
+         metadata['files'] = files
+         metadata['spine'] = spine
+         metadata['guide'] = guide
+Index: sphinx-1.3.6/sphinx/builders/gettext.py
+===================================================================
+--- sphinx-1.3.6.orig/sphinx/builders/gettext.py
++++ sphinx-1.3.6/sphinx/builders/gettext.py
+@@ -11,7 +11,7 @@
+ 
+ from __future__ import unicode_literals
+ 
+-from os import path, walk
++from os import path, walk, getenv
+ from codecs import open
+ from time import time
+ from datetime import datetime, tzinfo, timedelta
+@@ -130,7 +130,10 @@ class I18nBuilder(Builder):
+ timestamp = time()
+ tzdelta = datetime.fromtimestamp(timestamp) - \
+     datetime.utcfromtimestamp(timestamp)
+-
++source_date_epoch = getenv('SOURCE_DATE_EPOCH')
++if source_date_epoch is not None:
++    timestamp = float(source_date_epoch)
++    tzdelta = 0
+ 
+ class LocalTimeZone(tzinfo):
+ 
+Index: sphinx-1.3.6/sphinx/quickstart.py
+===================================================================
+--- sphinx-1.3.6.orig/sphinx/quickstart.py
++++ sphinx-1.3.6/sphinx/quickstart.py
+@@ -35,7 +35,7 @@ from six.moves.urllib.parse import quote
+ from docutils.utils import column_width
+ 
+ from sphinx import __display_version__
+-from sphinx.util.osutil import make_filename
++from sphinx.util.osutil import make_filename, ustrftime
+ from sphinx.util.console import purple, bold, red, turquoise, \
+     nocolor, color_terminal
+ from sphinx.util import texescape
+@@ -1335,7 +1335,7 @@ def generate(d, overwrite=True, silent=F
+         d['extensions'] = '\n' + indent + extensions + ',\n'
+     else:
+         d['extensions'] = extensions
+-    d['copyright'] = time.strftime('%Y') + ', ' + d['author']
++    d['copyright'] = ustrftime('%Y') + ', ' + d['author']
+     d['author_texescaped'] = text_type(d['author']).\
+         translate(texescape.tex_escape_map)
+     d['project_doc'] = d['project'] + ' Documentation'
+Index: sphinx-1.3.6/tests/test_quickstart.py
+===================================================================
+--- sphinx-1.3.6.orig/tests/test_quickstart.py
++++ sphinx-1.3.6/tests/test_quickstart.py
+@@ -21,6 +21,7 @@ from sphinx import application
+ from sphinx import quickstart as qs
+ from sphinx.util.console import nocolor, coloron
+ from sphinx.util.pycompat import execfile_
++from sphinx.util.osutil import ustrftime
+ 
+ 
+ warnfile = StringIO()
+@@ -147,7 +148,7 @@ def test_quickstart_defaults(tempdir):
+     assert ns['source_suffix'] == '.rst'
+     assert ns['master_doc'] == 'index'
+     assert ns['project'] == 'Sphinx Test'
+-    assert ns['copyright'] == '%s, Georg Brandl' % time.strftime('%Y')
++    assert ns['copyright'] == '%s, Georg Brandl' % ustrftime('%Y')
+     assert ns['version'] == '0.1'
+     assert ns['release'] == '0.1'
+     assert ns['todo_include_todos'] is False
+@@ -207,7 +208,7 @@ def test_quickstart_all_answers(tempdir)
+     assert ns['master_doc'] == 'contents'
+     assert ns['project'] == u'STASI™'
+     assert ns['copyright'] == u'%s, Wolfgang Schäuble & G\'Beckstein' % \
+-        time.strftime('%Y')
++        ustrftime('%Y')
+     assert ns['version'] == '2.0'
+     assert ns['release'] == '2.0.1'
+     assert ns['todo_include_todos'] is True

--- End Message ---
--- Begin Message ---
Source: sphinx
Source-Version: 1.4.1-1

We believe that the bug you reported is fixed in the latest version of
sphinx, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dmitry Shachnev <[email protected]> (supplier of updated sphinx package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 17 May 2016 18:57:02 +0300
Source: sphinx
Binary: python-sphinx python3-sphinx sphinx-common sphinx-doc libjs-sphinxdoc
Architecture: source
Version: 1.4.1-1
Distribution: experimental
Urgency: medium
Maintainer: Debian Python Modules Team 
<[email protected]>
Changed-By: Dmitry Shachnev <[email protected]>
Description:
 libjs-sphinxdoc - JavaScript support for Sphinx documentation
 python-sphinx - documentation generator for Python projects (implemented in 
Pytho
 python3-sphinx - documentation generator for Python projects (implemented in 
Pytho
 sphinx-common - documentation generator for Python projects - common data
 sphinx-doc - documentation generator for Python projects - documentation
Closes: 649488 820895 824375
Changes:
 sphinx (1.4.1-1) experimental; urgency=medium
 .
   * New upstream release (closes: #824375).
   * Drop the following patches, applied upstream:
     - disable_distribute_setup.diff
     - source_date_epoch.diff
     - reproducible_grammar.diff
     - reproducible_inventory.diff
     - reproducible_js_locale.diff
     - reproducible_searchindex.diff
   * Refresh and rebase other patches.
   * Update debian/watch to correctly mangle upstream alpha releases.
   * Demote sphinx-rtd-theme to Suggests, it has become optional.
   * Add dependency on python[3]-imagesize packages.
   * Bump Pygments build- and test dependencies to 2.1.1.
   * Demote python-sphinx recommendation of sphinx-doc to a suggestion.
   * Refactor the command to run tests to better match upstream.
   * Build-depend on dvipng to get the pngmath test run.
   * Update numbers in jstest/run-tests for the new version.
   * Add a patch from Alexis Bienvenüe to extend SOURCE_DATE_EPOCH support
     (closes: #820895).
   * Add a patch to fix a typing-related test failure with Python 3.5.2.
   * Update debian/copyright based on upstream LICENSE and AUTHORS files.
   * Add a patch to make compile_catalog code work with python-babel 2.3.
   * Add a patch to support LuaTeX 0.85.
   * Build-depend on texlive-luatex for tests.
   * Adapt dh-sphinxdoc/install-js for doctools.js changes.
   * Update sphinx-autogen manpage.
   * Bump Standards-Version to 3.9.8, no changes needed.
   * Build-depend on python3-xapian (closes: #649488).
Checksums-Sha1:
 5541b439731aa8a0a578065a330e69dd0e694942 3020 sphinx_1.4.1-1.dsc
 d18b856710b22ae9740147e21754ca5b851af9b2 4259820 sphinx_1.4.1.orig.tar.gz
 46d26b8a2fd6172889a95af10c59c28cb524ac61 33604 sphinx_1.4.1-1.debian.tar.xz
Checksums-Sha256:
 e8b982c651ccc6fceabd22760a8b4ae01844b9091e81a7291b1b30a751cb0288 3020 
sphinx_1.4.1-1.dsc
 c6871a784d24aba9270b6b28541537a57e2fcf4d7c799410eba18236bc76d6bc 4259820 
sphinx_1.4.1.orig.tar.gz
 1454508e6aad463d7b07b88074db0be15f668fcaa17a0d62adbb77b823044fc4 33604 
sphinx_1.4.1-1.debian.tar.xz
Files:
 320f735f6c491d0e31dabbd7794a942f 3020 python optional sphinx_1.4.1-1.dsc
 4c4988e0306a04cef8dccc384281e585 4259820 python optional 
sphinx_1.4.1.orig.tar.gz
 72eebca249dd14d5c68d2bee31ca867e 33604 python optional 
sphinx_1.4.1-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXO0AJAAoJENb+cQNj+F3TDIUQAJapCUHKW59eXuxty6n3mb4y
miCot8DSma0cdNl6eNLeJQ8YyS1siefHEB2sgE7ohwYAb7b0W6tJBMNOOuHYZHFt
PYlWdUqQdQz8xknAhI1wYTDSd4WiULYwy0Qa4BOTS++sy9ybTgCy7DC/fQ9MQkOV
2TyEQQ46CgrgKOKsvoolHir/q/pt3lJ6HCIfqvdJqlANQQK8Jz4uZ1YAymRVR8zz
nRUZA8JvUvoJdQld6LbjZZZtbxFc9MIPX4jqgqX8AHTbx8EmQXdCxgqLAKfslTE0
mNrw/Ohy120oIzbuCcm2H4pOXmW3USw9dxGwDipA3YTCDUqEgaetXlQJ35vuvcKO
ojvCrzj50gTg87XDvm3L4p14+t0XWVft1ftZY/ARBG5NMJfkOwthfcQgmlSzwX4h
R4sVQoWmTDMkcFsZfci6t/KKP/Bcgi/U9ObJjmCaMQ7pCQx/artcZEoAcsa2fFHv
8u3fS8w8NMUv6ZRIGmVAI9556dKVEGGcCBi2T4RZCE4x0MwSUufk2XsqC0crWajI
ZMDP/TqCMZVI7JcG4vNvT0bR8UpMT8+56yZTDJ1Bmk13fpfuInuj03PEro0jgijK
O2CDGHSOV8cyPuMSGrf7tHv81NxoBXpd1NTD89nRSD9Rwpb2F+GWUVRn199enxtu
VmnKRFfHM8QPoWq5FWyp
=AZ0D
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to