Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/libvirt/, app-emulation/libvirt/files/
Date: Mon, 21 Feb 2022 23:14:53
Message-Id: 1645485252.95d996936646bc7fe900cf7f59376b95e94b1b03.sam@gentoo
1 commit: 95d996936646bc7fe900cf7f59376b95e94b1b03
2 Author: Michal Privoznik <mprivozn <AT> redhat <DOT> com>
3 AuthorDate: Mon Feb 21 15:49:57 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 21 23:14:12 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95d99693
7
8 app-emulation/libvirt: Fix build with >=dev-libs/libxslt-1.1.35
9
10 Libvirt failed to build with new libxslt because of a bug in one
11 of libvirt's xsl files. Backport the fix from upstream repo.
12
13 Closes: https://bugs.gentoo.org/833586
14 Signed-off-by: Michal Privoznik <mprivozn <AT> redhat.com>
15 Closes: https://github.com/gentoo/gentoo/pull/24300
16 Signed-off-by: Sam James <sam <AT> gentoo.org>
17
18 ....0-docs-Fix-template-matching-in-page.xsl.patch | 62 ++++++++++++++++++++++
19 app-emulation/libvirt/libvirt-7.10.0-r3.ebuild | 1 +
20 app-emulation/libvirt/libvirt-7.7.0-r2.ebuild | 1 +
21 app-emulation/libvirt/libvirt-8.0.0-r1.ebuild | 1 +
22 4 files changed, 65 insertions(+)
23
24 diff --git a/app-emulation/libvirt/files/libvirt-8.1.0-docs-Fix-template-matching-in-page.xsl.patch b/app-emulation/libvirt/files/libvirt-8.1.0-docs-Fix-template-matching-in-page.xsl.patch
25 new file mode 100644
26 index 000000000000..5207c6d81ec7
27 --- /dev/null
28 +++ b/app-emulation/libvirt/files/libvirt-8.1.0-docs-Fix-template-matching-in-page.xsl.patch
29 @@ -0,0 +1,62 @@
30 +From 54814c87f3706cc8eb894634ebef0f9cf7dabae6 Mon Sep 17 00:00:00 2001
31 +Message-Id: <54814c87f3706cc8eb894634ebef0f9cf7dabae6.1645458252.git.mprivozn@××××××.com>
32 +From: Martin Kletzander <mkletzan@××××××.com>
33 +Date: Mon, 21 Feb 2022 09:26:13 +0100
34 +Subject: [PATCH] docs: Fix template matching in page.xsl
35 +
36 +Our last default template had a match of "node()" which incidentally matched
37 +everything, including text nodes. Since this has the same priority according to
38 +the XSLT spec, section 5.5:
39 +
40 + https://www.w3.org/TR/1999/REC-xslt-19991116#conflict
41 +
42 +this is an error. Also according to the same spec section, the XSLT processor
43 +may signal the error or pick the last rule.
44 +
45 +This was uncovered with libxslt 1.1.35 which contains the following commit:
46 +
47 + https://gitlab.gnome.org/GNOME/libxslt/-/commit/b0074eeca3c6b21b4da14fdf712b853900c51635
48 +
49 +which makes the build fail with:
50 +
51 + runtime error: file ../docs/page.xsl line 223 element element
52 + xsl:element: The effective name '' is not a valid QName.
53 +
54 +because our last rule also matches text nodes and we are trying to extract the
55 +node name out of them.
56 +
57 +To fix this we change the match to "*" which only matches elements and not all
58 +the nodes, and to avoid any possible errors with different XSLT processors we
59 +also bump the priority of the match="text()" rule a little higher, just in case
60 +someone needs to use an XSLT processor that chooses signalling the error instead
61 +of the optional recovery.
62 +
63 +https://bugs.gentoo.org/833586
64 +
65 +Signed-off-by: Martin Kletzander <mkletzan@××××××.com>
66 +Signed-off-by: Michal Privoznik <mprivozn@××××××.com>
67 +---
68 + docs/page.xsl | 4 ++--
69 + 1 file changed, 2 insertions(+), 2 deletions(-)
70 +
71 +diff --git a/docs/page.xsl b/docs/page.xsl
72 +index fd67918d3b..72a6fa0842 100644
73 +--- a/docs/page.xsl
74 ++++ b/docs/page.xsl
75 +@@ -215,11 +215,11 @@
76 + </xsl:element>
77 + </xsl:template>
78 +
79 +- <xsl:template match="text()" mode="copy">
80 ++ <xsl:template match="text()" mode="copy" priority="0">
81 + <xsl:value-of select="."/>
82 + </xsl:template>
83 +
84 +- <xsl:template match="node()" mode="copy">
85 ++ <xsl:template match="*" mode="copy">
86 + <xsl:element name="{name()}">
87 + <xsl:copy-of select="./@*"/>
88 + <xsl:apply-templates mode="copy" />
89 +--
90 +2.34.1
91 +
92
93 diff --git a/app-emulation/libvirt/libvirt-7.10.0-r3.ebuild b/app-emulation/libvirt/libvirt-7.10.0-r3.ebuild
94 index 21c5ce658519..ecec95b0d794 100644
95 --- a/app-emulation/libvirt/libvirt-7.10.0-r3.ebuild
96 +++ b/app-emulation/libvirt/libvirt-7.10.0-r3.ebuild
97 @@ -136,6 +136,7 @@ PATCHES=(
98 "${FILESDIR}"/${PN}-6.7.0-fix-paths-for-apparmor.patch
99 "${FILESDIR}"/${PN}-7.9.0-fix_cgroupv2.patch
100 "${FILESDIR}"/${PN}-7.10.0-fix_soname.patch
101 + "${FILESDIR}"/${PN}-8.1.0-docs-Fix-template-matching-in-page.xsl.patch
102 )
103
104 pkg_setup() {
105
106 diff --git a/app-emulation/libvirt/libvirt-7.7.0-r2.ebuild b/app-emulation/libvirt/libvirt-7.7.0-r2.ebuild
107 index e36b7d1dfd11..1d1927b62ac6 100644
108 --- a/app-emulation/libvirt/libvirt-7.7.0-r2.ebuild
109 +++ b/app-emulation/libvirt/libvirt-7.7.0-r2.ebuild
110 @@ -134,6 +134,7 @@ PATCHES=(
111 "${FILESDIR}"/${PN}-6.0.0-fix_paths_in_libvirt-guests_sh.patch
112 "${FILESDIR}"/${PN}-6.7.0-do-not-use-sysconfig.patch
113 "${FILESDIR}"/${PN}-6.7.0-fix-paths-for-apparmor.patch
114 + "${FILESDIR}"/${PN}-8.1.0-docs-Fix-template-matching-in-page.xsl.patch
115 )
116
117 pkg_setup() {
118
119 diff --git a/app-emulation/libvirt/libvirt-8.0.0-r1.ebuild b/app-emulation/libvirt/libvirt-8.0.0-r1.ebuild
120 index d62e076fcb1f..65a40aeebebc 100644
121 --- a/app-emulation/libvirt/libvirt-8.0.0-r1.ebuild
122 +++ b/app-emulation/libvirt/libvirt-8.0.0-r1.ebuild
123 @@ -134,6 +134,7 @@ PATCHES=(
124 "${FILESDIR}"/${PN}-6.0.0-fix_paths_in_libvirt-guests_sh.patch
125 "${FILESDIR}"/${PN}-6.7.0-do-not-use-sysconfig.patch
126 "${FILESDIR}"/${PN}-6.7.0-fix-paths-for-apparmor.patch
127 + "${FILESDIR}"/${PN}-8.1.0-docs-Fix-template-matching-in-page.xsl.patch
128 )
129
130 pkg_setup() {