From d3e2e2c5ad25aa67edfc976c50a4d4b279eaa332 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 7 Nov 2008 21:04:45 +0000 Subject: 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 --- pym/portage/dbapi/vartree.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'pym') 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() == "": -- cgit v1.2.3-1-g7c22