summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-07 21:04:45 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-07 21:04:45 +0000
commitd3e2e2c5ad25aa67edfc976c50a4d4b279eaa332 (patch)
tree5101f15452c09ee73dc44b35ee25f865849eab47
parent9cec53ed08b9d172d42631859d267f1d89623519 (diff)
downloadportage-d3e2e2c5ad25aa67edfc976c50a4d4b279eaa332.tar.gz
portage-d3e2e2c5ad25aa67edfc976c50a4d4b279eaa332.tar.bz2
portage-d3e2e2c5ad25aa67edfc976c50a4d4b279eaa332.zip
When calling scanelf inside LinkageMap.rebuild(), join paths with $ROOT when
generating the arguments and then strip $ROOT from the paths in the output. svn path=/main/trunk/; revision=11822
-rw-r--r--pym/portage/dbapi/vartree.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index ef77e0337..1b5a5b44b 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -248,6 +248,7 @@ class LinkageMap(object):
def rebuild(self, exclude_pkgs=None, include_file=None):
root = self._root
+ root_len = len(root) - 1
self._clear_cache()
self._defpath.update(getlibpaths(self._root))
libs = self._libs
@@ -273,10 +274,22 @@ class LinkageMap(object):
if self._dbapi.plib_registry and self._dbapi.plib_registry.getPreservedLibs():
args = ["/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
for items in self._dbapi.plib_registry.getPreservedLibs().values():
- args += [x.lstrip(".") for x in items]
+ args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
+ for x in items)
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
- output = [l[3:] for l in proc.communicate()[0].split("\n")]
- lines += output
+ for l in proc.stdout:
+ l = l[3:].rstrip("\n")
+ if not l:
+ continue
+ fields = l.split(";")
+ if len(fields) < 5:
+ writemsg_level("\nWrong number of fields " + \
+ "returned from scanelf: %s\n\n" % (l,),
+ level=logging.ERROR, noiselevel=-1)
+ continue
+ fields[1] = fields[1][root_len:]
+ lines.append(";".join(fields))
+ proc.wait()
for l in lines:
if l.strip() == "":