From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4DBFE15800A for ; Wed, 26 Jul 2023 07:58:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8E2EDE0934; Wed, 26 Jul 2023 07:58:36 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6D32AE0934 for ; Wed, 26 Jul 2023 07:58:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4E781335D6A for ; Wed, 26 Jul 2023 07:58:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E12FFDD1 for ; Wed, 26 Jul 2023 07:58:33 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1690358310.3da0ff3d2dd47469becd80e744c0c3ced448a516.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/util/, / X-VCS-Repository: proj/portage X-VCS-Files: NEWS lib/portage/util/env_update.py X-VCS-Directories: lib/portage/util/ / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 3da0ff3d2dd47469becd80e744c0c3ced448a516 X-VCS-Branch: master Date: Wed, 26 Jul 2023 07:58:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8a81dc5e-6648-4364-b048-34ba6bfdcf2d X-Archives-Hash: b7a857aa95b90fa548c361fd2012bad5 commit: 3da0ff3d2dd47469becd80e744c0c3ced448a516 Author: Sam James gentoo org> AuthorDate: Sat Jul 15 08:16:45 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jul 26 07:58:30 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3da0ff3d lib: env_update: check ldconfig exit code Bug: https://bugs.gentoo.org/910376 Signed-off-by: Sam James gentoo.org> NEWS | 2 ++ lib/portage/util/env_update.py | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index fcbbdb2a5..4c54ba382 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ Bug fixes: * install-qa-check.d/05prefix: Fix prefixifying shebang for >= EAPI 7 ebuilds (bug #909147). +* env-update: Check exit code from ldconfig (bug #910376). + * emerge: Fix 'no ebuilds available' message always mentioning binpkgs (bug #909853). diff --git a/lib/portage/util/env_update.py b/lib/portage/util/env_update.py index d76042a6b..5c2b2fdd5 100644 --- a/lib/portage/util/env_update.py +++ b/lib/portage/util/env_update.py @@ -1,4 +1,4 @@ -# Copyright 2010-2020 Gentoo Authors +# Copyright 2010-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 __all__ = ["env_update"] @@ -6,6 +6,7 @@ __all__ = ["env_update"] import errno import glob import stat +import sys import time import portage @@ -363,12 +364,12 @@ def _env_update(makelinks, target_root, prev_mtimes, contents, env, writemsg_lev writemsg_level( _(">>> Regenerating %setc/ld.so.cache...\n") % (target_root,) ) - os.system(f"cd / ; {ldconfig} -X -r '{target_root}'") + ret = os.system(f"cd / ; {ldconfig} -X -r '{target_root}'") elif ostype in ("FreeBSD", "DragonFly"): writemsg_level( _(">>> Regenerating %svar/run/ld-elf.so.hints...\n") % target_root ) - os.system( + ret = os.system( ( "cd / ; %s -elf -i " + "-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'" @@ -376,6 +377,12 @@ def _env_update(makelinks, target_root, prev_mtimes, contents, env, writemsg_lev % (ldconfig, target_root, target_root) ) + ret = os.waitstatus_to_exitcode(ret) + if ret > 0: + writemsg(f"!!! ldconfig failed with exit status {ret}\n", noiselevel=-1) + if ret < 0: + writemsg(f"!!! ldconfig was killed with signal {-ret}\n", noiselevel=-1) + del specials["LDPATH"] notice = "# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.\n"