Bug #250902 - Inside dblink._find_unused_preserved_libs(), show a warning
authorZac Medico <zmedico@gentoo.org>
Sun, 14 Dec 2008 20:50:37 +0000 (20:50 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 14 Dec 2008 20:50:37 +0000 (20:50 -0000)
instead of raising a KeyError if the preserved libs registry contains a
symlink that points to a lib which is not preserved.

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

pym/portage/dbapi/vartree.py

index d992a3292355e3ad8f9b5b64a6ac67cda2084e03..8b0fb5f4bebe8a4703227ce6927567b663e8da91 100644 (file)
@@ -2734,7 +2734,14 @@ class dblink(object):
                                unlink_list.update(node.alt_paths)
                        unlink_list = sorted(unlink_list)
                        for obj in unlink_list:
-                               cpv = path_cpv_map[obj]
+                               cpv = path_cpv_map.get(obj)
+                               if cpv is None:
+                                       # This means that a symlink is in the preserved libs
+                                       # registry, but the actual lib it points to is not.
+                                       self._display_merge("!!! symlink to lib is preserved, " + \
+                                               "but not the lib itself:\n!!! '%s'\n" % (obj,),
+                                               level=logging.ERROR, noiselevel=-1)
+                                       continue
                                removed = cpv_lib_map.get(cpv)
                                if removed is None:
                                        removed = set()