diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-12-20 04:01:26 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-12-20 04:01:26 +0000 |
commit | 276b547c532f22bdb054f0a288ccde1fa9025dff (patch) | |
tree | 307e9bf7828814eb8d3d15a6b9569dde48831b80 | |
parent | ad4c9c5b4611b8544bc6f746e110f6004f53a6a8 (diff) | |
download | portage-276b547c532f22bdb054f0a288ccde1fa9025dff.tar.gz portage-276b547c532f22bdb054f0a288ccde1fa9025dff.tar.bz2 portage-276b547c532f22bdb054f0a288ccde1fa9025dff.zip |
Give the user some advice whenever an invalid dependency string is encountered.
svn path=/main/trunk/; revision=5332
-rwxr-xr-x | bin/emerge | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/bin/emerge b/bin/emerge index c997937d6..9e4a1c542 100755 --- a/bin/emerge +++ b/bin/emerge @@ -785,6 +785,37 @@ def perform_global_updates(mycpv, mydb, mycommands): if updates: mydb.aux_update(mycpv, updates) + +def show_invalid_depstring_notice(parent_node, depstring, error_msg): + + from formatter import AbstractFormatter, DumbWriter + f = AbstractFormatter(DumbWriter(maxcol=72)) + + print "\n\n!!! Invalid or corrupt dependency specification: " + print + print error_msg + print + print parent_node + print + print depstring + print + p_type, p_root, p_key, p_status = parent_node + msg = [] + if p_status == "nomerge": + msg.append("Portage is unable to process the dependencies of this ") + msg.append("package. In order to correct this problem, the package ") + msg.append("should be uninstalled, reinstalled, or upgraded. ") + msg.append("As a temporary workaround, the --nodeps option can ") + msg.append("be used to ignore all dependencies.") + else: + msg.append("This package can not be installed. ") + msg.append("Please notify the '%s' package maintainer " % p_key) + msg.append("about this problem.") + + for x in msg: + f.add_flowing_data(x) + f.end_paragraph(1) + class depgraph: pkg_tree_map = { @@ -1340,9 +1371,7 @@ class depgraph: myroot=myroot, trees=self.trees) if not mycheck[0]: - sys.stderr.write("\n\n%s\n\n" % mycheck[1]) - sys.stderr.write("Parent: %s\n\n" % str(myparent)) - sys.stderr.write("%s\n\n" % depstring) + show_invalid_depstring_notice(myparent, depstring, mycheck[1]) return 0 mymerge = mycheck[1] @@ -1599,9 +1628,9 @@ class depgraph: pkgsettings, myuse=myuse, trees=dep_check_trees, myroot=myroot) if not success: - print "\n\n" - print "Error occurred while processing",pkg - print str(atoms) + show_invalid_depstring_notice( + ("installed", myroot, pkg, "nomerge"), + depstr, atoms) return False blocker_atoms = [myatom for myatom in atoms \ if myatom.startswith("!")] @@ -4187,9 +4216,9 @@ def action_depclean(settings, trees, ldpath_mtimes, success, atoms = portage.dep_check(depstr, None, settings, myuse=usedef, trees=dep_check_trees, myroot=myroot) if not success: - print "\n\n" - print "Error occurred while processing",pkg - print str(atoms) + show_invalid_depstring_notice( + ("installed", myroot, pkg, "nomerge"), + depstr, atoms) return if "--debug" in myopts: |