Bug #249805 - Add some more PreservedLibsRegistry.pruneNonExisting() calls,
authorZac Medico <zmedico@gentoo.org>
Thu, 4 Dec 2008 19:01:37 +0000 (19:01 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 4 Dec 2008 19:01:37 +0000 (19:01 -0000)
to avoid a KeyError from LinkageMap.findConsumers() triggered inside
display_preserved_libs().

svn path=/main/trunk/; revision=12152

pym/_emerge/__init__.py
pym/portage/dbapi/vartree.py

index 4dfe52a6d417c7435cad8e29251c9fe11193eaa5..20597c0536c907dfa63ebff80452e28598518c0f 100644 (file)
@@ -11374,6 +11374,9 @@ def display_news_notification(root_config, myopts):
 def display_preserved_libs(vardbapi):
        MAX_DISPLAY = 3
 
+       # Ensure the registry is consistent with existing files.
+       vardbapi.plib_registry.pruneNonExisting()
+
        if vardbapi.plib_registry.hasEntries():
                print
                print colorize("WARN", "!!!") + " existing preserved libs:"
index 152ec1aa6178cfcc60d31e81067cc11faebb0c7b..4abc1e1263f2601467edb0da639ac86704db9351 100644 (file)
@@ -2062,6 +2062,10 @@ class dblink(object):
                                                                break
                                                continue
                                        self.vartree.dbapi.removeFromContents(cpv, removed)
+                       else:
+                               # Prune any preserved libs that may have
+                               # been unmerged with this package.
+                               self.vartree.dbapi.plib_registry.pruneNonExisting()
 
                finally:
                        if builddir_lock: