1 |
commit: bce4fd1520fed9f35c8004f98ef3ed489efaa5db |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 3 21:28:47 2012 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 3 21:34:18 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bce4fd15 |
7 |
|
8 |
Support include directives in ld.so.conf. |
9 |
|
10 |
--- |
11 |
pym/portage/util/__init__.py | 13 ++++++++++++- |
12 |
1 files changed, 12 insertions(+), 1 deletions(-) |
13 |
|
14 |
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py |
15 |
index 54e6839..db8eb94 100644 |
16 |
--- a/pym/portage/util/__init__.py |
17 |
+++ b/pym/portage/util/__init__.py |
18 |
@@ -25,6 +25,7 @@ import stat |
19 |
import string |
20 |
import sys |
21 |
import traceback |
22 |
+import glob |
23 |
|
24 |
import portage |
25 |
portage.proxy.lazyimport.lazyimport(globals(), |
26 |
@@ -1596,12 +1597,22 @@ def find_updated_config_files(target_root, config_protect): |
27 |
yield (x, None) |
28 |
|
29 |
def getlibpaths(root, env=None): |
30 |
+ def read_ld_so_conf(path): |
31 |
+ for l in grabfile(path): |
32 |
+ if l.startswith('include '): |
33 |
+ subpath = os.path.join(os.path.dirname(path), l[8:].strip()) |
34 |
+ for p in glob.glob(subpath): |
35 |
+ for r in read_ld_so_conf(p): |
36 |
+ yield r |
37 |
+ else: |
38 |
+ yield l |
39 |
+ |
40 |
""" Return a list of paths that are used for library lookups """ |
41 |
if env is None: |
42 |
env = os.environ |
43 |
# the following is based on the information from ld.so(8) |
44 |
rval = env.get("LD_LIBRARY_PATH", "").split(":") |
45 |
- rval.extend(grabfile(os.path.join(root, "etc", "ld.so.conf"))) |
46 |
+ rval.extend(read_ld_so_conf(os.path.join(root, "etc", "ld.so.conf"))) |
47 |
rval.append("/usr/lib") |
48 |
rval.append("/lib") |