diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-11-13 11:00:56 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-11-13 11:00:56 +0000 |
commit | e9fe5d1a6789ceeaef1da6fae0761664c7cd727a (patch) | |
tree | df01df2cd03c03b28d974df020df12282bb82686 | |
parent | c281261a8c23137d09c616e1fd5f08e20c78ab39 (diff) | |
download | portage-e9fe5d1a6789ceeaef1da6fae0761664c7cd727a.tar.gz portage-e9fe5d1a6789ceeaef1da6fae0761664c7cd727a.tar.bz2 portage-e9fe5d1a6789ceeaef1da6fae0761664c7cd727a.zip |
Inside LinkageMap.rebuild(), ensure that all preserved 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.
svn path=/main/trunk/; revision=14820
-rw-r--r-- | pym/portage/dbapi/vartree.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index b1d668654..27f2241c7 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -337,9 +337,11 @@ class LinkageMap(object): # 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 = ["/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: @@ -369,9 +371,20 @@ class LinkageMap(object): 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: |