Blob Blame History Raw
From: Takashi Iwai <tiwai@suse.de>
Subject: Fix documents build with old sphinx 1.2
Patch-mainline: Never, SLE12-SP4 specific fix
References: bsc#1093117

python-Sphinx included in SLE12-SP4 doesn't seem supporting
version_info call.  Use the fixed version numbers as reverting the
changes introduced via commit c46988aef2de.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 Documentation/conf.py           |    4 +++-
 Documentation/sphinx/cdomain.py |    4 +++-
 Documentation/sphinx/kfigure.py |    9 ++++++---
 3 files changed, 12 insertions(+), 5 deletions(-)

--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -17,7 +17,9 @@ import os
 import sphinx
 
 # Get Sphinx version
-major, minor, patch = sphinx.version_info[:3]
+# major, minor, patch = sphinx.version_info[:3]
+# XXX use the fixed versions for SLE12-SP4 due to silly issues
+major, minor, patch = 1, 2, 3
 
 
 # If extensions (or modules to document with autodoc) are in another directory,
--- a/Documentation/sphinx/cdomain.py
+++ b/Documentation/sphinx/cdomain.py
@@ -44,7 +44,9 @@ from sphinx.domains.c import CDomain as
 __version__  = '1.0'
 
 # Get Sphinx version
-major, minor, patch = sphinx.version_info[:3]
+# major, minor, patch = sphinx.version_info[:3]
+# XXX use the fixed versions for SLE12-SP4 due to silly issues
+major, minor, patch = 1, 2, 3
 
 def setup(app):
 
--- a/Documentation/sphinx/kfigure.py
+++ b/Documentation/sphinx/kfigure.py
@@ -68,7 +68,10 @@ else:
     _unicode = unicode
 
 # Get Sphinx version
-major, minor, patch = sphinx.version_info[:3]
+# major, minor, patch = sphinx.version_info[:3]
+# XXX use the fixed versions for SLE12-SP4 due to silly issues
+major, minor, patch = 1, 2, 3
+
 if major == 1 and minor > 3:
     # patches.Figure only landed in Sphinx 1.4
     from sphinx.directives.patches import Figure  # pylint: disable=C0413
@@ -237,7 +240,7 @@ def convert_image(img_node, translator,
         elif translator.builder.format == 'html':
             dst_fname = path.join(
                 translator.builder.outdir,
-                translator.builder.imagedir,
+                '_images',
                 fname + '.svg')
             img_node['uri'] = path.join(
                 translator.builder.imgpath, fname + '.svg')
@@ -433,7 +436,7 @@ def visit_kernel_render(self, node):
     fname     = path.join('%s-%s' % (srclang, sha1(hashobj).hexdigest()))
 
     tmp_fname = path.join(
-        self.builder.outdir, self.builder.imagedir, fname + tmp_ext)
+        self.builder.outdir, '_images', fname + tmp_ext)
 
     if not path.isfile(tmp_fname):
         mkdir(path.dirname(tmp_fname))