super(database, self).__init__(location, label, auxdbkeys)
self.db_rw = db_rw(location, label, auxdbkeys, **config)
self.commit = self.db_rw.commit
- ro_config = config.copy()
- ro_config["readonly"] = True
- self.db_ro = db_ro(label, "metadata/cache", auxdbkeys, **ro_config)
+ if isinstance(db_ro, type):
+ ro_config = config.copy()
+ ro_config["readonly"] = True
+ self.db_ro = db_ro(label, "metadata/cache", auxdbkeys, **ro_config)
+ else:
+ self.db_ro = db_ro
def __getitem__(self, cpv):
"""funnel whiteout validation through here, since value needs to be fetched"""
if secpass < 1:
from cache import metadata_overlay, volatile
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=self.auxdbmodule)
+ db_ro=db_ro)
else:
for x in self.porttrees:
# location, label, auxdbkeys