aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-17 14:58:37 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-17 14:58:37 -0700
commitcbe44d92ff13b8a22f5b4215b73078ce600c6bf4 (patch)
treec47f73a3089a5c408b9e91eed55113a971622381
parenttreewalk: set REPLACING_VERSIONS later (diff)
downloadportage-cbe44d92ff13b8a22f5b4215b73078ce600c6bf4.tar.gz
portage-cbe44d92ff13b8a22f5b4215b73078ce600c6bf4.tar.bz2
portage-cbe44d92ff13b8a22f5b4215b73078ce600c6bf4.zip
misspell-suggestions: filter the input cp
Obviously, we don't want to consider the input cp as a possible suggestion, as reported in bug 372033.
-rw-r--r--pym/_emerge/depgraph.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 773a25659..80409b0d3 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3110,6 +3110,8 @@ class depgraph(object):
all_cp.update(portdb.cp_all())
if "--usepkg" in self._frozen_config.myopts:
all_cp.update(bindb.cp_all())
+ # discard dir containing no ebuilds
+ all_cp.discard(cp)
orig_cp_map = {}
for cp_orig in all_cp:
@@ -3120,8 +3122,12 @@ class depgraph(object):
matches = difflib.get_close_matches(cp, all_cp)
else:
pkg_to_cp = {}
- for other_cp in all_cp:
+ for other_cp in list(all_cp):
other_pkg = portage.catsplit(other_cp)[1]
+ if other_pkg == pkg:
+ # discard dir containing no ebuilds
+ all_cp.discard(other_cp)
+ continue
pkg_to_cp.setdefault(other_pkg, set()).add(other_cp)
pkg_matches = difflib.get_close_matches(pkg, pkg_to_cp)
matches = []