diff options
author | Mart Raudsepp <leio@gentoo.org> | 2009-01-11 19:46:59 +0000 |
---|---|---|
committer | Mart Raudsepp <leio@gentoo.org> | 2009-01-11 19:46:59 +0000 |
commit | d2e160b0baaf6510fecf372315becfe7f959c9c7 (patch) | |
tree | 169d3d409015c9488abaa64fe11cd95cd14a9a23 /dev-libs | |
parent | include freebsd 7 support and make shared libs naming really the same as on l... (diff) | |
download | gentoo-2-d2e160b0baaf6510fecf372315becfe7f959c9c7.tar.gz gentoo-2-d2e160b0baaf6510fecf372315becfe7f959c9c7.tar.bz2 gentoo-2-d2e160b0baaf6510fecf372315becfe7f959c9c7.zip |
Add a patch to allow a fix for bug 249703 - xml_parse_into_struct php function breakage. Also a few more patches from upstream while at it.
(Portage version: 2.2_rc20/cvs/Linux 2.6.28-gentoo x86_64)
Diffstat (limited to 'dev-libs')
5 files changed, 328 insertions, 2 deletions
diff --git a/dev-libs/libxml2/ChangeLog b/dev-libs/libxml2/ChangeLog index 2b3f34ac7bee..be305884c49e 100644 --- a/dev-libs/libxml2/ChangeLog +++ b/dev-libs/libxml2/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for dev-libs/libxml2 -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/ChangeLog,v 1.244 2008/12/23 04:56:02 robbat2 Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/ChangeLog,v 1.245 2009/01/11 19:46:59 leio Exp $ + +*libxml2-2.7.2-r2 (11 Jan 2009) + + 11 Jan 2009; Mart Raudsepp <leio@gentoo.org> + +files/libxml2-2.7.2-old-sax-parser-behaviour-option.patch, + +files/libxml2-2.7.2-xmlAddChildList-pointer.patch, + +files/libxml2-2.7.2-xmlTextWriterFullEndElement-indent.patch, + +libxml2-2.7.2-r2.ebuild: + Add a patch to allow a fix for bug 249703 - xml_parse_into_struct php + function breakage. Also a few more patches from upstream while at it. 23 Dec 2008; Robin H. Johnson <robbat2@gentoo.org> +files/libxml2-2.6.32-CVE-2008-422x.patch, +libxml2-2.6.32-r1.ebuild: diff --git a/dev-libs/libxml2/files/libxml2-2.7.2-old-sax-parser-behaviour-option.patch b/dev-libs/libxml2/files/libxml2-2.7.2-old-sax-parser-behaviour-option.patch new file mode 100644 index 000000000000..e7f601e3e991 --- /dev/null +++ b/dev-libs/libxml2/files/libxml2-2.7.2-old-sax-parser-behaviour-option.patch @@ -0,0 +1,109 @@ +Upstream SVN trunk revision 3807 + +This solves huge PHP problems in combination with a PHP patch using this +new xmlParserOption per gentoo bug #249703: + + +Mon Jan 05 18:28:41 CET 2009 Rob Richards + +* include/libxml/parser.h parser.c: add XML_PARSE_OLDSAX parser + option to enable pre 2.7 SAX behavior. + +diff --git a/include/libxml/parser.h b/include/libxml/parser.h +index 24d5cf9..01de128 100644 +--- a/include/libxml/parser.h ++++ b/include/libxml/parser.h +@@ -1096,7 +1096,8 @@ typedef enum { + crash if you try to modify the tree) */ + XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */ + XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */ +- XML_PARSE_HUGE = 1<<19 /* relax any hardcoded limit from the parser */ ++ XML_PARSE_HUGE = 1<<19, /* relax any hardcoded limit from the parser */ ++ XML_PARSE_OLDSAX = 1<<20 /* parse using SAX2 interface from before 2.7.0 */ + } xmlParserOption; + + XMLPUBFUN void XMLCALL +diff --git a/parser.c b/parser.c +index c52d360..9db664f 100644 +--- a/parser.c ++++ b/parser.c +@@ -7047,9 +7047,11 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { + /* + * Predefined entites override any extra definition + */ +- ent = xmlGetPredefinedEntity(name); +- if (ent != NULL) +- return(ent); ++ if ((ctxt->options & XML_PARSE_OLDSAX) == 0) { ++ ent = xmlGetPredefinedEntity(name); ++ if (ent != NULL) ++ return(ent); ++ } + + /* + * Increate the number of entity references parsed +@@ -7063,6 +7065,9 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { + if (ctxt->sax != NULL) { + if (ctxt->sax->getEntity != NULL) + ent = ctxt->sax->getEntity(ctxt->userData, name); ++ if ((ctxt->wellFormed == 1 ) && (ent == NULL) && ++ (ctxt->options & XML_PARSE_OLDSAX)) ++ ent = xmlGetPredefinedEntity(name); + if ((ctxt->wellFormed == 1 ) && (ent == NULL) && + (ctxt->userData==ctxt)) { + ent = xmlSAX2GetEntity(ctxt, name); +@@ -7135,6 +7140,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { + */ + else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) && + (ent != NULL) && (ent->content != NULL) && ++ (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) && + (xmlStrchr(ent->content, '<'))) { + xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, + "'<' in entity '%s' is not allowed in attributes values\n", name); +@@ -7231,11 +7237,13 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { + /* + * Predefined entites override any extra definition + */ +- ent = xmlGetPredefinedEntity(name); +- if (ent != NULL) { +- xmlFree(name); +- *str = ptr; +- return(ent); ++ if ((ctxt->options & XML_PARSE_OLDSAX) == 0) { ++ ent = xmlGetPredefinedEntity(name); ++ if (ent != NULL) { ++ xmlFree(name); ++ *str = ptr; ++ return(ent); ++ } + } + + /* +@@ -7250,6 +7258,8 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { + if (ctxt->sax != NULL) { + if (ctxt->sax->getEntity != NULL) + ent = ctxt->sax->getEntity(ctxt->userData, name); ++ if ((ent == NULL) && (ctxt->options & XML_PARSE_OLDSAX)) ++ ent = xmlGetPredefinedEntity(name); + if ((ent == NULL) && (ctxt->userData==ctxt)) { + ent = xmlSAX2GetEntity(ctxt, name); + } +@@ -7318,6 +7328,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { + */ + else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) && + (ent != NULL) && (ent->content != NULL) && ++ (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) && + (xmlStrchr(ent->content, '<'))) { + xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, + "'<' in entity '%s' is not allowed in attributes values\n", +@@ -14211,6 +14222,10 @@ xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encodi + ctxt->options |= XML_PARSE_HUGE; + options -= XML_PARSE_HUGE; + } ++ if (options & XML_PARSE_OLDSAX) { ++ ctxt->options |= XML_PARSE_OLDSAX; ++ options -= XML_PARSE_OLDSAX; ++ } + ctxt->linenumbers = 1; + return (options); + } diff --git a/dev-libs/libxml2/files/libxml2-2.7.2-xmlAddChildList-pointer.patch b/dev-libs/libxml2/files/libxml2-2.7.2-xmlAddChildList-pointer.patch new file mode 100644 index 000000000000..a7f40d857b97 --- /dev/null +++ b/dev-libs/libxml2/files/libxml2-2.7.2-xmlAddChildList-pointer.patch @@ -0,0 +1,50 @@ +Upstream SVN trunk revision 3806 + +Wed Dec 31 23:11:37 CET 2008 Rob Richards + +* tree.c: set doc on last child tree in xmlAddChildList for + bug #546772. Fix problem adding an attribute via with xmlAddChild + reported by Kris Breuker. + +diff --git a/tree.c b/tree.c +index fe89dc4..8e393da 100644 +--- a/tree.c ++++ b/tree.c +@@ -3216,7 +3216,10 @@ xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) { + cur = cur->next; + } + cur->parent = parent; +- cur->doc = parent->doc; /* the parent may not be linked to a doc ! */ ++ /* the parent may not be linked to a doc ! */ ++ if (cur->doc != parent->doc) { ++ xmlSetTreeDoc(cur, parent->doc); ++ } + parent->last = cur; + + return(cur); +@@ -3309,9 +3312,7 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { + if (cur->type == XML_ATTRIBUTE_NODE) { + if (parent->type != XML_ELEMENT_NODE) + return(NULL); +- if (parent->properties == NULL) { +- parent->properties = (xmlAttrPtr) cur; +- } else { ++ if (parent->properties != NULL) { + /* check if an attribute with the same name exists */ + xmlAttrPtr lastattr; + +@@ -3326,8 +3327,13 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { + } + if (lastattr == (xmlAttrPtr) cur) + return(cur); ++ ++ } ++ if (parent->properties == NULL) { ++ parent->properties = (xmlAttrPtr) cur; ++ } else { + /* find the end */ +- lastattr = parent->properties; ++ xmlAttrPtr lastattr = parent->properties; + while (lastattr->next != NULL) { + lastattr = lastattr->next; + } diff --git a/dev-libs/libxml2/files/libxml2-2.7.2-xmlTextWriterFullEndElement-indent.patch b/dev-libs/libxml2/files/libxml2-2.7.2-xmlTextWriterFullEndElement-indent.patch new file mode 100644 index 000000000000..0525c86ea7f9 --- /dev/null +++ b/dev-libs/libxml2/files/libxml2-2.7.2-xmlTextWriterFullEndElement-indent.patch @@ -0,0 +1,26 @@ +Upstream SVN trunk revision 3805 +Sun Dec 27 14:16:13 CET 2008 Rob Richards + +xmlwriter.c: fix indenting in xmlTextWriterFullEndElement for bug #554353. + +diff --git a/xmlwriter.c b/xmlwriter.c +index 69d4b85..b88de3a 100644 +--- a/xmlwriter.c ++++ b/xmlwriter.c +@@ -1240,8 +1240,16 @@ xmlTextWriterFullEndElement(xmlTextWriterPtr writer) + if (count < 0) + return -1; + sum += count; ++ if (writer->indent) ++ writer->doindent = 0; + /* fallthrough */ + case XML_TEXTWRITER_TEXT: ++ if ((writer->indent) && (writer->doindent)) { ++ count = xmlTextWriterWriteIndent(writer); ++ sum += count; ++ writer->doindent = 1; ++ } else ++ writer->doindent = 1; + count = xmlOutputBufferWriteString(writer->out, "</"); + if (count < 0) + return -1; diff --git a/dev-libs/libxml2/libxml2-2.7.2-r2.ebuild b/dev-libs/libxml2/libxml2-2.7.2-r2.ebuild new file mode 100644 index 000000000000..879ceb21dee6 --- /dev/null +++ b/dev-libs/libxml2/libxml2-2.7.2-r2.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/libxml2-2.7.2-r2.ebuild,v 1.1 2009/01/11 19:46:59 leio Exp $ + +inherit libtool flag-o-matic eutils + +DESCRIPTION="Version 2 of the library to manipulate XML files" +HOMEPAGE="http://www.xmlsoft.org/" + +LICENSE="MIT" +SLOT="2" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="debug doc examples ipv6 python readline test" + +XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite" +XSTS_NAME_1="xmlschema2002-01-16" +XSTS_NAME_2="xmlschema2004-01-14" +XSTS_TARBALL_1="xsts-2002-01-16.tar.gz" +XSTS_TARBALL_2="xsts-2004-01-14.tar.gz" + +SRC_URI="ftp://xmlsoft.org/${PN}/${P}.tar.gz + test? ( + ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1} + ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2} )" + +RDEPEND="sys-libs/zlib + python? ( dev-lang/python ) + readline? ( sys-libs/readline )" + +DEPEND="${RDEPEND} + hppa? ( >=sys-devel/binutils-2.15.92.0.2 )" + +src_unpack() { + unpack ${P}.tar.gz + cd "${S}" + + # Fix for CVE-2008-4225 and CVE-2008-4226, bug 245960 + epatch "${FILESDIR}/${P}-CVE-2008-422x.patch" + + # Few small patches from SVN (revisions 3805 and 3806) + epatch "${FILESDIR}/${P}-xmlTextWriterFullEndElement-indent.patch" + epatch "${FILESDIR}/${P}-xmlAddChildList-pointer.patch" + + # Fix possibility for PHP's xml_parse_into_struct function, bug 249703 + epatch "${FILESDIR}/${P}-old-sax-parser-behaviour-option.patch" + + if use test; then + cp "${DISTDIR}/${XSTS_TARBALL_1}" \ + "${DISTDIR}/${XSTS_TARBALL_2}" \ + "${S}"/xstc/ \ + || die "Failed to install test tarballs" + fi + + epunt_cxx +} + +src_compile() { + # USE zlib support breaks gnome2 + # (libgnomeprint for instance fails to compile with + # fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002). + + # The meaning of the 'debug' USE flag does not apply to the --with-debug + # switch (enabling the libxml2 debug module). See bug #100898. + + # --with-mem-debug causes unusual segmentation faults (bug #105120). + + local myconf="--with-zlib \ + $(use_with debug run-debug) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with readline history) \ + $(use_enable ipv6)" + + # Please do not remove, as else we get references to PORTAGE_TMPDIR + # in /usr/lib/python?.?/site-packages/libxml2mod.la among things. + elibtoolize + + # filter seemingly problematic CFLAGS (#26320) + filter-flags -fprefetch-loop-arrays -funroll-loops + + econf $myconf || die "Configuration failed" + + # Patching the Makefiles to respect get_libdir + # Fixes BUG #86766, please keep this. + # Danny van Dyk <kugelfang@gentoo.org> 2005/03/26 + for x in $(find "${S}" -name "Makefile") ; do + sed \ + -e "s|^\(PYTHON_SITE_PACKAGES\ =\ \/usr\/\).*\(\/python.*\)|\1$(get_libdir)\2|g" \ + -i ${x} \ + || die "sed failed" + done + + emake || die "Compilation failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "Installation failed" + + dodoc AUTHORS ChangeLog Copyright NEWS README* TODO* + + if ! use doc; then + rm -rf "${D}"/usr/share/gtk-doc + rm -rf "${D}"/usr/share/doc/${P}/html + fi + + if ! use examples; then + rm -rf "${D}/usr/share/doc/${P}/examples" + rm -rf "${D}/usr/share/doc/${PN}-python-${PV}/examples" + fi +} + +pkg_postinst() { + # We don't want to do the xmlcatalog during stage1, as xmlcatalog will not + # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208887. + if [[ "${ROOT}" != "/" ]] + then + elog "Skipping XML catalog creation for stage building (bug #208887)." + else + # need an XML catalog, so no-one writes to a non-existent one + CATALOG="${ROOT}etc/xml/catalog" + + # we dont want to clobber an existing catalog though, + # only ensure that one is there + # <obz@gentoo.org> + if [ ! -e ${CATALOG} ]; then + [ -d "${ROOT}etc/xml" ] || mkdir -p "${ROOT}etc/xml" + /usr/bin/xmlcatalog --create > ${CATALOG} + einfo "Created XML catalog in ${CATALOG}" + fi + fi +} |