summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-28 03:33:26 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-28 03:33:26 +0000
commit5d1ba0c7c6cb1d3d5f6880c6547a030f26fb0356 (patch)
tree82247b3cba08cf71fc53748e110628ae5db3cfc8 /pym
parent84ca6b64a0244720e8fe9986ef6f92d668be35f1 (diff)
downloadportage-5d1ba0c7c6cb1d3d5f6880c6547a030f26fb0356.tar.gz
portage-5d1ba0c7c6cb1d3d5f6880c6547a030f26fb0356.tar.bz2
portage-5d1ba0c7c6cb1d3d5f6880c6547a030f26fb0356.zip
Make bindbapi override cpv_inject and cpv_remove, for deleting stale values
from self._aux_cache. Also, add a comment about stale cache handling inside aux_update. svn path=/main/trunk/; revision=15488
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/bintree.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 626e55808..e4f3e60fc 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -65,6 +65,14 @@ class bindbapi(fakedbapi):
self.bintree.populate()
return fakedbapi.match(self, *pargs, **kwargs)
+ def cpv_inject(self, cpv, **kwargs):
+ self._aux_cache.pop(cpv, None)
+ fakedbapi.cpv_inject(cpv, **kwargs)
+
+ def cpv_remove(self, cpv):
+ self._aux_cache.pop(cpv, None)
+ fakedbapi.cpv_remove(cpv)
+
def aux_get(self, mycpv, wants):
if self.bintree and not self.bintree.populated:
self.bintree.populate()
@@ -135,6 +143,7 @@ class bindbapi(fakedbapi):
if not v:
del mydata[k]
mytbz2.recompose_mem(portage.xpak.xpak_mem(mydata))
+ # inject will clear stale caches via cpv_inject.
self.bintree.inject(cpv)
def cp_list(self, *pargs, **kwargs):
@@ -917,7 +926,6 @@ class binarytree(object):
return
slot = slot.strip()
self.dbapi.cpv_inject(cpv)
- self.dbapi._aux_cache.pop(cpv, None)
# Reread the Packages index (in case it's been changed by another
# process) and then updated it, all while holding a lock.