public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gnome:master commit in: gnome-extra/gnome-system-monitor/files/, gnome-extra/gnome-system-monitor/
@ 2011-07-26  8:29 Alexandre Restovtsev
  0 siblings, 0 replies; only message in thread
From: Alexandre Restovtsev @ 2011-07-26  8:29 UTC (permalink / raw
  To: gentoo-commits

commit:     5a5a7ebae55139c11f6ccae001e633dc2d95744a
Author:     Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com>
AuthorDate: Tue Jul 26 07:51:25 2011 +0000
Commit:     Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
CommitDate: Tue Jul 26 07:51:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=5a5a7eba

gnome-extra/gnome-system-monitor: 3.0.1 → 3.0.1-r1

Add patches from upstream git master (not present in the gnome-3-0
branch, unfortunately) fixing the maximum nice value on Linux and an
overflow in the network history totals counters on 32-bit architectures.

---
 ...or-3.0.1-32-bit-network-totals-overflow-1.patch |   68 +++++++++
 ...or-3.0.1-32-bit-network-totals-overflow-2.patch |  150 ++++++++++++++++++++
 ...or-3.0.1-32-bit-network-totals-overflow-3.patch |  102 +++++++++++++
 .../gnome-system-monitor-3.0.1-linux-nice.patch    |   21 +++
 ...ebuild => gnome-system-monitor-3.0.1-r1.ebuild} |   12 ++-
 5 files changed, 352 insertions(+), 1 deletions(-)

