summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-14 19:52:59 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-14 19:52:59 +0000
commit17a1514896d582e4bcb74007ea76f436dd1ca76c (patch)
tree502a1e47a4eddc99063632437179c071e663306f
parentcd16c3db0e276b455a2a8dd021e836efa1328bc5 (diff)
downloadportage-17a1514896d582e4bcb74007ea76f436dd1ca76c.tar.gz
portage-17a1514896d582e4bcb74007ea76f436dd1ca76c.tar.bz2
portage-17a1514896d582e4bcb74007ea76f436dd1ca76c.zip
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(). svn path=/main/trunk/; revision=12610
-rw-r--r--pym/_emerge/__init__.py18
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"