Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
knuxify
aports
Commits
27191e34
Commit
27191e34
authored
5 years ago
by
Leo
Browse files
Options
Downloads
Patches
Plain Diff
main/libxml2: finish removing python2 bits
parent
77da6c3e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main/libxml2/APKBUILD
+7
-21
7 additions, 21 deletions
main/libxml2/APKBUILD
main/libxml2/libxml2-2.9.8-python3-unicode-errors.patch
+34
-0
34 additions, 0 deletions
main/libxml2/libxml2-2.9.8-python3-unicode-errors.patch
with
41 additions
and
21 deletions
main/libxml2/APKBUILD
+
7
−
21
View file @
27191e34
...
...
@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname
=
libxml2
pkgver
=
2.9.10
pkgrel
=
1
pkgrel
=
2
pkgdesc
=
"XML parsing library, version 2"
url
=
"http://www.xmlsoft.org/"
arch
=
"all"
...
...
@@ -15,6 +15,7 @@ subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-utils
options
=
"!strip"
source
=
"http://xmlsoft.org/sources/libxml2-
$pkgver
.tar.gz
revert-Make-xmlFreeNodeList-non-recursive.patch
libxml2-2.9.8-python3-unicode-errors.patch
"
# secfixes:
...
...
@@ -39,11 +40,9 @@ prepare() {
# We don't build libxml2 with icu.
rm test
/icu_parse_test.xml
cp
-ra
"
$builddir
"
"
$builddir
"
-python2
}
libxml2_configure
()
{
build
()
{
./configure
\
--build
=
$CBUILD
\
--host
=
$CHOST
\
...
...
@@ -53,31 +52,17 @@ libxml2_configure() {
--infodir
=
/usr/share/info
\
--with-lzma
\
--with-zlib
\
"
$@
"
}
build
()
{
cd
"
$builddir
"
libxml2_configure
\
--with-python
=
/usr/bin/python3
make
msg
"build python2"
cd
"
$builddir
"
-python2
libxml2_configure
\
--with-python
=
/usr/bin/python2
make
}
check
()
{
rm
"
$builddir
"
-python2
/
test/ebcdic_566012.xml
make
-C
"
$builddir
"
-python2
runtests
rm
-f
test
/ebcdic_566012.xml
make runtests
}
package
()
{
cd
"
$builddir
"
make
-j1
DESTDIR
=
"
$pkgdir
"
install
make
-j1
-C
"
$builddir
"
-python2
/python
DESTDIR
=
"
$pkgdir
"
install
# We don't need static lib for python bindings.
rm
"
$pkgdir
"
/usr/lib/python
*
/site-packages/
*
.a
...
...
@@ -102,4 +87,5 @@ utils() {
}
sha512sums
=
"0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed libxml2-2.9.10.tar.gz
347178e432379d543683cba21b902e7305202c03e8dbd724ae395963d677096a5cfc4e345e208d498163ca5174683c167610fc2b297090476038bc2bb7c84b4f revert-Make-xmlFreeNodeList-non-recursive.patch"
347178e432379d543683cba21b902e7305202c03e8dbd724ae395963d677096a5cfc4e345e208d498163ca5174683c167610fc2b297090476038bc2bb7c84b4f revert-Make-xmlFreeNodeList-non-recursive.patch
a205c97fa1488fb8907cfa08b5f82e2055c80b86213dc3cc5c4b526fe6aa786bcc4e4eeb226c44635a1d021307b39e3940f706c42fb60e9e3e9b490a84164df7 libxml2-2.9.8-python3-unicode-errors.patch"
This diff is collapsed.
Click to expand it.
main/libxml2/libxml2-2.9.8-python3-unicode-errors.patch
0 → 100644
+
34
−
0
View file @
27191e34
Index: libxml2-2.9.5/python/libxml.c
===================================================================
--- libxml2-2.9.5.orig/python/libxml.c
+++ libxml2-2.9.5/python/libxml.c
@@ -1620,6 +1620,7 @@
libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
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);
@@ -1636,12 +1637,20 @@
libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
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);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment