getlibpaths: regex for include
authorZac Medico <zmedico@gentoo.org>
Tue, 3 Jan 2012 21:59:25 +0000 (13:59 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 3 Jan 2012 21:59:25 +0000 (13:59 -0800)
pym/portage/util/__init__.py

index db8eb94b1bd9a68954a17019ac08202177ca5d09..58501dca6c2e3bb09c70ba8aacc7532190ed91b2 100644 (file)
@@ -1596,11 +1596,15 @@ def find_updated_config_files(target_root, config_protect):
                                        else:
                                                yield (x, None)
 
+_ld_so_include_re = re.compile(r'^include\s+(\S.*)')
+
 def getlibpaths(root, env=None):
        def read_ld_so_conf(path):
                for l in grabfile(path):
-                       if l.startswith('include '):
-                               subpath = os.path.join(os.path.dirname(path), l[8:].strip())
+                       include_match = _ld_so_include_re.match(l)
+                       if include_match is not None:
+                               subpath = os.path.join(os.path.dirname(path),
+                                       include_match.group(1))
                                for p in glob.glob(subpath):
                                        for r in read_ld_so_conf(p):
                                                yield r