summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-29 14:09:12 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-29 14:09:12 +0000
commit31a1f587a8c8c3d7a8cb005248c63a2bebbd800d (patch)
treebcb749e9cd7f59d1da34a0b77d7866922c9f3040 /pym
parentb892f7da1fa1943c20beed6b30de718f07dc22ff (diff)
downloadportage-31a1f587a8c8c3d7a8cb005248c63a2bebbd800d.tar.gz
portage-31a1f587a8c8c3d7a8cb005248c63a2bebbd800d.tar.bz2
portage-31a1f587a8c8c3d7a8cb005248c63a2bebbd800d.zip
For bug #183639, give a more informative message with the package.provided warning.
svn path=/main/trunk/; revision=7091
Diffstat (limited to 'pym')
-rw-r--r--pym/emerge/__init__.py30
1 files changed, 26 insertions, 4 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 0686ea585..de37af141 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -1577,7 +1577,7 @@ class depgraph(object):
# package will not be merged and a warning will be displayed.
cp = portage.dep_getkey(depstring)
if cp in self._args_atoms and depstring in self._args_atoms[cp]:
- self._pprovided_args.append(arg)
+ self._pprovided_args.append((arg, depstring))
if myparent:
# The parent is added after it's own dep_check call so that it
@@ -2987,6 +2987,14 @@ class depgraph(object):
sys.stdout.write(text)
if self._pprovided_args:
+ arg_refs = {}
+ for arg_atom in self._pprovided_args:
+ arg, atom = arg_atom
+ arg_refs[arg_atom] = []
+ cp = portage.dep_getkey(atom)
+ for set_name, pkg_set in self._sets.iteritems():
+ if cp in pkg_set and atom in pkg_set[cp]:
+ arg_refs[arg_atom].append(set_name)
msg = []
msg.append(bad("\nWARNING: "))
if len(self._pprovided_args) > 1:
@@ -2995,10 +3003,24 @@ class depgraph(object):
else:
msg.append("A requested package will not be " + \
"merged because it is listed in\n")
- msg.append(" package.provided:\n\n")
- for arg in self._pprovided_args:
- msg.append(" " + arg + "\n")
+ msg.append("package.provided:\n\n")
+ problems_sets = set()
+ for (arg, atom), refs in arg_refs.iteritems():
+ ref_string = ""
+ if refs:
+ problems_sets.update(refs)
+ refs.sort()
+ ref_string = ", ".join(["'%s'" % name for name in refs])
+ ref_string = " pulled in by " + ref_string
+ msg.append(" %s%s\n" % (colorize("INFORM", arg), ref_string))
msg.append("\n")
+ if "world" in problems_sets:
+ msg.append("This problem can be solved in one of the following ways:\n\n")
+ msg.append(" A) Use emaint to clean offending packages from world (if not installed).\n")
+ msg.append(" B) Uninstall offending packages (cleans them from world).\n")
+ msg.append(" C) Remove offending entries from package.provided.\n\n")
+ msg.append("The best course of action depends on the reason that an offending\n")
+ msg.append("package.provided entry exists.\n\n")
sys.stderr.write("".join(msg))
def calc_changelog(self,ebuildpath,current,next):