diff --git a/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-1.patch b/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-1.patch
new file mode 100644
index 0000000..156845f
--- /dev/null
+++ b/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-1.patch
@@ -0,0 +1,68 @@
+From 3ea7303181e80e188e72a4fcd98b9970fe554b3b Mon Sep 17 00:00:00 2001
+From: Chris Kühl <chrisk@openismus.com>
+Date: Sat, 16 Apr 2011 23:07:20 +0000
+Subject: Added SI prefix tera to network counter
+
+https://bugzilla.gnome.org/show_bug.cgi?id=639212
+---
+diff --git a/src/util.cpp b/src/util.cpp
+index 90073fe..234e6fc 100644
+--- a/src/util.cpp
++++ b/src/util.cpp
+@@ -149,10 +149,12 @@ procman_make_label_for_mmaps_or_ofiles(const char *format,
+ gchar*
+ procman::format_size(guint64 size, guint64 max_size, bool want_bits)
+ {
++
+ 	enum {
+ 		K_INDEX,
+ 		M_INDEX,
+-		G_INDEX
++		G_INDEX,
++                T_INDEX
+ 	};
+ 
+ 	struct Format {
+@@ -160,16 +162,18 @@ procman::format_size(guint64 size, guint64 max_size, bool want_bits)
+ 		const char* string;
+ 	};
+ 
+-	const Format all_formats[2][3] = {
+-		{ { 1UL << 10,	N_("%.1f KiB") },
+-		  { 1UL << 20,	N_("%.1f MiB") },
+-		  { 1UL << 30,	N_("%.1f GiB") } },
+-		{ { 1000,	N_("%.1f kbit") },
+-		  { 1000000,	N_("%.1f Mbit") },
+-		  { 1000000000,	N_("%.1f Gbit") } }
++	const Format all_formats[2][4] = {
++		{ { 1UL << 10,	   N_("%.1f KiB")  },
++		  { 1UL << 20,	   N_("%.1f MiB")  },
++		  { 1UL << 30,	   N_("%.1f GiB")  },
++                  { 1UL << 40,     N_("%.1f TiB")  } },
++		{ { 1000,	   N_("%.1f kbit") },
++		  { 1000000,	   N_("%.1f Mbit") },
++		  { 1000000000,	   N_("%.1f Gbit") },
++                  { 1000000000000, N_("%.1f Tbit") } }
+ 	};
+ 
+-	const Format (&formats)[3] = all_formats[want_bits ? 1 : 0];
++	const Format (&formats)[4] = all_formats[want_bits ? 1 : 0];
+ 
+ 	if (want_bits) {
+ 	  size *= 8;
+@@ -194,9 +198,12 @@ procman::format_size(guint64 size, guint64 max_size, bool want_bits)
+ 		} else if (max_size < formats[G_INDEX].factor) {
+ 		  factor = formats[M_INDEX].factor;
+ 		  format = formats[M_INDEX].string;
+-		} else {
++		} else if (max_size < formats[T_INDEX].factor) {
+ 		  factor = formats[G_INDEX].factor;
+ 		  format = formats[G_INDEX].string;
++		} else {
++		  factor = formats[T_INDEX].factor;
++		  format = formats[T_INDEX].string;
+ 		}
+ 
+ 		return g_strdup_printf(_(format), size / (double)factor);
+--
+cgit v0.9

diff --git a/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-2.patch b/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-2.patch
new file mode 100644
index 0000000..4fdc57a
--- /dev/null
+++ b/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-2.patch
@@ -0,0 +1,150 @@
+From c7275791a89623ad1edc820a6ef16faae37a18aa Mon Sep 17 00:00:00 2001
+From: Chris Kühl <chrisk@openismus.com>
+Date: Sun, 17 Apr 2011 22:31:00 +0000
+Subject: Fix network totals overflow on 32-bit machines.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=639212
+---
+diff --git a/src/load-graph.cpp b/src/load-graph.cpp
+index 57bca17..a6d2a7e 100644
+--- a/src/load-graph.cpp
++++ b/src/load-graph.cpp
+@@ -368,16 +368,16 @@ get_memory (LoadGraph *g)
+ }
+ 
+ static void
+-net_scale (LoadGraph *g, unsigned din, unsigned dout)
++net_scale (LoadGraph *g, guint64 din, guint64 dout)
+ {
+ 	g->data[0][0] = 1.0f * din / g->net.max;
+ 	g->data[0][1] = 1.0f * dout / g->net.max;
+ 
+-	unsigned dmax = std::max(din, dout);
++        guint64 dmax = std::max(din, dout);
+ 	g->net.values[g->net.cur] = dmax;
+ 	g->net.cur = (g->net.cur + 1) % LoadGraph::NUM_POINTS;
+ 
+-	unsigned new_max;
++	guint64 new_max;
+ 	// both way, new_max is the greatest value
+ 	if (dmax >= g->net.max)
+ 		new_max = dmax;
+@@ -389,7 +389,7 @@ net_scale (LoadGraph *g, unsigned din, unsigned dout)
+ 	// Round network maximum
+ 	//
+ 
+-	const unsigned bak_max(new_max);
++	const guint64 bak_max(new_max);
+ 
+ 	if (ProcData::get_instance()->config.network_in_bits) {
+ 	  // TODO: fix logic to give a nice scale with bits
+@@ -399,7 +399,7 @@ net_scale (LoadGraph *g, unsigned din, unsigned dout)
+ 	  new_max = 1.1 * new_max;
+ 	  // make sure max is not 0 to avoid / 0
+ 	  // default to 125 bytes == 1kbit
+-	  new_max = std::max(new_max, 125U);
++	  new_max = std::max(new_max, 125UL);
+ 
+ 	} else {
+ 	  // round up to get some extra space
+@@ -407,7 +407,7 @@ net_scale (LoadGraph *g, unsigned din, unsigned dout)
+ 	  new_max = 1.1 * new_max;
+ 	  // make sure max is not 0 to avoid / 0
+ 	  // default to 1 KiB
+-	  new_max = std::max(new_max, 1024U);
++	  new_max = std::max(new_max, 1024UL);
+ 
+ 	  // decompose new_max = coef10 * 2**(base10 * 10)
+ 	  // where coef10 and base10 are integers and coef10 < 2**10
+@@ -415,16 +415,16 @@ net_scale (LoadGraph *g, unsigned din, unsigned dout)
+ 	  // e.g: ceil(100.5 KiB) = 101 KiB = 101 * 2**(1 * 10)
+ 	  //      where base10 = 1, coef10 = 101, pow2 = 16
+ 
+-	  unsigned pow2 = std::floor(log2(new_max));
+-	  unsigned base10 = pow2 / 10;
+-	  unsigned coef10 = std::ceil(new_max / double(1UL << (base10 * 10)));
++	  guint64 pow2 = std::floor(log2(new_max));
++	  guint64 base10 = pow2 / 10.0;
++	  guint64 coef10 = std::ceil(new_max / double(1UL <<(base10 * 10)));
+ 	  g_assert(new_max <= (coef10 * (1UL << (base10 * 10))));
+ 
+ 	  // then decompose coef10 = x * 10**factor10
+ 	  // where factor10 is integer and x < 10
+ 	  // so we new_max has only 1 significant digit
+ 
+-	  unsigned factor10 = std::pow(10.0, std::floor(std::log10(coef10)));
++	  guint64 factor10 = std::pow(10.0, std::floor(std::log10(coef10)));
+ 	  coef10 = std::ceil(coef10 / double(factor10)) * factor10;
+ 
+ 	  // then make coef10 divisible by num_bars
+@@ -432,12 +432,12 @@ net_scale (LoadGraph *g, unsigned din, unsigned dout)
+ 	    coef10 = coef10 + (g->num_bars() - coef10 % g->num_bars());
+ 	  g_assert(coef10 % g->num_bars() == 0);
+ 
+-	  new_max = coef10 * (1UL << (base10 * 10));
+-	  procman_debug("bak %u new_max %u pow2 %u coef10 %u", bak_max, new_max, pow2, coef10);
++	  new_max = coef10 * (1UL << guint64(base10 * 10));
++	  procman_debug("bak %lu new_max %lu pow2 %lu coef10 %lu", bak_max, new_max, pow2, coef10);
+ 	}
+ 
+ 	if (bak_max > new_max) {
+-	  procman_debug("overflow detected: bak=%u new=%u", bak_max, new_max);
++	  procman_debug("overflow detected: bak=%lu new=%lu", bak_max, new_max);
+ 	  new_max = bak_max;
+ 	}
+ 
+@@ -446,7 +446,7 @@ net_scale (LoadGraph *g, unsigned din, unsigned dout)
+ 	if ((0.8 * g->net.max) < new_max && new_max <= g->net.max)
+ 		return;
+ 
+-	const float scale = 1.0f * g->net.max / new_max;
++	const double scale = 1.0f * g->net.max / new_max;
+ 
+ 	for (size_t i = 0; i < LoadGraph::NUM_POINTS; i++) {
+ 		if (g->data[i][0] >= 0.0f) {
+@@ -455,7 +455,7 @@ net_scale (LoadGraph *g, unsigned din, unsigned dout)
+ 		}
+ 	}
+ 
+-	procman_debug("rescale dmax = %u max = %u new_max = %u", dmax, g->net.max, new_max);
++	procman_debug("rescale dmax = %lu max = %lu new_max = %lu", dmax, g->net.max, new_max);
+ 
+ 	g->net.max = new_max;
+ 
+@@ -471,7 +471,7 @@ get_net (LoadGraph *g)
+ 	guint32 i;
+ 	guint64 in = 0, out = 0;
+ 	GTimeVal time;
+-	unsigned din, dout;
++	guint64 din, dout;
+ 
+ 	ifnames = glibtop_get_netlist(&netlist);
+ 
+@@ -510,9 +510,9 @@ get_net (LoadGraph *g)
+ 	    g->net.time.tv_sec != 0) {
+ 		float dtime;
+ 		dtime = time.tv_sec - g->net.time.tv_sec +
+-			(float) (time.tv_usec - g->net.time.tv_usec) / G_USEC_PER_SEC;
+-		din   = static_cast<unsigned>((in  - g->net.last_in)  / dtime);
+-		dout  = static_cast<unsigned>((out - g->net.last_out) / dtime);
++			(double) (time.tv_usec - g->net.time.tv_usec) / G_USEC_PER_SEC;
++		din   = static_cast<guint64>((in  - g->net.last_in)  / dtime);
++		dout  = static_cast<guint64>((out - g->net.last_out) / dtime);
+ 	} else {
+ 		/* Don't calc anything if new data is less than old (interface
+ 		   removed, counters reset, ...) or if it is the first time */
+diff --git a/src/load-graph.h b/src/load-graph.h
+index d90cf38..9b43c86 100644
+--- a/src/load-graph.h
++++ b/src/load-graph.h
+@@ -87,7 +87,7 @@ struct LoadGraph {
+ 		struct {
+ 			guint64 last_in, last_out;
+ 			GTimeVal time;
+-			unsigned int max;
++			guint64 max;
+ 			unsigned values[NUM_POINTS];
+ 			size_t cur;
+ 		} net;
+--
+cgit v0.9

diff --git a/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-3.patch b/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-3.patch
new file mode 100644
index 0000000..d3ac4d9
--- /dev/null
+++ b/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-32-bit-network-totals-overflow-3.patch
@@ -0,0 +1,102 @@
+From 843cc40119d36873f9670975c7815fbd38481093 Mon Sep 17 00:00:00 2001
+From: Chris Kühl <chrisk@openismus.com>
+Date: Thu, 12 May 2011 21:43:31 +0000
+Subject: Fix for issues on 32-bit machines.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=649842
+---
+diff --git a/src/load-graph.cpp b/src/load-graph.cpp
+index a6d2a7e..9291179 100644
+--- a/src/load-graph.cpp
++++ b/src/load-graph.cpp
+@@ -399,7 +399,7 @@ net_scale (LoadGraph *g, guint64 din, guint64 dout)
+ 	  new_max = 1.1 * new_max;
+ 	  // make sure max is not 0 to avoid / 0
+ 	  // default to 125 bytes == 1kbit
+-	  new_max = std::max(new_max, 125UL);
++	  new_max = std::max(new_max, G_GUINT64_CONSTANT(125));
+ 
+ 	} else {
+ 	  // round up to get some extra space
+@@ -407,7 +407,7 @@ net_scale (LoadGraph *g, guint64 din, guint64 dout)
+ 	  new_max = 1.1 * new_max;
+ 	  // make sure max is not 0 to avoid / 0
+ 	  // default to 1 KiB
+-	  new_max = std::max(new_max, 1024UL);
++	  new_max = std::max(new_max, G_GUINT64_CONSTANT(1024));
+ 
+ 	  // decompose new_max = coef10 * 2**(base10 * 10)
+ 	  // where coef10 and base10 are integers and coef10 < 2**10
+@@ -417,8 +417,8 @@ net_scale (LoadGraph *g, guint64 din, guint64 dout)
+ 
+ 	  guint64 pow2 = std::floor(log2(new_max));
+ 	  guint64 base10 = pow2 / 10.0;
+-	  guint64 coef10 = std::ceil(new_max / double(1UL <<(base10 * 10)));
+-	  g_assert(new_max <= (coef10 * (1UL << (base10 * 10))));
++	  guint64 coef10 = std::ceil(new_max / double(G_GUINT64_CONSTANT(1) << (base10 * 10)));
++	  g_assert(new_max <= (coef10 * (G_GUINT64_CONSTANT(1) << (base10 * 10))));
+ 
+ 	  // then decompose coef10 = x * 10**factor10
+ 	  // where factor10 is integer and x < 10
+@@ -431,13 +431,16 @@ net_scale (LoadGraph *g, guint64 din, guint64 dout)
+ 	  if (coef10 % g->num_bars() != 0)
+ 	    coef10 = coef10 + (g->num_bars() - coef10 % g->num_bars());
+ 	  g_assert(coef10 % g->num_bars() == 0);
+-
+-	  new_max = coef10 * (1UL << guint64(base10 * 10));
+-	  procman_debug("bak %lu new_max %lu pow2 %lu coef10 %lu", bak_max, new_max, pow2, coef10);
++	  new_max = coef10 * (G_GUINT64_CONSTANT(1) << guint64(base10 * 10));
++	  procman_debug("bak %" G_GUINT64_FORMAT " new_max %" G_GUINT64_FORMAT
++                        "pow2 %" G_GUINT64_FORMAT " coef10 %" G_GUINT64_FORMAT,
++                        bak_max, new_max, pow2, coef10);
+ 	}
+ 
+ 	if (bak_max > new_max) {
+-	  procman_debug("overflow detected: bak=%lu new=%lu", bak_max, new_max);
++	  procman_debug("overflow detected: bak=%" G_GUINT64_FORMAT
++                        " new=%" G_GUINT64_FORMAT,
++                        bak_max, new_max);
+ 	  new_max = bak_max;
+ 	}
+ 
+@@ -455,7 +458,10 @@ net_scale (LoadGraph *g, guint64 din, guint64 dout)
+ 		}
+ 	}
+ 
+-	procman_debug("rescale dmax = %lu max = %lu new_max = %lu", dmax, g->net.max, new_max);
++	procman_debug("rescale dmax = %" G_GUINT64_FORMAT
++                      " max = %" G_GUINT64_FORMAT
++                      " new_max = %" G_GUINT64_FORMAT,
++                      dmax, g->net.max, new_max);
+ 
+ 	g->net.max = new_max;
+ 
+diff --git a/src/util.cpp b/src/util.cpp
+index 234e6fc..7183ff4 100644
+--- a/src/util.cpp
++++ b/src/util.cpp
+@@ -163,14 +163,14 @@ procman::format_size(guint64 size, guint64 max_size, bool want_bits)
+ 	};
+ 
+ 	const Format all_formats[2][4] = {
+-		{ { 1UL << 10,	   N_("%.1f KiB")  },
+-		  { 1UL << 20,	   N_("%.1f MiB")  },
+-		  { 1UL << 30,	   N_("%.1f GiB")  },
+-                  { 1UL << 40,     N_("%.1f TiB")  } },
+-		{ { 1000,	   N_("%.1f kbit") },
+-		  { 1000000,	   N_("%.1f Mbit") },
+-		  { 1000000000,	   N_("%.1f Gbit") },
+-                  { 1000000000000, N_("%.1f Tbit") } }
++          { { G_GUINT64_CONSTANT(1) << 10,       N_("%.1f KiB")  },
++            { G_GUINT64_CONSTANT(1) << 20,       N_("%.1f MiB")  },
++            { G_GUINT64_CONSTANT(1) << 30,       N_("%.1f GiB")  },
++            { G_GUINT64_CONSTANT(1) << 40,       N_("%.1f TiB")  } },
++          { { G_GUINT64_CONSTANT(1000),          N_("%.1f kbit") },
++            { G_GUINT64_CONSTANT(1000000),       N_("%.1f Mbit") },
++            { G_GUINT64_CONSTANT(1000000000),    N_("%.1f Gbit") },
++            { G_GUINT64_CONSTANT(1000000000000), N_("%.1f Tbit") } }
+ 	};
+ 
+ 	const Format (&formats)[4] = all_formats[want_bits ? 1 : 0];
+--
+cgit v0.9

