[packages/docbook-style-xsl] - rel 2; avoid recursion (from FC)

arekm arekm at pld-linux.org
Sun Nov 5 16:41:53 CET 2017


commit 1e2946d64b5962344d8187df8c717bbefc1f1ee4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Nov 5 16:41:46 2017 +0100

    - rel 2; avoid recursion (from FC)

 docbook-style-xsl-non-recursive-string-subst.patch | 30 ++++++++++++++++++++++
 docbook-style-xsl.spec                             |  4 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)
---
diff --git a/docbook-style-xsl.spec b/docbook-style-xsl.spec
index 335cc11..858c2f4 100644
--- a/docbook-style-xsl.spec
+++ b/docbook-style-xsl.spec
@@ -9,13 +9,14 @@ Summary(pl.UTF-8):	Arkusze stylów XSL dla DocBooka
 Summary(pt_BR.UTF-8):	Stylesheets modulares do Norman Walsh para DocBook
 Name:		docbook-style-xsl
 Version:	1.79.2
-Release:	1
+Release:	2
 License:	MIT-like
 Group:		Applications/Publishing/XML
 Source0:	https://github.com/docbook/xslt10-stylesheets/releases/download/release/%{version}/docbook-xsl-%{version}.tar.bz2
 # Source0-md5:	4a400f0264a19329c7f95f69e098744a
 Source1:	https://github.com/docbook/xslt10-stylesheets/releases/download/release/%{version}/docbook-xsl-doc-%{version}.tar.bz2
 # Source1-md5:	62375ca864fc198cb2b17d98209d0b8c
+Patch0:		docbook-style-xsl-non-recursive-string-subst.patch
 URL:		https://github.com/docbook/xslt10-stylesheets
 BuildRequires:	libxml2-progs
 BuildRequires:	unzip
@@ -83,6 +84,7 @@ Rozszerzenia DocBook Saxon.
 
 %prep
 %setup -q -n docbook-xsl-%{version} -b1
+%patch0 -p2
 
 %install
 rm -rf $RPM_BUILD_ROOT
diff --git a/docbook-style-xsl-non-recursive-string-subst.patch b/docbook-style-xsl-non-recursive-string-subst.patch
new file mode 100644
index 0000000..ed302a9
--- /dev/null
+++ b/docbook-style-xsl-non-recursive-string-subst.patch
@@ -0,0 +1,30 @@
+Description: use EXSLT "replace" function when available
+ A recursive implementation  of string.subst is problematic,
+ long strings with many matches will cause stack overflows.
+Author: Peter De Wachter <pdewacht at gmail.com>
+Bug-Debian: https://bugs.debian.org/750593
+
+--- docbook-xsl-1.78.1+dfsg.orig/docbook-xsl/lib/lib.xsl
++++ docbook-xsl-1.78.1+dfsg/docbook-xsl/lib/lib.xsl
+@@ -10,7 +10,10 @@
+ 
+      This module implements DTD-independent functions
+ 
+-     ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
++     ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
++                xmlns:str="http://exslt.org/strings"
++                exclude-result-prefixes="str"
++                version="1.0">
+ 
+ <xsl:template name="dot.count">
+   <!-- Returns the number of "." characters in a string -->
+@@ -56,6 +59,9 @@
+   <xsl:param name="replacement"/>
+ 
+   <xsl:choose>
++    <xsl:when test="function-available('str:replace')">
++      <xsl:value-of select="str:replace($string, string($target), string($replacement))"/>
++    </xsl:when>
+     <xsl:when test="contains($string, $target)">
+       <xsl:variable name="rest">
+         <xsl:call-template name="string.subst">
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/docbook-style-xsl.git/commitdiff/1e2946d64b5962344d8187df8c717bbefc1f1ee4



More information about the pld-cvs-commit mailing list