diff options
-rw-r--r-- | pym/_emerge/__init__.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index c02d99e6c..0ad8c1b02 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -5104,10 +5104,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: @@ -14245,9 +14241,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" @@ -14255,9 +14254,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" |