- Update to 1.0.2

- Convert to new options framework
- Trim Makefile headers

PR:		ports/178010
Submitted by:	Hung-Yi Chen <gaod@hychen.org> (maintainer)
This commit is contained in:
Guido Falsi 2013-04-28 09:48:25 +00:00
parent 5c2da02b91
commit 9575980d92
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=316709
6 changed files with 101 additions and 20 deletions

View File

@ -1,22 +1,18 @@
# New ports collection makefile for: htop
# Date created: 27 August 2007
# Whom: Tony Shadwick <tshadwick@oss-solutions.com>
#
# Created by: Tony Shadwick <tshadwick@oss-solutions.com>
# $FreeBSD$
#
PORTNAME= htop
PORTVERSION= 1.0.1
PORTREVISION= 2
PORTVERSION= 1.0.2
CATEGORIES= sysutils
MASTER_SITES= SF
MAINTAINER= gaod@hychen.org
COMMENT= A better top(1) - interactive process viewer
LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo
LIB_DEPENDS= execinfo:${PORTSDIR}/devel/libexecinfo
OPTIONS= LSOF "Enable lsof support" On
OPTIONS_DEFINE= LSOF
OPTIONS_DEFAULT= LSOF
NOT_FOR_ARCHS= ia64 powerpc sparc64
@ -35,9 +31,9 @@ USE_PYTHON_BUILD= yes
MAN1= htop.1
.include <bsd.port.pre.mk>
.include <bsd.port.options.mk>
.if !defined(WITHOUT_LSOF)
.if ${PORT_OPTIONS:MLSOF}
RUN_DEPENDS+= lsof:${PORTSDIR}/sysutils/lsof
.endif
@ -47,4 +43,4 @@ post-patch:
pre-configure:
@[ -f /compat/linux/proc/stat ] || { ${CAT} ${PKGMESSAGE}; ${FALSE}; }
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (htop-1.0.1.tar.gz) = 07db2cbe02835f9e186b9610ecc3beca330a5c9beadb3b6069dd0a10561506f2
SIZE (htop-1.0.1.tar.gz) = 384683
SHA256 (htop-1.0.2.tar.gz) = ee60657b044ece0df096c053060df7abf3cce3a568ab34d260049e6a37ccd8a1
SIZE (htop-1.0.2.tar.gz) = 388499

View File

@ -0,0 +1,20 @@
--- Process.c.orig 2013-04-21 03:33:42.000000000 +0800
+++ Process.c 2013-04-21 03:34:27.000000000 +0800
@@ -602,7 +602,7 @@
bool Process_changePriorityBy(Process* this, size_t delta) {
return Process_setPriority(this, this->nice + delta);
}
-
+/*
IOPriority Process_updateIOPriority(Process* this) {
IOPriority ioprio = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, this->pid);
this->ioPriority = ioprio;
@@ -613,7 +613,7 @@
syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->pid, ioprio);
return (Process_updateIOPriority(this) == ioprio);
}
-
+*/
/*
[1] Note that before kernel 2.6.26 a process that has not asked for
an io priority formally uses "none" as scheduling class, but the

View File

@ -0,0 +1,16 @@
--- Process.h.orig 2013-04-21 03:34:39.000000000 +0800
+++ Process.h 2013-04-21 03:34:49.000000000 +0800
@@ -179,11 +179,11 @@
bool Process_setPriority(Process* this, int priority);
bool Process_changePriorityBy(Process* this, size_t delta);
-
+/*
IOPriority Process_updateIOPriority(Process* this);
bool Process_setIOPriority(Process* this, IOPriority ioprio);
-
+*/
/*
[1] Note that before kernel 2.6.26 a process that has not asked for
an io priority formally uses "none" as scheduling class, but the

View File

@ -1,5 +1,5 @@
--- ProcessList.c.orig 2012-02-03 01:45:11.000000000 +0200
+++ ProcessList.c 2012-05-16 17:39:50.000000000 +0300
--- ProcessList.c.orig 2013-04-21 03:39:12.000000000 +0800
+++ ProcessList.c 2013-04-21 03:41:41.000000000 +0800
@@ -25,6 +25,19 @@
#include <time.h>
#include <assert.h>
@ -20,7 +20,16 @@
/*{
#include "Vector.h"
#include "Hashtable.h"
@@ -749,11 +762,13 @@
@@ -685,7 +698,7 @@
unsigned long long int lasttimes = (process->utime + process->stime);
if (! ProcessList_readStatFile(process, dirname, name, command))
goto errorReadingProcess;
- Process_updateIOPriority(process);
+// Process_updateIOPriority(process);
float percent_cpu = (process->utime + process->stime - lasttimes) / period * 100.0;
process->percent_cpu = MAX(MIN(percent_cpu, cpus*100.0), 0.0);
if (isnan(process->percent_cpu)) process->percent_cpu = 0.0;
@@ -764,13 +777,15 @@
void ProcessList_scan(ProcessList* this) {
unsigned long long int usertime, nicetime, systemtime, systemalltime, idlealltime, idletime, totaltime, virtalltime;
@ -32,12 +41,14 @@
+ #ifndef __FreeBSD__
+ unsigned long long int swapFree = 0;
+ file = fopen(PROCMEMINFOFILE, "r");
assert(file != NULL);
if (file == NULL) {
CRT_fatalError("Cannot open " PROCMEMINFOFILE);
}
- int cpus = this->cpuCount;
{
char buffer[128];
while (fgets(buffer, 128, file)) {
@@ -788,6 +803,33 @@
@@ -805,6 +820,33 @@
this->usedMem = this->totalMem - this->freeMem;
this->usedSwap = this->totalSwap - swapFree;
fclose(file);
@ -70,4 +81,4 @@
+ #endif
file = fopen(PROCSTATFILE, "r");
assert(file != NULL);
if (file == NULL) {

View File

@ -0,0 +1,38 @@
--- htop.c.orig 2012-10-05 07:55:31.000000000 +0800
+++ htop.c 2013-04-21 03:47:54.882373049 +0800
@@ -126,7 +126,7 @@
mvaddstr(13, 0, " Space: tag processes F: cursor follows process");
mvaddstr(14, 0, " U: untag all processes + -: expand/collapse tree");
mvaddstr(15, 0, " F9 k: kill process/tagged processes P M T: sort by CPU%, MEM% or TIME");
- mvaddstr(16, 0, " ] F7: higher priority (root only) i: set IO priority");
+ mvaddstr(16, 0, " ] F7: higher priority (root only)");
mvaddstr(17, 0, " [ F8: lower priority (+ nice) I: invert sort order");
#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
if (pl->cpuCount > 1)
@@ -146,7 +146,7 @@
mvaddstr(13, 0, " Space"); mvaddstr(13,40, " F");
mvaddstr(14, 0, " U"); mvaddstr(14,40, " + -");
mvaddstr(15, 0, " F9 k"); mvaddstr(15,40, "P M T");
- mvaddstr(16, 0, " ] F7"); mvaddstr(16,40, " i");
+ mvaddstr(16, 0, " ] F7");
mvaddstr(17, 0, " [ F8"); mvaddstr(17,40, " I");
mvaddstr(18,40, " F6 >");
#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
@@ -850,7 +850,7 @@
((Object*)sortPanel)->delete((Object*)sortPanel);
refreshTimeout = 0;
break;
- }
+ }/*
case 'i':
{
Process* p = (Process*) Panel_getSelected(panel);
@@ -869,7 +869,7 @@
ProcessList_printHeader(pl, Panel_getHeader(panel));
refreshTimeout = 0;
break;
- }
+ }*/
case 'I':
{
refreshTimeout = 0;