procps: added some patches from gentoo, bumprev.

This commit is contained in:
Juan RP 2010-10-28 04:15:07 +02:00
parent d9e7e6ea69
commit d3f6f0273d
5 changed files with 143 additions and 56 deletions

View File

@ -0,0 +1,39 @@
Under certain conditions, top's display can break.
This patch is by Curtis Doty, updated by Andreas Kling for 3.2.5.
To reproduce bug:
- run top
- turn on color mode ('z')
- highlight sort column ('x')
- move sort column all the way to the left ('<')
- get drunk
procps e-mail: http://sourceforge.net/mailarchive/forum.php?thread_id=6042978&forum_id=12454
Redhat bug: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=140975
Gentoo bug: http://bugs.gentoo.org/show_bug.cgi?id=80296
--- top.c~ 2005-01-26 06:15:18.000000000 +0100
+++ top.c 2005-02-01 09:23:35.000000000 +0100
@@ -2952,12 +2952,10 @@
for (x = 0; x < q->maxpflgs; x++) {
char cbuf[ROWBUFSIZ], _z[ROWBUFSIZ];
FLG_t i = q->procflags[x]; // support for our field/column
- const char *f = Fieldstab[i].fmts; // macro AND sometimes the fmt
+ const char *f = Fieldstab[i].fmts + ((x==0) && !Rc.mode_altscr);
unsigned s = Fieldstab[i].scale; // string must be altered !
unsigned w = Fieldstab[i].width;
- int advance = (x==0) && !Rc.mode_altscr;
-
switch (i) {
case P_CMD:
{ char tmp[ROWBUFSIZ];
@@ -3069,7 +3067,7 @@
} /* end: switch 'procflag' */
- rp = scat(rp, cbuf+advance);
+ rp = scat(rp, cbuf);
} /* end: for 'maxpflgs' */
PUFF(

View File

@ -1,58 +1,3 @@
--- Makefile.orig 2009-05-10 20:50:48.000000000 +0200
+++ Makefile 2010-04-22 13:18:13.010792002 +0200
@@ -24,10 +24,10 @@ TARVERSION := $(VERSION).$(SUBVERSION)
############ vars
# so you can disable them or choose alternates
-ldconfig := ldconfig
+ldconfig :=
ln_f := ln -f
ln_sf := ln -sf
-install := install -D --owner 0 --group 0
+install := install -D
# Lame x86-64 /lib64 and /usr/lib64 abomination:
lib64 := lib$(shell [ -d /lib64 ] && echo 64)
@@ -39,20 +39,20 @@ usr/proc/bin := $(DESTDIR)/u
man1 := $(DESTDIR)/usr/share/man/man1/
man5 := $(DESTDIR)/usr/share/man/man5/
man8 := $(DESTDIR)/usr/share/man/man8/
-lib := $(DESTDIR)/$(lib64)/
-usr/lib := $(DESTDIR)/usr/$(lib64)/
+lib := $(DESTDIR)/lib/
+usr/lib := $(DESTDIR)/usr/lib/
usr/include := $(DESTDIR)/usr/include/
#SKIP := $(bin)kill $(man1)kill.1
-BINFILES := $(usr/bin)uptime $(usr/bin)tload $(usr/bin)free $(usr/bin)w \
+BINFILES := $(usr/bin)tload $(usr/bin)free $(usr/bin)w \
$(usr/bin)top $(usr/bin)vmstat $(usr/bin)watch $(usr/bin)skill \
- $(usr/bin)snice $(bin)kill $(sbin)sysctl $(usr/bin)pmap \
+ $(usr/bin)snice $(sbin)sysctl $(usr/bin)pmap \
$(usr/proc/bin)pgrep $(usr/proc/bin)pkill $(usr/bin)slabtop \
$(usr/proc/bin)pwdx
-MANFILES := $(man1)uptime.1 $(man1)tload.1 $(man1)free.1 $(man1)w.1 \
- $(man1)top.1 $(man1)watch.1 $(man1)skill.1 $(man1)kill.1 \
+MANFILES := $(man1)tload.1 $(man1)free.1 $(man1)w.1 \
+ $(man1)top.1 $(man1)watch.1 $(man1)skill.1 \
$(man1)snice.1 $(man1)pgrep.1 $(man1)pkill.1 $(man1)pmap.1 \
$(man5)sysctl.conf.5 $(man8)vmstat.8 $(man8)sysctl.8 \
$(man1)slabtop.1 $(man1)pwdx.1
@@ -222,10 +222,10 @@ clean:
###### install
$(BINFILES) : all
- $(install) --mode a=rx $(notdir $@) $@
+ $(install) -m755 $(notdir $@) $@
$(MANFILES) : all
- $(install) --mode a=r $(notdir $@) $@
+ $(install) -m644 $(notdir $@) $@
install: $(filter-out $(SKIP) $(addprefix $(DESTDIR),$(SKIP)),$(INSTALL))
cd $(usr/bin) && $(ln_f) skill snice
--- proc/module.mk.orig 2010-04-22 13:22:25.736775611 +0200
+++ proc/module.mk 2010-04-22 13:24:09.814780650 +0200
@@ -42,7 +42,7 @@ FPIC := -fpic
@ -95,3 +40,68 @@
- $(install) --mode a=r $< $@
+ $(install) -m644 $< $@
-rm -f $(DESTDIR)/var/catman/cat1/ps.1.gz $(DESTDIR)/var/man/cat1/ps.1.gz
--- Makefile.orig 2009-05-10 20:50:48.000000000 +0200
+++ Makefile 2010-10-28 04:09:31.000000000 +0200
@@ -24,10 +24,10 @@ TARVERSION := $(VERSION).$(SUBVERSION)
############ vars
# so you can disable them or choose alternates
-ldconfig := ldconfig
+ldconfig :=
ln_f := ln -f
ln_sf := ln -sf
-install := install -D --owner 0 --group 0
+install := install -D
# Lame x86-64 /lib64 and /usr/lib64 abomination:
lib64 := lib$(shell [ -d /lib64 ] && echo 64)
@@ -39,20 +39,20 @@ usr/proc/bin := $(DESTDIR)/u
man1 := $(DESTDIR)/usr/share/man/man1/
man5 := $(DESTDIR)/usr/share/man/man5/
man8 := $(DESTDIR)/usr/share/man/man8/
-lib := $(DESTDIR)/$(lib64)/
-usr/lib := $(DESTDIR)/usr/$(lib64)/
+lib := $(DESTDIR)/lib/
+usr/lib := $(DESTDIR)/usr/lib/
usr/include := $(DESTDIR)/usr/include/
#SKIP := $(bin)kill $(man1)kill.1
-BINFILES := $(usr/bin)uptime $(usr/bin)tload $(usr/bin)free $(usr/bin)w \
+BINFILES := $(usr/bin)tload $(usr/bin)free $(usr/bin)w \
$(usr/bin)top $(usr/bin)vmstat $(usr/bin)watch $(usr/bin)skill \
- $(usr/bin)snice $(bin)kill $(sbin)sysctl $(usr/bin)pmap \
+ $(usr/bin)snice $(sbin)sysctl $(usr/bin)pmap \
$(usr/proc/bin)pgrep $(usr/proc/bin)pkill $(usr/bin)slabtop \
$(usr/proc/bin)pwdx
-MANFILES := $(man1)uptime.1 $(man1)tload.1 $(man1)free.1 $(man1)w.1 \
- $(man1)top.1 $(man1)watch.1 $(man1)skill.1 $(man1)kill.1 \
+MANFILES := $(man1)tload.1 $(man1)free.1 $(man1)w.1 \
+ $(man1)top.1 $(man1)watch.1 $(man1)skill.1 \
$(man1)snice.1 $(man1)pgrep.1 $(man1)pkill.1 $(man1)pmap.1 \
$(man5)sysctl.conf.5 $(man8)vmstat.8 $(man8)sysctl.8 \
$(man1)slabtop.1 $(man1)pwdx.1
@@ -174,7 +174,8 @@ INSTALL := $(BINFILES) $(MANFILES)
# want this rule first, use := on ALL, and ALL not filled in yet
all: do_all
--include */module.mk
+-include proc/module.mk
+-include ps/module.mk
do_all: $(ALL)
@@ -222,10 +223,10 @@ clean:
###### install
$(BINFILES) : all
- $(install) --mode a=rx $(notdir $@) $@
+ $(install) -m755 $(notdir $@) $@
$(MANFILES) : all
- $(install) --mode a=r $(notdir $@) $@
+ $(install) -m644 $(notdir $@) $@
install: $(filter-out $(SKIP) $(addprefix $(DESTDIR),$(SKIP)),$(INSTALL))
cd $(usr/bin) && $(ln_f) skill snice

View File

@ -0,0 +1,22 @@
Ripped from Fedora
If /proc isnt mounted, `top` will cause screen corruption ...
--- top.c~
+++ top.c
@@ -3201,12 +3201,15 @@
int main (int dont_care_argc, char *argv[])
{
+ struct stat isproc;
(void)dont_care_argc;
before(*argv);
// +-------------+
windows_stage1(); // top (sic) slice
configs_read(); // > spread etc, <
parse_args(&argv[1]); // > lean stuff, <
+ if (stat("/proc/self", &isproc)==-1)
+ std_err("/proc is not mounted, required for output data");
whack_terminal(); // > onions etc. <
windows_stage2(); // as bottom slice
// +-------------+

View File

@ -0,0 +1,16 @@
X-Gentoo-Bug: 279819
Upstream-Patch: http://procps.cvs.sourceforge.net/viewvc/procps/procps/top.c?r1=1.132&r2=1.134
--- top.c~ 2008/03/24 04:41:26 1.132
+++ top.c 2009/12/10 11:37:48 1.134
@@ -2190,7 +2190,10 @@
// Value a window's name and make the associated group name.
static void win_names (WIN_t *q, const char *name)
{
- sprintf(q->rc.winname, "%.*s", WINNAMSIZ -1, name);
+ // Note that src==dst is illegal in sprintf.
+ // Failure: amd64, glibc 2.9-20081201, gcc 4.3.4
+ if(q->rc.winname != name)
+ sprintf(q->rc.winname, "%.*s", WINNAMSIZ -1, name);
sprintf(q->grpname, "%d:%.*s", q->winnum, WINNAMSIZ -1, name);
}

View File

@ -1,7 +1,7 @@
# Template file for 'procps'
pkgname=procps
version=3.2.8
revision=1
revision=2
distfiles="http://procps.sf.net/$pkgname-$version.tar.gz"
build_style=gnu_makefile
short_desc="The /proc file system utilities"