diff options
author | Santiago M. Mola <coldwind@gentoo.org> | 2007-08-17 22:56:50 +0000 |
---|---|---|
committer | Santiago M. Mola <coldwind@gentoo.org> | 2007-08-17 22:56:50 +0000 |
commit | cedfeaa77983295fbc0104d399e3e9389cdac6d4 (patch) | |
tree | 2eaacf26e6ac6a9447afb605bb6390b74d3df60f /net-p2p | |
parent | Stable for HPPA (bug #187710). (diff) | |
download | gentoo-2-cedfeaa77983295fbc0104d399e3e9389cdac6d4.tar.gz gentoo-2-cedfeaa77983295fbc0104d399e3e9389cdac6d4.tar.bz2 gentoo-2-cedfeaa77983295fbc0104d399e3e9389cdac6d4.zip |
Upgraded cacheupdate.sh, bug #162313
(Portage version: 2.1.2.11)
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/gift-gnutella/ChangeLog | 6 | ||||
-rw-r--r-- | net-p2p/gift-gnutella/files/cacheupdate.sh | 76 | ||||
-rw-r--r-- | net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild | 38 |
3 files changed, 86 insertions, 34 deletions
diff --git a/net-p2p/gift-gnutella/ChangeLog b/net-p2p/gift-gnutella/ChangeLog index f8a20f64716b..0d463c02125d 100644 --- a/net-p2p/gift-gnutella/ChangeLog +++ b/net-p2p/gift-gnutella/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-p2p/gift-gnutella # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/gift-gnutella/ChangeLog,v 1.40 2007/07/12 14:33:49 betelgeuse Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/gift-gnutella/ChangeLog,v 1.41 2007/08/17 22:56:49 coldwind Exp $ + + 17 Aug 2007; Santiago M. Mola <coldwind@gentoo.org> files/cacheupdate.sh, + gift-gnutella-0.0.11.ebuild: + Upgraded cacheupdate.sh, bug #162313 12 Jul 2007; Petteri Räty <betelgeuse@gentoo.org> metadata.xml, gift-gnutella-0.0.11.ebuild: diff --git a/net-p2p/gift-gnutella/files/cacheupdate.sh b/net-p2p/gift-gnutella/files/cacheupdate.sh index 692e5f23beaf..8dc5e9a140e1 100644 --- a/net-p2p/gift-gnutella/files/cacheupdate.sh +++ b/net-p2p/gift-gnutella/files/cacheupdate.sh @@ -1,25 +1,73 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/gift-gnutella/files/cacheupdate.sh,v 1.9 2007/01/16 13:42:00 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/gift-gnutella/files/cacheupdate.sh,v 1.10 2007/08/17 22:56:50 coldwind Exp $ -CACHE=http://www.gnucleus.com/gwebcache/ +CACHE_LIST="g2.tjtech.org/g2/ + gwc1c.olden.ch.3557.nyud.net:8080/gwc/ + gwc.eod.cc/skulls.php + skulls.mi-cha-el.org/skulls.php + gwc.frodoslair.net/skulls/skulls" + +URLFILE="?urlfile=1\&client=GEN2\&version=0.2" +HOSTFILE="?hostfile=1\&client=GEN2\&version=0.2" if [ -d ~/.giFT/Gnutella/ ]; then cd ~/.giFT/Gnutella - wget ${CACHE}?urlfile=1\&client=GEN2\&version=0.2 -O gwebcaches.new || die "Unable to retrieve new caches." - if [ "`grep ERROR gwebcaches.new`" ]; then - cat gwebcaches.new + + # Try to fetch an updated list + wget http://gcachescan.jonatkins.com/ -O .my_list &> /dev/null + if [[ $? -eq 0 ]] ; then + my_cache_list=$(grep gcachedetail .my_list | sed -e "s:.*gcachedetail.cgi?\(.*\)\">?</a>.*:\1:g" | head -n 10) + [[ -n ${my_cache_list} ]] && CACHE_LIST=${my_cache_list} else - mv gwebcaches.new gwebcaches + echo "Failed to fetch gwebcaches' list, trying with local list." fi - wget ${CACHE}?hostfile=1\&client=GEN2\&version=0.2 -O nodes.new || die "Unable to retrieve new hosts." - if [ "`grep ERROR nodes.new`" ]; then - cat nodes.new - else - mv nodes.new nodes + + # Fetch gwebcaches + ok=0 + for cache in ${CACHE_LIST} ; do + wget ${cache}${URLFILE} -O .gwebcaches.new &> /dev/null + if [[ $? -ne 0 ]] ; then + echo "Failed to fetch gwebcaches file from ${cache}" + #CACHE_LIST=${CACHE_LIST/${cache}/} + elif [[ -z $(grep -e "^http://.*" .gwebcaches.new) ]] || [[ -n $(grep ERROR .gwebcaches.new) ]] ; then + echo "Fetched file from ${cache} is invalid" + else + mv .gwebcaches.new gwebcaches + echo -e "\ngwebcaches fetched\n" + ok=1 + break + fi + done + if [[ $ok -ne 1 ]] ; then + echo "Couldn't fetch gwebcaches!" + exit 1 fi - echo "Update complete!" + + # Fetch nodes + ok=0 + for cache in ${CACHE_LIST} ; do + wget ${cache}${HOSTFILE} -O .nodes.new &> /dev/null + if [[ $? -ne 0 ]] ; then + echo "Failed to fetch nodes file from ${cache}" + #CACHE_LIST=${CACHE_LIST/${cache}/} + elif [[ -n $(grep ERROR .nodes.new) ]] ; then + echo "Fetched file from ${cache} is invalid" + else + mv .nodes.new nodes + echo -e "\nnodes fetched\n" + ok=1 + break + fi + done + if [[ $ok -ne 1 ]] ; then + echo "Couldn't fetch nodes!" + exit 1 + fi + + rm .my_list + echo -e "\nUpdate complete!" else - echo "Please emerge gift-gnutella and run gift-setup." + echo " ~/.giFT/Gnutella/ does not exist. Please run gift-setup." fi diff --git a/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild b/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild index d194110fc861..56c87b1a8265 100644 --- a/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild +++ b/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild @@ -1,24 +1,23 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild,v 1.10 2007/07/13 05:52:07 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild,v 1.11 2007/08/17 22:56:49 coldwind Exp $ inherit eutils -IUSE="xml" - DESCRIPTION="The giFT Gnutella plugin" HOMEPAGE="http://gift.sf.net/" SRC_URI="mirror://sourceforge/gift/${P}.tar.bz2" + SLOT="0" LICENSE="GPL-2" KEYWORDS="alpha amd64 ia64 ~ppc sparc x86 ~x86-fbsd" +IUSE="xml" RDEPEND=">=net-p2p/gift-0.11.6" -DEPEND=" +DEPEND="${RDEPEND} dev-util/pkgconfig app-arch/bzip2 - dev-libs/libxml2 - ${RDEPEND}" + dev-libs/libxml2" src_compile() { econf $(use_with xml libxml) || die "failed to configure" @@ -26,22 +25,23 @@ src_compile() { } src_install() { - einstall giftconfdir=${D}/etc/giFT \ - plugindir=${D}/usr/$(get_libdir)/giFT \ - datadir=${D}/usr/share \ - giftperldir=${D}/usr/bin \ - libgiftincdir=${D}/usr/include/libgift || die "Install failed" + einstall giftconfdir="${D}"/etc/giFT \ + plugindir="${D}"/usr/$(get_libdir)/giFT \ + datadir="${D}"/usr/share \ + giftperldir="${D}"/usr/bin \ + libgiftincdir="${D}"/usr/include/libgift || die "einstall failed" + newbin "${FILESDIR}"/cacheupdate.sh ${PN}-cacheupdate.sh } pkg_postinst() { - einfo "It is recommended that you re-run gift-setup as" - einfo "the user you will run the giFT daemon as:" - einfo "\tgift-setup" + elog "It is recommended that you re-run gift-setup as" + elog "the user you will run the giFT daemon as:" + elog "\tgift-setup" echo - einfo "Alternatively you can add the following line to" - einfo "your ~/.giFT/giftd.conf configuration file:" - einfo "plugins = Gnutella" + elog "Alternatively you can add the following line to" + elog "your ~/.giFT/giftd.conf configuration file:" + elog "plugins = Gnutella" echo - einfo "To update your caches, run:" - einfo "\tsh /usr/portage/net-p2p/${PN}/files/cacheupdate.sh" + elog "To update your caches, run:" + elog "\t${PN}-cacheupdate.sh" } |