summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2009-07-11 07:38:53 +0000
committerAlin Năstac <mrness@gentoo.org>2009-07-11 07:38:53 +0000
commit7001bc1eb343839de33706917a3d048a4d90c344 (patch)
tree9048b72747ec68ffe69bc7c650dbe5b99b9fd936
parentVersion Bump. (diff)
downloadgentoo-2-7001bc1eb343839de33706917a3d048a4d90c344.tar.gz
gentoo-2-7001bc1eb343839de33706917a3d048a4d90c344.tar.bz2
gentoo-2-7001bc1eb343839de33706917a3d048a4d90c344.zip
Migrate to EAPI 2. Fix flush commands (#274973).
(Portage version: 2.1.6.13/cvs/Linux x86_64)
-rw-r--r--sys-apps/iproute2/ChangeLog9
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.29.1-flush.patch220
-rw-r--r--sys-apps/iproute2/iproute2-2.6.29.1-r1.ebuild119
-rw-r--r--sys-apps/iproute2/iproute2-9999.ebuild16
4 files changed, 359 insertions, 5 deletions
diff --git a/sys-apps/iproute2/ChangeLog b/sys-apps/iproute2/ChangeLog
index cee28c8c20af..40da16ced989 100644
--- a/sys-apps/iproute2/ChangeLog
+++ b/sys-apps/iproute2/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/iproute2
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/ChangeLog,v 1.129 2009/06/09 02:46:56 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/ChangeLog,v 1.130 2009/07/11 07:38:52 mrness Exp $
+
+*iproute2-2.6.29.1-r1 (11 Jul 2009)
+
+ 11 Jul 2009; Alin Năstac <mrness@gentoo.org>
+ +files/iproute2-2.6.29.1-flush.patch, +iproute2-2.6.29.1-r1.ebuild,
+ iproute2-9999.ebuild:
+ Migrate to EAPI 2. Fix flush commands (#274973).
09 Jun 2009; Jeroen Roovers <jer@gentoo.org> iproute2-2.6.28.ebuild:
Stable for HPPA (bug #269184).
diff --git a/sys-apps/iproute2/files/iproute2-2.6.29.1-flush.patch b/sys-apps/iproute2/files/iproute2-2.6.29.1-flush.patch
new file mode 100644
index 000000000000..5e6be1ec1fa8
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.29.1-flush.patch
@@ -0,0 +1,220 @@
+diff -Nru iproute2-2.6.29-1.orig/ip/ipaddress.c iproute2-2.6.29-1/ip/ipaddress.c
+--- iproute2-2.6.29-1.orig/ip/ipaddress.c 2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/ip/ipaddress.c 2009-07-11 09:00:32.000000000 +0200
+@@ -37,6 +37,8 @@
+
+ #define MAX_ROUNDS 10
+
++static struct rtnl_handle rth_flush = { .fd = -1 };
++
+ static struct
+ {
+ int ifindex;
+@@ -339,7 +341,7 @@
+
+ static int flush_update(void)
+ {
+- if (rtnl_send_check(&rth, filter.flushb, filter.flushp) < 0) {
++ if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) {
+ perror("Failed to send flush request");
+ return -1;
+ }
+@@ -697,6 +699,9 @@
+ filter.flushp = 0;
+ filter.flushe = sizeof(flushb);
+
++ if (rtnl_open(&rth_flush, 0) < 0)
++ return 1;
++
+ while (round < MAX_ROUNDS) {
+ if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) {
+ perror("Cannot send dump request");
+@@ -715,18 +720,20 @@
+ printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":"");
+ }
+ fflush(stdout);
++ rtnl_close(&rth_flush);
+ return 0;
+ }
+ round++;
+ if (flush_update() < 0)
+- return 1;
++ break;
+
+ if (show_stats) {
+ printf("\n*** Round %d, deleting %d addresses ***\n", round, filter.flushed);
+ fflush(stdout);
+ }
+ }
+- fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", MAX_ROUNDS); fflush(stderr);
++ fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", round); fflush(stderr);
++ rtnl_close(&rth_flush);
+ return 1;
+ }
+
+diff -Nru iproute2-2.6.29-1.orig/ip/ipneigh.c iproute2-2.6.29-1/ip/ipneigh.c
+--- iproute2-2.6.29-1.orig/ip/ipneigh.c 2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/ip/ipneigh.c 2009-07-11 09:04:32.000000000 +0200
+@@ -32,6 +32,8 @@
+ #define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY)
+ #define MAX_ROUNDS 10
+
++static struct rtnl_handle rth_flush = { .fd = -1 };
++
+ static struct
+ {
+ int family;
+@@ -87,7 +89,7 @@
+
+ static int flush_update(void)
+ {
+- if (rtnl_send_check(&rth, filter.flushb, filter.flushp) < 0) {
++ if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) {
+ perror("Failed to send flush request");
+ return -1;
+ }
+@@ -391,6 +393,9 @@
+ filter.flushe = sizeof(flushb);
+ filter.state &= ~NUD_FAILED;
+
++ if (rtnl_open(&rth_flush, 0) < 0)
++ return 1;
++
+ while (round < MAX_ROUNDS) {
+ if (rtnl_wilddump_request(&rth, filter.family, RTM_GETNEIGH) < 0) {
+ perror("Cannot send dump request");
+@@ -409,18 +414,20 @@
+ printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":"");
+ }
+ fflush(stdout);
++ rtnl_close(&rth_flush);
+ return 0;
+ }
+ round++;
+ if (flush_update() < 0)
+- exit(1);
++ break;
++
+ if (show_stats) {
+ printf("\n*** Round %d, deleting %d entries ***\n", round, filter.flushed);
+ fflush(stdout);
+ }
+ }
+- printf("*** Flush not complete bailing out after %d rounds\n",
+- MAX_ROUNDS);
++ fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", round); fflush(stderr);
++ rtnl_close(&rth_flush);
+ return 1;
+ }
+
+diff -Nru iproute2-2.6.29-1.orig/ip/iproute.c iproute2-2.6.29-1/ip/iproute.c
+--- iproute2-2.6.29-1.orig/ip/iproute.c 2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/ip/iproute.c 2009-07-11 09:04:45.000000000 +0200
+@@ -37,6 +37,7 @@
+ #define RTAX_RTTVAR RTAX_HOPS
+ #endif
+
++static struct rtnl_handle rth_flush = { .fd = -1 };
+
+ static const char *mx_names[RTAX_MAX+1] = {
+ [RTAX_MTU] = "mtu",
+@@ -112,7 +113,7 @@
+
+ static int flush_update(void)
+ {
+- if (rtnl_send_check(&rth, filter.flushb, filter.flushp) < 0) {
++ if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) {
+ perror("Failed to send flush request");
+ return -1;
+ }
+@@ -1210,6 +1211,9 @@
+ filter.flushp = 0;
+ filter.flushe = sizeof(flushb);
+
++ if (rtnl_open(&rth_flush, 0) < 0)
++ return 1;
++
+ for (;;) {
+ if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
+ perror("Cannot send dump request");
+@@ -1228,6 +1232,7 @@
+ printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":"");
+ }
+ fflush(stdout);
++ rtnl_close(&rth_flush);
+ return 0;
+ }
+ round++;
+diff -Nru iproute2-2.6.29-1.orig/ip/xfrm_policy.c iproute2-2.6.29-1/ip/xfrm_policy.c
+--- iproute2-2.6.29-1.orig/ip/xfrm_policy.c 2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/ip/xfrm_policy.c 2009-07-11 08:59:34.000000000 +0200
+@@ -756,11 +756,15 @@
+ struct xfrm_buffer xb;
+ char buf[NLMSG_DELETEALL_BUF_SIZE];
+ int i;
++ struct rtnl_handle rth2;
+
+ xb.buf = buf;
+ xb.size = sizeof(buf);
+ xb.rth = &rth;
+
++ if (rtnl_open(&rth2, 0) < 0)
++ exit(1);
++
+ for (i = 0; ; i++) {
+ xb.offset = 0;
+ xb.nlmsg_count = 0;
+@@ -783,7 +787,7 @@
+ break;
+ }
+
+- if (rtnl_send_check(&rth, xb.buf, xb.offset) < 0) {
++ if (rtnl_send_check(&rth2, xb.buf, xb.offset) < 0) {
+ perror("Failed to send delete-all request");
+ exit(1);
+ }
+@@ -793,6 +797,8 @@
+ xb.offset = 0;
+ xb.nlmsg_count = 0;
+ }
++
++ rtnl_close(&rth2);
+ } else {
+ if (rtnl_wilddump_request(&rth, preferred_family, XFRM_MSG_GETPOLICY) < 0) {
+ perror("Cannot send dump request");
+diff -Nru iproute2-2.6.29-1.orig/ip/xfrm_state.c iproute2-2.6.29-1/ip/xfrm_state.c
+--- iproute2-2.6.29-1.orig/ip/xfrm_state.c 2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/ip/xfrm_state.c 2009-07-11 09:03:37.000000000 +0200
+@@ -924,11 +924,15 @@
+ struct xfrm_buffer xb;
+ char buf[NLMSG_DELETEALL_BUF_SIZE];
+ int i;
++ struct rtnl_handle rth2;
+
+ xb.buf = buf;
+ xb.size = sizeof(buf);
+ xb.rth = &rth;
+
++ if (rtnl_open(&rth2, 0) < 0)
++ exit(1);
++
+ for (i = 0; ; i++) {
+ xb.offset = 0;
+ xb.nlmsg_count = 0;
+@@ -951,7 +955,7 @@
+ break;
+ }
+
+- if (rtnl_send_check(&rth, xb.buf, xb.offset) < 0) {
++ if (rtnl_send_check(&rth2, xb.buf, xb.offset) < 0) {
+ perror("Failed to send delete-all request\n");
+ exit(1);
+ }
+@@ -962,6 +966,7 @@
+ xb.nlmsg_count = 0;
+ }
+
++ rtnl_close(&rth2);
+ } else {
+ if (rtnl_wilddump_request(&rth, preferred_family, XFRM_MSG_GETSA) < 0) {
+ perror("Cannot send dump request");
diff --git a/sys-apps/iproute2/iproute2-2.6.29.1-r1.ebuild b/sys-apps/iproute2/iproute2-2.6.29.1-r1.ebuild
new file mode 100644
index 000000000000..5b7a3fb93999
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-2.6.29.1-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-2.6.29.1-r1.ebuild,v 1.1 2009/07/11 07:38:52 mrness Exp $
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git
+ SRC_URI=""
+ KEYWORDS=""
+else
+ if [[ ${PV} == *.*.*.* ]] ; then
+ MY_PV=${PV%.*}-${PV##*.}
+ else
+ MY_PV=${PV}
+ fi
+ MY_P="${PN}-${MY_PV}"
+ SRC_URI="http://developer.osdl.org/dev/iproute2/download/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh -sparc ~x86"
+ S=${WORKDIR}/${MY_P}
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://linux-net.osdl.org/index.php/Iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb minimal"
+
+RDEPEND="!net-misc/arpd
+ !minimal? ( berkdb? ( sys-libs/db ) )
+ atm? ( net-dialup/linux-atm )"
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )
+ >=virtual/os-headers-2.6.27"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git_src_unpack
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ sed -i "s:-O2:${CFLAGS} ${CPPFLAGS}:" Makefile || die "sed Makefile failed"
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+
+ epatch "${FILESDIR}"/${PN}-2.6.26-ldflags.patch #236861
+ epatch "${FILESDIR}"/${PN}-2.6.29.1-flush.patch #274973
+
+ local check base=${PORTAGE_CONFIGROOT}/etc/portage/patches
+ for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do
+ EPATCH_SOURCE=${base}/${CTARGET}/${check}
+ [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check}
+ [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check}
+ if [[ -d ${EPATCH_SOURCE} ]] ; then
+ EPATCH_SUFFIX="patch"
+ EPATCH_FORCE="yes" \
+ EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \
+ epatch
+ break
+ fi
+ done
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+ # Multilib fixes
+ sed -i 's:/usr/local:/usr:' tc/m_ipt.c include/iptables.h
+ sed -i "s:/usr/lib:/usr/$(get_libdir):g" \
+ netem/Makefile tc/{Makefile,tc.c,q_netem.c,m_ipt.c} include/iptables.h || die
+ sed -i "s:/lib/tc:$(get_libdir)/tc:g" tc/Makefile || die
+ # Use correct iptables dir, #144265
+ sed -i "s:/usr/local/lib/iptables:/$(get_libdir)/iptables:g" \
+ include/iptables.h
+}
+
+src_configure() {
+ echo -n 'TC_CONFIG_ATM:=' > Config
+ use atm \
+ && echo 'y' >> Config \
+ || echo 'n' >> Config
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ || die "make failed"
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc || die "minimal"
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ SBINDIR=/sbin \
+ DOCDIR=/usr/share/doc/${PF} \
+ MANDIR=/usr/share/man \
+ install \
+ || die "make install failed"
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/sbin
+ mv "${D}"/sbin/arpd "${D}"/usr/sbin/
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-9999.ebuild b/sys-apps/iproute2/iproute2-9999.ebuild
index e322d6e02073..a1ca5ea14372 100644
--- a/sys-apps/iproute2/iproute2-9999.ebuild
+++ b/sys-apps/iproute2/iproute2-9999.ebuild
@@ -1,6 +1,8 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-9999.ebuild,v 1.4 2009/05/29 22:30:26 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-9999.ebuild,v 1.5 2009/07/11 07:38:52 mrness Exp $
+
+EAPI="2"
inherit eutils toolchain-funcs
@@ -41,13 +43,16 @@ src_unpack() {
else
unpack ${A}
fi
- cd "${S}"
+}
+
+src_prepare() {
sed -i "s:-O2:${CFLAGS} ${CPPFLAGS}:" Makefile || die "sed Makefile failed"
# build against system headers
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
epatch "${FILESDIR}"/${PN}-2.6.26-ldflags.patch #236861
+ epatch "${FILESDIR}"/${PN}-2.6.29.1-flush.patch #274973
local check base=${PORTAGE_CONFIGROOT}/etc/portage/patches
for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do
@@ -75,17 +80,20 @@ src_unpack() {
include/iptables.h
}
-src_compile() {
+src_configure() {
echo -n 'TC_CONFIG_ATM:=' > Config
use atm \
&& echo 'y' >> Config \
|| echo 'n' >> Config
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
+}
+
+src_compile() {
emake \
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
- || die "make"
+ || die "make failed"
}
src_install() {