Revert most of r4086 because it broke circular bootstrap dependencies for things...
authorZac Medico <zmedico@gentoo.org>
Mon, 14 Aug 2006 06:42:12 +0000 (06:42 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 14 Aug 2006 06:42:12 +0000 (06:42 -0000)
svn path=/main/trunk/; revision=4253

bin/emerge

index 0c832e2a77d0fd23258b05bc26f6317d89d8b8f3..58044fe28711e656000eda8383e58cad15b5af88 100755 (executable)
@@ -764,13 +764,6 @@ class depgraph:
 
                if addme and merging == 1:
                        mybigkey.append("merge")
-                       # Update old-style virtuals if this package provides any.  These
-                       # are needed for dep_virtual calls inside dep_check.
-                       self.pkgsettings[myroot].setinst(mykey,
-                               self.trees[myroot][self.pkg_tree_map[mytype]].dbapi)
-                       # Update our fakedbapi state that is used for dep_wordreduce calls
-                       # inside dep_check.
-                       self.mydbapi[myroot].cpv_inject(mykey)
                else:
                        mybigkey.append("nomerge")
 
@@ -1026,6 +1019,32 @@ class depgraph:
                        #we're processing a command-line argument; unconditionally merge it even if it's already merged
                        mymerge=[depstring]
 
+               if myparent:
+                       # In order to get past circular dependencies (in
+                       # `emerge -e world`, for example), the parent must be allowed
+                       # to satisfy dependencies of it's children.
+
+                       # The parent is added after it's own dep_check call so that it
+                       # isn't allowed to satisfy a direct bootstrap dependency on itself
+                       # or an old-style virtual that it satisfies (unfortunately, this
+                       # only works for one level of deps, so it won't work for new-style
+                       # virtuals since they introduce an additional level of dependency
+                       # indirection).
+
+                       p_type, p_root, p_key, p_status = myparent.split()
+                       if p_status == "merge" and \
+                               not self.mydbapi[p_root].cpv_exists(p_key):
+                               # XXX Bug: This fakedbapi data is used in dep_check calls to
+                               # determine satisfied deps via dep_wordreduce but it does not
+                               # account for merge order (merge order is later calculated
+                               # in self.altlist() using data from the digraph).
+                               self.mydbapi[p_root].cpv_inject(p_key)
+
+                               # Update old-style virtuals if this package provides any.
+                               # These are needed for dep_virtual calls inside dep_check.
+                               self.pkgsettings[p_root].setinst(p_key,
+                                       self.trees[p_root][self.pkg_tree_map[p_type]].dbapi)
+
                if not mymerge:
                        return 1