From 59cdf889e63a4640d21cac58e14117c75e3b78df Mon Sep 17 00:00:00 2001 From: "Mike L." Date: Mon, 28 Apr 2025 12:53:53 +0200 Subject: [PATCH] docbook-xsl: fix infinite recursion for e.g. samba Closes: https://trac.macports.org/ticket/72362 --- textproc/docbook-xsl/Portfile | 10 +++++-- textproc/docbook-xsl/files/patch-libxsl.diff | 30 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 textproc/docbook-xsl/files/patch-libxsl.diff diff --git a/textproc/docbook-xsl/Portfile b/textproc/docbook-xsl/Portfile index e4e709258a8..700caf41beb 100644 --- a/textproc/docbook-xsl/Portfile +++ b/textproc/docbook-xsl/Portfile @@ -37,7 +37,7 @@ if {${subport} eq ${name}} { } subport ${name}-nons { - revision 0 + revision 1 description Non-namespaced version of the DocBook XSL stylesheets distname ${subport}-${version} checksums rmd160 63bae43e79c3b8bc3dac66711eb8c9e5ae3e4a32 \ @@ -46,7 +46,7 @@ subport ${name}-nons { } subport ${name}-ns { - revision 0 + revision 1 description Namespaced version of the DocBook XSL stylesheets distname ${name}-${version} checksums rmd160 425ca8723443bcd45c23d33df26e13b930b2ce42 \ @@ -55,7 +55,7 @@ subport ${name}-ns { } subport ${name}-docs { - revision 0 + revision 1 description Documentation for the DocBook XSL stylesheets distname ${name}-doc-${version} worksrcdir ${name}-${version} @@ -76,6 +76,10 @@ use_configure no build {} if {${subport} in [list "${name}-nons" "${name}-ns"]} { + # Non-recursive string.subst that doesn't kill smb.conf.5 generation + # See: https://trac.macports.org/ticket/72362 + patchfiles-append patch-libxsl.diff + xml.catalog ${prefix}/${instxsldir}/catalog.xml \ ${prefix}/${instxsldir}/catalog.sf.xml diff --git a/textproc/docbook-xsl/files/patch-libxsl.diff b/textproc/docbook-xsl/files/patch-libxsl.diff new file mode 100644 index 00000000000..ffd980d48b4 --- /dev/null +++ b/textproc/docbook-xsl/files/patch-libxsl.diff @@ -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 +Bug-Debian: https://bugs.debian.org/750593 + +--- lib/lib.xsl.orig ++++ lib/lib.xsl +@@ -6,7 +6,10 @@ + + This module implements DTD-independent functions + +- ******************************************************************** --> ++ ******************************************************************** --> + + + +@@ -52,6 +56,9 @@ + + + ++ ++ ++ + + +