preserve-libs: check for broken linkmap more
authorZac Medico <zmedico@gentoo.org>
Wed, 18 May 2011 05:27:07 +0000 (22:27 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 18 May 2011 05:27:07 +0000 (22:27 -0700)
pym/portage/dbapi/vartree.py

index cae8cd0edcb196e1843c4191e1c0696c0c983a9a..fd5c774a354a0699ee71de84a33eebe72a8f38ce 100644 (file)
@@ -1498,9 +1498,11 @@ class dblink(object):
        def _prune_plib_registry(self, unmerge=False,
                needed=None, preserve_paths=None):
                # remove preserved libraries that don't have any consumers left
-               plib_registry = self.vartree.dbapi._plib_registry
-               if plib_registry:
+               if not (self._linkmap_broken or
+                       self.vartree.dbapi._linkmap is None or
+                       self.vartree.dbapi._plib_registry is None):
                        self.vartree.dbapi._fs_lock()
+                       plib_registry = self.vartree.dbapi._plib_registry
                        plib_registry.lock()
                        try:
                                plib_registry.load()
@@ -3405,7 +3407,8 @@ class dblink(object):
 
                preserve_paths = set()
                needed = None
-               if not (linkmap is None or plib_registry is None):
+               if not (self._linkmap_broken or linkmap is None or
+                       plib_registry is None):
                        self.vartree.dbapi._fs_lock()
                        plib_registry.lock()
                        try: