From a7d4bc7dfd2a50ae67262fe9f8a743bf6528fc6f Mon Sep 17 00:00:00 2001 From: Christian Heim Date: Sat, 2 Jun 2007 12:18:17 +0000 Subject: Hopefully fixing this weird bug I'm seeing on amd64. svn path=/; revision=329 --- bugfixes/net-analyzer/nload/Manifest | 16 ++++ .../net-analyzer/nload/files/digest-nload-0.6.0-r1 | 3 + .../files/nload-0.6.0-prevent-stripping.patch | 15 ++++ .../nload/files/nload-0.6.0-signedness.patch | 99 ++++++++++++++++++++++ bugfixes/net-analyzer/nload/nload-0.6.0-r1.ebuild | 31 +++++++ 5 files changed, 164 insertions(+) create mode 100644 bugfixes/net-analyzer/nload/Manifest create mode 100644 bugfixes/net-analyzer/nload/files/digest-nload-0.6.0-r1 create mode 100644 bugfixes/net-analyzer/nload/files/nload-0.6.0-prevent-stripping.patch create mode 100644 bugfixes/net-analyzer/nload/files/nload-0.6.0-signedness.patch create mode 100644 bugfixes/net-analyzer/nload/nload-0.6.0-r1.ebuild diff --git a/bugfixes/net-analyzer/nload/Manifest b/bugfixes/net-analyzer/nload/Manifest new file mode 100644 index 0000000..738b422 --- /dev/null +++ b/bugfixes/net-analyzer/nload/Manifest @@ -0,0 +1,16 @@ +AUX nload-0.6.0-prevent-stripping.patch 592 RMD160 1ba0691ced3d591909d461d46b1148d0f9a6de8a SHA1 9bcfde2518901760bcbebf36a0259702019a1341 SHA256 9367907e43aa05a50d4d74efc3d9d360e52c316640505ac9f77ed4ad46ef49c6 +MD5 db2db19aa3a812f774d7ada931d743e5 files/nload-0.6.0-prevent-stripping.patch 592 +RMD160 1ba0691ced3d591909d461d46b1148d0f9a6de8a files/nload-0.6.0-prevent-stripping.patch 592 +SHA256 9367907e43aa05a50d4d74efc3d9d360e52c316640505ac9f77ed4ad46ef49c6 files/nload-0.6.0-prevent-stripping.patch 592 +AUX nload-0.6.0-signedness.patch 2382 RMD160 1fbdc77b07c6c80c48e13614c8d97950651b0140 SHA1 7c3fcff9084db36c2bf8e64fcfe46e23fa079c41 SHA256 21bc1dd5f45dfd3bf01173026f5703af88400f49ad1bf4e78024a0e4b28a4522 +MD5 6f96a6869f1a912e0895a98791fa298f files/nload-0.6.0-signedness.patch 2382 +RMD160 1fbdc77b07c6c80c48e13614c8d97950651b0140 files/nload-0.6.0-signedness.patch 2382 +SHA256 21bc1dd5f45dfd3bf01173026f5703af88400f49ad1bf4e78024a0e4b28a4522 files/nload-0.6.0-signedness.patch 2382 +DIST nload-0.6.0.tar.gz 121136 RMD160 d7bcd89d32b90ce4e5676c6630e478cd3e73a9d7 SHA1 3f71fb4fce9b8f4da7dccf9ab9696c3d051012c2 SHA256 546c7934a1e97aed34982eca6a4f17d33956479f76de9151371fa58eb24766c9 +EBUILD nload-0.6.0-r1.ebuild 811 RMD160 030bea2f63a7f8fe7f1018935657c5e238e31db6 SHA1 8da4f98d62f35f18f4a2cb542bfac52abf3376fe SHA256 98e34db3a4be91f64db68290d7dec7075b492a0f7d7999b4db6553a0fddc1f5e +MD5 540eabb82625d07b7b75fa867361c227 nload-0.6.0-r1.ebuild 811 +RMD160 030bea2f63a7f8fe7f1018935657c5e238e31db6 nload-0.6.0-r1.ebuild 811 +SHA256 98e34db3a4be91f64db68290d7dec7075b492a0f7d7999b4db6553a0fddc1f5e nload-0.6.0-r1.ebuild 811 +MD5 a1c20bed67b2dbef6f42f70d4c522aac files/digest-nload-0.6.0-r1 235 +RMD160 a701c9930f2a92fa5970f8f787ac0079a4e65972 files/digest-nload-0.6.0-r1 235 +SHA256 141ed5b85ca905e8d5fe9095db7b032d08304554886805d21cf15b3e12a7c926 files/digest-nload-0.6.0-r1 235 diff --git a/bugfixes/net-analyzer/nload/files/digest-nload-0.6.0-r1 b/bugfixes/net-analyzer/nload/files/digest-nload-0.6.0-r1 new file mode 100644 index 0000000..821d6ef --- /dev/null +++ b/bugfixes/net-analyzer/nload/files/digest-nload-0.6.0-r1 @@ -0,0 +1,3 @@ +MD5 a8859e49176bb50826b52b8345b117d3 nload-0.6.0.tar.gz 121136 +RMD160 d7bcd89d32b90ce4e5676c6630e478cd3e73a9d7 nload-0.6.0.tar.gz 121136 +SHA256 546c7934a1e97aed34982eca6a4f17d33956479f76de9151371fa58eb24766c9 nload-0.6.0.tar.gz 121136 diff --git a/bugfixes/net-analyzer/nload/files/nload-0.6.0-prevent-stripping.patch b/bugfixes/net-analyzer/nload/files/nload-0.6.0-prevent-stripping.patch new file mode 100644 index 0000000..a856f8e --- /dev/null +++ b/bugfixes/net-analyzer/nload/files/nload-0.6.0-prevent-stripping.patch @@ -0,0 +1,15 @@ +Index: nload-0.6.0/configure.in +=================================================================== +--- nload-0.6.0.orig/configure.in ++++ nload-0.6.0/configure.in +@@ -76,8 +76,8 @@ fi + dnl Adds extra arguments to configure script. + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug], [do not strip debugging symbols (default no)]), +- test "$enableval" = "no" && LDFLAGS="$LDFLAGS -s", +- LDFLAGS="$LDFLAGS -s") ++ test "$enableval" = "no" && LDFLAGS="$LDFLAGS", ++ LDFLAGS="$LDFLAGS") + + dnl Checks for library functions. + AC_TYPE_SIGNAL diff --git a/bugfixes/net-analyzer/nload/files/nload-0.6.0-signedness.patch b/bugfixes/net-analyzer/nload/files/nload-0.6.0-signedness.patch new file mode 100644 index 0000000..53d53c1 --- /dev/null +++ b/bugfixes/net-analyzer/nload/files/nload-0.6.0-signedness.patch @@ -0,0 +1,99 @@ +--- nload-0.6.0.orig/src/proc.h ++++ nload-0.6.0/src/proc.h +@@ -36,8 +36,8 @@ + + void readLoad( unsigned long& in, unsigned long& out ); + +- unsigned long totalIn(); +- unsigned long totalOut(); ++ long long totalIn(); ++ long long totalOut(); + + int getElapsedTime(); + +@@ -51,7 +51,7 @@ + + char m_ip[16]; + +- unsigned long m_total[2]; ++ long long m_total[2]; + + }; + +--- nload-0.6.0.orig/src/status.h ++++ nload-0.6.0/src/status.h +@@ -52,7 +52,7 @@ + gigabyte = 7 + }; + +- void update( unsigned long, unsigned long ); ++ void update( unsigned long, long long); + void print( Window&, int, int, status_format traff_format, status_format data_format ); + void resetTrafficData(); + +--- nload-0.6.0.orig/src/proc.cpp ++++ nload-0.6.0/src/proc.cpp +@@ -126,7 +126,7 @@ + + void Proc::readLoad( unsigned long& in, unsigned long& out ) + { +- unsigned long total_new[2] = { 0, 0 }; ++ long long total_new[2] = { 0, 0 }; + int curr_time = 0; + struct timeval time; + +@@ -181,7 +181,7 @@ + + if( ! strcmp( m_dev, dev ) ) + { +- sscanf( tmp, "%lu %*u %*u %*u %*u %*u %*u %*u %lu", &total_new[0], &total_new[1] ); ++ sscanf( tmp, "%llu %*u %*u %*u %*u %*u %*u %*u %llu", &total_new[0], &total_new[1] ); + + if( total_new[0] > m_total[0] ) + in = total_new[0] - m_total[0]; +@@ -198,7 +198,7 @@ + } + } while( 0 ); + +- fclose(fd); ++ if (fd != NULL) fclose(fd); + + #endif + // === End Linux specific network data reading code === +@@ -513,12 +513,12 @@ + return m_elapsed_time; + } + +-unsigned long Proc::totalIn() ++long long Proc::totalIn() + { + return m_total[0]; + } + +-unsigned long Proc::totalOut() ++long long Proc::totalOut() + { + return m_total[1]; + } +--- nload-0.6.0.orig/src/status.cpp ++++ nload-0.6.0/src/status.cpp +@@ -30,7 +30,7 @@ + } + + //new traffic measurement has been made => update statistics +-void Status::update( unsigned long new_value, unsigned long new_total ) ++void Status::update( unsigned long new_value, long long new_total ) + { + + m_cur = new_value; +@@ -44,7 +44,9 @@ + *the /proc/net/dev file + *(the total bytes value reaches 4GB and then switches to 0) + */ +- if( new_total < ( m_total % UINT_MAX ) ) ++ if (new_total >= UINT_MAX ) ++ m_total = new_total; ++ else if ( new_total < ( m_total % UINT_MAX ) ) + m_total = ( ( m_total / UINT_MAX ) + 1 ) * UINT_MAX + new_total; + else + m_total = ( m_total / UINT_MAX ) * UINT_MAX + new_total; diff --git a/bugfixes/net-analyzer/nload/nload-0.6.0-r1.ebuild b/bugfixes/net-analyzer/nload/nload-0.6.0-r1.ebuild new file mode 100644 index 0000000..68e3cc7 --- /dev/null +++ b/bugfixes/net-analyzer/nload/nload-0.6.0-r1.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nload/nload-0.6.0-r1.ebuild,v 1.3 2007/03/22 14:25:52 gustavoz Exp $ + +inherit eutils autotools + +DESCRIPTION="console application which monitors network traffic and bandwidth usage in real time" +SRC_URI="mirror://sourceforge/nload/${P}.tar.gz" +HOMEPAGE="http://roland-riegel.de/nload/index_en.html" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~ppc sparc x86" +IUSE="" + +DEPEND=">=sys-libs/ncurses-5.2" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-prevent-stripping.patch + epatch "${FILESDIR}"/${P}-unsignedness.patch + eautoreconf +} + +src_install () { + #make DESTDIR=${D} install + einstall || die + dodoc README INSTALL ChangeLog AUTHORS +} + -- cgit v1.2.3-65-gdbad