diff --git a/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-linux-nice.patch b/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-linux-nice.patch
new file mode 100644
index 0000000..55d4e41
--- /dev/null
+++ b/gnome-extra/gnome-system-monitor/files/gnome-system-monitor-3.0.1-linux-nice.patch
@@ -0,0 +1,21 @@
+From 7c493352b24fb6d0d8b003f25043b070244eeb2e Mon Sep 17 00:00:00 2001
+From: Chris Kühl <chrisk@openismus.com>
+Date: Fri, 15 Apr 2011 09:18:10 +0000
+Subject: Make maximum nice value 19 instead of 20 on Linux.
+
+---
+diff --git a/src/procdialogs.h b/src/procdialogs.h
+index eba3212..61decf8 100644
+--- a/src/procdialogs.h
++++ b/src/procdialogs.h
+@@ -26,7 +26,7 @@
+ /* These are the actual range of settable values. Values outside this range
+    are scaled back to these limits. So show these limits in the slider
+ */
+-#ifdef linux
++#ifdef __linux__
+ #define RENICE_VAL_MIN -20
+ #define RENICE_VAL_MAX 19
+ #else /* ! linux */
+--
+cgit v0.9

diff --git a/gnome-extra/gnome-system-monitor/gnome-system-monitor-3.0.1.ebuild b/gnome-extra/gnome-system-monitor/gnome-system-monitor-3.0.1-r1.ebuild
similarity index 72%
rename from gnome-extra/gnome-system-monitor/gnome-system-monitor-3.0.1.ebuild
rename to gnome-extra/gnome-system-monitor/gnome-system-monitor-3.0.1-r1.ebuild
index 6590d05..6162a1e 100644
--- a/gnome-extra/gnome-system-monitor/gnome-system-monitor-3.0.1.ebuild
+++ b/gnome-extra/gnome-system-monitor/gnome-system-monitor-3.0.1-r1.ebuild
@@ -5,7 +5,7 @@
 EAPI="3"
 GCONF_DEBUG="no"
 
-inherit gnome2
+inherit eutils gnome2
 
 DESCRIPTION="The Gnome System Monitor"
 HOMEPAGE="http://www.gnome.org/"
@@ -37,3 +37,13 @@ pkg_setup() {
 		--disable-schemas-compile
 		--disable-scrollkeeper"
 }
+
+src_prepare() {
+	# Add some useful patches from upstream git master
+	# Use the correct maximum nice value on Linux
+	epatch "${FILESDIR}/${PN}-3.0.1-linux-nice.patch"
+	# Don't overflow the network history totals counters on 32-bit machines
+	epatch "${FILESDIR}/${PN}"-3.0.1-32-bit-network-totals-overflow-{1,2,3}.patch
+
+	gnome2_src_prepare
+}



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-26  9:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26  8:29 [gentoo-commits] proj/gnome:master commit in: gnome-extra/gnome-system-monitor/files/, gnome-extra/gnome-system-monitor/ Alexandre Restovtsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox