From 161437273b668f4b276f9669aae89ef99213d40d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 12 May 2011 12:02:27 -0700 Subject: [PATCH] porttree: use pure volatile cache if necessary --- pym/portage/dbapi/porttree.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 231d1fb06..429f8cfa2 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -286,12 +286,18 @@ class portdbapi(dbapi): # to the cache entries/directories. if secpass < 1 or not depcachedir_w_ok: for x in self.porttrees: - db_ro = self.auxdbmodule(self.depcachedir, x, - filtered_auxdbkeys, gid=portage_gid, readonly=True) - self.auxdb[x] = metadata_overlay.database( - self.depcachedir, x, filtered_auxdbkeys, - gid=portage_gid, db_rw=volatile.database, - db_ro=db_ro) + try: + db_ro = self.auxdbmodule(self.depcachedir, x, + filtered_auxdbkeys, readonly=True, **cache_kwargs) + except CacheError: + self.auxdb[x] = volatile.database( + self.depcachedir, x, filtered_auxdbkeys, + **cache_kwargs) + else: + self.auxdb[x] = metadata_overlay.database( + self.depcachedir, x, filtered_auxdbkeys, + db_rw=volatile.database, db_ro=db_ro, + **cache_kwargs) else: for x in self.porttrees: if x in self.auxdb: -- 2.26.2