Store dependency metadata in depgraph.mydbapi so that it can be used in place of...
authorZac Medico <zmedico@gentoo.org>
Tue, 12 Dec 2006 01:47:23 +0000 (01:47 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 12 Dec 2006 01:47:23 +0000 (01:47 -0000)
svn path=/main/trunk/; revision=5276

bin/emerge

index 4393e4f4b0ce670afd3a1a2d6e391f0fbedec281..ac569b9b1dec3981f96061d64e731528b8625dc9 100755 (executable)
@@ -804,6 +804,7 @@ class depgraph:
                self.pkgsettings = {}
                self.pkg_node_map = {}
                self.mydbapi = {}
+               self._mydbapi_keys = ["SLOT", "DEPEND", "RDEPEND", "PDEPEND"]
                self.useFlags = {}
                self.trees = {}
                for myroot in trees:
@@ -822,8 +823,9 @@ class depgraph:
                        fakedb = portage.fakedbapi(settings=self.pkgsettings[myroot])
                        self.mydbapi[myroot] = fakedb
                        for pkg in vardb.cpv_all():
-                               myslot = vardb.aux_get(pkg, ["SLOT"])[0]
-                               fakedb.cpv_inject(pkg, metadata={"SLOT":myslot})
+                               fakedb.cpv_inject(pkg,
+                                       metadata=dict(izip(self._mydbapi_keys,
+                                       vardb.aux_get(pkg, self._mydbapi_keys))))
                        del vardb, fakedb
                        self.useFlags[myroot] = {}
                        if "--usepkg" in self.myopts:
@@ -960,8 +962,9 @@ class depgraph:
                                priority=priority)
 
                if addme:
-                       myslot = mydbapi.aux_get(mykey, ["SLOT"])[0]
-                       self.mydbapi[myroot].cpv_inject(mykey, metadata={"SLOT":myslot})
+                       self.mydbapi[myroot].cpv_inject(mykey,
+                               metadata=dict(izip(self._mydbapi_keys,
+                               mydbapi.aux_get(mykey, self._mydbapi_keys))))
 
                """ This section determines whether we go deeper into dependencies or not.
                    We want to go deeper on a few occasions: