Pass a cache instance into metadata_overlay since it doesn't have enough information...
authorZac Medico <zmedico@gentoo.org>
Sat, 23 Dec 2006 00:11:27 +0000 (00:11 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 23 Dec 2006 00:11:27 +0000 (00:11 -0000)
svn path=/main/trunk/; revision=5356

pym/cache/metadata_overlay.py
pym/portage.py

index b829ea579cfcc758de5766134f846a7cd4799fec..fc99b40110762210fc17bb00587a9ab89f533afd 100644 (file)
@@ -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"""
index e67231ca0d2c53e5d17750d3bd7169259bc787bc..34fb37f63ec2816d6fc2227e98449c28d3860226 100644 (file)
@@ -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