Tweak vardbapi.aux_get() cache logic a bit.
authorZac Medico <zmedico@gentoo.org>
Sun, 18 May 2008 22:27:15 +0000 (22:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 18 May 2008 22:27:15 +0000 (22:27 -0000)
svn path=/main/trunk/; revision=10360

pym/portage/dbapi/vartree.py

index 8506a23e4486e71a301728f8b57ef452da231051..041c60a166849905081e5539b5d573cb4979d147 100644 (file)
@@ -615,6 +615,8 @@ class vardbapi(dbapi):
                mydata = {}
                cache_valid = False
                cache_incomplete = False
+               cache_mtime = None
+               metadata = None
                if pkg_data:
                        cache_mtime, metadata = pkg_data
                        cache_valid = cache_mtime == mydir_mtime
@@ -638,7 +640,7 @@ class vardbapi(dbapi):
                                mydata[k] = v
                        if not cache_valid or cache_incomplete:
                                cache_data = {}
-                               if cache_incomplete:
+                               if cache_valid and metadata:
                                        cache_data.update(metadata)
                                for aux_key in cache_these:
                                        cache_data[aux_key] = mydata[aux_key]