From 5c44979e9b42c37247981a3a115114b12be10f59 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 28 Oct 2008 03:41:32 +0000 Subject: Pass $ROOT into portage.util.getlibpaths(). svn path=/main/trunk/; revision=11729 --- pym/portage/dbapi/vartree.py | 2 +- pym/portage/util.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'pym') 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 -- cgit v1.2.3-1-g7c22