[arch-commits] Commit in python-sphinx/trunk (2 files)

Eli Schwartz eschwartz at archlinux.org
Mon Jul 16 14:40:10 UTC 2018


    Date: Monday, July 16, 2018 @ 14:40:09
  Author: eschwartz
Revision: 359855

upgpkg: python-sphinx 1.7.5-3

Backport fix for bug that prevented python-recommonmark from being rebuilt.

Added:
  python-sphinx/trunk/0001-Fix-5016-crashed-when-recommonmark.AutoStrictify-is-.patch
Modified:
  python-sphinx/trunk/PKGBUILD

-----------------------------------------------------------------+
 0001-Fix-5016-crashed-when-recommonmark.AutoStrictify-is-.patch |   38 ++++++++++
 PKGBUILD                                                        |   11 ++
 2 files changed, 46 insertions(+), 3 deletions(-)

Added: 0001-Fix-5016-crashed-when-recommonmark.AutoStrictify-is-.patch
===================================================================
--- 0001-Fix-5016-crashed-when-recommonmark.AutoStrictify-is-.patch	                        (rev 0)
+++ 0001-Fix-5016-crashed-when-recommonmark.AutoStrictify-is-.patch	2018-07-16 14:40:09 UTC (rev 359855)
@@ -0,0 +1,38 @@
+From 34a08ad7e3321f36a1258cc11090c5d3a2ba8649 Mon Sep 17 00:00:00 2001
+From: Takeshi KOMIYA <i.tkomiya at gmail.com>
+Date: Thu, 7 Jun 2018 21:54:03 +0900
+Subject: [PATCH] Fix #5016: crashed when recommonmark.AutoStrictify is enabled
+
+---
+ sphinx/io.py | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/sphinx/io.py b/sphinx/io.py
+index 8f1da22bd..4cb59c90e 100644
+--- a/sphinx/io.py
++++ b/sphinx/io.py
+@@ -13,6 +13,7 @@ import re
+ 
+ from docutils.core import Publisher
+ from docutils.io import FileInput, NullOutput
++from docutils.parsers.rst import Parser as RSTParser
+ from docutils.readers import standalone
+ from docutils.statemachine import StringList, string2lines
+ from docutils.writers import UnfilteredWriter
+@@ -282,6 +283,13 @@ def read_doc(app, env, filename):
+     source = input_class(app, env, source=None, source_path=filename,
+                          encoding=env.config.source_encoding)
+     parser = app.registry.create_source_parser(app, filename)
++    if parser.__class__.__name__ == 'CommonMarkParser' and parser.settings_spec == ():
++        # a workaround for recommonmark
++        #   If recommonmark.AutoStrictify is enabled, the parser invokes reST parser
++        #   internally.  But recommonmark-0.4.0 does not provide settings_spec for reST
++        #   parser.  As a workaround, this copies settings_spec for RSTParser to the
++        #   CommonMarkParser.
++        parser.settings_spec = RSTParser.settings_spec
+ 
+     pub = Publisher(reader=reader,
+                     parser=parser,
+-- 
+2.18.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-07-16 14:12:02 UTC (rev 359854)
+++ PKGBUILD	2018-07-16 14:40:09 UTC (rev 359855)
@@ -7,7 +7,7 @@
 pkgbase=python-sphinx
 pkgname=('python-sphinx' 'python2-sphinx')
 pkgver=1.7.5
-pkgrel=2
+pkgrel=3
 
 arch=('any')
 url='http://sphinx.pocoo.org/'
@@ -51,14 +51,19 @@
   'imagemagick' 'librsvg'
 )
 
-source=("https://pypi.org/packages/source/S/Sphinx/Sphinx-$pkgver.tar.gz"{,.asc})
+source=("https://pypi.org/packages/source/S/Sphinx/Sphinx-$pkgver.tar.gz"{,.asc}
+        "0001-Fix-5016-crashed-when-recommonmark.AutoStrictify-is-.patch")
 
 validpgpkeys=('8A11B79A5D0D749A66F0A030102C2C17498D6B9E'
               'E9BEABB07E7B9CC3F56E62C91425F8CE5EBA0E07')
 md5sums=('478a4d94506febd4786f47cc8ae297bb'
-         'SKIP')
+         'SKIP'
+         '546b6aeddcc76cb4eb6bf8ff9802bf36')
 
 prepare() {
+  # https://github.com/sphinx-doc/sphinx/issues/5016
+  # https://github.com/rtfd/recommonmark/issues/109
+  patch -p1 -d Sphinx-$pkgver < 0001-Fix-5016-crashed-when-recommonmark.AutoStrictify-is-.patch
   # souce duplication is required because makefile modify source code
   # setyp.py --build tricks don't works well
   cp -a Sphinx-$pkgver Sphinx-${pkgver}2



More information about the arch-commits mailing list