* update procps-ng to 4.0.5-2

This commit is contained in:
Alexander Baldeck 2025-02-04 00:08:58 +01:00
parent 3a71925c0b
commit cc2ae74c3b
6 changed files with 59 additions and 252 deletions

View File

@ -1,7 +1,7 @@
pkgbase = procps-ng
pkgdesc = Utilities for monitoring your system and its processes
pkgver = 4.0.5
pkgrel = 1
pkgrel = 2
url = https://gitlab.com/procps-ng/procps
arch = x86_64
arch = powerpc64le
@ -11,6 +11,9 @@ pkgbase = procps-ng
arch = riscv64
license = GPL
license = LGPL
makedepends = gettext
makedepends = git
makedepends = po4a
makedepends = systemd
depends = glibc
depends = ncurses
@ -24,12 +27,12 @@ pkgbase = procps-ng
replaces = procps
replaces = sysvinit-tools
options = !emptydirs
source = https://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-4.0.5.tar.xz
source = https://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-4.0.5.tar.xz.asc
source = git+https://gitlab.com/procps-ng/procps.git#tag=v4.0.5?signed
source = 0001-fix-breakage-in-unhex.patch
validpgpkeys = 5D2FB320B825D93904D205193938F96BDF50FEA5
sha256sums = c2e6d193cc78f84cd6ddb72aaf6d5c6a9162f0470e5992092057f5ff518562fa
sha256sums = SKIP
b2sums = 4b273ac7737202147fbf392995da1c5ff385df2b53ad84180b6412dc45c2a671e81d7659c0a5824c0d8c19fa37cbf2e58b0545841c74399b3717a9f27fd26c23
b2sums = SKIP
sha256sums = 640ad0085ee013efb94877072cfa7c0c025884dc8cc398e331b7efb6ebaefc01
sha256sums = 5386ca099f38dc1c0e0521f193896ff38c6c7a3855090ff4e245f1d6d165708d
b2sums = 4f5d23ecd02434e83896e93840dddbe0896e321c7cb2294a54d280abf03b87302489ef7d99c56476952d1364eb4acfe7715b06b2b56a956373e037b0a273111b
b2sums = 80c67d37768c56e9c9eff24ed51ffef115cdba8ed670294ac02241b752167fc595ecb7cfebfb203dc9ba2891350c4921660f694cd1acea49fb2f55d521ee99b2
pkgname = procps-ng

View File

@ -1,43 +0,0 @@
From ca004d4657d5e8b468a4552ede429be53193a3a9 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@dropbear.xyz>
Date: Thu, 31 Aug 2023 22:24:23 +1000
Subject: build-sys: Add systemd/elogind to w
Depending on the compiler flags, w needs to be explictly linked
to libsystemd or elogind even though libproc2 is linked to it.
Signed-off-by: Craig Small <csmall@dropbear.xyz>
---
Makefile.am | 7 +++++++
NEWS | 3 +++
2 files changed, 10 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index f70c8fb1..ddfc0141 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -149,6 +149,13 @@ endif
dist_man_MANS += man/w.1
src_w_SOURCES = src/w.c local/fileutils.c
+src_w_LDADD = $(LDADD)
+if WITH_SYSTEMD
+src_w_LDADD += @SYSTEMD_LIBS@
+endif
+if WITH_ELOGIND
+src_w_LDADD += @ELOGIND_LIBS@
+endif
else
EXTRA_DIST += man/w.1
endif
diff --git a/NEWS b/NEWS
index 3f2158d4..4ad9f74e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+procps-ng-NEXT
+---------------
+
procps-ng-4.0.4
---------------
* library (API & ABI unchanged)

View File

