* Re: [gentoo-portage-dev] equery: deprecate --category filtering in belongs
@ 2009-02-08 6:30 99% ` Brian Harring
0 siblings, 0 replies; 1+ results
From: Brian Harring @ 2009-02-08 6:30 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1.1: Type: text/plain, Size: 1709 bytes --]
patch attached against 0.2.4.2-r1; rough stats follow;
full cold cache
[ Searching for file(s) /usr/bin/equery in *... ]
app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery)
real 0m10.320s
user 0m0.733s
sys 0m0.162s
[ Searching for file(s) /usr/bin/equery in app-portage... ]
app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery)
real 0m8.512s
user 0m0.315s
sys 0m0.124s
That particular cold cache is a *full* cold cache; not the best test
imo since most users have at least some chunks of portage
configuration/python cached.
Cold cache, with equery --help primer to warm the cache; CONTENTS
(what belongs operates on) is still out of the cache however making
this a bit more likely use scenario.
[ Searching for file(s) /usr/bin/equery in *... ]
app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery)
real 0m2.335s
user 0m0.670s
sys 0m0.050s
[ Searching for file(s) /usr/bin/equery in app-portage... ]
app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery)
real 0m0.391s
user 0m0.248s
sys 0m0.046s
Pretty heavy difference, no?
hotcache:
[ Searching for file(s) /usr/bin/equery in *... ]
app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery)
real 0m0.710s
user 0m0.661s
sys 0m0.047s
[ Searching for file(s) /usr/bin/equery in app-portage... ]
app-portage/gentoolkit-0.2.4.2-r1 (/usr/bin/equery)
real 0m0.291s
user 0m0.237s
sys 0m0.053s
Mind you this isn't multiple runs, so the numbers are rough
approximations- that said they're fairly representative.
Strongly suggest y'all keep category support (although I'll keep on
using pquery instead ;).
Cheers,
~harring
[-- Attachment #1.2: equery-enable-categories.patch --]
[-- Type: text/plain, Size: 1082 bytes --]
--- /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
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2009-02-08 5:07 [gentoo-portage-dev] equery: deprecate --category filtering in belongs Douglas Anderson
2009-02-08 6:30 99% ` Brian Harring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox