summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dbapi/vartree.py2
-rw-r--r--pym/portage/util.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 141585fe0..eede29c7e 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -146,7 +146,7 @@ class LinkageMap(object):
self._dbapi = vardbapi
self._libs = {}
self._obj_properties = {}
- self._defpath = set(getlibpaths())
+ self._defpath = set(getlibpaths(self._dbapi.root))
self._obj_key_cache = {}
class _ObjectKey(object):
diff --git a/pym/portage/util.py b/pym/portage/util.py
index 0e4fd0bd3..d7a0b0fcb 100644
--- a/pym/portage/util.py
+++ b/pym/portage/util.py
@@ -1212,16 +1212,17 @@ def new_protect_filename(mydest, newmd5=None):
return old_pfile
return new_pfile
-def getlibpaths():
+def getlibpaths(root):
""" Return a list of paths that are used for library lookups """
# the following is based on the information from ld.so(8)
rval = os.environ.get("LD_LIBRARY_PATH", "").split(":")
- rval.extend(grabfile("/etc/ld.so.conf"))
+ rval.extend(grabfile(os.path.join(root, "etc", "ld.so.conf")))
rval.append("/usr/lib")
rval.append("/lib")
- rval = [normalize_path(x) for x in rval if x != ""]
-
+ rval = [normalize_path(os.path.join(root, x.lstrip(os.path.sep))) \
+ for x in rval if x]
+
return rval