@ -0,0 +1,29 @@
From b6f858f08d355739c49099f87a8590379f2b250d Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 20 Jan 2025 12:03:11 +0100
Subject: [PATCH 1/1] fix breakage in unhex
This broke in commit 23491ebf40cd85de4ec62b135da513cbe88632e0, where
ITEMS_COUNT was introduced for procps_pids_new(). But we still want to
calculate with base of 16 here...
Fixes: https://gitlab.com/procps-ng/procps/-/issues/369
Signed-off-by: Christian Hesse <mail@eworm.de>
---
src/pgrep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pgrep.c b/src/pgrep.c
index 6fc25dd4..4fdc46ce 100644
--- a/src/pgrep.c
+++ b/src/pgrep.c
@@ -498,7 +498,7 @@ static unsigned long long unhex (const char *restrict in)
unsigned long long ret;
char *rem;
errno = 0;
- ret = strtoull(in, &rem, ITEMS_COUNT);
+ ret = strtoull(in, &rem, 16);
if (errno || *rem != '\0') {
xwarnx(_("not a hex string: %s"), in);
return 0;

View File

@ -1,176 +0,0 @@
From 79042e07fab9956135a21b1df7a69d1fbde7ef79 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@dropbear.xyz>
Date: Tue, 12 Sep 2023 16:59:18 +1000
Subject: [PATCH] ps: Don't crash when using short option
ps would crash with the -si or -sf options with systemd enabled.
The issue was the utmp wasn't filled in, the long option checked, the
short option did not.
Refactored the showinfo() function so instead of a branch with duplicate
prints for the items in both long and short we just branch on the items
for long output.
Also, made the function prototypes not dependendent on systemd enabled,
it was too messy that way and passing a char* NULL is not really going
to hurt anything.
References:
#301
Signed-off-by: Craig Small <csmall@dropbear.xyz>
---
NEWS | 1 +
src/w.c | 61 ++++++++++++++++++++-------------------------------------
2 files changed, 22 insertions(+), 40 deletions(-)
diff --git a/NEWS b/NEWS
index 4ad9f74e..883f9139 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
procps-ng-NEXT
---------------
+ * w: Don't segfault with -s option issue #301
procps-ng-4.0.4
---------------
diff --git a/src/w.c b/src/w.c
index fd6e75f7..e2d754b5 100644
--- a/src/w.c
+++ b/src/w.c
@@ -207,9 +207,7 @@ static void print_display_or_interface(const char *restrict host, int len, int r
/* This routine prints either the hostname or the IP address of the remote */
static void print_from(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
const char *session,
-#endif
const utmp_t *restrict const u, const int ip_addresses, const int fromlen) {
#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
if (session) {
@@ -508,11 +506,10 @@ static int find_best_proc(
#undef PIDS_GETSTR
}
+
static void showinfo(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
const char *session, const char *name,
-#endif
- utmp_t * u, int formtype, int maxcmd, int from,
+ utmp_t * u, const int longform, int maxcmd, int from,
const int userlen, const int fromlen, const int ip_addresses,
const int pids)
{
@@ -575,25 +572,20 @@ static void showinfo(
/* force NUL term for printf */
uname[UT_NAMESIZE] = '\0';
- if (formtype) {
- printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, tty + 5);
+ printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, tty + 5);
+ if (from)
+ print_from(session, NULL, ip_addresses, fromlen);
+
+ /* login time */
+ if (longform) {
#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
if (session) {
uint64_t ltime;
- if (from)
- print_from(session, NULL, ip_addresses, fromlen);
-
sd_session_get_start_time(session, &ltime);
print_logintime(ltime/((uint64_t) 1000000ULL), stdout);
} else {
#endif
- if (from)
- print_from(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
- NULL,
-#endif
- u, ip_addresses, fromlen);
#ifdef HAVE_UTMPX_H
print_logintime(u->ut_tv.tv_sec, stdout);
@@ -603,11 +595,16 @@ static void showinfo(
#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
}
#endif
- if (u && *u->ut_line == ':')
- /* idle unknown for xdm logins */
- printf(" ?xdm? ");
- else
- print_time_ival7(idletime(tty), 0, stdout);
+ }
+ /* idle */
+ if (u && *u->ut_line == ':')
+ /* idle unknown for xdm logins */
+ printf(" ?xdm? ");
+ else
+ print_time_ival7(idletime(tty), 0, stdout);
+
+ /* jpcpu/pcpu */
+ if (longform) {
print_time_ival7(jcpu / hertz, (jcpu % hertz) * (100. / hertz),
stdout);
if (pcpu > 0)
@@ -616,20 +613,8 @@ static void showinfo(
stdout);
else
printf(" ? ");
- } else {
- printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, tty + 5);
- if (from)
- print_from(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
- NULL,
-#endif
- u, ip_addresses, fromlen);
- if (u && *u->ut_line == ':')
- /* idle unknown for xdm logins */
- printf(" ?xdm? ");
- else
- print_time_ival7(idletime(tty), 0, stdout);
}
+ /* what */
if (pids) {
pid_t ut_pid = -1;
if (u)
@@ -798,9 +783,9 @@ int main(int argc, char **argv)
* headers. Try to keep alignment intact. */
printf(_("%-*s TTY "), userlen, _("USER"));
if (from)
- printf("%-*s", fromlen - 1, _("FROM"));
+ printf("%-*s", fromlen, _("FROM"));
if (longform)
- printf(_(" LOGIN@ IDLE JCPU PCPU WHAT\n"));
+ printf(_(" LOGIN@ IDLE JCPU PCPU WHAT\n"));
else
printf(_(" IDLE WHAT\n"));
}
@@ -857,9 +842,7 @@ int main(int argc, char **argv)
continue;
if (!strncmp(u->ut_user, user, UT_NAMESIZE))
showinfo(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
NULL, NULL,
-#endif
u, longform, maxcmd, from, userlen,
fromlen, ip_addresses, pids);
}
@@ -876,9 +859,7 @@ int main(int argc, char **argv)
continue;
if (*u->ut_user)
showinfo(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
NULL, NULL,
-#endif
u, longform, maxcmd, from, userlen,
fromlen, ip_addresses, pids);
}
--
GitLab

View File

@ -7,32 +7,39 @@
pkgname=procps-ng
pkgver=4.0.5
pkgrel=1
pkgrel=2
pkgdesc='Utilities for monitoring your system and its processes'
url='https://gitlab.com/procps-ng/procps'
license=(GPL LGPL)
arch=(x86_64 powerpc64le powerpc64 powerpc espresso riscv64)
depends=(glibc ncurses libncursesw.so systemd-libs)
makedepends=(systemd)
makedepends=(gettext git po4a systemd)
conflicts=(procps sysvinit-tools)
provides=(procps sysvinit-tools libproc2.so)
replaces=(procps sysvinit-tools)
options=('!emptydirs')
validpgpkeys=('5D2FB320B825D93904D205193938F96BDF50FEA5') # Craig Small <csmall@debian.org>
source=("https://downloads.sourceforge.net/project/$pkgname/Production/${pkgname}-${pkgver}.tar.xz"{,.asc})
sha256sums=('c2e6d193cc78f84cd6ddb72aaf6d5c6a9162f0470e5992092057f5ff518562fa'
'SKIP')
b2sums=('4b273ac7737202147fbf392995da1c5ff385df2b53ad84180b6412dc45c2a671e81d7659c0a5824c0d8c19fa37cbf2e58b0545841c74399b3717a9f27fd26c23'
'SKIP')
source=("git+https://gitlab.com/procps-ng/procps.git#tag=v${pkgver}?signed"
'0001-fix-breakage-in-unhex.patch')
sha256sums=('640ad0085ee013efb94877072cfa7c0c025884dc8cc398e331b7efb6ebaefc01'
'5386ca099f38dc1c0e0521f193896ff38c6c7a3855090ff4e245f1d6d165708d')
b2sums=('4f5d23ecd02434e83896e93840dddbe0896e321c7cb2294a54d280abf03b87302489ef7d99c56476952d1364eb4acfe7715b06b2b56a956373e037b0a273111b'
'80c67d37768c56e9c9eff24ed51ffef115cdba8ed670294ac02241b752167fc595ecb7cfebfb203dc9ba2891350c4921660f694cd1acea49fb2f55d521ee99b2')
prepare() {
cd procps-ng-$pkgver
sed 's:<ncursesw/:<:g' -i src/watch.c
autoreconf -fi
cd procps
# fix breakage in unhex
# https://gitlab.com/procps-ng/procps/-/issues/369
# https://gitlab.com/procps-ng/procps/-/merge_requests/247
patch -Np1 < ../0001-fix-breakage-in-unhex.patch
./autogen.sh
}
build() {
cd procps-ng-$pkgver
cd procps
./configure \
--prefix=/usr \
--exec-prefix=/ \
@ -49,6 +56,7 @@ build() {
}
package() {
cd procps-ng-$pkgver
cd procps
make DESTDIR="$pkgdir" install
}

View File

@ -1,14 +0,0 @@
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
}