[python-sphinx] Fix for use of sphinx's manpage writer with docutils-0.10

Toshio くらとみ toshio at fedoraproject.org
Fri Aug 24 13:48:00 UTC 2012


commit 949853df2763376d4e1094d58b23b27f99f172fa
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date:   Fri Aug 24 06:47:45 2012 -0700

    Fix for use of sphinx's manpage writer with docutils-0.10

 python-sphinx.spec         |    9 ++++++++-
 sphinx-docutils-0.10.patch |   28 ++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/python-sphinx.spec b/python-sphinx.spec
index 9bb7fe1..a2e963e 100644
--- a/python-sphinx.spec
+++ b/python-sphinx.spec
@@ -9,7 +9,7 @@
 
 Name:       python-sphinx
 Version:    1.1.3
-Release:    4%{?dist}
+Release:    5%{?dist}
 Summary:    Python documentation generator
 
 Group:      Development/Tools
@@ -21,6 +21,8 @@ Group:      Development/Tools
 License:    BSD and Public Domain and Python and (MIT or GPLv2)
 URL:        http://sphinx.pocoo.org/
 Source0:    http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
+# Sent upstream as a fix to work with the next version of docutils
+Patch0: sphinx-docutils-0.10.patch
 
 BuildArch:     noarch
 BuildRequires: python2-devel >= 2.4
@@ -133,6 +135,8 @@ This package contains documentation in reST and HTML formats.
 %setup -q -n %{upstream_name}-%{version}%{?prerel}
 sed '1d' -i sphinx/pycode/pgen2/token.py
 
+%patch0 -p1
+
 %if 0%{?with_python3}
 rm -rf %{py3dir}
 cp -a . %{py3dir}
@@ -252,6 +256,9 @@ popd
 
 
 %changelog
+* Tue Aug 21 2012 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.3-5
+- Fix for use of sphinx's manpage writer with docutils-0.10
+
 * Mon Aug  6 2012 Michel Salim <salimma at fedoraproject.org> - 1.1.3-4
 - Rebuild for Python 3.3
 
diff --git a/sphinx-docutils-0.10.patch b/sphinx-docutils-0.10.patch
new file mode 100644
index 0000000..7f4f331
--- /dev/null
+++ b/sphinx-docutils-0.10.patch
@@ -0,0 +1,28 @@
+diff -up Sphinx-1.1.3/sphinx/writers/manpage.py.bak Sphinx-1.1.3/sphinx/writers/manpage.py
+--- Sphinx-1.1.3/sphinx/writers/manpage.py.bak	2011-11-01 00:38:44.000000000 -0700
++++ Sphinx-1.1.3/sphinx/writers/manpage.py	2012-08-21 12:38:33.380808202 -0700
+@@ -72,6 +72,11 @@ class ManualPageTranslator(BaseTranslato
+         # since self.append_header() is never called, need to do this here
+         self.body.append(MACRO_DEF)
+ 
++        # Overwrite admonition label translations with our own
++        for label, translation in admonitionlabels.items():
++            self.language.labels[label] = self.deunicode(translation)
++
++
+     # overwritten -- added quotes around all .TH arguments
+     def header(self):
+         tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\""
+@@ -193,12 +198,6 @@ class ManualPageTranslator(BaseTranslato
+     def depart_seealso(self, node):
+         self.depart_admonition(node)
+ 
+-    # overwritten -- use our own label translations
+-    def visit_admonition(self, node, name=None):
+-        if name:
+-            self.body.append('.IP %s\n' %
+-                             self.deunicode(admonitionlabels.get(name, name)))
+-
+     def visit_productionlist(self, node):
+         self.ensure_eol()
+         names = []


More information about the scm-commits mailing list