summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-extended/libvirt/libvirt/0001-docs-Fix-template-matching-in-page.xsl.patch64
-rw-r--r--recipes-extended/libvirt/libvirt_7.2.0.bb1
2 files changed, 65 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt/0001-docs-Fix-template-matching-in-page.xsl.patch b/recipes-extended/libvirt/libvirt/0001-docs-Fix-template-matching-in-page.xsl.patch
new file mode 100644
index 00000000..9dd650ee
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt/0001-docs-Fix-template-matching-in-page.xsl.patch
@@ -0,0 +1,64 @@
1Upstream-Status: Backport
2
3Signed-off-by: Kai Kang <kai.kang@windriver.com>
4
5From 54814c87f3706cc8eb894634ebef0f9cf7dabae6 Mon Sep 17 00:00:00 2001
6From: Martin Kletzander <mkletzan@redhat.com>
7Date: Mon, 21 Feb 2022 09:26:13 +0100
8Subject: [PATCH] docs: Fix template matching in page.xsl
9
10Our last default template had a match of "node()" which incidentally matched
11everything, including text nodes. Since this has the same priority according to
12the XSLT spec, section 5.5:
13
14 https://www.w3.org/TR/1999/REC-xslt-19991116#conflict
15
16this is an error. Also according to the same spec section, the XSLT processor
17may signal the error or pick the last rule.
18
19This was uncovered with libxslt 1.1.35 which contains the following commit:
20
21 https://gitlab.gnome.org/GNOME/libxslt/-/commit/b0074eeca3c6b21b4da14fdf712b853900c51635
22
23which makes the build fail with:
24
25 runtime error: file ../docs/page.xsl line 223 element element
26 xsl:element: The effective name '' is not a valid QName.
27
28because our last rule also matches text nodes and we are trying to extract the
29node name out of them.
30
31To fix this we change the match to "*" which only matches elements and not all
32the nodes, and to avoid any possible errors with different XSLT processors we
33also bump the priority of the match="text()" rule a little higher, just in case
34someone needs to use an XSLT processor that chooses signalling the error instead
35of the optional recovery.
36
37https://bugs.gentoo.org/833586
38
39Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
40---
41 docs/page.xsl | 4 ++--
42 1 file changed, 2 insertions(+), 2 deletions(-)
43
44diff --git a/docs/page.xsl b/docs/page.xsl
45index fd67918d3b..72a6fa0842 100644
46--- a/docs/page.xsl
47+++ b/docs/page.xsl
48@@ -215,11 +215,11 @@
49 </xsl:element>
50 </xsl:template>
51
52- <xsl:template match="text()" mode="copy">
53+ <xsl:template match="text()" mode="copy" priority="0">
54 <xsl:value-of select="."/>
55 </xsl:template>
56
57- <xsl:template match="node()" mode="copy">
58+ <xsl:template match="*" mode="copy">
59 <xsl:element name="{name()}">
60 <xsl:copy-of select="./@*"/>
61 <xsl:apply-templates mode="copy" />
62--
632.33.0
64
diff --git a/recipes-extended/libvirt/libvirt_7.2.0.bb b/recipes-extended/libvirt/libvirt_7.2.0.bb
index 5ad7d59e..1fc55b8d 100644
--- a/recipes-extended/libvirt/libvirt_7.2.0.bb
+++ b/recipes-extended/libvirt/libvirt_7.2.0.bb
@@ -31,6 +31,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \
31 file://0002-meson-Fix-compatibility-with-Meson-0.58.patch \ 31 file://0002-meson-Fix-compatibility-with-Meson-0.58.patch \
32 file://0001-security-fix-SELinux-label-generation-logic.patch \ 32 file://0001-security-fix-SELinux-label-generation-logic.patch \
33 file://0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch \ 33 file://0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch \
34 file://0001-docs-Fix-template-matching-in-page.xsl.patch \
34 " 35 "
35 36
36SRC_URI[libvirt.md5sum] = "92044b629216e44adce63224970a54a3" 37SRC_URI[libvirt.md5sum] = "92044b629216e44adce63224970a54a3"