ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/pack/freebsd/diff/sysutils/psmisc/psmisc.2011-08-07T053402Z.diff
Revision: 282
Committed: 2010-05-18T22:41:26-07:00 (15 years, 1 month ago) by douglas
Original Path: freebsd/sysutils/psmisc.patch
File size: 10021 byte(s)
Log Message:
This should be more correct/better!

File Contents

# User Rev Content
1 douglas 281 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 douglas 282 +++ psmisc/Makefile 2010-05-18 22:39:22.883081611 -0700
4     @@ -6,28 +6,41 @@
5 douglas 281 #
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 douglas 282 +BUILD_DEPENDS= gsed:${PORTSDIR}/textproc/gsed
19     +
20 douglas 281 GNU_CONFIGURE= yes
21 douglas 282 -CONFIGURE_ARGS= --disable-nls
22 douglas 281 USE_GMAKE= yes
23    
24     CONFLICTS= pstree-2.* \
25     - pidof-*
26     + pidof-[0-9]*
27 douglas 282 +
28     +OPTIONS= NLS "Native Language Support via gettext utilities" On
29     +
30     +.include <bsd.port.pre.mk>
31 douglas 281
32 douglas 282 -PLIST_FILES= bin/killall \
33     - bin/pidof \
34     - bin/pstree bin/pstree.x11
35     +.if defined(WITHOUT_NLS)
36     +CONFIGURE_ARGS+=--disable-nls
37     +PLIST_SUB+= NLS="@comment "
38     +.else
39     +USE_GETTEXT= yes
40     +CONFIGURE_ARGS+=--enable-nls
41     +CPPFLAGS+= -I${LOCALBASE}/include
42     +LDFLAGS+= -L${LOCALBASE}/lib
43     +CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
44     +PLIST_SUB+= NLS=""
45     +.endif
46    
47     MAN1= pstree.1 killall.1
48    
49     post-install:
50     @${LN} -sf killall ${PREFIX}/bin/pidof
51    
52     -.include <bsd.port.mk>
53     +.include <bsd.port.post.mk>
54 douglas 281 diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/distinfo psmisc/distinfo
55     --- /usr/ports/sysutils/psmisc/distinfo 2010-01-02 08:40:09.000000000 -0800
56     +++ psmisc/distinfo 2010-05-18 04:02:47.141686600 -0700
57     @@ -1,3 +1,3 @@
58     -MD5 (psmisc-22.9.tar.gz) = c242530de46b951ab10a2237a6048a9c
59     -SHA256 (psmisc-22.9.tar.gz) = c98aef4bc379790229c54c8e7d97b1d1ab898346bfffcde54fcf585a3e353edd
60     -SIZE (psmisc-22.9.tar.gz) = 316530
61     +MD5 (psmisc-22.11.tar.gz) = b5d32aa285b75c59dee96d3ea26a4881
62     +SHA256 (psmisc-22.11.tar.gz) = 8fff37557f5150d89ef9afc03133731da3eaa2bad1a94f64355218a68b884536
63     +SIZE (psmisc-22.11.tar.gz) = 375038
64 douglas 282 diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/files/patch-src-Makefile.in psmisc/files/patch-src-Makefile.in
65     --- /usr/ports/sysutils/psmisc/files/patch-src-Makefile.in 2010-01-02 08:40:10.000000000 -0800
66     +++ psmisc/files/patch-src-Makefile.in 2010-05-18 21:35:53.776313591 -0700
67     @@ -1,5 +1,5 @@
68     ---- src/Makefile.in.orig 2009-12-27 16:19:06.000000000 +0900
69     -+++ src/Makefile.in 2010-01-03 00:25:56.093987293 +0900
70     +--- src/Makefile.in.orig 2010-04-08 05:41:34.000000000 -0700
71     ++++ src/Makefile.in 2010-05-18 21:30:06.746914197 -0700
72     @@ -34,8 +34,8 @@
73     POST_UNINSTALL = :
74     build_triplet = @build@
75     @@ -26,44 +26,37 @@
76     ETAGS = etags
77     CTAGS = ctags
78     DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
79     -@@ -208,10 +208,10 @@
80     - $(am__append_4) $(am__append_6)
81     - fuser_SOURCES = fuser.c comm.h signals.c signals.h i18n.h fuser.h
82     - killall_SOURCES = killall.c comm.h signals.c signals.h i18n.h
83     --killall_LDADD = @SELINUX_LIB@
84     -+killall_LDADD =
85     - peekfd_SOURCES = peekfd.c
86     - pstree_SOURCES = pstree.c comm.h i18n.h
87     --pstree_LDADD = @TERMCAP_LIB@ @SELINUX_LIB@
88     -+pstree_LDADD = @TERMCAP_LIB@
89     - prtstat_SOURCES = prtstat.c prtstat.h
90     - BUILT_SOURCES = signames.h
91     - EXTRA_DIST = signames.c
92     -@@ -537,13 +537,20 @@
93     +@@ -290,19 +290,19 @@
94     + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
95     + fuser$(EXEEXT): $(fuser_OBJECTS) $(fuser_DEPENDENCIES)
96     + @rm -f fuser$(EXEEXT)
97     +- $(LINK) $(fuser_OBJECTS) $(fuser_LDADD) $(LIBS)
98     ++ $(LINK) $(fuser_OBJECTS) $(fuser_LDADD) $(LIBS) $(INTLLIBS)
99     + killall$(EXEEXT): $(killall_OBJECTS) $(killall_DEPENDENCIES)
100     + @rm -f killall$(EXEEXT)
101     +- $(LINK) $(killall_OBJECTS) $(killall_LDADD) $(LIBS)
102     ++ $(LINK) $(killall_OBJECTS) $(killall_LDADD) $(LIBS) $(INTLLIBS)
103     + peekfd$(EXEEXT): $(peekfd_OBJECTS) $(peekfd_DEPENDENCIES)
104     + @rm -f peekfd$(EXEEXT)
105     +- $(LINK) $(peekfd_OBJECTS) $(peekfd_LDADD) $(LIBS)
106     ++ $(LINK) $(peekfd_OBJECTS) $(peekfd_LDADD) $(LIBS) $(INTLLIBS)
107     + prtstat$(EXEEXT): $(prtstat_OBJECTS) $(prtstat_DEPENDENCIES)
108     + @rm -f prtstat$(EXEEXT)
109     +- $(LINK) $(prtstat_OBJECTS) $(prtstat_LDADD) $(LIBS)
110     ++ $(LINK) $(prtstat_OBJECTS) $(prtstat_LDADD) $(LIBS) $(INTLLIBS)
111     + pstree$(EXEEXT): $(pstree_OBJECTS) $(pstree_DEPENDENCIES)
112     + @rm -f pstree$(EXEEXT)
113     +- $(LINK) $(pstree_OBJECTS) $(pstree_LDADD) $(LIBS)
114     ++ $(LINK) $(pstree_OBJECTS) $(pstree_LDADD) $(LIBS) $(INTLLIBS)
115    
116     + mostlyclean-compile:
117     + -rm -f *.$(OBJEXT)
118     +@@ -538,7 +538,7 @@
119     signames.h: signames.c Makefile
120     export LC_ALL=C ; \
121     -- @CPP@ -dM $< |\
122     + @CPP@ -dM $< |\
123     - tr -s '\t ' ' ' | sort -n -k 3 | sed \
124     -- 's:#define SIG\([A-Z]\+[0-9]*\) \([0-9]\+\) *\(\|/\*.*\)$$:{\ \2,"\1" },:p;d' | \
125     -- grep -v '[0-9][0-9][0-9]' >signames.h || \
126     -- { rm -f signames.h; exit 1; }
127     -- grep '^{ 1,"HUP" },$$' signames.h >/dev/null || \
128     -- { rm -f signames.h; exit 1; }
129     -+ @CPP@ -dM $< | {\
130     -+ signames=`kill -l | tr a-z A-Z`; \
131     -+ while read define name value; do \
132     -+ [ "$$define" = '#define' ] || continue; \
133     -+ case "$$value" in \
134     -+ *[!0-9]*) continue; \
135     -+ esac; \
136     -+ for signame in $$signames; do \
137     -+ if [ "$$name" = "SIG$$signame" ]; then \
138     -+ echo "{ $$value, \"$$signame\" },"; \
139     -+ fi; \
140     -+ done; \
141     -+ done; \
142     -+ } | sort -n -k 2 > signames.h
143     -
144     - install-exec-hook:
145     - cd $(DESTDIR)$(bindir) && \
146     ++ tr -s '\t ' ' ' | sort -n -k 3 | gsed \
147     + 's:#define SIG\([A-Z]\+[0-9]*\) \([0-9]\+\) *\(\|/\*.*\)$$:{\ \2,"\1" },:p;d' | \
148     + grep -v '[0-9][0-9][0-9]' >signames.h || \
149     + { rm -f signames.h; exit 1; }
150 douglas 281 diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/files/patch-src-pstree.c psmisc/files/patch-src-pstree.c
151     --- /usr/ports/sysutils/psmisc/files/patch-src-pstree.c 2010-01-02 08:40:10.000000000 -0800
152 douglas 282 +++ psmisc/files/patch-src-pstree.c 2010-05-18 20:03:36.709489357 -0700
153     @@ -1,14 +1,16 @@
154 douglas 281 ---- src/pstree.c.orig 2009-12-27 15:46:47.000000000 +0900
155     -+++ src/pstree.c 2010-01-03 00:52:21.437862505 +0900
156     -@@ -37,6 +37,7 @@
157     +--- src/pstree.c.orig 2010-04-08 05:20:10.000000000 -0700
158     ++++ src/pstree.c 2010-05-18 07:20:57.583839746 -0700
159 douglas 282 +@@ -37,6 +37,9 @@
160 douglas 281 #include <term.h>
161     #include <termios.h>
162     #include <langinfo.h>
163     ++#ifdef __FreeBSD__
164     +#include <limits.h>
165     ++#endif
166     #include <assert.h>
167     #include <sys/types.h>
168     #include <sys/stat.h>
169     -@@ -590,7 +591,11 @@
170     +@@ -590,7 +594,11 @@
171     struct dirent *de;
172     FILE *file;
173     struct stat st;
174 douglas 282 @@ -20,31 +22,53 @@
175 douglas 281 char *buffer;
176     size_t buffer_size;
177     char readbuf[BUFSIZ + 1];
178     -@@ -623,7 +628,7 @@
179     +@@ -623,7 +631,11 @@
180     if ((pid = (pid_t) atoi(de->d_name)) != 0) {
181     if (! (path = malloc(strlen(PROC_BASE) + strlen(de->d_name) + 10)))
182     exit(2);
183     -- sprintf(path, "%s/%d/stat", PROC_BASE, pid);
184     -+ sprintf (path, "%s/%d/status", PROC_BASE, pid);
185     ++#ifdef __FreeBSD__
186     ++ sprintf(path, "%s/%d/status", PROC_BASE, pid);
187     ++#else
188     + sprintf(path, "%s/%d/stat", PROC_BASE, pid);
189     ++#endif
190     if ((file = fopen(path, "r")) != NULL) {
191     empty = 0;
192     sprintf(path, "%s/%d", PROC_BASE, pid);
193     -@@ -638,6 +643,10 @@
194     +@@ -638,6 +650,29 @@
195     perror(path);
196     exit(1);
197     }
198     +#ifdef __FreeBSD__
199     -+ if (fscanf(file, "%s %*d %d", comm, &ppid) == 2)
200     -+ add_proc(comm, pid, ppid, st.st_uid, NULL, 0, 0);
201     ++ /* Read comm and ppid */
202     ++ if (fscanf(file, "%s %*d %d", readbuf, &ppid) == 2) {
203     ++ tmpptr = readbuf;
204     ++ size = 0;
205     ++ /* Unescape comm */
206     ++ do {
207     ++ if (*tmpptr == '\\')
208     ++ {
209     ++ char tmp = tmpptr[4];
210     ++ tmpptr[4] = 0;
211     ++ comm[size++] = strtol(++tmpptr, NULL, 8);
212     ++ tmpptr += 2;
213     ++ tmpptr[1] = tmp;
214     ++ }
215     ++ else
216     ++ comm[size++] = *tmpptr;
217     ++ } while (*++tmpptr);
218     ++ comm[size] = 0;
219     ++ /* Balance braces */
220     ++ {
221     ++ {
222     +#else
223     size = fread(readbuf, 1, BUFSIZ, file);
224     if (ferror(file) == 0) {
225     readbuf[size] = 0;
226     -@@ -725,6 +734,7 @@
227     - }
228     - }
229     - }
230     +@@ -692,6 +727,7 @@
231     + (void) closedir(taskdir);
232     + }
233     + free(taskpath);
234     +#endif /*__FreeBSD__*/
235     - (void) fclose(file);
236     - }
237     - free(path);
238     + if (!print_args)
239     + #ifdef WITH_SELINUX
240     + add_proc(comm, pid, ppid, st.st_uid, NULL, 0, 0, scontext);
241     diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/pkg-descr psmisc/pkg-descr
242     --- /usr/ports/sysutils/psmisc/pkg-descr 2005-10-05 00:49:45.000000000 -0700
243     +++ psmisc/pkg-descr 2010-05-18 07:57:55.280442813 -0700
244     @@ -1,4 +1,4 @@
245     A port of the Linux pstree, killall and pidof commands.
246     Does not include the 'fuser' command.
247    
248     -WWW: http://psmisc.sourceforge.net
249     +WWW: http://psmisc.sourceforge.net/
250 douglas 282 diff -Nrux .svn -x work /usr/ports/sysutils/psmisc/pkg-plist psmisc/pkg-plist
251     --- /usr/ports/sysutils/psmisc/pkg-plist 1969-12-31 16:00:00.000000000 -0800
252     +++ psmisc/pkg-plist 2010-05-18 22:11:15.201428734 -0700
253     @@ -0,0 +1,26 @@
254     +bin/killall
255     +bin/pidof
256     +bin/pstree
257     +bin/pstree.x11
258     +%%NLS%%share/locale/bg/LC_MESSAGES/psmisc.mo
259     +%%NLS%%share/locale/ca/LC_MESSAGES/psmisc.mo
260     +%%NLS%%share/locale/cs/LC_MESSAGES/psmisc.mo
261     +%%NLS%%share/locale/de/LC_MESSAGES/psmisc.mo
262     +%%NLS%%share/locale/el/LC_MESSAGES/psmisc.mo
263     +%%NLS%%share/locale/eu/LC_MESSAGES/psmisc.mo
264     +%%NLS%%share/locale/fi/LC_MESSAGES/psmisc.mo
265     +%%NLS%%share/locale/fr/LC_MESSAGES/psmisc.mo
266     +%%NLS%%share/locale/hu/LC_MESSAGES/psmisc.mo
267     +%%NLS%%share/locale/id/LC_MESSAGES/psmisc.mo
268     +%%NLS%%share/locale/it/LC_MESSAGES/psmisc.mo
269     +%%NLS%%share/locale/ja/LC_MESSAGES/psmisc.mo
270     +%%NLS%%share/locale/nb/LC_MESSAGES/psmisc.mo
271     +%%NLS%%share/locale/nl/LC_MESSAGES/psmisc.mo
272     +%%NLS%%share/locale/pl/LC_MESSAGES/psmisc.mo
273     +%%NLS%%share/locale/pt/LC_MESSAGES/psmisc.mo
274     +%%NLS%%share/locale/ro/LC_MESSAGES/psmisc.mo
275     +%%NLS%%share/locale/ru/LC_MESSAGES/psmisc.mo
276     +%%NLS%%share/locale/sv/LC_MESSAGES/psmisc.mo
277     +%%NLS%%share/locale/vi/LC_MESSAGES/psmisc.mo
278     +%%NLS%%share/locale/zh_CN/LC_MESSAGES/psmisc.mo
279     +%%NLS%%share/locale/zh_TW/LC_MESSAGES/psmisc.mo