Make sure that everything except Package nodes is ignored when doing
authorZac Medico <zmedico@gentoo.org>
Thu, 10 Apr 2008 08:43:34 +0000 (08:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 10 Apr 2008 08:43:34 +0000 (08:43 -0000)
the --buildpkgonly digraph.hasallzeros() check. (trunk r9797)

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

bin/emerge

index 21af48674e960d823b9306437845a7c4051cd147..6e97d545659f5629ecd710ee36fee388e9a2a4c4 100755 (executable)
@@ -7142,14 +7142,22 @@ def action_build(settings, trees, mtimedb,
                                favorites=favorites)
                        if retval != os.EX_OK:
                                return retval
-                       if "--buildpkgonly" in myopts and \
-                               not mydepgraph.digraph.hasallzeros(ignore_priority=DepPriority.MEDIUM):
+                       if "--buildpkgonly" in myopts:
+                               graph_copy = mydepgraph.digraph.clone()
+                               for node in graph_copy.order:
+                                       if not isinstance(node, Package):
+                                               graph_copy.remove(node)
+                               if not graph_copy.hasallzeros(ignore_priority=DepPriority.MEDIUM):
                                        print "\n!!! --buildpkgonly requires all dependencies to be merged."
                                        print "!!! You have to merge the dependencies before you can build this package.\n"
                                        return 1
        else:
-               if ("--buildpkgonly" in myopts):
-                       if not mydepgraph.digraph.hasallzeros(ignore_priority=DepPriority.MEDIUM):
+               if "--buildpkgonly" in myopts:
+                       graph_copy = mydepgraph.digraph.clone()
+                       for node in graph_copy.order:
+                               if not isinstance(node, Package):
+                                       graph_copy.remove(node)
+                       if not graph_copy.hasallzeros(ignore_priority=DepPriority.MEDIUM):
                                print "\n!!! --buildpkgonly requires all dependencies to be merged."
                                print "!!! Cannot merge requested packages. Merge deps and try again.\n"
                                return 1