commit: 984acf5b6aa06aecf7f2ef3824486a2fba8e8742 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Tue Feb 3 22:04:27 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Feb 3 22:11:54 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=984acf5b
sys-process/procps: add 4.0.6 Rebased the sysctl '-' ignore errors patch from ulm's upstream PR, include another patch from ulm for bug #969469, and wire up verify-sig. Closes: https://bugs.gentoo.org/969469 Signed-off-by: Sam James <sam <AT> gentoo.org> sys-process/procps/Manifest | 2 + .../procps/files/procps-4.0.6-pid-off-by-one.patch | 50 ++++++++ .../files/procps-4.0.6-sysctl-ignore_failure.patch | 41 +++++++ sys-process/procps/procps-4.0.6.ebuild | 127 +++++++++++++++++++++ 4 files changed, 220 insertions(+) diff --git a/sys-process/procps/Manifest b/sys-process/procps/Manifest index d4aa26e48717..8646cfbef255 100644 --- a/sys-process/procps/Manifest +++ b/sys-process/procps/Manifest @@ -1 +1,3 @@ DIST procps-ng-4.0.5.tar.xz 1517672 BLAKE2B 4b273ac7737202147fbf392995da1c5ff385df2b53ad84180b6412dc45c2a671e81d7659c0a5824c0d8c19fa37cbf2e58b0545841c74399b3717a9f27fd26c23 SHA512 c27730743210cf850c4af98e1fb81bc8ee8d550b07b9eedb34a5b9d661263d0f1bc92c4e73802a0ed8d4405854aef4bc542bff283c28e8fbb6dabb967f9e4359 +DIST procps-ng-4.0.6.tar.xz 1580516 BLAKE2B 20acd79cf60e2967f82724ef432a239c29fd12fc6d24dac5d606eac6a167a7ad46001c08796fa2a910afc709d1e7c3ee1b9260d9753339f423b21fb457264c6b SHA512 c499aa14b6c94eda3a455bfe0d2d3c74c79dd718bffbd20207bd0831cb87725b83a76e4ee537a49ddf112bd1248a156d35da00035cbcd4c22037a20dcb4bdc9c +DIST procps-ng-4.0.6.tar.xz.asc 833 BLAKE2B baaf361cf5e173fafa090930c2cd06769b9cecb95c5b0c41e38d1d5d4ac342b098e3906b836c610f177c8a582c4fe1bc76b8fa8afb111c85c394137d7fad19b7 SHA512 a5cee151b5a1591efad4f91ca75e43e0b7fc9d2d403db1d71d7e0937b8916c1fcffaa22369ca5289e2e5989cca35c3a6073efcfc969026a59738e793bdf28331 diff --git a/sys-process/procps/files/procps-4.0.6-pid-off-by-one.patch b/sys-process/procps/files/procps-4.0.6-pid-off-by-one.patch new file mode 100644 index 000000000000..f725e77f6344 --- /dev/null +++ b/sys-process/procps/files/procps-4.0.6-pid-off-by-one.patch @@ -0,0 +1,50 @@ +https://bugs.gentoo.org/969469 +https://gitlab.com/procps-ng/procps/-/issues/412 +https://gitlab.com/procps-ng/procps/-/merge_requests/284 + +From 5574f049830ec8f76b5042855b65b418a0b3e8f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <[email protected]> +Date: Fri, 30 Jan 2026 13:05:18 +0100 +Subject: [PATCH] library: Fix off-by-one error in procps_pid_length +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Section "pid_max" in Linux admin-guide/sysctl/kernel.rst says: + +| PID allocation wrap value. When the kernel's next PID value +| reaches this value, it wraps back to a minimum PID value. +| PIDs of value "pid_max" or larger are not allocated. + +In particular, when pid_max == 10**N exactly, then the largest +possible PID is 10**N - 1, i.e. the length is N. + +Signed-off-by: Ulrich Müller <[email protected]> +--- + library/sysinfo.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/library/sysinfo.c b/library/sysinfo.c +index 35a99220..aad90f56 100644 +--- a/library/sysinfo.c ++++ b/library/sysinfo.c +@@ -139,9 +139,14 @@ PROCPS_EXPORT unsigned int procps_pid_length(void) + pid_length = DEFAULT_PID_LENGTH; + if ((fp = fopen(PROCFS_PID_MAX, "r")) != NULL) { + if (fgets(pidbuf, sizeof(pidbuf), fp) != NULL) { +- pid_length = strlen(pidbuf); +- if (pidbuf[pid_length-1] == '\n') +- --pid_length; ++ errno = 0; ++ long pid_max = strtol(pidbuf, NULL, 10); ++ if (errno == 0 && pid_max > 0) { ++ pid_max--; ++ pid_length = 1; ++ while ((pid_max /= 10) > 0) ++ pid_length++; ++ } + } + fclose(fp); + } +-- +GitLab diff --git a/sys-process/procps/files/procps-4.0.6-sysctl-ignore_failure.patch b/sys-process/procps/files/procps-4.0.6-sysctl-ignore_failure.patch new file mode 100644 index 000000000000..9ed062475aca --- /dev/null +++ b/sys-process/procps/files/procps-4.0.6-sysctl-ignore_failure.patch @@ -0,0 +1,41 @@ +https://bugs.gentoo.org/969014 +https://gitlab.com/procps-ng/procps/-/issues/410 +https://gitlab.com/procps-ng/procps/-/merge_requests/282 + +From 98f60043abb4d45661b3adee261e4a14cf94c025 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <[email protected]> +Date: Sun, 25 Jan 2026 13:35:34 +0100 +Subject: [PATCH] sysctl: Respect ignore_failure also for close_stream +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When the kernel rejects an unknown value for given a key, then output +will be pending and close_stream will fail (typically with ENOENT). + +Signed-off-by: Ulrich Müller <[email protected]> +--- + src/sysctl.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/sysctl.c b/src/sysctl.c +index d04d5e36..b702fd9f 100644 +--- a/src/sysctl.c ++++ b/src/sysctl.c +@@ -623,9 +623,12 @@ static int WriteSetting( + if (0 < fprintf(fp, "%s\n", value)) + rc = EXIT_SUCCESS; + if (close_stream(fp) != 0) { +- warn(_("setting key \"%s\""), dotted_key); ++ warn(_("setting key \"%s\"%s"), ++ dotted_key, (ignore_failure?_(", ignoring"):"")); + free(dotted_key); +- return EXIT_FAILURE; ++ if (!ignore_failure) ++ rc = EXIT_FAILURE; ++ return rc; + } + } + } +-- +GitLab diff --git a/sys-process/procps/procps-4.0.6.ebuild b/sys-process/procps/procps-4.0.6.ebuild new file mode 100644 index 000000000000..eb2579d7712d --- /dev/null +++ b/sys-process/procps/procps-4.0.6.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/craigsmall.asc +inherit autotools flag-o-matic multilib-minimal verify-sig + +DESCRIPTION="Standard informational utilities and process-handling tools" +HOMEPAGE="https://gitlab.com/procps-ng/procps" +# Per e.g. https://gitlab.com/procps-ng/procps/-/releases/v4.0.5, the dist tarballs +# are still hosted on SF. +SRC_URI=" + https://downloads.sourceforge.net/${PN}-ng/${PN}-ng-${PV}.tar.xz + verify-sig? ( https://downloads.sourceforge.net/${PN}-ng/${PN}-ng-${PV}.tar.xz.asc ) +" +S="${WORKDIR}"/${PN}-ng-${PV} + +# See bug #913210 +LICENSE="GPL-2+ LGPL-2+ LGPL-2.1+" +SLOT="0/1-ng" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="elogind +kill modern-top +ncurses nls selinux static-libs skill systemd test unicode" +RESTRICT="!test? ( test )" + +DEPEND=" + elogind? ( sys-auth/elogind ) + elibc_musl? ( sys-libs/error-standalone ) + ncurses? ( >=sys-libs/ncurses-5.7-r7:=[unicode(+)?] ) + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] ) + systemd? ( sys-apps/systemd[${MULTILIB_USEDEP}] ) +" +RDEPEND=" + ${DEPEND} + !<app-i18n/man-pages-l10n-4.2.0-r1 + !<app-i18n/man-pages-zh_CN-1.6.4.2 + kill? ( + !sys-apps/coreutils[kill] + !sys-apps/util-linux[kill] + ) +" +BDEPEND=" + elogind? ( virtual/pkgconfig ) + elibc_musl? ( virtual/pkgconfig ) + ncurses? ( virtual/pkgconfig ) + systemd? ( virtual/pkgconfig ) + test? ( dev-util/dejagnu ) + verify-sig? ( sec-keys/openpgp-keys-craigsmall ) +" + +# bug #898830 +QA_CONFIG_IMPL_DECL_SKIP=( makedev ) + +PATCHES=( + "${FILESDIR}"/${PN}-4.0.4-xfail-pmap-test.patch + "${FILESDIR}"/${PN}-4.0.5-sysctl-manpage.patch # bug #565304 + "${FILESDIR}"/${PN}-4.0.6-sysctl-ignore_failure.patch + "${FILESDIR}"/${PN}-4.0.6-pid-off-by-one.patch +) + +src_prepare() { + default + + # Only needed for fix-tests-multilib.patch and pgrep-old-linux-headers.patch + eautoreconf +} + +multilib_src_configure() { + # http://www.freelists.org/post/procps/PATCH-enable-transparent-large-file-support + # bug #471102 + append-lfs-flags + + local myeconfargs=( + # No elogind multilib support + $(multilib_native_use_with elogind) + $(multilib_native_use_enable kill) + $(multilib_native_use_enable modern-top) + $(multilib_native_enable pidof) + $(multilib_native_enable pidwait) + $(multilib_native_use_with ncurses) + # bug #794997 + $(multilib_native_use_enable !elibc_musl w) + $(use_enable nls) + $(use_enable selinux libselinux) + $(use_enable static-libs static) + $(use_with systemd) + $(use_enable skill) + ) + + if use ncurses; then + # Only pass whis when we are building the 'watch' command + myeconfargs+=( $(multilib_native_use_enable unicode watch8bit) ) + fi + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_test() { + local ps="${BUILD_DIR}/src/ps/pscommand" + if [[ $("${ps}" --no-headers -o cls -q $$) == IDL ]]; then + # bug #708230 + ewarn "Skipping tests due to SCHED_IDLE" + else + # bug #461302 + emake check </dev/null + fi +} + +multilib_src_install() { + default + + dodoc "${S}"/sysctl.conf + + if multilib_is_native_abi; then + # We keep ps and kill in /bin per bug #565304. + dodir /bin + mv "${ED}"/usr/bin/ps "${ED}"/bin/ || die + if use kill; then + mv "${ED}"/usr/bin/kill "${ED}"/bin/ || die + fi + fi +} + +multilib_src_install_all() { + einstalldocs + find "${ED}" -type f -name '*.la' -delete || die +}
