summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-20 04:01:26 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-20 04:01:26 +0000
commit276b547c532f22bdb054f0a288ccde1fa9025dff (patch)
tree307e9bf7828814eb8d3d15a6b9569dde48831b80 /bin/emerge
parentAdd missing newlines to the warning message that's printed when the user has ... (diff)
downloadportage-multirepo-276b547c532f22bdb054f0a288ccde1fa9025dff.tar.gz
portage-multirepo-276b547c532f22bdb054f0a288ccde1fa9025dff.tar.bz2
portage-multirepo-276b547c532f22bdb054f0a288ccde1fa9025dff.zip
Give the user some advice whenever an invalid dependency string is encountered.
svn path=/main/trunk/; revision=5332
Diffstat (limited to 'bin/emerge')
-rwxr-xr-xbin/emerge47
1 files changed, 38 insertions, 9 deletions
diff --git a/bin/emerge b/bin/emerge
index c997937d..9e4a1c54 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: