Date: Monday, February 12, 2018 @ 23:22:00 Author: bpiotrowski Revision: 316737
archrelease: copy trunk to testing-x86_64 Added: procps-ng/repos/testing-x86_64/ procps-ng/repos/testing-x86_64/PKGBUILD (from rev 316736, procps-ng/trunk/PKGBUILD) procps-ng/repos/testing-x86_64/impossibly-high-memory.patch (from rev 316736, procps-ng/trunk/impossibly-high-memory.patch) procps-ng/repos/testing-x86_64/install (from rev 316736, procps-ng/trunk/install) ------------------------------+ PKGBUILD | 55 ++++++++++++++++++++++++++++++ impossibly-high-memory.patch | 75 +++++++++++++++++++++++++++++++++++++++++ install | 14 +++++++ 3 files changed, 144 insertions(+) Copied: procps-ng/repos/testing-x86_64/PKGBUILD (from rev 316736, procps-ng/trunk/PKGBUILD) =================================================================== --- testing-x86_64/PKGBUILD (rev 0) +++ testing-x86_64/PKGBUILD 2018-02-12 23:22:00 UTC (rev 316737) @@ -0,0 +1,55 @@ +# $Id$ +# Maintainer: Gaetan Bisson <bis...@archlinux.org> +# Contributor: Eric Bélanger <e...@archlinux.org> + +pkgname=procps-ng +pkgver=3.3.12 +pkgrel=3 +pkgdesc='Utilities for monitoring your system and its processes' +url='https://gitlab.com/procps-ng/procps' +license=('GPL' 'LGPL') +arch=('x86_64') +makedepends=('systemd') +depends=('ncurses' 'libsystemd') +source=("https://downloads.sourceforge.net/project/${pkgname}/Production/${pkgname}-${pkgver}.tar.xz" + 'impossibly-high-memory.patch') +sha256sums=('6ed65ab86318f37904e8f9014415a098bec5bc53653e5d9ab404f95ca5e1a7d4' + '1095223d697cf86b7086839666222b853bfa80bb83c7b09eaeceb0c506bea980') + +groups=('base') + +conflicts=('procps' 'sysvinit-tools') +provides=('procps' 'sysvinit-tools') +replaces=('procps' 'sysvinit-tools') + +install=install + +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}" + patch -p1 -i ../impossibly-high-memory.patch + sed 's:<ncursesw/:<:g' -i watch.c +} + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + ./configure \ + --prefix=/usr \ + --exec-prefix=/ \ + --sysconfdir=/etc \ + --libdir=/usr/lib \ + --bindir=/usr/bin \ + --sbindir=/usr/bin \ + --enable-watch8bit \ + --with-systemd \ + --disable-modern-top \ + --disable-kill \ + + # kill is provided by util-linux + + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install +} Copied: procps-ng/repos/testing-x86_64/impossibly-high-memory.patch (from rev 316736, procps-ng/trunk/impossibly-high-memory.patch) =================================================================== --- testing-x86_64/impossibly-high-memory.patch (rev 0) +++ testing-x86_64/impossibly-high-memory.patch 2018-02-12 23:22:00 UTC (rev 316737) @@ -0,0 +1,75 @@ +From a2ceb95e2a7d5bf0270f0d342d2edb560f5cfcf4 Mon Sep 17 00:00:00 2001 +From: Jim Warner <james.war...@comcast.net> +Date: Thu, 17 Aug 2017 01:11:11 -0500 +Subject: [PATCH] top: protect against the anomalous 'Mem' graph display + +Until this patch, top falsely assumed that there would +always be some (small) amount of physical memory after +subtracting 'used' and 'available' from the total. But +as the issue referenced below attests, a sum of 'used' +and 'available' might exceed that total memory amount. + +I'm not sure if this is a problem with our calculation +of the 'used' amount, a flaw in the kernel 'available' +algorithms or some other reason I cannot even imagine. + +Anyway, this patch protects against such a contingency +through the following single line addition of new code +. if (pct_used + pct_misc > 100.0 || pct_misc < 0) ... + +The check for less than zero is not actually necessary +as long as the source numbers remain unsigned. However +should they ever become signed, we'll have protection. + +[ Most of the changes in this commit simply separate ] +[ a variable's definition from its associated logic. ] + +Reference(s): +https://gitlab.com/procps-ng/procps/issues/64 + +Signed-off-by: Jim Warner <james.war...@comcast.net> +--- + top/top.c | 19 ++++++++++++------- + 1 files changed, 12 insertions(+), 7 deletions(-) + +diff --git a/top/top.c b/top/top.c +index 385df1d..948805e 100644 +--- a/top/top.c ++++ b/top/top.c +@@ -5249,21 +5249,26 @@ numa_nope: + { "%-.*s~4", "%-.*s~6", "%-.*s~6", Graph_blks } + }; + char used[SMLBUFSIZ], util[SMLBUFSIZ], dual[MEDBUFSIZ]; +- int ix = w->rc.graph_mems - 1; +- float pct_used = (float)kb_main_used * (100.0 / (float)kb_main_total), ++ float pct_used, pct_misc, pct_swap; ++ int ix, num_used, num_misc; ++ ++ pct_used = (float)kb_main_used * (100.0 / (float)kb_main_total); + #ifdef MEMGRAPH_OLD +- pct_misc = (float)(kb_main_buffers + kb_main_cached) * (100.0 / (float)kb_main_total), ++ pct_misc = (float)(kb_main_buffers + kb_main_cached) * (100.0 / (float)kb_main_total); + #else +- pct_misc = (float)(kb_main_total - kb_main_available - kb_main_used) * (100.0 / (float)kb_main_total), ++ pct_misc = (float)(kb_main_total - kb_main_available - kb_main_used) * (100.0 / (float)kb_main_total); + #endif +- pct_swap = kb_swap_total ? (float)kb_swap_used * (100.0 / (float)kb_swap_total) : 0; ++ if (pct_used + pct_misc > 100.0 || pct_misc < 0) pct_misc = 0; ++ pct_swap = kb_swap_total ? (float)kb_swap_used * (100.0 / (float)kb_swap_total) : 0; ++ ix = w->rc.graph_mems - 1; + #ifndef QUICK_GRAPHS +- int num_used = (int)((pct_used * Graph_adj) + .5), +- num_misc = (int)((pct_misc * Graph_adj) + .5); ++ num_used = (int)((pct_used * Graph_adj) + .5), ++ num_misc = (int)((pct_misc * Graph_adj) + .5); + if (num_used + num_misc > Graph_len) --num_misc; + snprintf(used, sizeof(used), gtab[ix].used, num_used, gtab[ix].type); + snprintf(util, sizeof(util), gtab[ix].misc, num_misc, gtab[ix].type); + #else ++ (void)num_used; (void)num_misc; + snprintf(used, sizeof(used), gtab[ix].used, (int)((pct_used * Graph_adj) + .5), gtab[ix].type); + snprintf(util, sizeof(util), gtab[ix].misc, (int)((pct_misc * Graph_adj) + .4), gtab[ix].type); + #endif +-- +libgit2 0.26.0 + Copied: procps-ng/repos/testing-x86_64/install (from rev 316736, procps-ng/trunk/install) =================================================================== --- testing-x86_64/install (rev 0) +++ testing-x86_64/install 2018-02-12 23:22:00 UTC (rev 316737) @@ -0,0 +1,14 @@ +post_upgrade() { + if [[ $(vercmp $2 3.3.8-3) = -1 ]]; then + cat <<EOF + +==> The file /etc/sysctl.conf has been removed from this +==> package, as all its settings are now kernel defaults. + +==> If you had customized it, you need to rename it as +==> /etc/sysctl.d/99-sysctl.conf since from version 207 on +==> systemd only applies settings from /etc/sysctl.d/* . + +EOF + fi +}