diff options
author | 2003-11-13 09:36:37 +0000 | |
---|---|---|
committer | 2003-11-13 09:36:37 +0000 | |
commit | 493caba22b4f5643df8c247380bd1cef604a9277 (patch) | |
tree | c0ea39dcda6ebb46245541de9fc51cd2eda6f75e /net-libs | |
parent | Fixes bug with libxml2 (diff) | |
download | historical-493caba22b4f5643df8c247380bd1cef604a9277.tar.gz historical-493caba22b4f5643df8c247380bd1cef604a9277.tar.bz2 historical-493caba22b4f5643df8c247380bd1cef604a9277.zip |
Fixes bug with libxml2
Diffstat (limited to 'net-libs')
-rw-r--r-- | net-libs/libfwbuilder/Manifest | 6 | ||||
-rw-r--r-- | net-libs/libfwbuilder/files/libfwbuilder-1.0.1-libxml2.patch | 161 | ||||
-rw-r--r-- | net-libs/libfwbuilder/libfwbuilder-1.0.1-r1.ebuild | 51 |
3 files changed, 215 insertions, 3 deletions
diff --git a/net-libs/libfwbuilder/Manifest b/net-libs/libfwbuilder/Manifest index 62b6283fac92..aa267d7fb176 100644 --- a/net-libs/libfwbuilder/Manifest +++ b/net-libs/libfwbuilder/Manifest @@ -1,14 +1,14 @@ MD5 895f86129f0373f6092534540e5e3a70 libfwbuilder-1.0.0.ebuild 1113 MD5 3e735683fbba54279cb1da237b38c428 libfwbuilder-0.10.11.ebuild 1060 -MD5 ee2d8ef3bf122b639cea5cb7d5169995 libfwbuilder-1.0.1-r1.ebuild 1190 +MD5 a1928c511a4ab70c7c266f49aeebad8f libfwbuilder-1.0.1-r1.ebuild 1176 MD5 9233d87f4a15a69a07db0aae59a278bb libfwbuilder-0.10.13.ebuild 1052 MD5 7be875350a5f6fd26be2d4bb5325277c libfwbuilder-0.10.10.ebuild 1060 MD5 11bfaad3db7a4cbba500a8941db7929d libfwbuilder-1.0.1.ebuild 1109 MD5 756d6f7f25f7cbdcaa370b7ec4db8eda libfwbuilder-0.10.12.ebuild 1052 -MD5 bdd2de588ab1af5c292b5856a2a01831 ChangeLog 3026 +MD5 e7d626356fa940e834077fafe32b5837 ChangeLog 3271 MD5 37236013e0d26d43c6bff35a8a48e8ec metadata.xml 220 MD5 cc28aa8050183b43c259859a3ed0bdbc files/digest-libfwbuilder-1.0.1-r1 70 -MD5 27724eff91107ffabce373282e00791e files/libfwbuilder-1.0.1-libxml2.patch 6267 +MD5 0a89c83dc5f8bf1edc0e931d62d8f9e0 files/libfwbuilder-1.0.1-libxml2.patch 5355 MD5 608e23e9cf5c678692e850954088ab06 files/digest-libfwbuilder-0.10.10 72 MD5 c0dd1aa7a50e79514abd40c73fe8c85c files/digest-libfwbuilder-0.10.11 72 MD5 cbd2384867d6471fe70ad380109763df files/digest-libfwbuilder-0.10.12 72 diff --git a/net-libs/libfwbuilder/files/libfwbuilder-1.0.1-libxml2.patch b/net-libs/libfwbuilder/files/libfwbuilder-1.0.1-libxml2.patch new file mode 100644 index 000000000000..e129e7dd3282 --- /dev/null +++ b/net-libs/libfwbuilder/files/libfwbuilder-1.0.1-libxml2.patch @@ -0,0 +1,161 @@ +diff -u /var/tmp/portage/libfwbuilder-1.0.1/work/libfwbuilder-1.0.1/src/fwbuilder/Resources.cc ./Resources.cc +--- src/fwbuilder/Resources.cc 2003-03-03 08:18:03.000000000 +0000 ++++ src/fwbuilderResources.cc 2003-11-13 09:21:17.815706848 +0000 +@@ -6,7 +6,7 @@ + + Author: Vadim Kurland vadim@vk.crocodile.org + +- $Id: libfwbuilder-1.0.1-libxml2.patch,v 1.1 2003/11/13 09:36:22 aliz Exp $ ++ $Id: libfwbuilder-1.0.1-libxml2.patch,v 1.1 2003/11/13 09:36:22 aliz Exp $ + + + This program is free software which we release under the GNU General Public +@@ -117,18 +117,15 @@ + + void Resources::loadRes(const std::string &rfile ) throw(FWException) + { +- if(access(rfile.c_str() , R_OK )!=0) +- throw FWException("Could not load resources: "+rfile); + +- doc = xmlParseFile(rfile.c_str()); +- +- if(!doc) +- throw FWException("Error parsing "+rfile); ++// doc = xmlParseFile(rfile.c_str()); ++ doc = XMLTools::loadAndParseFile(rfile); ++ ++ if(!doc) throw FWException("Error parsing "+rfile); + + root=xmlDocGetRootElement(doc); +- +- if(!root || !root->name || +- strcmp(FROMXMLCAST(root->name), "FWBuilderResources")!=0) ++ ++ if(!root || !root->name || strcmp(FROMXMLCAST(root->name), "FWBuilderResources")!=0) + { + xmlFreeDoc(doc); + throw FWException("Invalid resources file "+rfile); +diff -u /var/tmp/portage/libfwbuilder-1.0.1/work/libfwbuilder-1.0.1/src/fwbuilder/XMLTools.cc ./XMLTools.cc +--- src/fwbuilder/XMLTools.cc 2003-07-06 06:12:20.000000000 +0000 ++++ src/fwbuilder/XMLTools.cc 2003-11-13 09:21:17.829704720 +0000 +@@ -6,7 +6,7 @@ + + Author: Vadim Kurland vadim@vk.crocodile.org + +- $Id: libfwbuilder-1.0.1-libxml2.patch,v 1.1 2003/11/13 09:36:22 aliz Exp $ ++ $Id: libfwbuilder-1.0.1-libxml2.patch,v 1.1 2003/11/13 09:36:22 aliz Exp $ + + + This program is free software which we release under the GNU General Public +@@ -31,6 +31,11 @@ + + #include <string.h> + #include <unistd.h> ++#include <sys/stat.h> ++#include <fcntl.h> ++#include <unistd.h> ++#include <errno.h> ++#include <assert.h> + + #ifdef HAVE_LIBXSLT_XSLTCONFIG_H + # include <libxslt/xsltconfig.h> +@@ -43,8 +48,6 @@ + + #include <glib.h> + +-#include <assert.h> +- + #include <iostream> + + #undef FW_XMLTOOLS_VERBOSE +@@ -202,6 +205,41 @@ + xmlSetExternalEntityLoader(fwbExternalEntityLoader); + } + ++/* ++ * I use xmlParseMemory because libxml2 v2.6.2 broke xmlParseFile. If ++ * file name had a full path in it, it won't load and gave an error ++ * like this: ++ * ++ * I/O warning : failed to load external entity "/resources.xml" ++ * ++ * I do not check if xmlParseMemory succeeded in this method because ++ * I may need to throw different exceptions in different method using ++ * loadAndParseFile. loadAndParseFile just returns whatever ++ * xmlParseMemory returned, this works better in a sense that ++ * loadAndParseFile should be just a wrapper for xmlParseMemory and ++ * should replicate its behavior. ++ * ++ */ ++xmlDocPtr XMLTools::loadAndParseFile(const std::string &rfile) throw(FWException) ++{ ++ struct stat stt; ++ int fd; ++ ++ if (stat( rfile.c_str() , &stt )!=0 || (fd=open(rfile.c_str(),O_RDONLY))<0) ++ throw FWException("Could not read file "+rfile); ++ ++ char *buf=(char*)malloc(stt.st_size); ++ ++ read(fd,buf,stt.st_size); ++ close(fd); ++ ++ xmlDocPtr doc = xmlParseMemory(buf, stt.st_size); ++ memset(buf,0,stt.st_size); ++ free(buf); ++ ++ return doc; ++} ++ + xmlDocPtr XMLTools::parseFile(const string &file_name, + bool use_dtd, const string &template_dir) throw(FWException) + { +@@ -215,7 +253,8 @@ + + string errors; + xmlSetGenericErrorFunc (&errors, xslt_error_handler); +- xmlDocPtr doc = xmlParseFile(file_name.c_str()); ++// xmlDocPtr doc = xmlParseFile(file_name.c_str()); ++ xmlDocPtr doc = loadAndParseFile(file_name); + xmlSetGenericErrorFunc (NULL, NULL); + + g_mutex_unlock(xml_parser_mutex); +@@ -415,7 +454,9 @@ + } + + +- doc = xmlParseFile(src_file.c_str()); ++// doc = xmlParseFile(src_file.c_str()); ++ doc = loadAndParseFile(src_file); ++ + res = xsltApplyStylesheet(ss, doc, params); + xsltSaveResultToFilename(dst_file.c_str(), res, ss, 0); + +diff -u /var/tmp/portage/libfwbuilder-1.0.1/work/libfwbuilder-1.0.1/src/fwbuilder/XMLTools.hh ./XMLTools.hh +--- src/fwbuilder/XMLTools.hh 2003-07-06 06:12:20.000000000 +0000 ++++ src/fwbuilder/XMLTools.hh 2003-11-13 09:21:17.835703808 +0000 +@@ -6,7 +6,7 @@ + + Author: Vadim Kurland vadim@vk.crocodile.org + +- $Id: libfwbuilder-1.0.1-libxml2.patch,v 1.1 2003/11/13 09:36:22 aliz Exp $ ++ $Id: libfwbuilder-1.0.1-libxml2.patch,v 1.1 2003/11/13 09:36:22 aliz Exp $ + + + This program is free software which we release under the GNU General Public +@@ -64,6 +64,15 @@ + + static void initXMLTools(); + ++ /** ++ * a wrapper for xmlParseMemory. Returns a pointer to the document ++ * structure or NULL in case of failure. This wrapper allows us to ++ * use xmlParseFile or xmlParseMemory, whatever works. I used to ++ * use xmlParseFile just fine unitl libxml2 v2.6.2, in which it ++ * broke and I had to start using xmlParseMemory instead. ++ */ ++ static xmlDocPtr loadAndParseFile(const std::string &file_name) ++ throw(FWException); + + class UpgradePredicate + { diff --git a/net-libs/libfwbuilder/libfwbuilder-1.0.1-r1.ebuild b/net-libs/libfwbuilder/libfwbuilder-1.0.1-r1.ebuild new file mode 100644 index 000000000000..c847648bb5dd --- /dev/null +++ b/net-libs/libfwbuilder/libfwbuilder-1.0.1-r1.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-libs/libfwbuilder/libfwbuilder-1.0.1-r1.ebuild,v 1.1 2003/11/13 09:36:22 aliz Exp $ + +IUSE="ssl static" + +DESCRIPTION="A firewall GUI (library functions)" +SRC_URI="mirror://sourceforge/fwbuilder/${P}.tar.gz" +HOMEPAGE="http://www.fwbuilder.org/" +S=${WORKDIR}/${P} + +KEYWORDS="x86 ~sparc ~amd64" +LICENSE="GPL-2" +SLOT="0" + +DEPEND="sys-devel/autoconf + =dev-libs/glib-1.2* + >=dev-libs/libxml2-2.4.19 + !=dev-libs/libxml2-2.4.25 + >=dev-libs/libxslt-1.0.15 + snmp? ( virtual/snmp ) + ssl? ( dev-libs/openssl )" + +src_unpack() { + unpack ${A} ; cd ${S} + + epatch ${FILESDIR}/${P}-libxml2.patch +} + +src_compile() { + local myconf + + use static && myconf="${myconf} --disable-shared --enable-static=yes" + + ./autogen.sh \ + --prefix=/usr \ + --host=${CHOST} \ + `use_with ssl openssl` + ${myconf} || die "./configure failed" + + if [ "`use static`" ] ; then + emake LDFLAGS="-static" || die "emake LDFLAGS failed" + else + emake || die "emake failed" + fi +} + +src_install() { + emake DESTDIR=${D} install || die "emake install failed" + prepalldocs +} |