porttree: use pure volatile cache if necessary
authorZac Medico <zmedico@gentoo.org>
Thu, 12 May 2011 19:02:27 +0000 (12:02 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 12 May 2011 19:20:08 +0000 (12:20 -0700)
pym/portage/dbapi/porttree.py

index 231d1fb06f499bf4112e7169b840896e9ed90607..429f8cfa2b500419e8a8b08ba8374f4103f95b9a 100644 (file)
@@ -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: