public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/util/, /
Date: Wed, 26 Jul 2023 07:58:33 +0000 (UTC)	[thread overview]
Message-ID: <1690358310.3da0ff3d2dd47469becd80e744c0c3ced448a516.sam@gentoo> (raw)

commit:     3da0ff3d2dd47469becd80e744c0c3ced448a516
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 08:16:45 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> 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 <sam <AT> 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"


             reply	other threads:[~2023-07-26  7:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  7:58 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-02 21:40 [gentoo-commits] proj/portage:master commit in: lib/portage/util/, / James Le Cuirot
2023-08-02  6:31 Sam James
2022-11-30 22:29 Sam James
2021-02-28 10:10 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1690358310.3da0ff3d2dd47469becd80e744c0c3ced448a516.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox