--- /usr/bin/equery 2009-02-07 13:16:51.000000000 -0800 +++ /home/ferringb/equery 2009-02-07 14:15:52.000000000 -0800 @@ -345,7 +345,7 @@ need_help = 1 break elif x in ["-c", "--category"]: - opts["category"] = args[i+1] + opts["category"] = args[i+1].rstrip("/") skip = 1 elif x in ["-e", "--earlyout"]: opts["earlyOut"] = 1 @@ -383,16 +383,14 @@ die(2, "The query '" + pp.regexpquery(q) + "' does not appear to be a valid regular expression") # Pick out only selected categories - cat = opts["category"] - filter_fn = None - if cat != "*": - filter_fn = lambda x: x.find(cat+"/")==0 + cat = opts["category"] if not Config["piping"] and Config["verbosityLevel"] >= 3: print_info(3, "[ Searching for file(s) " + pp.regexpquery(",".join(query)) + " in " + pp.cpv(cat) + "... ]") matches = portage.db["/"]["vartree"].dbapi.cpv_all() - #matches = gentoolkit.find_all_installed_packages(filter_fn) + if cat != "*": + matches = (x for x in matches if x.startswith(cat)) found = 0