Print better error messages when the dependency graph is broken.

TEST=Add impossible-to-satisfy constraints into the dependency graph
     that require packages to be reinstalled due to use flags, and run
     ./parallel_emerge -p chromeos
BUG=chromium-os:6625

Change-Id: I389f7e5ba647a4be0413d1b0b6ea079df5b56433

Review URL: http://codereview.chromium.org/3459006
This commit is contained in:
David James 2010-09-19 14:24:16 -07:00
parent 30d46e3c0d
commit aee3041603

View File

@ -884,6 +884,20 @@ class DepGraphGenerator(object):
if (this_pkg[merge_type] or pkg not in final_pkgs):
return
if pkg not in deps_info:
emerge_cmd = "emerge"
if self.board:
emerge_cmd = "emerge-%s" % self.board
emerge_cmd += " -pe =%s %s" % (pkg, " ".join(emerge.cmdline_packages))
use_str = os.environ.get("USE")
if use_str:
emerge_cmd = 'USE="%s" %s' % (use_str, emerge_cmd)
print "ERROR: emerge has refused to update %s" % pkg
print "Are there impossible-to-satisfy constraints in the dependency"
print "graph? To debug the issue, try the following command:"
print " %s" % emerge_cmd
sys.exit(1)
# Mark this package as non-optional
deps_info[pkg]["optional"] = False
this_pkg[merge_type] = True