1 |
diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/Makefile psmisc/Makefile |
2 |
--- /usr/ports/sysutils/psmisc/Makefile 2010-01-02 08:40:09.000000000 -0800 |
3 |
+++ psmisc/Makefile 2010-05-18 08:37:45.668699414 -0700 |
4 |
@@ -6,12 +6,12 @@ |
5 |
# |
6 |
|
7 |
PORTNAME= psmisc |
8 |
-PORTVERSION= 22.9 |
9 |
+PORTVERSION= 22.11 |
10 |
CATEGORIES= sysutils |
11 |
MASTER_SITES= SF |
12 |
MASTER_SITE_SUBDIR= ${PORTNAME}/${PORTNAME} |
13 |
|
14 |
-MAINTAINER= ports@FreeBSD.org |
15 |
+MAINTAINER= douglas@douglasthrift.net |
16 |
COMMENT= A port of the Linux pstree, killall and pidof commands |
17 |
|
18 |
GNU_CONFIGURE= yes |
19 |
@@ -19,7 +19,7 @@ |
20 |
USE_GMAKE= yes |
21 |
|
22 |
CONFLICTS= pstree-2.* \ |
23 |
- pidof-* |
24 |
+ pidof-[0-9]* |
25 |
|
26 |
PLIST_FILES= bin/killall \ |
27 |
bin/pidof \ |
28 |
diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/distinfo psmisc/distinfo |
29 |
--- /usr/ports/sysutils/psmisc/distinfo 2010-01-02 08:40:09.000000000 -0800 |
30 |
+++ psmisc/distinfo 2010-05-18 04:02:47.141686600 -0700 |
31 |
@@ -1,3 +1,3 @@ |
32 |
-MD5 (psmisc-22.9.tar.gz) = c242530de46b951ab10a2237a6048a9c |
33 |
-SHA256 (psmisc-22.9.tar.gz) = c98aef4bc379790229c54c8e7d97b1d1ab898346bfffcde54fcf585a3e353edd |
34 |
-SIZE (psmisc-22.9.tar.gz) = 316530 |
35 |
+MD5 (psmisc-22.11.tar.gz) = b5d32aa285b75c59dee96d3ea26a4881 |
36 |
+SHA256 (psmisc-22.11.tar.gz) = 8fff37557f5150d89ef9afc03133731da3eaa2bad1a94f64355218a68b884536 |
37 |
+SIZE (psmisc-22.11.tar.gz) = 375038 |
38 |
diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/files/patch-src-pstree.c psmisc/files/patch-src-pstree.c |
39 |
--- /usr/ports/sysutils/psmisc/files/patch-src-pstree.c 2010-01-02 08:40:10.000000000 -0800 |
40 |
+++ psmisc/files/patch-src-pstree.c 2010-05-18 07:21:54.752390269 -0700 |
41 |
@@ -1,14 +1,17 @@ |
42 |
---- src/pstree.c.orig 2009-12-27 15:46:47.000000000 +0900 |
43 |
-+++ src/pstree.c 2010-01-03 00:52:21.437862505 +0900 |
44 |
-@@ -37,6 +37,7 @@ |
45 |
+--- src/pstree.c.orig 2010-04-08 05:20:10.000000000 -0700 |
46 |
++++ src/pstree.c 2010-05-18 07:20:57.583839746 -0700 |
47 |
+@@ -37,6 +37,10 @@ |
48 |
#include <term.h> |
49 |
#include <termios.h> |
50 |
#include <langinfo.h> |
51 |
++#ifdef __FreeBSD__ |
52 |
++#include <locale.h> |
53 |
+#include <limits.h> |
54 |
++#endif |
55 |
#include <assert.h> |
56 |
#include <sys/types.h> |
57 |
#include <sys/stat.h> |
58 |
-@@ -590,7 +591,11 @@ |
59 |
+@@ -590,7 +594,11 @@ |
60 |
struct dirent *de; |
61 |
FILE *file; |
62 |
struct stat st; |
63 |
@@ -20,31 +23,64 @@ |
64 |
char *buffer; |
65 |
size_t buffer_size; |
66 |
char readbuf[BUFSIZ + 1]; |
67 |
-@@ -623,7 +628,7 @@ |
68 |
+@@ -623,7 +631,11 @@ |
69 |
if ((pid = (pid_t) atoi(de->d_name)) != 0) { |
70 |
if (! (path = malloc(strlen(PROC_BASE) + strlen(de->d_name) + 10))) |
71 |
exit(2); |
72 |
-- sprintf(path, "%s/%d/stat", PROC_BASE, pid); |
73 |
-+ sprintf (path, "%s/%d/status", PROC_BASE, pid); |
74 |
++#ifdef __FreeBSD__ |
75 |
++ sprintf(path, "%s/%d/status", PROC_BASE, pid); |
76 |
++#else |
77 |
+ sprintf(path, "%s/%d/stat", PROC_BASE, pid); |
78 |
++#endif |
79 |
if ((file = fopen(path, "r")) != NULL) { |
80 |
empty = 0; |
81 |
sprintf(path, "%s/%d", PROC_BASE, pid); |
82 |
-@@ -638,6 +643,10 @@ |
83 |
+@@ -638,6 +650,29 @@ |
84 |
perror(path); |
85 |
exit(1); |
86 |
} |
87 |
+#ifdef __FreeBSD__ |
88 |
-+ if (fscanf(file, "%s %*d %d", comm, &ppid) == 2) |
89 |
-+ add_proc(comm, pid, ppid, st.st_uid, NULL, 0, 0); |
90 |
++ /* Read comm and ppid */ |
91 |
++ if (fscanf(file, "%s %*d %d", readbuf, &ppid) == 2) { |
92 |
++ tmpptr = readbuf; |
93 |
++ size = 0; |
94 |
++ /* Unescape comm */ |
95 |
++ do { |
96 |
++ if (*tmpptr == '\\') |
97 |
++ { |
98 |
++ char tmp = tmpptr[4]; |
99 |
++ tmpptr[4] = 0; |
100 |
++ comm[size++] = strtol(++tmpptr, NULL, 8); |
101 |
++ tmpptr += 2; |
102 |
++ tmpptr[1] = tmp; |
103 |
++ } |
104 |
++ else |
105 |
++ comm[size++] = *tmpptr; |
106 |
++ } while (*++tmpptr); |
107 |
++ comm[size] = 0; |
108 |
++ /* Balance braces */ |
109 |
++ { |
110 |
++ { |
111 |
+#else |
112 |
size = fread(readbuf, 1, BUFSIZ, file); |
113 |
if (ferror(file) == 0) { |
114 |
readbuf[size] = 0; |
115 |
-@@ -725,6 +734,7 @@ |
116 |
- } |
117 |
- } |
118 |
- } |
119 |
+@@ -692,6 +727,7 @@ |
120 |
+ (void) closedir(taskdir); |
121 |
+ } |
122 |
+ free(taskpath); |
123 |
+#endif /*__FreeBSD__*/ |
124 |
- (void) fclose(file); |
125 |
- } |
126 |
- free(path); |
127 |
+ if (!print_args) |
128 |
+ #ifdef WITH_SELINUX |
129 |
+ add_proc(comm, pid, ppid, st.st_uid, NULL, 0, 0, scontext); |
130 |
+@@ -860,6 +896,10 @@ |
131 |
+ * command-line options, if given. |
132 |
+ */ |
133 |
+ |
134 |
++#ifdef __FreeBSD__ |
135 |
++ /* Actually set the locale because nl_langinfo won't do it. */ |
136 |
++ setlocale(LC_CTYPE, ""); |
137 |
++#endif |
138 |
+ if (isatty(1) && !strcmp(nl_langinfo(CODESET), "UTF-8")) { |
139 |
+ /* Use UTF-8 symbols if the locale's character set is UTF-8. */ |
140 |
+ sym = &sym_utf; |
141 |
diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/pkg-descr psmisc/pkg-descr |
142 |
--- /usr/ports/sysutils/psmisc/pkg-descr 2005-10-05 00:49:45.000000000 -0700 |
143 |
+++ psmisc/pkg-descr 2010-05-18 07:57:55.280442813 -0700 |
144 |
@@ -1,4 +1,4 @@ |
145 |
A port of the Linux pstree, killall and pidof commands. |
146 |
Does not include the 'fuser' command. |
147 |
|
148 |
-WWW: http://psmisc.sourceforge.net |
149 |
+WWW: http://psmisc.sourceforge.net/ |