From c3bc709ae99074ed65584ad68ff403d2e75ae04f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 25 Nov 2012 19:26:46 -0800 Subject: [PATCH] similar_name_search: fix lower/upper case bugs --- pym/portage/dbapi/_similar_name_search.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pym/portage/dbapi/_similar_name_search.py b/pym/portage/dbapi/_similar_name_search.py index d569fbf89..b6e4a1fbe 100644 --- a/pym/portage/dbapi/_similar_name_search.py +++ b/pym/portage/dbapi/_similar_name_search.py @@ -7,8 +7,8 @@ from portage.versions import catsplit def similar_name_search(dbs, atom): - cp = atom.cp.lower() - cat, pkg = catsplit(cp) + cp_lower = atom.cp.lower() + cat, pkg = catsplit(cp_lower) if cat == "null": cat = None @@ -17,7 +17,7 @@ def similar_name_search(dbs, atom): all_cp.update(db.cp_all()) # discard dir containing no ebuilds - all_cp.discard(cp) + all_cp.discard(atom.cp) orig_cp_map = {} for cp_orig in all_cp: @@ -25,7 +25,7 @@ def similar_name_search(dbs, atom): all_cp = set(orig_cp_map) if cat: - matches = difflib.get_close_matches(cp, all_cp) + matches = difflib.get_close_matches(cp_lower, all_cp) else: pkg_to_cp = {} for other_cp in list(all_cp): -- 2.26.2