aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--lib/portage/util/env_update.py13
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"