* update libxml2 to 2.11.4-1

This commit is contained in:
Alexander Baldeck 2023-07-19 08:59:56 +02:00
parent 86f81a6e47
commit 65053a6828
6 changed files with 13 additions and 164 deletions

View File

@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Tue, 11 Apr 2023 21:55:36 +0000
Subject: [PATCH] Fix python3 unicode errors
Patch taken from Fedora at
https://src.fedoraproject.org/rpms/libxml2/raw/c1fa5c85e9d3a0b7340aaf34d2e5134cf47f5d66/f/libxml2-2.9.8-python3-unicode-errors.patch
Works around https://bugzilla.gnome.org/show_bug.cgi?id=789714
and https://gitlab.gnome.org/GNOME/libxml2/-/issues/64
---
python/libxml.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/python/libxml.c b/python/libxml.c
index e071e824ca39..9d476f4fcd92 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -1621,28 +1621,37 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg,
PyObject *message;
PyObject *result;
char str[1000];
+ unsigned char *ptr = (unsigned char *)str;
#ifdef DEBUG_ERROR
printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
#endif
if (libxml_xmlPythonErrorFuncHandler == NULL) {
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
} else {
va_start(ap, msg);
if (vsnprintf(str, 999, msg, ap) >= 998)
str[999] = 0;
va_end(ap);
+#if PY_MAJOR_VERSION >= 3
+ /* Ensure the error string doesn't start at UTF8 continuation. */
+ while (*ptr && (*ptr & 0xc0) == 0x80)
+ ptr++;
+#endif
+
list = PyTuple_New(2);
PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
- message = libxml_charPtrConstWrap(str);
+ message = libxml_charPtrConstWrap(ptr);
PyTuple_SetItem(list, 1, message);
result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
+ /* Forget any errors caused in the error handler. */
+ PyErr_Clear();
Py_XDECREF(list);
Py_XDECREF(result);
}

View File

@ -5,22 +5,20 @@ Subject: [PATCH] HACK: Don't run fuzzing tests
They take way too long.
---
Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Makefile.am | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 316109b16148..3ef672fe911f 100644
index 5bc401813e6b..0d69d2cdf235 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,12 +2,12 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = include . doc example fuzz xstc
+SUBDIRS = include . doc example xstc
@@ -6,11 +6,8 @@ SUBDIRS = include . doc example xstc
if WITH_PYTHON
SUBDIRS += python
endif
-if WITH_GLOB
-SUBDIRS += fuzz
-endif
-DIST_SUBDIRS = include . doc example fuzz python xstc
+DIST_SUBDIRS = include . doc example python xstc

View File

@ -1,4 +1,3 @@
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Jan de Groot <jgc@archlinux.org>
@ -10,8 +9,8 @@ pkgname=(
libxml2
libxml2-docs
)
pkgver=2.10.4
pkgrel=6
pkgver=2.11.4
pkgrel=1
pkgdesc="XML C parser and toolkit"
url="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
@ -27,16 +26,14 @@ makedepends=(
git
python
)
_commit=223cb03a5d27b1b2393b266a8657443d046139d6 # tags/v2.10.4^0
_commit=2e9f7860a9cb8be29eca90b7409ef0278d30ef10 # tags/v2.11.4^0
source=(
"git+https://gitlab.gnome.org/GNOME/libxml2.git#commit=$_commit"
0001-Fix-python3-unicode-errors.patch
0002-HACK-Don-t-run-fuzzing-tests.patch
0001-HACK-Don-t-run-fuzzing-tests.patch
https://www.w3.org/XML/Test/xmlts20130923.tar.gz
)
b2sums=('SKIP'
'ec5a0955906c5fdd4bc65248bdb46f315460f4b2208bf37c49f55ef7468585786bdf563aa3e9357370d4f1ff947a6d4467869eeb2ca6b77ca5e40ffa45213a13'
'ec247c8caad963307d8f487176fde518cfb087bbff3f10c2a5846b90a04c9909c2f0e6aaf8ded4784f46586eafb16df493caf1debc20ff10014f03b1f1f8241d'
'5f47a4949e9485c40b5685840d48aef87aa7919eb7e0afd679b598ee054392f18a657947c10c627d3239937e53611f8263c47312d26b093aa5973854307f53aa'
'63a47bc69278ef510cd0b3779aed729e1b309e30efa0015d28ed051cc03f9dfddb447ab57b07b3393e8f47393d15473b0e199c34cb1f5f746b15ddfaa55670be')
pkgver() {
@ -50,11 +47,8 @@ prepare() {
# Use xmlconf from conformance test suite
ln -s ../xmlconf
# https://gitlab.gnome.org/GNOME/libxml2/-/issues/64
git apply -3 ../0001-Fix-python3-unicode-errors.patch
# Do not run fuzzing tests
git apply -3 ../0002-HACK-Don-t-run-fuzzing-tests.patch
git apply -3 ../0001-HACK-Don-t-run-fuzzing-tests.patch
NOCONFIGURE=1 ./autogen.sh
}

View File

@ -1,43 +0,0 @@
diff --git i/python/libxml.c w/python/libxml.c
index e071e824..9d476f4f 100644
--- i/python/libxml.c
+++ w/python/libxml.c
@@ -1621,28 +1621,37 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg,
PyObject *message;
PyObject *result;
char str[1000];
+ unsigned char *ptr = (unsigned char *)str;
#ifdef DEBUG_ERROR
printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
#endif
if (libxml_xmlPythonErrorFuncHandler == NULL) {
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
} else {
va_start(ap, msg);
if (vsnprintf(str, 999, msg, ap) >= 998)
str[999] = 0;
va_end(ap);
+#if PY_MAJOR_VERSION >= 3
+ /* Ensure the error string doesn't start at UTF8 continuation. */
+ while (*ptr && (*ptr & 0xc0) == 0x80)
+ ptr++;
+#endif
+
list = PyTuple_New(2);
PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
- message = libxml_charPtrConstWrap(str);
+ message = libxml_charPtrConstWrap(ptr);
PyTuple_SetItem(list, 1, message);
result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
+ /* Forget any errors caused in the error handler. */
+ PyErr_Clear();
Py_XDECREF(list);
Py_XDECREF(result);
}

View File

@ -1,19 +0,0 @@
diff --git i/Makefile.am w/Makefile.am
index 316109b1..3ef672fe 100644
--- i/Makefile.am
+++ w/Makefile.am
@@ -2,12 +2,12 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = include . doc example fuzz xstc
+SUBDIRS = include . doc example xstc
if WITH_PYTHON
SUBDIRS += python
endif
-DIST_SUBDIRS = include . doc example fuzz python xstc
+DIST_SUBDIRS = include . doc example python xstc
AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include -DSYSCONFDIR='"$(sysconfdir)"'

View File

@ -1,24 +0,0 @@
diff --git i/Makefile.am w/Makefile.am
index a9284b95..3d7b344d 100644
--- i/Makefile.am
+++ w/Makefile.am
@@ -2,9 +2,9 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR)
+SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
-DIST_SUBDIRS = include . doc example fuzz python xstc
+DIST_SUBDIRS = include . doc example python xstc
AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
@@ -210,7 +210,6 @@ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
$(CHECKER) ./runxmlconf$(EXEEXT)
@(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
$(MAKE) tests ; fi)
- @cd fuzz; $(MAKE) tests
check: all runtests