diff options
-rw-r--r-- | pym/cache/metadata_overlay.py | 9 | ||||
-rw-r--r-- | pym/portage.py | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/pym/cache/metadata_overlay.py b/pym/cache/metadata_overlay.py index b829ea579..fc99b4011 100644 --- a/pym/cache/metadata_overlay.py +++ b/pym/cache/metadata_overlay.py @@ -20,9 +20,12 @@ class database(template.database): 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""" diff --git a/pym/portage.py b/pym/portage.py index e67231ca0..34fb37f63 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5171,10 +5171,12 @@ class portdbapi(dbapi): 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 |