From: Zac Medico Date: Wed, 11 Mar 2009 05:08:53 +0000 (-0000) Subject: For the --buildpkgonly digraph.hasallzeros() check, remove "nomerge" nodes X-Git-Tag: v2.1.6.8~189 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e21a364874b908e9f1e6e4cbdfbadba62bac2f2a;p=portage.git For the --buildpkgonly digraph.hasallzeros() check, remove "nomerge" nodes from the graph. This makes it unnecessary to tweak the dependency priority for onlydeps packages inside depgraph._add_pkg_dep(). (trunk r12610) svn path=/main/branches/2.1.6/; revision=12888 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 4109322f9..0d94025bd 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -5088,10 +5088,6 @@ class depgraph(object): strict = mytype != "installed" try: for dep_root, dep_string, dep_priority in deps: - if pkg.onlydeps: - # Decrease priority so that --buildpkgonly - # hasallzeros() works correctly. - dep_priority = DepPriority() if not dep_string: continue if debug: @@ -13891,9 +13887,12 @@ def action_build(settings, trees, mtimedb, return retval if "--buildpkgonly" in myopts: graph_copy = mydepgraph.digraph.clone() + removed_nodes = set() for node in list(graph_copy.order): - if not isinstance(node, Package): - graph_copy.remove(node) + if not isinstance(node, Package) or \ + node.operation == "nomerge": + removed_nodes.add(node) + graph_copy.difference_update(removed_nodes) 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" @@ -13901,9 +13900,12 @@ def action_build(settings, trees, mtimedb, else: if "--buildpkgonly" in myopts: graph_copy = mydepgraph.digraph.clone() + removed_nodes = set() for node in list(graph_copy.order): - if not isinstance(node, Package): - graph_copy.remove(node) + if not isinstance(node, Package) or \ + node.operation == "nomerge": + removed_nodes.add(node) + graph_copy.difference_update(removed_nodes) 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"