Be slightly more defensive when loading the vdb/blockers caches.
authorZac Medico <zmedico@gentoo.org>
Sat, 30 Dec 2006 03:54:36 +0000 (03:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 30 Dec 2006 03:54:36 +0000 (03:54 -0000)
svn path=/main/trunk/; revision=5421

bin/emerge
pym/portage.py

index 17a54cbc5947bc09776a186b6ac986effd6fc3ab..6e7cb55582475b7e0e6cdf6a09c877f148e17791 100755 (executable)
@@ -844,8 +844,8 @@ class BlockerCache(DictMixin):
                cache_valid = self._cache_data and \
                        isinstance(self._cache_data, dict) and \
                        self._cache_data.get("version") == self._cache_version and \
-                       self._cache_data["virtuals"] == self._virtuals and \
-                       set(self._cache_data["blockers"]) == self._installed_pkgs
+                       self._cache_data.get("virtuals") == self._virtuals and \
+                       set(self._cache_data.get("blockers", [])) == self._installed_pkgs
                if cache_valid:
                        for pkg in self._installed_pkgs:
                                if long(self._vardb.aux_get(pkg, ["COUNTER"])[0]) != \
index 642bc157064dbbe3bdc256beaf5637d128762f7f..249252bb15335bacd97a5ef24b0736418e46d505 100644 (file)
@@ -5070,7 +5070,8 @@ class vardbapi(dbapi):
                                pass
                        if not self._aux_cache or \
                                not isinstance(self._aux_cache, dict) or \
-                               self._aux_cache.get("version") != self._aux_cache_version:
+                               self._aux_cache.get("version") != self._aux_cache_version or \
+                               not self._aux_cache.get("packages"):
                                self._aux_cache = {"version":self._aux_cache_version}
                                self._aux_cache["packages"] = {}
                        self._aux_cache["modified"] = False