summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2011-08-26 21:37:18 +0000
committerSebastian Pipping <sping@gentoo.org>2011-08-26 21:37:18 +0000
commit55ed9eb59acbe457df542b484e5b9b9ba07c937e (patch)
tree5aa479859ba4ba54ccde0cedd48d22cc103e5a6b /sys-process/htop
parentRevbump to combine the gconf and gnome-keyring USE flags under the gnome USE ... (diff)
downloadgentoo-2-55ed9eb59acbe457df542b484e5b9b9ba07c937e.tar.gz
gentoo-2-55ed9eb59acbe457df542b484e5b9b9ba07c937e.tar.bz2
gentoo-2-55ed9eb59acbe457df542b484e5b9b9ba07c937e.zip
sys-process/htop: Integrate post-0.9 bugfix patch
(Portage version: 2.1.10.11/cvs/Linux x86_64)
Diffstat (limited to 'sys-process/htop')
-rw-r--r--sys-process/htop/ChangeLog8
-rw-r--r--sys-process/htop/files/htop-0.9-small-width.patch42
-rw-r--r--sys-process/htop/htop-0.9-r2.ebuild61
3 files changed, 110 insertions, 1 deletions
diff --git a/sys-process/htop/ChangeLog b/sys-process/htop/ChangeLog
index f65c67950526..7e6ecaeca12d 100644
--- a/sys-process/htop/ChangeLog
+++ b/sys-process/htop/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-process/htop
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/htop/ChangeLog,v 1.98 2011/07/22 13:48:01 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-process/htop/ChangeLog,v 1.99 2011/08/26 21:37:18 sping Exp $
+
+*htop-0.9-r2 (26 Aug 2011)
+
+ 26 Aug 2011; Sebastian Pipping <sping@gentoo.org> +htop-0.9-r2.ebuild,
+ +files/htop-0.9-small-width.patch:
+ Integrate post-0.9 bugfix patch for small terminal widths
22 Jul 2011; Jeroen Roovers <jer@gentoo.org> htop-0.9.ebuild:
Stable for HPPA (bug #372889).
diff --git a/sys-process/htop/files/htop-0.9-small-width.patch b/sys-process/htop/files/htop-0.9-small-width.patch
new file mode 100644
index 000000000000..743111137b03
--- /dev/null
+++ b/sys-process/htop/files/htop-0.9-small-width.patch
@@ -0,0 +1,42 @@
+From 17d258ff0a216dd87655c8e93d065e5e6c504f42 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Mon, 1 Aug 2011 02:51:24 +0200
+Subject: [PATCH 3/3] Fix segfault in BarMeterMode_draw() for small terminal
+ widths
+
+Segfault can be triggered by running "COLUMNS=1 ./htop"
+For me, COLUMNS=40 was the first that would not crash.
+---
+ ChangeLog | 2 ++
+ Meter.c | 11 +++++++++--
+ 2 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/Meter.c b/Meter.c
+index 6947d9b..408b981 100644
+--- a/Meter.c
++++ b/Meter.c
+@@ -264,13 +265,19 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
+
+ w--;
+ x++;
+- char bar[w];
++
++ if (w < 1) {
++ attrset(CRT_colors[RESET_COLOR]);
++ return;
++ }
++ char bar[w + 1];
+
+ int blockSizes[10];
+ for (int i = 0; i < w; i++)
+ bar[i] = ' ';
+
+- sprintf(bar + (w-strlen(buffer)), "%s", buffer);
++ const size_t bar_offset = w - MIN(strlen(buffer), w);
++ snprintf(bar + bar_offset, w - bar_offset + 1, "%s", buffer);
+
+ // First draw in the bar[] buffer...
+ double total = 0.0;
+--
+1.7.6
+
diff --git a/sys-process/htop/htop-0.9-r2.ebuild b/sys-process/htop/htop-0.9-r2.ebuild
new file mode 100644
index 000000000000..6d6f3c408fac
--- /dev/null
+++ b/sys-process/htop/htop-0.9-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/htop/htop-0.9-r2.ebuild,v 1.1 2011/08/26 21:37:18 sping Exp $
+
+EAPI=4
+inherit autotools eutils flag-o-matic multilib
+
+DESCRIPTION="interactive process viewer"
+HOMEPAGE="http://htop.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
+IUSE="debug elibc_FreeBSD kernel_linux openvz unicode vserver"
+
+RDEPEND="sys-libs/ncurses[unicode?]"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog README TODO )
+
+pkg_setup() {
+ if use elibc_FreeBSD && ! [[ -f ${ROOT}/proc/stat && -f ${ROOT}/proc/meminfo ]]; then
+ eerror
+ eerror "htop needs /proc mounted to compile and work, to mount it type"
+ eerror "mount -t linprocfs none /proc"
+ eerror "or uncomment the example in /etc/fstab"
+ eerror
+ die "htop needs /proc mounted"
+ fi
+
+ if ! has_version sys-process/lsof; then
+ ewarn "To use lsof features in htop(what processes are accessing"
+ ewarn "what files), you must have sys-process/lsof installed."
+ fi
+}
+
+src_prepare() {
+ sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python' \
+ scripts/MakeHeader.py || die
+
+ epatch "${FILESDIR}"/${P}-debug.patch #352024, 372911
+ epatch "${FILESDIR}"/${P}-uclibc.patch #374595
+
+ # patch accepted by upstream (bug 3383385), remove on >=0.9.1
+ epatch "${FILESDIR}"/${P}-small-width.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ use debug && append-flags -DDEBUG
+
+ econf \
+ $(use_enable openvz) \
+ $(use_enable kernel_linux cgroup) \
+ $(use_enable vserver) \
+ $(use_enable unicode) \
+ --enable-taskstats \
+ --without-valgrind
+}