diff --git a/.gitignore b/.gitignore index f9a6ee3..bdc9391 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ libxml2-2.7.6.tar.gz /libxml2-2.9.9.tar.gz /libxml2-2.9.10.tar.gz /libxml2-v2.9.12.tar.bz2 +/libxml2-v2.9.13.tar.bz2 diff --git a/libxml2-2.9.12-fix-formatting-regression.patch b/libxml2-2.9.12-fix-formatting-regression.patch deleted file mode 100644 index 6419a76..0000000 --- a/libxml2-2.9.12-fix-formatting-regression.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -rupN --no-dereference libxml2-v2.9.12/xmlsave.c libxml2-v2.9.12-new/xmlsave.c ---- libxml2-v2.9.12/xmlsave.c 2022-02-18 21:00:14.226540564 +0100 -+++ libxml2-v2.9.12-new/xmlsave.c 2022-02-18 21:00:14.229540592 +0100 -@@ -890,6 +890,13 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr - break; - - case XML_ELEMENT_NODE: -+ if ((cur != root) && (ctxt->format == 1) && -+ (xmlIndentTreeOutput)) -+ xmlOutputBufferWrite(buf, ctxt->indent_size * -+ (ctxt->level > ctxt->indent_nr ? -+ ctxt->indent_nr : ctxt->level), -+ ctxt->indent); -+ - /* - * Some users like lxml are known to pass nodes with a corrupted - * tree structure. Fall back to a recursive call to handle this -@@ -900,13 +907,6 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr - break; - } - -- if ((ctxt->level > 0) && (ctxt->format == 1) && -- (xmlIndentTreeOutput)) -- xmlOutputBufferWrite(buf, ctxt->indent_size * -- (ctxt->level > ctxt->indent_nr ? -- ctxt->indent_nr : ctxt->level), -- ctxt->indent); -- - xmlOutputBufferWrite(buf, 1, "<"); - if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { - xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); diff --git a/libxml2-2.9.12-fix-lxml-corrupted-tree.patch b/libxml2-2.9.12-fix-lxml-corrupted-tree.patch deleted file mode 100644 index 97722d7..0000000 --- a/libxml2-2.9.12-fix-lxml-corrupted-tree.patch +++ /dev/null @@ -1,188 +0,0 @@ -diff -rupN --no-dereference libxml2-v2.9.12/HTMLtree.c libxml2-v2.9.12-new/HTMLtree.c ---- libxml2-v2.9.12/HTMLtree.c 2021-05-13 20:56:16.000000000 +0200 -+++ libxml2-v2.9.12-new/HTMLtree.c 2022-02-18 21:00:14.021538664 +0100 -@@ -744,7 +744,7 @@ void - htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, - xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED, - int format) { -- xmlNodePtr root; -+ xmlNodePtr root, parent; - xmlAttrPtr attr; - const htmlElemDesc * info; - -@@ -755,6 +755,7 @@ htmlNodeDumpFormatOutput(xmlOutputBuffer - } - - root = cur; -+ parent = cur->parent; - while (1) { - switch (cur->type) { - case XML_HTML_DOCUMENT_NODE: -@@ -762,7 +763,9 @@ htmlNodeDumpFormatOutput(xmlOutputBuffer - if (((xmlDocPtr) cur)->intSubset != NULL) { - htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL); - } -- if (cur->children != NULL) { -+ /* Always validate cur->parent when descending. */ -+ if ((cur->parent == parent) && (cur->children != NULL)) { -+ parent = cur; - cur = cur->children; - continue; - } -@@ -770,6 +773,16 @@ htmlNodeDumpFormatOutput(xmlOutputBuffer - - case XML_ELEMENT_NODE: - /* -+ * Some users like lxml are known to pass nodes with a corrupted -+ * tree structure. Fall back to a recursive call to handle this -+ * case. -+ */ -+ if ((cur->parent != parent) && (cur->children != NULL)) { -+ htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format); -+ break; -+ } -+ -+ /* - * Get specific HTML info for that node. - */ - if (cur->ns == NULL) -@@ -817,6 +830,7 @@ htmlNodeDumpFormatOutput(xmlOutputBuffer - (cur->name != NULL) && - (cur->name[0] != 'p')) /* p, pre, param */ - xmlOutputBufferWriteString(buf, "\n"); -+ parent = cur; - cur = cur->children; - continue; - } -@@ -825,9 +839,9 @@ htmlNodeDumpFormatOutput(xmlOutputBuffer - (info != NULL) && (!info->isinline)) { - if ((cur->next->type != HTML_TEXT_NODE) && - (cur->next->type != HTML_ENTITY_REF_NODE) && -- (cur->parent != NULL) && -- (cur->parent->name != NULL) && -- (cur->parent->name[0] != 'p')) /* p, pre, param */ -+ (parent != NULL) && -+ (parent->name != NULL) && -+ (parent->name[0] != 'p')) /* p, pre, param */ - xmlOutputBufferWriteString(buf, "\n"); - } - -@@ -842,9 +856,9 @@ htmlNodeDumpFormatOutput(xmlOutputBuffer - break; - if (((cur->name == (const xmlChar *)xmlStringText) || - (cur->name != (const xmlChar *)xmlStringTextNoenc)) && -- ((cur->parent == NULL) || -- ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) && -- (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) { -+ ((parent == NULL) || -+ ((xmlStrcasecmp(parent->name, BAD_CAST "script")) && -+ (xmlStrcasecmp(parent->name, BAD_CAST "style"))))) { - xmlChar *buffer; - - buffer = xmlEncodeEntitiesReentrant(doc, cur->content); -@@ -902,13 +916,9 @@ htmlNodeDumpFormatOutput(xmlOutputBuffer - break; - } - -- /* -- * The parent should never be NULL here but we want to handle -- * corrupted documents gracefully. -- */ -- if (cur->parent == NULL) -- return; -- cur = cur->parent; -+ cur = parent; -+ /* cur->parent was validated when descending. */ -+ parent = cur->parent; - - if ((cur->type == XML_HTML_DOCUMENT_NODE) || - (cur->type == XML_DOCUMENT_NODE)) { -@@ -939,9 +949,9 @@ htmlNodeDumpFormatOutput(xmlOutputBuffer - (cur->next != NULL)) { - if ((cur->next->type != HTML_TEXT_NODE) && - (cur->next->type != HTML_ENTITY_REF_NODE) && -- (cur->parent != NULL) && -- (cur->parent->name != NULL) && -- (cur->parent->name[0] != 'p')) /* p, pre, param */ -+ (parent != NULL) && -+ (parent->name != NULL) && -+ (parent->name[0] != 'p')) /* p, pre, param */ - xmlOutputBufferWriteString(buf, "\n"); - } - } -diff -rupN --no-dereference libxml2-v2.9.12/xmlsave.c libxml2-v2.9.12-new/xmlsave.c ---- libxml2-v2.9.12/xmlsave.c 2021-05-13 20:56:16.000000000 +0200 -+++ libxml2-v2.9.12-new/xmlsave.c 2022-02-18 21:00:14.022538674 +0100 -@@ -847,7 +847,7 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPt - static void - xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { - int format = ctxt->format; -- xmlNodePtr tmp, root, unformattedNode = NULL; -+ xmlNodePtr tmp, root, unformattedNode = NULL, parent; - xmlAttrPtr attr; - xmlChar *start, *end; - xmlOutputBufferPtr buf; -@@ -856,6 +856,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr - buf = ctxt->buf; - - root = cur; -+ parent = cur->parent; - while (1) { - switch (cur->type) { - case XML_DOCUMENT_NODE: -@@ -868,7 +869,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr - break; - - case XML_DOCUMENT_FRAG_NODE: -- if (cur->children != NULL) { -+ /* Always validate cur->parent when descending. */ -+ if ((cur->parent == parent) && (cur->children != NULL)) { -+ parent = cur; - cur = cur->children; - continue; - } -@@ -887,7 +890,18 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr - break; - - case XML_ELEMENT_NODE: -- if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput)) -+ /* -+ * Some users like lxml are known to pass nodes with a corrupted -+ * tree structure. Fall back to a recursive call to handle this -+ * case. -+ */ -+ if ((cur->parent != parent) && (cur->children != NULL)) { -+ xmlNodeDumpOutputInternal(ctxt, cur); -+ break; -+ } -+ -+ if ((ctxt->level > 0) && (ctxt->format == 1) && -+ (xmlIndentTreeOutput)) - xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? - ctxt->indent_nr : ctxt->level), -@@ -942,6 +956,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr - xmlOutputBufferWrite(buf, 1, ">"); - if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n"); - if (ctxt->level >= 0) ctxt->level++; -+ parent = cur; - cur = cur->children; - continue; - } -@@ -1058,13 +1073,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr - break; - } - -- /* -- * The parent should never be NULL here but we want to handle -- * corrupted documents gracefully. -- */ -- if (cur->parent == NULL) -- return; -- cur = cur->parent; -+ cur = parent; -+ /* cur->parent was validated when descending. */ -+ parent = cur->parent; - - if (cur->type == XML_ELEMENT_NODE) { - if (ctxt->level > 0) ctxt->level--; diff --git a/libxml2-2.9.8-python3-unicode-errors.patch b/libxml2-2.9.8-python3-unicode-errors.patch index adbc097..77dbf03 100644 --- a/libxml2-2.9.8-python3-unicode-errors.patch +++ b/libxml2-2.9.8-python3-unicode-errors.patch @@ -1,6 +1,6 @@ -diff -rupN --no-dereference libxml2-v2.9.12/python/libxml.c libxml2-v2.9.12-new/python/libxml.c ---- libxml2-v2.9.12/python/libxml.c 2021-05-13 20:56:16.000000000 +0200 -+++ libxml2-v2.9.12-new/python/libxml.c 2022-02-18 21:00:13.813536737 +0100 +diff -rupN --no-dereference libxml2-v2.9.13/python/libxml.c libxml2-v2.9.13-new/python/libxml.c +--- libxml2-v2.9.13/python/libxml.c 2022-02-19 19:26:42.000000000 +0100 ++++ libxml2-v2.9.13-new/python/libxml.c 2022-02-22 13:16:40.590376397 +0100 @@ -1621,6 +1621,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU PyObject *message; PyObject *result; diff --git a/mingw-libxml2.spec b/mingw-libxml2.spec index e8506c9..ed8a02b 100644 --- a/mingw-libxml2.spec +++ b/mingw-libxml2.spec @@ -1,7 +1,7 @@ %{?mingw_package_header} Name: mingw-libxml2 -Version: 2.9.12 +Version: 2.9.13 Release: 1%{?dist} Summary: MinGW Windows libxml2 XML processing library @@ -12,10 +12,6 @@ Source0: https://gitlab.gnome.org/GNOME/libxml2/-/archive/v%{version}/lib # Patch from openSUSE. # See: https://bugzilla.gnome.org/show_bug.cgi?id=789714 Patch1: libxml2-2.9.8-python3-unicode-errors.patch -# https://gitlab.gnome.org/GNOME/libxml2/-/issues/255 -Patch2: libxml2-2.9.12-fix-lxml-corrupted-tree.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1965662 -Patch3: libxml2-2.9.12-fix-formatting-regression.patch BuildArch: noarch @@ -82,43 +78,35 @@ Static version of the MinGW Windows XML processing library. %build NOCONFIGURE=1 ./autogen.sh -# LibXML2 can't build static and shared libraries in one go, so we -# build LibXML2 twice here -MINGW32_CPPFLAGS="-DLIBXML_STATIC_FOR_DLL" -MINGW64_CPPFLAGS="-DLIBXML_STATIC_FOR_DLL" +# LibXML2 can't build static and shared libraries in one go, so we build LibXML2 twice here +MINGW32_CPPFLAGS="-DLIBXML_STATIC_FOR_DLL" \ +MINGW64_CPPFLAGS="-DLIBXML_STATIC_FOR_DLL" \ MINGW_BUILDDIR_SUFFIX=static %mingw_configure --without-python --with-modules --enable-static --disable-shared --with-threads=win32 -MINGW32_CPPFLAGS= -MINGW64_CPPFLAGS= MINGW_BUILDDIR_SUFFIX=shared %mingw_configure --without-python --with-modules --disable-static --enable-shared --with-threads=win32 -MINGW_BUILDDIR_SUFFIX=static %mingw_make %{?_smp_mflags} -MINGW_BUILDDIR_SUFFIX=shared %mingw_make %{?_smp_mflags} +MINGW_BUILDDIR_SUFFIX=static %mingw_make_build +MINGW_BUILDDIR_SUFFIX=shared %mingw_make_build %install -# First install all the files belonging to the shared build -MINGW_BUILDDIR_SUFFIX=shared %mingw_make_install DESTDIR=$RPM_BUILD_ROOT - -# Then manually install the static libraries to the right location -install -m 0644 build_win32static/.libs/libxml2.a $RPM_BUILD_ROOT%{mingw32_libdir}/ -install -m 0644 build_win64static/.libs/libxml2.a $RPM_BUILD_ROOT%{mingw64_libdir}/ +MINGW_BUILDDIR_SUFFIX=static %mingw_make_install +MINGW_BUILDDIR_SUFFIX=shared %mingw_make_install # Remove documentation which duplicates Fedora native. -rm -rf $RPM_BUILD_ROOT%{mingw32_mandir} -rm -rf $RPM_BUILD_ROOT%{mingw32_docdir} -rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc/ +rm -rf %{buildroot}%{mingw32_mandir} +rm -rf %{buildroot}%{mingw32_docdir} +rm -rf %{buildroot}%{mingw32_datadir}/gtk-doc/ -rm -rf $RPM_BUILD_ROOT%{mingw64_mandir} -rm -rf $RPM_BUILD_ROOT%{mingw64_docdir} -rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gtk-doc/ +rm -rf %{buildroot}%{mingw64_mandir} +rm -rf %{buildroot}%{mingw64_docdir} +rm -rf %{buildroot}%{mingw64_datadir}/gtk-doc/ # Drop all .la files -find $RPM_BUILD_ROOT -name "*.la" -delete +find %{buildroot} -name "*.la" -delete # Win32 %files -n mingw32-libxml2 -%doc AUTHORS ChangeLog NEWS README README.tests TODO TODO_SCHEMAS %license Copyright %{mingw32_bindir}/libxml2-2.dll %{mingw32_bindir}/xml2-config @@ -136,7 +124,6 @@ find $RPM_BUILD_ROOT -name "*.la" -delete # Win64 %files -n mingw64-libxml2 -%doc AUTHORS ChangeLog NEWS README README.tests TODO TODO_SCHEMAS %license Copyright %{mingw64_bindir}/libxml2-2.dll %{mingw64_bindir}/xml2-config @@ -154,6 +141,10 @@ find $RPM_BUILD_ROOT -name "*.la" -delete %changelog +* Tue Feb 22 2022 Sandro Mani - 2.9.13-1 +- Update to 2.9.13 +- Cleanup spec + * Fri Feb 18 2022 Sandro Mani - 2.9.12-1 - Update to 2.9.12 diff --git a/sources b/sources index c79d231..01da2e6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libxml2-v2.9.12.tar.bz2) = 7d3c6f7dcfd528102f70fd81cb109351427865fb990163cd64e90a51902077902c2329ea46ebbe8d1fe973e3e78c5f322e0611d98b84d97a0cc46bef16848008 +SHA512 (libxml2-v2.9.13.tar.bz2) = 7e524b358cd817bdcb945c05c7bfd3b67123a6096671eb73e5466f5bb8e8f845654e3ccecf9bd29e6bfcbc2cc8b58c8cd9281d7415a7700417047ce4b6218b67