summaryrefslogtreecommitdiff
path: root/sysutils/psmisc
diff options
context:
space:
mode:
authorjlam <jlam>2000-03-17 15:54:52 +0000
committerjlam <jlam>2000-03-17 15:54:52 +0000
commit3470dc6036c0dde5ed734c6bf9dddb2419bd78bb (patch)
treeba101140789b18ccc57b610f452772c2fa78d0e0 /sysutils/psmisc
parented74de104647a0f1a2d5ccf320b8c3ca71624168 (diff)
downloadpkgsrc-3470dc6036c0dde5ed734c6bf9dddb2419bd78bb.tar.gz
Updated psmisc to version 19. Changes from version 17:
- supports /proc/cmdline on NetBSD - killall: new option -g to kill process group instead of process - pidof: new option -g to show PGID instead of PID (by Florian La Roche) - pstree: new option -H to highlight process specified by PID
Diffstat (limited to 'sysutils/psmisc')
-rw-r--r--sysutils/psmisc/Makefile14
-rw-r--r--sysutils/psmisc/files/md54
-rw-r--r--sysutils/psmisc/files/patch-sum9
-rw-r--r--sysutils/psmisc/patches/patch-aa63
-rw-r--r--sysutils/psmisc/patches/patch-ac48
-rw-r--r--sysutils/psmisc/patches/patch-ad88
-rw-r--r--sysutils/psmisc/patches/patch-af12
-rw-r--r--sysutils/psmisc/pkg/DESCR3
8 files changed, 97 insertions, 144 deletions
diff --git a/sysutils/psmisc/Makefile b/sysutils/psmisc/Makefile
index 71a25fbc164..08ebb3cb7dd 100644
--- a/sysutils/psmisc/Makefile
+++ b/sysutils/psmisc/Makefile
@@ -1,13 +1,21 @@
-# $NetBSD: Makefile,v 1.2 1999/04/15 20:39:47 tron Exp $
+# $NetBSD: Makefile,v 1.3 2000/03/17 15:54:52 jlam Exp $
#
-DISTNAME= psmisc-17
+DISTNAME= psmisc-19
CATEGORIES= sysutils
MASTER_SITES= ftp://lrcftp.epfl.ch/pub/linux/local/psmisc/ \
${MASTER_SITE_SUNSITE:=system/status/ps/}
-MAINTAINER= bjh21@cam.ac.uk
+MAINTAINER= packages@netbsd.org
WRKSRC= ${WRKDIR}/psmisc
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/killall ${PREFIX}/bin
+ ${LN} -sf killall ${PREFIX}/bin/pidof
+ ${INSTALL_PROGRAM} ${WRKSRC}/pstree ${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/killall.1 ${PREFIX}/man/man1
+ ${INSTALL_MAN} ${WRKSRC}/pidof.1 ${PREFIX}/man/man1
+ ${INSTALL_MAN} ${WRKSRC}/pstree.1 ${PREFIX}/man/man1
+
.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/psmisc/files/md5 b/sysutils/psmisc/files/md5
index 08452111f43..f7a29e7764d 100644
--- a/sysutils/psmisc/files/md5
+++ b/sysutils/psmisc/files/md5
@@ -1,3 +1,3 @@
-$NetBSD: md5,v 1.2 1998/08/11 12:20:58 agc Exp $
+$NetBSD: md5,v 1.3 2000/03/17 15:54:53 jlam Exp $
-MD5 (psmisc-17.tar.gz) = d7ee62a4c936360aa2f87b24c86e4092
+MD5 (psmisc-19.tar.gz) = 1d56ac6c32b657fdf8f780084b095932
diff --git a/sysutils/psmisc/files/patch-sum b/sysutils/psmisc/files/patch-sum
index 08864d23fe3..755f2b3848f 100644
--- a/sysutils/psmisc/files/patch-sum
+++ b/sysutils/psmisc/files/patch-sum
@@ -1,8 +1,7 @@
-$NetBSD: patch-sum,v 1.2 1999/07/23 15:50:19 frueauf Exp $
+$NetBSD: patch-sum,v 1.3 2000/03/17 15:54:53 jlam Exp $
-MD5 (patch-aa) = a7c6b68e6d4b96bad28ffd8e1f786c39
+MD5 (patch-aa) = 553cca054a9c815e02dd89e93c68c17c
MD5 (patch-ab) = 62e268cfbc302d0cfe5703c456fb7094
-MD5 (patch-ac) = 2bd50909ee05fa78c4db9142f030186b
-MD5 (patch-ad) = e672e9b5fe8aaeb1bdc4e0ad7ddd30d7
+MD5 (patch-ac) = 6b6ddfceb1f3d685880f68f1790941de
+MD5 (patch-ad) = 71070f10f948b7d2ffbf510f154112b6
MD5 (patch-ae) = 58d238136d9e4149f1659c655d03a7c7
-MD5 (patch-af) = e196a6372c95f6f3635908f4ac591e78
diff --git a/sysutils/psmisc/patches/patch-aa b/sysutils/psmisc/patches/patch-aa
index 09902465f62..28b814cc5e9 100644
--- a/sysutils/psmisc/patches/patch-aa
+++ b/sysutils/psmisc/patches/patch-aa
@@ -1,30 +1,19 @@
-$NetBSD: patch-aa,v 1.3 1999/07/23 15:49:44 frueauf Exp $
+$NetBSD: patch-aa,v 1.4 2000/03/17 15:54:53 jlam Exp $
---- Makefile.orig Mon Jul 28 11:28:00 1997
-+++ Makefile Wed Jul 21 21:00:29 1999
-@@ -1,13 +1,13 @@
- CC=cc
--CFLAGS=-O -DPSMISC_VERSION=\"`cat VERSION`\" \
-+CFLAGS=-O -Dunix -DPSMISC_VERSION=\"`cat VERSION`\" \
- -Wall -Wno-parentheses -Wwrite-strings -Wpointer-arith \
+--- Makefile.orig Mon Oct 25 14:01:33 1999
++++ Makefile Thu Mar 16 23:46:06 2000
+@@ -5,7 +5,7 @@
# -Wcast-align -Wconversion -g
LDFLAGS=#-s -N #-Xlinker -qmagic
--REAL_CPP=/lib/cpp
+ REAL_CPP=cc -E
-PROGS=killall pstree fuser
--EBINDIR=/bin # essential binaries
--BINDIR=/usr/bin # not so essential ones
--MANDIR=/usr/man/man1 # all man pages
-+REAL_CPP=/usr/bin/cpp
-+PROGS=killall pstree #fuser
-+EBINDIR=$(PREFIX)/bin # essential binaries
-+BINDIR=$(PREFIX)/bin # not so essential ones
-+MANDIR=$(PREFIX)/man/man1 # all man pages
-
- all: $(PROGS)
-
-@@ -18,34 +18,26 @@
- \2,"\1" },:p;d' \
- > signames.h
++PROGS=killall pstree # fuser
+ EBINDIR=/bin # essential binaries
+ BINDIR=/usr/bin # not so essential ones
+ MANDIR=/usr/man/man1 # all man pages
+@@ -22,13 +22,14 @@
+ grep '^{ 1,"HUP" },$$' signames.h >/dev/null || \
+ { rm -f signames.h; exit 1; }
-signals.o: signals.h signals.c signames.h Makefile
+signals.o: signals.h signals.c Makefile
@@ -34,33 +23,7 @@ $NetBSD: patch-aa,v 1.3 1999/07/23 15:49:44 frueauf Exp $
fuser: fuser.o signals.o
killall: killall.o signals.o
-+ $(CC) $(LDFLAGS) -o killall killall.o signals.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o killall killall.o signals.o
pstree: pstree.c comm.h Makefile VERSION
$(CC) $(CFLAGS) $(LDFLAGS) -o pstree pstree.c -ltermcap
-
- install: $(PROGS)
- # EBINDIR is expected to exist, so we don't try to create it
-- install -o 0 -g 0 -m 555 fuser $(EBINDIR)
-- [ -d $(BINDIR) ] || install -d -o 0 -g 0 -m 755 $(BINDIR)
-- install -o 0 -g 0 -m 555 killall $(BINDIR)
-- install -o 0 -g 0 -m 555 pstree $(BINDIR)
-- [ -d $(MANDIR) ] || install -d -o 0 -g 0 -m 755 $(MANDIR)
-- install -o 0 -g 0 -m 444 fuser.1 $(MANDIR)
-- install -o 0 -g 0 -m 444 killall.1 $(MANDIR)
-- install -o 0 -g 0 -m 444 pstree.1 $(MANDIR)
--
--install-pidof:
-- @[ -x `echo $(BINDIR)`/killall ] || { \
-- echo "Need `echo $(BINDIR)`/killall to install pidof"; \
-- exit 1 }
-+ $(BSD_INSTALL_PROGRAM) killall $(BINDIR)
-+ $(BSD_INSTALL_PROGRAM) pstree $(BINDIR)
-+ $(BSD_INSTALL_MAN) killall.1 $(MANDIR)
-+ $(BSD_INSTALL_MAN) pstree.1 $(MANDIR)
- ln -sf killall `echo $(BINDIR)`/pidof
-- install -o 0 -g 0 -m 444 pidof.1 $(MANDIR)
-+ $(BSD_INSTALL_MAN) pidof.1 $(MANDIR)
-
- clean:
- rm -f *.o signames.h
diff --git a/sysutils/psmisc/patches/patch-ac b/sysutils/psmisc/patches/patch-ac
index e4c1f825b95..ef15878a583 100644
--- a/sysutils/psmisc/patches/patch-ac
+++ b/sysutils/psmisc/patches/patch-ac
@@ -1,29 +1,35 @@
-$NetBSD: patch-ac,v 1.3 1999/03/11 16:23:33 hubertf Exp $
+$NetBSD: patch-ac,v 1.4 2000/03/17 15:54:53 jlam Exp $
---- killall.c.orig Tue Feb 17 20:05:21 1998
-+++ killall.c Sun Jul 19 16:18:26 1998
-@@ -2,6 +2,13 @@
+--- killall.c.orig Wed May 6 09:56:48 1998
++++ killall.c Thu Mar 16 22:57:03 2000
+@@ -10,12 +10,19 @@
+ #include <dirent.h>
+ #include <signal.h>
+ #include <errno.h>
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
- /* Copyright 1993-1998 Werner Almesberger. See file COPYING for details. */
+ #include "comm.h"
+ #include "signals.h"
-+#if (defined(__unix__) || defined(unix) || defined(__NetBSD__)) && !defined(USG)
-+#include <sys/param.h>
-+#endif
-+
+#if (defined(BSD) && BSD >= 199306)
+#define BSD_44_PROC
++#if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104180000)
++#define BSD_PROC_CMDLINE
++#endif
+#endif
- #include <stdlib.h>
- #include <stdio.h>
-@@ -103,20 +110,32 @@
- exit(1);
+ #define PROC_BASE "/proc"
+ #define MAX_NAMES (sizeof(unsigned long)*8)
+@@ -112,20 +119,32 @@
+ }
}
for (i = 0; i < pids; i++) {
+#ifdef BSD_44_PROC
-+ sprintf(path,"%s/%d/status",PROC_BASE,pid_table[i]);
++ sprintf(path,PROC_BASE "/%d/status",pid_table[i]);
+#else
- sprintf(path,"%s/%d/stat",PROC_BASE,pid_table[i]);
+ sprintf(path,PROC_BASE "/%d/stat",pid_table[i]);
+#endif
if (!(file = fopen(path,"r"))) continue;
empty = 0;
@@ -38,10 +44,10 @@ $NetBSD: patch-ac,v 1.3 1999/03/11 16:23:33 hubertf Exp $
command = NULL; /* make gcc happy */
length = strlen(comm);
if (length == COMM_LEN-1) {
-+#ifdef BSD_44_PROC
++#if defined(BSD_44_PROC) && !defined(BSD_PROC_CMDLINE)
+ okay = 0;
+#else
- sprintf(path,"%s/%d/cmdline",PROC_BASE,pid_table[i]);
+ sprintf(path,PROC_BASE "/%d/cmdline",pid_table[i]);
if (!(file = fopen(path,"r"))) continue;
okay = fscanf(file,"%s",command_buf) == 1;
(void) fclose(file);
@@ -49,14 +55,14 @@ $NetBSD: patch-ac,v 1.3 1999/03/11 16:23:33 hubertf Exp $
if (exact && !okay) {
if (verbose)
fprintf(stderr,"skipping partial match %s(%d)\n",comm,
-@@ -139,7 +158,11 @@
+@@ -150,7 +169,11 @@
strncmp(namelist[j],comm,COMM_LEN-1)) continue;
}
else {
+#ifdef BSD_44_PROC
-+ sprintf(path,"%s/%d/file",PROC_BASE,pid_table[i]);
-+#else
- sprintf(path,"%s/%d/exe",PROC_BASE,pid_table[i]);
++ sprintf(path,PROC_BASE "/%d/file",pid_table[i]);
++#else
+ sprintf(path,PROC_BASE "/%d/exe",pid_table[i]);
+#endif
if (stat(path,&st) < 0) continue;
if (sts[j].st_dev != st.st_dev || sts[j].st_ino != st.st_ino)
diff --git a/sysutils/psmisc/patches/patch-ad b/sysutils/psmisc/patches/patch-ad
index 9468e0d2f01..362661fb2dc 100644
--- a/sysutils/psmisc/patches/patch-ad
+++ b/sysutils/psmisc/patches/patch-ad
@@ -1,23 +1,18 @@
-$NetBSD: patch-ad,v 1.2 1998/08/07 11:14:07 agc Exp $
+$NetBSD: patch-ad,v 1.3 2000/03/17 15:54:53 jlam Exp $
---- pstree.c.orig Tue Aug 26 17:09:05 1997
-+++ pstree.c Sun Jul 19 15:20:24 1998
-@@ -2,6 +2,14 @@
+--- pstree.c.orig Sat May 1 15:40:56 1999
++++ pstree.c Thu Mar 16 23:22:45 2000
+@@ -2,6 +2,9 @@
- /* Copyright 1993-1996 Werner Almesberger. See file COPYING for details. */
+ /* Copyright 1993-1999 Werner Almesberger. See file COPYING for details. */
-+#ifdef __NetBSD__
-+#define HAVE_SYS_SYSLIMITS_H
-+#define BSD_44_PROC
-+#define BSD_TERMCAP
-+#else /* Linux */
++#ifdef linux
+#define HAVE_GETOPT_H
-+#define ENABLE_PRINT_ARGS
+#endif
#include <stdlib.h>
#include <stdio.h>
-@@ -9,12 +17,17 @@
+@@ -9,17 +12,26 @@
#include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
@@ -28,63 +23,64 @@ $NetBSD: patch-ad,v 1.2 1998/08/07 11:14:07 agc Exp $
#include <dirent.h>
#include <termios.h>
#include <termcap.h>
++#include <sys/param.h>
#include <sys/types.h>
-+#ifdef HAVE_SYS_SYSLIMITS_H
-+#include <sys/syslimits.h>
-+#endif
#include <sys/stat.h>
#include <sys/ioctl.h>
-@@ -251,7 +264,10 @@
- CHILD *walk,*next,**scan;
+ #include "comm.h"
+
++#if (defined(BSD) && BSD >= 199306)
++#define BSD_44_PROC
++#if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104180000)
++#define BSD_PROC_CMDLINE
++#endif
++#endif
+
+ #ifndef MAX_DEPTH
+ #define MAX_DEPTH 100
+@@ -252,6 +264,7 @@
const struct passwd *pw;
int lvl,i,add,offset,len,swapped,info,count,comm_len,first;
const char *tmp,*here;
-+#ifdef BSD_TERMCAP
-+ char tbuf[1024], *tbufptr;
-+#endif
++ char tbuf[1024], *pbuf;
char comm_tmp[5];
if (!current) return;
-@@ -270,7 +286,12 @@
+@@ -270,7 +283,8 @@
add = out_int(rep)+2;
out_string("*[");
}
-+#ifdef BSD_TERMCAP
-+ tbufptr = tbuf;
-+ if (current->highlight && (tmp = tgetstr("md",&tbufptr))) tputs(tmp,1,putchar);
-+#else
- if (current->highlight && (tmp = tgetstr("md",NULL))) tputs(tmp,1,putchar);
-+#endif
+- if (current->highlight && (tmp = tgetstr("md",NULL))) tputs(tmp,1,putchar);
++ pbuf = tbuf;
++ if (current->highlight && (tmp = tgetstr("md",&pbuf))) tputs(tmp,1,putchar);
if (swapped = print_args && current->argc < 0) out_char('(');
comm_len = 0;
for (here = current->comm; *here; here++)
-@@ -297,7 +318,12 @@
+@@ -297,7 +311,8 @@
else (void) out_int(current->uid);
}
if (info || swapped) out_char(')');
-+#ifdef BSD_TERMCAP
-+ tbufptr = tbuf;
-+ if (current->highlight && (tmp = tgetstr("me",&tbufptr))) tputs(tmp,1,putchar);
-+#else
- if (current->highlight && (tmp = tgetstr("me",NULL))) tputs(tmp,1,putchar);
-+#endif
+- if (current->highlight && (tmp = tgetstr("me",NULL))) tputs(tmp,1,putchar);
++ pbuf = tbuf;
++ if (current->highlight && (tmp = tgetstr("me",&pbuf))) tputs(tmp,1,putchar);
if (print_args) {
for (i = 0; i < current->argc; i++) {
out_char(' ');
-@@ -387,8 +413,10 @@
+@@ -387,8 +402,11 @@
char path[PATH_MAX+1],comm[COMM_LEN+1];
char *buffer;
pid_t pid,ppid;
-+#ifndef BSD_44_PROC
++#if !defined(BSD_44_PROC) || defined(BSD_PROC_CMDLINE)
int fd,size;
- int empty,dummy;
++ int dummy;
+#endif
+ int empty;
if (!print_args) buffer = NULL;
else if (!(buffer = malloc((size_t) (output_width+1)))) {
-@@ -402,17 +430,28 @@
+@@ -402,15 +420,26 @@
empty = 1;
while (de = readdir(dir))
if (pid = atoi(de->d_name)) {
@@ -99,23 +95,19 @@ $NetBSD: patch-ad,v 1.2 1998/08/07 11:14:07 agc Exp $
perror(path);
exit(1);
}
-- if (fscanf(file,"%d (%[^)]) %c %d",&dummy,comm,(char *) &dummy,
-- &ppid) == 4) {
+#ifdef BSD_44_PROC
-+ if (fscanf(file, "%s %*d %d", comm, &ppid) == 2) {
++ if (fscanf(file,"%s %*d %d",comm,&ppid) == 2) {
+#else
-+ if (fscanf(file,"%*d (%[^)]) %*c %d",comm,&ppid) == 2) {
+ if (fscanf(file,"%d (%[^)]) %c %d",&dummy,comm,(char *) &dummy,
+ &ppid) == 4) {
+#endif
++#if defined(BSD_44_PROC) && !defined(BSD_PROC_CMDLINE)
++ add_proc(comm,pid,ppid,st,st_uid,NULL,0);
++#else
if (!print_args) add_proc(comm,pid,ppid,st.st_uid,NULL,0);
else {
-+#ifdef BSD_44_PROC
-+ /* NetBSD 1.3 /proc doesn't seem to do command-lines */
-+ add_proc(comm,pid,ppid,st.st_uid,buffer,0);
-+#else
sprintf(path,"%s/%d/cmdline",PROC_BASE,pid);
- if ((fd = open(path,O_RDONLY)) < 0) {
- perror(path);
-@@ -426,6 +465,7 @@
+@@ -426,6 +455,7 @@
(void) close(fd);
if (size) buffer[size++] = 0;
add_proc(comm,pid,ppid,st.st_uid,buffer,size);
diff --git a/sysutils/psmisc/patches/patch-af b/sysutils/psmisc/patches/patch-af
deleted file mode 100644
index fe84784c38e..00000000000
--- a/sysutils/psmisc/patches/patch-af
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-af,v 1.2 1998/08/07 11:14:08 agc Exp $
-
---- pstree.1.orig Sun Apr 7 15:57:44 1996
-+++ pstree.1 Sun Jul 19 23:51:52 1998
-@@ -78,4 +78,7 @@
- Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
- .SH "SEE ALSO"
- ps(1), top(1)
-+.SH BUGS
-+The \fB\-a\fP option does nothing of any use under NetBSD due to deficiencies
-+in the BSD version of /proc.
- .\"{{{}}}
diff --git a/sysutils/psmisc/pkg/DESCR b/sysutils/psmisc/pkg/DESCR
index 5161cc2aa79..af8160beb3a 100644
--- a/sysutils/psmisc/pkg/DESCR
+++ b/sysutils/psmisc/pkg/DESCR
@@ -1,6 +1,3 @@
-psmisc, version 17
-==================
-
This package contains three little utilities that use the proc FS:
killall kills processes by name, e.g. killall -HUP named