From 88837dde0134300dac9de501e2b0ca25c00fa252 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 23 Dec 2006 00:11:27 +0000 Subject: [PATCH] Pass a cache instance into metadata_overlay since it doesn't have enough information to construct one itself. svn path=/main/trunk/; revision=5356 --- pym/cache/metadata_overlay.py | 9 ++++++--- 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 -- 2.26.2