Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11729 - in main/trunk/pym/portage: . dbapi
Date: Tue, 28 Oct 2008 03:41:35
Message-Id: E1KufSX-0005eF-5p@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-10-28 03:41:32 +0000 (Tue, 28 Oct 2008)
3 New Revision: 11729
4
5 Modified:
6 main/trunk/pym/portage/dbapi/vartree.py
7 main/trunk/pym/portage/util.py
8 Log:
9 Pass $ROOT into portage.util.getlibpaths().
10
11
12 Modified: main/trunk/pym/portage/dbapi/vartree.py
13 ===================================================================
14 --- main/trunk/pym/portage/dbapi/vartree.py 2008-10-27 22:35:43 UTC (rev 11728)
15 +++ main/trunk/pym/portage/dbapi/vartree.py 2008-10-28 03:41:32 UTC (rev 11729)
16 @@ -146,7 +146,7 @@
17 self._dbapi = vardbapi
18 self._libs = {}
19 self._obj_properties = {}
20 - self._defpath = set(getlibpaths())
21 + self._defpath = set(getlibpaths(self._dbapi.root))
22 self._obj_key_cache = {}
23
24 class _ObjectKey(object):
25
26 Modified: main/trunk/pym/portage/util.py
27 ===================================================================
28 --- main/trunk/pym/portage/util.py 2008-10-27 22:35:43 UTC (rev 11728)
29 +++ main/trunk/pym/portage/util.py 2008-10-28 03:41:32 UTC (rev 11729)
30 @@ -1212,16 +1212,17 @@
31 return old_pfile
32 return new_pfile
33
34 -def getlibpaths():
35 +def getlibpaths(root):
36 """ Return a list of paths that are used for library lookups """
37
38 # the following is based on the information from ld.so(8)
39 rval = os.environ.get("LD_LIBRARY_PATH", "").split(":")
40 - rval.extend(grabfile("/etc/ld.so.conf"))
41 + rval.extend(grabfile(os.path.join(root, "etc", "ld.so.conf")))
42 rval.append("/usr/lib")
43 rval.append("/lib")
44
45 - rval = [normalize_path(x) for x in rval if x != ""]
46 -
47 + rval = [normalize_path(os.path.join(root, x.lstrip(os.path.sep))) \
48 + for x in rval if x]
49 +
50 return rval