mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-01-06 02:17:34 -08:00
sys-libs/libosinfo: handle libxml2-2.14 breakage
Bug: https://bugs.gentoo.org/955816 Signed-off-by: Alfred Wingate <parona@protonmail.com> Part-of: https://github.com/gentoo/gentoo/pull/42150 Closes: https://github.com/gentoo/gentoo/pull/42150 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
parent
ec491d9df0
commit
5843588a1a
81
sys-libs/libosinfo/files/libosinfo-1.12.0-libxml2-2.14.patch
Normal file
81
sys-libs/libosinfo/files/libosinfo-1.12.0-libxml2-2.14.patch
Normal file
@ -0,0 +1,81 @@
|
||||
https://bugs.gentoo.org/955816
|
||||
https://gitlab.com/libosinfo/libosinfo/-/issues/58
|
||||
https://gitlab.com/libosinfo/libosinfo/-/merge_requests/162
|
||||
|
||||
From 0adf38535637ec668e658d43f04f60f11f51574f Mon Sep 17 00:00:00 2001
|
||||
From: Roman Bogorodskiy <bogorodskiy@gmail.com>
|
||||
Date: Thu, 10 Apr 2025 13:54:02 +0200
|
||||
Subject: [PATCH] loader: don't use libxml2 deprecated APIs
|
||||
|
||||
Address the following items:
|
||||
|
||||
- Deprecated direct access to buf's content
|
||||
- Mismatching error function signature
|
||||
- Deprecated direct access to ctxt's lastError
|
||||
|
||||
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
|
||||
--- a/osinfo/osinfo_loader.c
|
||||
+++ b/osinfo/osinfo_loader.c
|
||||
@@ -354,7 +354,7 @@ osinfo_loader_doc(const char *xpath,
|
||||
xmlXPathFreeObject(obj);
|
||||
OSINFO_LOADER_SET_ERROR(err, "Cannot format stylesheet");
|
||||
}
|
||||
- ret = g_strdup((char *)buf->content);
|
||||
+ ret = g_strdup((char *)xmlBufferContent(buf));
|
||||
|
||||
xmlBufferFree(buf);
|
||||
xmlXPathFreeObject(obj);
|
||||
@@ -1902,28 +1902,32 @@ static void osinfo_loader_root(OsinfoLoader *loader,
|
||||
}
|
||||
|
||||
static void
|
||||
-catchXMLError(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
|
||||
+catchXMLError(void *ctx, const char *msg, ...)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
+ const xmlError *xmlErr = NULL;
|
||||
+ g_autofree gchar *xmlmsg = NULL;
|
||||
|
||||
- if (ctxt && ctxt->_private) {
|
||||
- GError **err = ctxt->_private;
|
||||
- if (!error_is_set(err)) {
|
||||
- gchar *xmlmsg;
|
||||
- if (ctxt->lastError.file) {
|
||||
- xmlmsg = g_strdup_printf("%s:%d: %s",
|
||||
- ctxt->lastError.file,
|
||||
- ctxt->lastError.line,
|
||||
- ctxt->lastError.message);
|
||||
- } else {
|
||||
- xmlmsg = g_strdup_printf("at line %d: %s",
|
||||
- ctxt->lastError.line,
|
||||
- ctxt->lastError.message);
|
||||
- }
|
||||
- OSINFO_LOADER_SET_ERROR(ctxt->_private, xmlmsg);
|
||||
- g_free(xmlmsg);
|
||||
- }
|
||||
+ if (!ctxt || !ctxt->_private)
|
||||
+ return;
|
||||
+
|
||||
+ if (error_is_set(ctxt->_private))
|
||||
+ return;
|
||||
+
|
||||
+ if (!(xmlErr = xmlCtxtGetLastError(ctx)))
|
||||
+ return;
|
||||
+
|
||||
+ if (xmlErr->file) {
|
||||
+ xmlmsg = g_strdup_printf("%s:%d: %s",
|
||||
+ xmlErr->file,
|
||||
+ xmlErr->line,
|
||||
+ xmlErr->message);
|
||||
+ } else {
|
||||
+ xmlmsg = g_strdup_printf("at line %d: %s",
|
||||
+ xmlErr->line,
|
||||
+ xmlErr->message);
|
||||
}
|
||||
+ OSINFO_LOADER_SET_ERROR(ctxt->_private, xmlmsg);
|
||||
}
|
||||
|
||||
static void osinfo_loader_process_xml(OsinfoLoader *loader,
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -42,6 +42,10 @@ BDEPEND="
|
||||
vala? ( $(vala_depend) )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/libosinfo-1.12.0-libxml2-2.14.patch
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
use vala && vala_setup
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user