summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-23 00:46:30 +0000
committerMike Frysinger <vapier@gentoo.org>2005-05-23 00:46:30 +0000
commit7865772df124d9b4c5edfb390dd0e01264744d8d (patch)
treee942af797ab5473e2d95c9326cb2d3119198904d /net-analyzer/vnstat
parentStable on SPARC. (diff)
downloadhistorical-7865772df124d9b4c5edfb390dd0e01264744d8d.tar.gz
historical-7865772df124d9b4c5edfb390dd0e01264744d8d.tar.bz2
historical-7865772df124d9b4c5edfb390dd0e01264744d8d.zip
Add patch by Aleksey Fedoseev to support ifaces with long names.
Package-Manager: portage-2.0.51.22-r1
Diffstat (limited to 'net-analyzer/vnstat')
-rw-r--r--net-analyzer/vnstat/ChangeLog10
-rw-r--r--net-analyzer/vnstat/Manifest19
-rw-r--r--net-analyzer/vnstat/files/digest-vnstat-1.4-r11
-rw-r--r--net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch49
-rw-r--r--net-analyzer/vnstat/vnstat-1.4-r1.ebuild65
5 files changed, 129 insertions, 15 deletions
diff --git a/net-analyzer/vnstat/ChangeLog b/net-analyzer/vnstat/ChangeLog
index ebbe2eca3138..fd6b9e67b702 100644
--- a/net-analyzer/vnstat/ChangeLog
+++ b/net-analyzer/vnstat/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-analyzer/vnstat
-# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/ChangeLog,v 1.9 2005/03/03 00:46:15 ka0ttic Exp $
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/ChangeLog,v 1.10 2005/05/23 00:46:30 vapier Exp $
+
+*vnstat-1.4-r1 (23 May 2005)
+
+ 23 May 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/vnstat-1.4-long_iface_name.patch, +vnstat-1.4-r1.ebuild:
+ Add patch by Aleksey Fedoseev to support ifaces with long names.
02 Mar 2005; Aaron Walker <ka0ttic@gentoo.org> vnstat-1.4.ebuild:
Fix pkg_postinst messages wrt to cron script name for bug 83825.
diff --git a/net-analyzer/vnstat/Manifest b/net-analyzer/vnstat/Manifest
index 1a93002d7c92..8bf08fe06496 100644
--- a/net-analyzer/vnstat/Manifest
+++ b/net-analyzer/vnstat/Manifest
@@ -1,17 +1,10 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 596e113e2623121b8b54f9398a7a9192 vnstat-1.4.ebuild 1741
-MD5 8658c3b493218f4c0929cffb6efe805f ChangeLog 1283
-MD5 432c6dc3dfd22b4c6657ddcc6c37979e metadata.xml 271
+MD5 a1ba79aaef00cab01a47abc87249c4b0 ChangeLog 1497
MD5 eb0a408331b471c0ce66781c2cf44ada vnstat-1.1.ebuild 645
+MD5 432c6dc3dfd22b4c6657ddcc6c37979e metadata.xml 271
+MD5 c9221af7fbb443f047e3160e37777593 vnstat-1.4-r1.ebuild 1859
+MD5 596e113e2623121b8b54f9398a7a9192 vnstat-1.4.ebuild 1741
MD5 389e6b2723965358ef9876b4e78d3bfc files/vnstat.cron 220
MD5 afdaa51d96e363c56fe7358b1c5814c5 files/digest-vnstat-1.1 61
+MD5 9330b188606445c3e0a9a90731ced54d files/vnstat-1.4-long_iface_name.patch 1260
+MD5 94dd735fdba2070fefd9f85480b1a2b9 files/digest-vnstat-1.4-r1 61
MD5 94dd735fdba2070fefd9f85480b1a2b9 files/digest-vnstat-1.4 61
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.0 (GNU/Linux)
-
-iD8DBQFCJl5iEZCkKN40op4RAteIAKCoH3QdFjUtCk5DTJcZrLDOgFar4wCeOQPz
-sSAfGRCzdmwDS1WctC/Lgeg=
-=vNpv
------END PGP SIGNATURE-----
diff --git a/net-analyzer/vnstat/files/digest-vnstat-1.4-r1 b/net-analyzer/vnstat/files/digest-vnstat-1.4-r1
new file mode 100644
index 000000000000..c2424fe6d2b1
--- /dev/null
+++ b/net-analyzer/vnstat/files/digest-vnstat-1.4-r1
@@ -0,0 +1 @@
+MD5 9184f79b5e60499bc059f670032291e5 vnstat-1.4.tar.gz 26237
diff --git a/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch b/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch
new file mode 100644
index 000000000000..ba869b6fb7dd
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch
@@ -0,0 +1,49 @@
+Interface names can be more than 7 chars long.
+
+Patch by Aleksey Fedoseev.
+
+--- vnstat-1.4/src/proc.c
++++ vnstat-1.4/src/proc.c
+@@ -64,6 +64,7 @@
+ void parseproc(int newdb)
+ {
+ char temp[64];
++ char* colon_pos;
+ uint64_t rx, tx, rxchange=0, txchange=0, btime; /* rxchange = rx change in MB */
+ uint64_t krxchange=0, ktxchange=0; /* krxchange = rx change in kB */
+ time_t current;
+@@ -86,12 +87,22 @@
+
+ current=time(NULL);
+
+- /* get rx from procline, easy since it's always procline+7 */
++ /* get rx position, then get it from procline */
++
++ colon_pos = strchr(procline, ':');
++ if (colon_pos == NULL) {
++ if (debug) {
++ printf("Bad /proc/net/dev string");
++ }
++ return;
++ }
++
++ colon_pos++;
+
+ #ifdef BLIMIT
+- rx=strtoull(procline+7, (char **)NULL, 0);
++ rx=strtoull(colon_pos, (char **)NULL, 0);
+ #else
+- rx=strtoul(procline+7, (char **)NULL, 0);
++ rx=strtoul(colon_pos, (char **)NULL, 0);
+ #endif
+
+ if (newdb!=1) {
+@@ -116,7 +127,7 @@
+
+
+ /* get tx from procline, ugly hack */
+- sscanf(procline+7,"%s %s %s %s %s %s %s %s %s",temp,temp,temp,temp,temp,temp,temp,temp,temp);
++ sscanf(colon_pos, "%s %s %s %s %s %s %s %s %s",temp,temp,temp,temp,temp,temp,temp,temp,temp);
+
+ #ifdef BLIMIT
+ tx=strtoull(temp, (char **)NULL, 0);
diff --git a/net-analyzer/vnstat/vnstat-1.4-r1.ebuild b/net-analyzer/vnstat/vnstat-1.4-r1.ebuild
new file mode 100644
index 000000000000..f5ae2a21ca58
--- /dev/null
+++ b/net-analyzer/vnstat/vnstat-1.4-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/vnstat-1.4-r1.ebuild,v 1.1 2005/05/23 00:46:30 vapier Exp $
+
+inherit eutils
+
+DESCRIPTION="Console-based network traffic monitor that keeps statistics of network usage"
+HOMEPAGE="http://humdi.net/vnstat/"
+SRC_URI="http://humdi.net/vnstat/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="virtual/cron"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-long_iface_name.patch
+}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}" || die
+}
+
+src_install() {
+ keepdir /var/lib/vnstat
+
+ dobin src/vnstat || die
+ exeinto /etc/cron.hourly
+ doexe "${FILESDIR}"/vnstat.cron vnstat
+ doman man/vnstat.1
+
+ newdoc pppd/vnstat_ip-down ip-down.example
+ newdoc pppd/vnstat_ip-up ip-up.example
+ dodoc CHANGES INSTALL README UPGRADE FAQ
+}
+
+pkg_postinst() {
+ # compatibility for 1.1 ebuild
+ if [[ -d ${ROOT}/var/spool/vnstat ]] ; then
+ mv -f "${ROOT}"/var/spool/vnstat/* "${ROOT}"/var/lib/vnstat/ \
+ && rmdir "${ROOT}"/var/spool/vnstat
+ einfo "vnStat db files moved from /var/spool/vnstat to /var/lib/vnstat"
+ fi
+
+ einfo "Repeat the following command for every interface you"
+ einfo "wish to monitor (replace eth0):"
+ einfo " vnstat -u -i eth0"
+ einfo
+ einfo "Note: if an interface transfers more than ~4GB in"
+ einfo "the time between cron runs, you may miss traffic"
+ einfo
+
+ if [[ -e ${ROOT}/etc/cron.d/vnstat ]] ; then
+ einfo "vnstat\'s cron script is now installed as /etc/cron.hourly/vnstat."
+ einfo "Please remove /etc/cron.d/vnstat."
+ else
+ einfo "A cron script has been installed to /etc/cron.hourly/vnstat.cron."
+ fi
+ einfo "To update your interface database automatically with"
+ einfo "cron, uncomment the lines in /etc/cron.hourly/vnstat.cron."
+}