To optimize consistency of atom selections, add all of the root packages
authorZac Medico <zmedico@gentoo.org>
Sun, 13 Apr 2008 22:22:14 +0000 (22:22 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 13 Apr 2008 22:22:14 +0000 (22:22 -0000)
to the graph before processing any dependencies. (trunk r9874)

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

bin/emerge

index a2a27850a8c46fdefbad631adbd770500ca51c7b..c803afb35c52d684de381966bc8e6b2edaed1a01 100755 (executable)
@@ -2535,6 +2535,7 @@ class depgraph(object):
                while args:
                        arg = args.pop()
                        for atom in arg.set:
+                               self.spinner.update()
                                atom_cp = portage.dep_getkey(atom)
                                try:
                                        pprovided = pprovideddict.get(portage.dep_getkey(atom))
@@ -2585,16 +2586,12 @@ class depgraph(object):
 
                                        dep = Dependency(atom=atom, onlydeps=onlydeps,
                                                root=myroot, parent=arg)
-                                       self._dep_stack.append(dep)
 
                                        # Add the selected package to the graph as soon as possible
                                        # so that later dep_check() calls can use it as feedback
                                        # for making more consistent atom selections.
                                        if not self._add_pkg(pkg, dep.parent,
                                                priority=dep.priority, depth=dep.depth):
-                                               return 0, myfavorites
-
-                                       if not self._create_graph():
                                                if isinstance(arg, SetArg):
                                                        sys.stderr.write(("\n\n!!! Problem resolving " + \
                                                                "dependencies for %s from %s\n") % \
@@ -2603,6 +2600,7 @@ class depgraph(object):
                                                        sys.stderr.write(("\n\n!!! Problem resolving " + \
                                                                "dependencies for %s\n") % atom)
                                                return 0, myfavorites
+
                                except portage_exception.MissingSignature, e:
                                        portage.writemsg("\n\n!!! A missing gpg signature is preventing portage from calculating the\n")
                                        portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n")
@@ -2624,6 +2622,11 @@ class depgraph(object):
                                        print >> sys.stderr, "!!!", str(e), getattr(e, "__module__", None)
                                        raise
 
+               # Now that the root packages have been added to the graph,
+               # process the dependencies.
+               if not self._create_graph():
+                       return 0, myfavorites
+
                missing=0
                if "--usepkgonly" in self.myopts:
                        for xs in self.digraph.all_nodes():