From 1dd22e980db952be5edfae0cd864bfd0925c547b Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Sun, 8 Jun 2008 19:01:17 +0000 Subject: make sure that scanelf is called with the right paths, and properly register all preserved objects to fix bug #223591 svn path=/main/trunk/; revision=10607 --- pym/portage/dbapi/vartree.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index cb2fe28ba..f2593be62 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -147,9 +147,9 @@ class LinkageMap(object): # have to call scanelf for preserved libs here as they aren't # registered in NEEDED.ELF.2 files if self._dbapi.plib_registry and self._dbapi.plib_registry.getPreservedLibs(): - args = ["/usr/bin/scanelf", "-yqF", "%a;%F;%S;%r;%n"] + args = ["/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"] for items in self._dbapi.plib_registry.getPreservedLibs().values(): - args += items + args += [x.lstrip(".") for x in items] proc = subprocess.Popen(args, stdout=subprocess.PIPE) output = [l[3:] for l in proc.communicate()[0].split("\n")] lines += output @@ -1812,18 +1812,16 @@ class dblink(object): # inject files that should be preserved into our image dir import shutil - missing_paths = [] + preserve_paths = [] candidates_stack = list(candidates) while candidates_stack: x = candidates_stack.pop() # skip existing files so the 'new' libs aren't overwritten if os.path.exists(os.path.join(srcroot, x.lstrip(os.sep))): - missing_paths.append(x) continue print "injecting %s into %s" % (x, srcroot) if not os.path.exists(os.path.join(destroot, x.lstrip(os.sep))): print "%s does not exist so can't be preserved" % x - missing_paths.append(x) continue mydir = os.path.join(srcroot, os.path.dirname(x).lstrip(os.sep)) if not os.path.exists(mydir): @@ -1842,10 +1840,9 @@ class dblink(object): else: shutil.copy2(os.path.join(destroot, x.lstrip(os.sep)), os.path.join(srcroot, x.lstrip(os.sep))) - - preserve_paths = [x for x in candidates if x not in missing_paths] - - del missing_paths, candidates + preserve_paths.append(x) + + del candidates # keep track of the libs we preserved self.vartree.dbapi.plib_registry.register(self.mycpv, self.settings["SLOT"], counter, preserve_paths) -- cgit v1.2.3-1-g7c22