Pass db_keys in to the FakeVartree constructor (merged from trunk). This
authorZac Medico <zmedico@gentoo.org>
Wed, 30 Jan 2008 20:03:44 +0000 (20:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 30 Jan 2008 20:03:44 +0000 (20:03 -0000)
solves an issue with EAPI missing from the key list which triggers invalid
EAPI messages for masked packages in cases where there is an installed
version and all ebuilds are masked.

svn path=/main/branches/2.1.2/; revision=9234

bin/emerge

index 122e87fd11c13b38e7df5a25036624d07b9dab77..e54d8c7f67b579ee9c8ea22ba63c891ea0b3b989 100755 (executable)
@@ -1031,9 +1031,13 @@ class FakeVartree(portage.vartree):
        user doesn't necessarily need write access to the vardb in cases where
        global updates are necessary (updates are performed when necessary if there
        is not a matching ebuild in the tree)."""
-       def __init__(self, real_vartree, portdb):
+       def __init__(self, real_vartree, portdb, db_keys):
                self.root = real_vartree.root
                self.settings = real_vartree.settings
+               mykeys = db_keys[:]
+               for required_key in ("COUNTER", "SLOT"):
+                       if required_key not in mykeys:
+                               mykeys.append(required_key)
                self.dbapi = portage.fakedbapi(settings=real_vartree.settings)
                vdb_path = os.path.join(self.root, portage.VDB_PATH)
                try:
@@ -1045,8 +1049,6 @@ class FakeVartree(portage.vartree):
                try:
                        if os.access(vdb_path, os.W_OK):
                                vdb_lock = portage_locks.lockdir(vdb_path)
-                       mykeys = ["SLOT", "COUNTER", "PROVIDE", "USE", "IUSE",
-                               "RESTRICT", "DEPEND", "RDEPEND", "PDEPEND", "repository"]
                        real_dbapi = real_vartree.dbapi
                        slot_counters = {}
                        for cpv in real_dbapi.cpv_all():
@@ -1324,7 +1326,8 @@ class depgraph:
                                self.trees[myroot][tree] = trees[myroot][tree]
                        self.trees[myroot]["vartree"] = \
                                FakeVartree(trees[myroot]["vartree"],
-                                       trees[myroot]["porttree"].dbapi)
+                                       trees[myroot]["porttree"].dbapi,
+                                       self._mydbapi_keys)
                        self.pkgsettings[myroot] = portage.config(
                                clone=self.trees[myroot]["vartree"].settings)
                        self.pkg_node_map[myroot] = {}
@@ -5709,7 +5712,9 @@ def action_depclean(settings, trees, ldpath_mtimes,
        dep_check_trees = {}
        dep_check_trees[myroot] = {}
        dep_check_trees[myroot]["vartree"] = \
-               FakeVartree(trees[myroot]["vartree"], trees[myroot]["porttree"].dbapi)
+               FakeVartree(trees[myroot]["vartree"],
+               trees[myroot]["porttree"].dbapi.
+               depgraph._mydbapi_keys)
        vardb = dep_check_trees[myroot]["vartree"].dbapi
        # Constrain dependency selection to the installed packages.
        dep_check_trees[myroot]["porttree"] = dep_check_trees[myroot]["vartree"]