public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r14848 - main/branches/prefix/pym/portage/dbapi
@ 2009-11-19 19:48 Fabian Groffen (grobian)
  0 siblings, 0 replies; only message in thread
From: Fabian Groffen (grobian) @ 2009-11-19 19:48 UTC (permalink / raw
  To: gentoo-commits

Author: grobian
Date: 2009-11-19 19:48:32 +0000 (Thu, 19 Nov 2009)
New Revision: 14848

Modified:
   main/branches/prefix/pym/portage/dbapi/vartree.py
Log:
   Merged from trunk -r14819:14820

   | 14820   | Inside LinkageMap.rebuild(), ensure that all preserved       |
   | zmedico | libraries have an entry in self._obj_properties, even when   |
   |         | they fail to appear in scanelf output. This is important in  |
   |         | order to prevent findConsumers from raising an unwanted      |
   |         | KeyError.                                                    |


Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/vartree.py	2009-11-18 21:17:00 UTC (rev 14847)
+++ main/branches/prefix/pym/portage/dbapi/vartree.py	2009-11-19 19:48:32 UTC (rev 14848)
@@ -338,9 +338,11 @@
 
 		# have to call scanelf for preserved libs here as they aren't 
 		# registered in NEEDED.ELF.2 files
+		plibs = set()
 		if self._dbapi.plib_registry and self._dbapi.plib_registry.getPreservedLibs():
 			args = [EPREFIX+"/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
 			for items in self._dbapi.plib_registry.getPreservedLibs().values():
+				plibs.update(items)
 				args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
 					for x in items)
 			try:
@@ -370,9 +372,20 @@
 							level=logging.ERROR, noiselevel=-1)
 						continue
 					fields[1] = fields[1][root_len:]
+					plibs.discard(fields[1])
 					lines.append(";".join(fields))
 				proc.wait()
 
+		if plibs:
+			# Preserved libraries that did not appear in the scanelf output.
+			# This is known to happen with statically linked libraries.
+			# Generate dummy lines for these, so we can assume that every
+			# preserved library has an entry in self._obj_properties. This
+			# is important in order to prevent findConsumers from raising
+			# an unwanted KeyError.
+			for x in plibs:
+				lines.append(";".join(['', x, '', '', '']))
+
 		for l in lines:
 			l = l.rstrip("\n")
 			if not l:




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-19 19:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-19 19:48 [gentoo-commits] portage r14848 - main/branches/prefix/pym/portage/dbapi Fabian Groffen (grobian)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox