summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-11-04 05:17:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-11-04 05:17:03 +0000
commit5e572bdd7378f7a5a592b57266354b729d9b5c40 (patch)
tree7c51f1e3b42ba3a6f004629c3682f61227001e0e
parentReleasing progress-linux version 1.6.5-1~dschinn1. (diff)
downloadsphinx-5e572bdd7378f7a5a592b57266354b729d9b5c40.zip
sphinx-5e572bdd7378f7a5a592b57266354b729d9b5c40.tar.xz
Merging debian version 1.6.5-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/changelog8
-rw-r--r--debian/patches/reproducible_dicts.diff31
-rw-r--r--debian/patches/reproducible_epub.diff71
-rw-r--r--debian/patches/series2
4 files changed, 112 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 13af83c..8081e2e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+sphinx (1.6.5-2) unstable; urgency=medium
+
+ * Backport two upstream patches to improve builds reproducibility:
+ - reproducible_dicts.diff to sort dictionary keys (closes: #877637).
+ - reproducible_epub.diff to make EPUB generation reproducible.
+
+ -- Dmitry Shachnev <mitya57@debian.org> Sun, 29 Oct 2017 19:12:40 +0300
+
sphinx (1.6.5-1~dschinn1) dschinn-backports; urgency=medium
* Uploading to dschinn-backports, remaining changes:
diff --git a/debian/patches/reproducible_dicts.diff b/debian/patches/reproducible_dicts.diff
new file mode 100644
index 0000000..7c2efa3
--- /dev/null
+++ b/debian/patches/reproducible_dicts.diff
@@ -0,0 +1,31 @@
+From: Dmitry Shachnev <mitya57@gmail.com>
+Date: Sun, 22 Oct 2017 21:51:47 +0300
+Subject: inspect: Sort dictionary keys when possible
+
+This should help for reproducible builds and for finding items in large
+dictionaries.
+
+(cherry picked from commit 49e486ff47780a3113a98512a88086ffab0e1854)
+---
+ sphinx/util/inspect.py | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
+index 5e0d219..f29cd9a 100644
+--- a/sphinx/util/inspect.py
++++ b/sphinx/util/inspect.py
+@@ -203,6 +203,14 @@ def safe_getmembers(object, predicate=None, attr_getter=safe_getattr):
+ def object_description(object):
+ # type: (Any) -> unicode
+ """A repr() implementation that returns text safe to use in reST context."""
++ if isinstance(object, dict):
++ try:
++ sorted_keys = sorted(object)
++ except TypeError:
++ pass # Cannot sort dict keys, fall back to generic repr
++ else:
++ items = ("%r: %r" % (key, object[key]) for key in sorted_keys)
++ return "{%s}" % ", ".join(items)
+ try:
+ s = repr(object)
+ except Exception:
diff --git a/debian/patches/reproducible_epub.diff b/debian/patches/reproducible_epub.diff
new file mode 100644
index 0000000..9862575
--- /dev/null
+++ b/debian/patches/reproducible_epub.diff
@@ -0,0 +1,71 @@
+From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
+Date: Tue, 1 Aug 2017 07:26:06 +0200
+Subject: epub: use format-date, sort manifest entries by filename
+
+(cherry picked from commit 5b4761e8277b71b3341335b8cf5e9691f9866c0a
+and commit 3164e27ca0638fbe212c15d47ef9662c4b42af9c)
+---
+ sphinx/builders/_epub_base.py | 5 +++--
+ sphinx/builders/epub3.py | 4 ++--
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/sphinx/builders/_epub_base.py b/sphinx/builders/_epub_base.py
+index b68fdba..a2530b1 100644
+--- a/sphinx/builders/_epub_base.py
++++ b/sphinx/builders/_epub_base.py
+@@ -12,8 +12,8 @@
+ import os
+ import re
+ from os import path
++from sphinx.util.i18n import format_date
+ from zipfile import ZIP_DEFLATED, ZIP_STORED, ZipFile
+-from datetime import datetime
+ from collections import namedtuple
+
+ try:
+@@ -486,7 +486,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(datetime.utcnow().strftime("%Y-%m-%d"))
++ metadata['date'] = self.esc(format_date("%Y-%m-%d"))
+ metadata['manifest_items'] = []
+ metadata['spines'] = []
+ metadata['guides'] = []
+@@ -513,6 +513,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
+ if not self.use_index:
+ self.ignored_files.append('genindex' + self.out_suffix)
+ for root, dirs, files in os.walk(outdir):
++ dirs.sort()
+ for fn in sorted(files):
+ filename = path.join(root, fn)[olen:]
+ if filename in self.ignored_files:
+diff --git a/sphinx/builders/epub3.py b/sphinx/builders/epub3.py
+index fb2a71b..47ef94f 100644
+--- a/sphinx/builders/epub3.py
++++ b/sphinx/builders/epub3.py
+@@ -11,7 +11,6 @@
+ """
+
+ from os import path
+-from datetime import datetime
+ from collections import namedtuple
+
+ from sphinx import package_dir
+@@ -19,6 +18,7 @@ from sphinx.config import string_classes, ENUM
+ from sphinx.builders import _epub_base
+ from sphinx.util import logging, xmlname_checker
+ from sphinx.util.fileutil import copy_asset_file
++from sphinx.util.i18n import format_date
+
+ if False:
+ # For type annotation
+@@ -129,7 +129,7 @@ class Epub3Builder(_epub_base.EpubBuilder):
+ metadata['contributor'] = self.esc(self.config.epub_contributor)
+ metadata['page_progression_direction'] = PAGE_PROGRESSION_DIRECTIONS.get(writing_mode)
+ metadata['ibook_scroll_axis'] = IBOOK_SCROLL_AXIS.get(writing_mode)
+- metadata['date'] = self.esc(datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"))
++ metadata['date'] = self.esc(format_date("%Y-%m-%dT%H:%M:%SZ"))
+ metadata['version'] = self.esc(self.config.version)
+ return metadata
+
diff --git a/debian/patches/series b/debian/patches/series
index 609a68b..8d4523e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,5 @@ disable_js_version_check.diff
no_snowballstemmer.diff
skip_tests_network.diff
no_require_websupport.diff
+reproducible_dicts.diff
+reproducible_epub.diff