Hello community, here is the log from the commit of package procinfo for openSUSE:Factory checked in at 2014-10-11 19:25:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/procinfo (Old) and /work/SRC/openSUSE:Factory/.procinfo.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "procinfo" Changes: -------- --- /work/SRC/openSUSE:Factory/procinfo/procinfo.changes 2011-10-04 18:14:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.procinfo.new/procinfo.changes 2014-10-11 19:25:05.000000000 +0200 @@ -1,0 +2,17 @@ +Thu Oct 9 12:25:07 UTC 2014 - [email protected] + +- Add the patches + procinfo-man.dif to avoid bogus comments nroff code + procinfo-maxdev.dif to increase the numbers og devices a lot (bsc#900125) + procinfo-ranges.dif to check buffer boundaries + procinfo-sysconf.dif to get the number of CPU's which are online + procinfo-uptime.dif avoid variable overflow in case the system is idle +- Modify the patches + procinfo-18.dif + procinfo-float.dif + procinfo-hz + procinfo-ia64.diff + procinfo-intr.dif + procinfo-lsdev.dif + +------------------------------------------------------------------- New: ---- procinfo-man.dif procinfo-maxdev.dif procinfo-ranges.dif procinfo-sysconf.dif procinfo-uptime.dif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ procinfo.spec ++++++ --- /var/tmp/diff_new_pack.eDia6e/_old 2014-10-11 19:25:07.000000000 +0200 +++ /var/tmp/diff_new_pack.eDia6e/_new 2014-10-11 19:25:07.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package procinfo # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,37 +15,39 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - Name: procinfo BuildRequires: ncurses-devel Url: ftp://ftp.cistron.nl/pub/people/00-OLD/svm/ -License: GPL-2.0+ -Group: System/Monitoring -AutoReqProv: on Version: 18 -Release: 202 +Release: 0 Summary: Display System Status Gathered from /proc +License: GPL-2.0+ +Group: System/Monitoring Provides: ps:/usr/bin/lsdev Source: ftp://ftp.cistron.nl/pub/people/svm/%{name}-%{version}.tar.bz2 Patch0: procinfo-%{version}.dif -Patch1: procinfo-ia64.diff -Patch2: procinfo-hz -Patch3: procinfo-TERM.dif -Patch4: procinfo-26.diff -Patch5: procinfo-gccver.diff -Patch6: procinfo-irq.dif -Patch7: procinfo-loadavg.dif -Patch8: procinfo-lsdev.dif -Patch9: procinfo-socklist.dif -Patch10: procinfo-float.dif -Patch11: procinfo-intr.dif -Patch12: procinfo-gcc.dif -Patch13: procinfo-tickless.dif -Patch14: procinfo-termcap.diff -Patch15: procinfo-disks.dif -Patch16: procinfo-gccver2.dif +Patch1: procinfo-uptime.dif +Patch2: procinfo-ia64.diff +Patch3: procinfo-hz +Patch4: procinfo-TERM.dif +Patch5: procinfo-26.diff +Patch6: procinfo-gccver.diff +Patch7: procinfo-irq.dif +Patch8: procinfo-loadavg.dif +Patch9: procinfo-lsdev.dif +Patch10: procinfo-socklist.dif +Patch11: procinfo-float.dif +Patch12: procinfo-intr.dif +Patch13: procinfo-gcc.dif +Patch14: procinfo-tickless.dif +Patch15: procinfo-termcap.diff +Patch16: procinfo-disks.dif +Patch17: procinfo-gccver2.dif +Patch18: procinfo-man.dif +Patch19: procinfo-maxdev.dif +Patch20: procinfo-sysconf.dif +Patch21: procinfo-ranges.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -64,9 +66,9 @@ %patch1 %patch2 %patch3 -%patch4 -p1 +%patch4 %patch5 -p1 -%patch6 +%patch6 -p1 %patch7 %patch8 %patch9 @@ -74,11 +76,16 @@ %patch11 %patch12 %patch13 +%patch14 %if %suse_version > 1100 -%patch14 -p1 +%patch15 -p1 %endif -%patch15 %patch16 +%patch17 +%patch18 +%patch19 +%patch20 +%patch21 %build CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 ${RPM_OPT_FLAGS} -pipe" ++++++ procinfo-18.dif ++++++ --- /var/tmp/diff_new_pack.eDia6e/_old 2014-10-11 19:25:07.000000000 +0200 +++ /var/tmp/diff_new_pack.eDia6e/_new 2014-10-11 19:25:07.000000000 +0200 @@ -1,6 +1,16 @@ +--- + Makefile | 13 +++++++------ + procinfo.c | 2 +- + routines.c | 2 +- + 3 files changed, 9 insertions(+), 8 deletions(-) + --- Makefile -+++ Makefile Mon Sep 17 14:56:55 2001 -@@ -4,13 +4,13 @@ ++++ Makefile 2014-10-09 10:39:00.144337785 +0000 +@@ -1,16 +1,17 @@ + ### Makefile for procinfo. + + prefix=/usr ++mandir=$(prefix)/share/man CC = gcc -Wall -Wstrict-prototypes @@ -12,11 +22,11 @@ # instead: -LDLIBS = -ltermcap -+LDLIBS = -lncurses ++LDLIBS = -ltinfo ### Add to taste: -@@ -36,10 +36,10 @@ +@@ -36,10 +37,10 @@ install: procinfo procinfo.8 lsdev.pl so install procinfo $(prefix)/bin/procinfo install lsdev.pl $(prefix)/bin/lsdev install socklist.pl $(prefix)/bin/socklist @@ -24,15 +34,15 @@ - install -m 644 procinfo.8 $(prefix)/man/man8/procinfo.8 - install -m 644 lsdev.8 $(prefix)/man/man8/lsdev.8 - install -m 644 socklist.8 $(prefix)/man/man8/socklist.8 -+ -mkdir -p $(prefix)/share/man/man8 -+ install -m 644 procinfo.8 $(prefix)/share/man/man8/procinfo.8 -+ install -m 644 lsdev.8 $(prefix)/share/man/man8/lsdev.8 -+ install -m 644 socklist.8 $(prefix)/share/man/man8/socklist.8 ++ -mkdir -p $(mandir)/man8 ++ install -m 644 procinfo.8 $(mandir)/man8/procinfo.8 ++ install -m 644 lsdev.8 $(mandir)/man8/lsdev.8 ++ install -m 644 socklist.8 $(mandir)/man8/socklist.8 clean: rm -f procinfo procinfo.0 *.o *~ out --- procinfo.c -+++ procinfo.c Mon Sep 17 14:56:55 2001 ++++ procinfo.c 2001-09-17 14:56:55.000000000 +0000 @@ -16,7 +16,7 @@ */ @@ -43,7 +53,7 @@ #include <errno.h> #include <fcntl.h> --- routines.c -+++ routines.c Mon Sep 17 15:12:46 2001 ++++ routines.c 2001-09-17 15:12:46.000000000 +0000 @@ -16,7 +16,7 @@ */ @@ -53,34 +63,3 @@ #include <errno.h> #include <signal.h> -@@ -390,19 +390,19 @@ - unsigned int d, h, m, s; - static char buf[22]; - -- t = t * 100 / HZ; -- d = (int) (t / 8640000); -- t = t - (long) (d * 8640000); -- h = (int) (t / 360000); -- t = t - (long) (h * 360000); -- m = (int) (t / 6000); -- t = t - (long) (m * 6000); -- s = (int) (t / 100); -- t = t - (long) (s * 100); -+ t *= 100 / HZ; -+ d = (unsigned int) (t / 8640000); -+ t = t - (unsigned long) (d * 8640000); -+ h = (unsigned int) (t / 360000); -+ t = t - (unsigned long) (h * 360000); -+ m = (unsigned int) (t / 6000); -+ t = t - (unsigned long) (m * 6000); -+ s = (unsigned int) (t / 100); -+ t = t - (unsigned long) (s * 100); - if (d > 0) -- sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (int) t); -+ sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t); - else -- sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (int) t); -+ sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (unsigned int) t); - return buf; - } - ++++++ procinfo-float.dif ++++++ --- /var/tmp/diff_new_pack.eDia6e/_old 2014-10-11 19:25:07.000000000 +0200 +++ /var/tmp/diff_new_pack.eDia6e/_new 2014-10-11 19:25:07.000000000 +0200 @@ -1,7 +1,5 @@ -Index: procinfo.c -=================================================================== ---- procinfo.c.orig -+++ procinfo.c +--- procinfo.c ++++ procinfo.c 2007-07-30 14:53:29.000000000 +0000 @@ -219,7 +219,7 @@ first_page (long sl) the DIFF macro, so that we'll end up with nice multiples of 4 when using the -d option. @@ -26,10 +24,8 @@ } else { putchar ('\n'); -Index: routines.c -=================================================================== ---- routines.c.orig -+++ routines.c +--- routines.c ++++ routines.c 2007-07-30 14:50:08.000000000 +0000 @@ -397,7 +397,7 @@ char * hms (unsigned long t) { @@ -41,7 +37,7 @@ d = (unsigned int) (t / 8640000); @@ -409,9 +409,11 @@ hms (unsigned long t) s = (unsigned int) (t / 100); - t = t - (unsigned long) (s * 100); + t = t - ((unsigned long)s * 100); if (d > 0) - sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t); + snprintf (buf, sizeof(buf)-1, ++++++ procinfo-hz ++++++ --- /var/tmp/diff_new_pack.eDia6e/_old 2014-10-11 19:25:07.000000000 +0200 +++ /var/tmp/diff_new_pack.eDia6e/_new 2014-10-11 19:25:07.000000000 +0200 @@ -4,8 +4,8 @@ # If you get lots of `undefined references', you probably need -lncurses # instead: --LDLIBS = -lncurses -+LDLIBS = -lncurses -lrt +-LDLIBS = -ltinfo ++LDLIBS = -ltinfo -lrt ### Add to taste: @@ -102,7 +102,7 @@ - t = (t*100) / HZ; + t = (t*100ULL) / usr_hz; d = (unsigned int) (t / 8640000); - t = t - (unsigned long) (d * 8640000); + t = t - ((unsigned long)d * 8640000); h = (unsigned int) (t / 360000); @@ -413,6 +413,7 @@ perc (unsigned long i, unsigned long t, unsigned int v; ++++++ procinfo-ia64.diff ++++++ --- /var/tmp/diff_new_pack.eDia6e/_old 2014-10-11 19:25:07.000000000 +0200 +++ /var/tmp/diff_new_pack.eDia6e/_new 2014-10-11 19:25:07.000000000 +0200 @@ -10,6 +10,6 @@ - t *= 100 / HZ; + t = (t*100) / HZ; d = (unsigned int) (t / 8640000); - t = t - (unsigned long) (d * 8640000); + t = t - ((unsigned long)d * 8640000); h = (unsigned int) (t / 360000); Only in .: routines.o ++++++ procinfo-intr.dif ++++++ --- /var/tmp/diff_new_pack.eDia6e/_old 2014-10-11 19:25:07.000000000 +0200 +++ /var/tmp/diff_new_pack.eDia6e/_new 2014-10-11 19:25:07.000000000 +0200 @@ -1,5 +1,5 @@ --- procinfo.c -+++ procinfo.c 2008-04-28 15:40:20.000000000 +0200 ++++ procinfo.c 2014-10-09 11:56:25.996337561 +0000 @@ -19,6 +19,9 @@ static char *rcsid __attribute__ ((unused)) = "$Id: procinfo.c,v 1.56 2001/02/25 11:29:13 svm Exp svm $"; @@ -260,6 +260,21 @@ howmany++; } } +@@ -653,11 +732,11 @@ first_page (long sl) + for (i = 0; i < rows; i++) { + /* The last row may be incomplete if howmany is odd, hence: */ + if (i == rows - 1 && howmany & 1) { +- printf ("irq%3d:%10lu %-21s\n", ++ printf ("irq%4d:%10lu %-20s\n", + squirqs[i].nr, squirqs[i].count, squirqs[i].label); + } else { +- printf ("irq%3d:%10lu %-21s " +- "irq%3d:%10lu %-21s\n", ++ printf ("irq%4d:%10lu %-20s " ++ "irq%4d:%10lu %-20s\n", + squirqs[i].nr, squirqs[i].count, squirqs[i].label, + squirqs[i+rows].nr, + squirqs[i+rows].count, @@ -665,13 +744,15 @@ first_page (long sl) } } @@ -346,3 +361,36 @@ unsigned long disk[8]; unsigned long disk_r[8]; unsigned long disk_w[8]; +--- routines.c ++++ routines.c 2014-10-09 11:47:57.891838889 +0000 +@@ -430,22 +430,21 @@ hms (unsigned long t) + char * + perc (unsigned long i, unsigned long t, int cpus) + { +- unsigned int v; ++ long double v; + static char buf[128]; + + t = (t*100ULL) / usr_hz; + if ((signed long) i == -1 || t == 0) + return "---.-%"; + +- v = (unsigned int) (i < 1000000 ? +- ((1000 * i + t / 2) / t) : +- ((i + t / 2000) / (t / 1000))); +- v /= cpus; ++ if (i < 1000000UL) ++ v = (1000.0 * i + t / 2.0) / t; ++ else ++ v = (i + t / 2000.0) / (t / 1000.0); ++ v = v / (cpus * 10.0); + +- /* if (v > 1000) +- return "+++.+%"; +- else */ +- snprintf (buf, sizeof(buf)-1, "%3u.%u%%", v / 10, v % 10); ++ buf[0] = '\0'; ++ snprintf (buf, sizeof(buf)-1, "%5.1Lf%%", v); + return buf; + } + ++++++ procinfo-lsdev.dif ++++++ --- /var/tmp/diff_new_pack.eDia6e/_old 2014-10-11 19:25:07.000000000 +0200 +++ /var/tmp/diff_new_pack.eDia6e/_new 2014-10-11 19:25:07.000000000 +0200 @@ -1,5 +1,5 @@ --- lsdev.pl -+++ lsdev.pl 2007-04-17 17:21:17.114752512 +0200 ++++ lsdev.pl 2007-04-17 15:21:17.000000000 +0000 @@ -16,33 +16,42 @@ open (IRQ, "</proc/interrupts") || die " while (<IRQ>) { next if /^[ \t]*[A-Z]/; @@ -7,8 +7,8 @@ - if (/PIC/) { - $n = (@line = split()); + s/^ +//g; -+ if (/-(PIC|edge|level) /) { -+ $n = (@line = split(/-(PIC|edge|level) /)); ++ if (/-(PIC|edge|level|fasteoi) /) { ++ $n = (@line = split(/-(PIC|edge|level|fasteoi) /)); } else { $n = (@line = split(' [ +] ')); } ++++++ procinfo-man.dif ++++++ --- procinfo.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- procinfo.8 +++ procinfo.8 2010-10-12 13:42:49.000000000 +0000 @@ -174,8 +174,8 @@ or option). Modules with a use count larger than 0 are marked with an asterisk. -." Deleted modules are marked with a `d', uninitialized -." modules with a `u', and modules with a bad state flag with a `b'. +.\" Deleted modules are marked with a `d', uninitialized +.\" modules with a `u', and modules with a bad state flag with a `b'. .TP .BI Character\ and\ Block\ Devices: ++++++ procinfo-maxdev.dif ++++++ --- procinfo.c | 4 +++- procinfo.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) --- procinfo.c +++ procinfo.c 2004-12-17 10:20:49.000000000 +0000 @@ -829,7 +829,9 @@ second_page (void) printf ("%s\nCharacter Devices: " "Block Devices:\n", fs ? ce : ""); - while (fgets (line, sizeof (line), devicesfp)) { + while (fgets (line, sizeof (line), devicesfp) && + count[CDRV] < MAX_DEV && + count[BDRV] < MAX_DEV) { switch (line[0]) { case 'C': which = CDRV; --- procinfo.h +++ procinfo.h 2004-12-17 10:18:11.000000000 +0000 @@ -71,10 +71,10 @@ static inline unsigned long find_val(voi #define CDRV 0 #define BDRV 1 #ifndef MAX_CHRDEV -#define MAX_CHRDEV 32 +#define MAX_CHRDEV 512 #endif #ifndef MAX_BLKDEV -#define MAX_BLKDEV 32 +#define MAX_BLKDEV 512 #endif #define MAX_DEV MAX(MAX_CHRDEV, MAX_BLKDEV) ++++++ procinfo-ranges.dif ++++++ --- procinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- procinfo.c +++ procinfo.c 2014-10-09 12:05:59.099837903 +0000 @@ -661,7 +661,7 @@ first_page (long sl) while (fgets (line, sizeof (line), dmafp)) { char *q, *p; size_t len; - int num; + long num; q = strchr(line, ':'); if (!q || (*q == '\0') || (*q == '\n')) @@ -692,7 +692,7 @@ first_page (long sl) continue; if (strncmp (q, s->label, len) == 0) { - tmplen = snprintf(tmp, sizeof(tmp), " [%d]", num); + tmplen = snprintf(tmp, sizeof(tmp), " [%ld]", num); if (tmplen > 21) /* Should not happen */ continue; @@ -902,7 +902,7 @@ second_page (void) fs = strchr (line, '\t'); fs = strtok (fs + 1, "\n"); if (line[0] == 'n') { - sprintf (tmp, "[%s]", fs); + snprintf (tmp, sizeof(tmp), "[%s]", fs); printf ("%-20s", tmp); } else printf ("%-20s", fs); @@ -1235,7 +1235,7 @@ main (int ac, char **av) if (strlen (line) > 1) { tmpsl = atof (line); sl = (long) (tmpsl * 1000000.0); - sprintf (line, "delay set to %f", tmpsl); + snprintf (line, sizeof(line), "delay set to %f", tmpsl); message = line; } redrawn = 1; ++++++ procinfo-sysconf.dif ++++++ --- procinfo.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) --- procinfo.c +++ procinfo.c 2004-01-17 07:01:16.000000000 +0000 @@ -1058,19 +1058,7 @@ main (int ac, char **av) } /* Count number of CPUs */ - cpuinfofp = myfopen (PROC_DIR "cpuinfo"); - if (cpuinfofp) { - while (fgets (line, sizeof (line), cpuinfofp)) - if (!strncmp ("processor", line, 9)) /* intel */ - nr_cpus++; - else if (!strncmp ("ncpus ", line, 6)) /* sparc */ - nr_cpus = atoi(line+19); - else if (!strncmp ("cpus detected", line, 13)) /* alpha */ - nr_cpus = atoi(line+27); - fclose (cpuinfofp); - } - if (nr_cpus == 0) - nr_cpus = 1; + nr_cpus = sysconf (_SC_NPROCESSORS_ONLN); /* Gets called from winsz(), but in case stdout is redirected: */ version = make_version (versionfp); ++++++ procinfo-uptime.dif ++++++ --- routines.c +++ routines.c 2001-09-17 15:12:46.000000000 +0000 @@ -390,19 +390,19 @@ hms (unsigned long t) unsigned int d, h, m, s; static char buf[22]; - t = t * 100 / HZ; - d = (int) (t / 8640000); - t = t - (long) (d * 8640000); - h = (int) (t / 360000); - t = t - (long) (h * 360000); - m = (int) (t / 6000); - t = t - (long) (m * 6000); - s = (int) (t / 100); - t = t - (long) (s * 100); + t *= 100 / HZ; + d = (unsigned int) (t / 8640000); + t = t - ((unsigned long)d * 8640000); + h = (unsigned int) (t / 360000); + t = t - ((unsigned long)h * 360000); + m = (unsigned int) (t / 6000); + t = t - ((unsigned long)m * 6000); + s = (unsigned int) (t / 100); + t = t - ((unsigned long)s * 100); if (d > 0) - sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (int) t); + sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t); else - sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (int) t); + sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (unsigned int) t); return buf; } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
