diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-12-23 00:11:27 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-12-23 00:11:27 +0000 |
commit | 88837dde0134300dac9de501e2b0ca25c00fa252 (patch) | |
tree | b96f17ecff6562fe05e9c49b6ad7a85af8554bcd | |
parent | 345338127788f8cb73aeb70c16f3529dd9630f52 (diff) | |
download | portage-88837dde0134300dac9de501e2b0ca25c00fa252.tar.gz portage-88837dde0134300dac9de501e2b0ca25c00fa252.tar.bz2 portage-88837dde0134300dac9de501e2b0ca25c00fa252.zip |
Pass a cache instance into metadata_overlay since it doesn't have enough information to construct one itself.
svn path=/main/trunk/; revision=5356
-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 |