summaryrefslogtreecommitdiff
blob: 65fbd3e0d32979880a3cd2b99e67fd9c59514b26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
commit dde7fb0919d40cc5585e8a603046e7098371ad69
Author: Benda Xu <heroxbd@gentoo.org>
Date:   Wed Dec 10 10:45:31 2014 +0900

    let env-update call ldconfig if it exists
    
        In Prefix, let env-update call ldconfig if it exists.
    
        It does not affect prefix-rpath, and handles prefix-libc(RAP) correctly.
    
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

diff --git a/pym/portage/util/env_update.py b/pym/portage/util/env_update.py
index ace492c..5e732ad 100644
--- a/pym/portage/util/env_update.py
+++ b/pym/portage/util/env_update.py
@@ -306,13 +306,15 @@ def _env_update(makelinks, target_root, prev_mtimes, contents, env,
 		if not libdir_contents_changed:
 			makelinks = False
 
-	ldconfig = "/sbin/ldconfig"
+	ldconfig = eprefix + "/sbin/ldconfig"
 	if "CHOST" in settings and "CBUILD" in settings and \
 		settings["CHOST"] != settings["CBUILD"]:
 		ldconfig = find_binary("%s-ldconfig" % settings["CHOST"])
+	elif not (os.access(ldconfig, os.X_OK) and os.path.isfile(ldconfig)):
+		ldconfig = None
 
 	# Only run ldconfig as needed
-	if makelinks and ldconfig and not eprefix:
+	if makelinks and ldconfig:
 		# ldconfig has very different behaviour between FreeBSD and Linux
 		if ostype == "Linux" or ostype.lower().endswith("gnu"):
 			# We can't update links if we haven't cleaned other versions first, as