diff options
-rw-r--r-- | pym/_emerge/depgraph.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 7e55c776e..b9c308bca 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2738,7 +2738,7 @@ class depgraph(object): else: writemsg_stdout("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1) if isinstance(myparent, AtomArg): - cp = myparent.atom.cp + cp = myparent.atom.cp.lower() cat, pkg = portage.catsplit(cp) if cat == "null": cat = None @@ -2752,6 +2752,12 @@ class depgraph(object): if "--usepkg" in self._frozen_config.myopts: all_cp.update(bindb.cp_all()) + orig_cp_map = {} + for cp in all_cp: + cp_lower = cp.lower() + orig_cp_map.setdefault(cp_lower, []).append(cp) + all_cp = set(orig_cp_map) + if cat: matches = difflib.get_close_matches(cp, all_cp) else: @@ -2764,6 +2770,11 @@ class depgraph(object): for pkg_match in pkg_matches: matches.extend(pkg_to_cp[pkg_match]) + matches_orig_case = [] + for cp in matches: + matches_orig_case.extend(orig_cp_map[cp]) + matches = matches_orig_case + if len(matches) == 1: writemsg_stdout("\nemerge: Maybe you meant " + matches[0] + "?\n" , noiselevel=-1) |