From 6cae89f30ded12b24a4e971b1797a666f0d000bc Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 29 Jun 2007 14:10:21 +0000 Subject: [PATCH] For bug #183639, give a more informative message with the package.provided warning. (trunk r7091) svn path=/main/branches/2.1.2/; revision=7092 --- bin/emerge | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/bin/emerge b/bin/emerge index 1e76f98e3..b6b12b279 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1576,7 +1576,7 @@ class depgraph: # 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 @@ -2930,6 +2930,14 @@ class depgraph: 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: @@ -2938,10 +2946,24 @@ class depgraph: 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): -- 2.26.2