* [gentoo-commits] portage r15488 - main/trunk/pym/portage/dbapi
@ 2010-02-28 3:33 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2010-02-28 3:33 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2010-02-28 03:33:26 +0000 (Sun, 28 Feb 2010)
New Revision: 15488
Modified:
main/trunk/pym/portage/dbapi/bintree.py
Log:
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.
Modified: main/trunk/pym/portage/dbapi/bintree.py
===================================================================
--- main/trunk/pym/portage/dbapi/bintree.py 2010-02-28 03:05:44 UTC (rev 15487)
+++ main/trunk/pym/portage/dbapi/bintree.py 2010-02-28 03:33:26 UTC (rev 15488)
@@ -65,6 +65,14 @@
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 @@
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 @@
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-02-28 3:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-28 3:33 [gentoo-commits] portage r15488 - main/trunk/pym/portage/dbapi Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox