On Mon, 16 Oct 2017 18:29:19 -0700 Ian Zimmerman <i...@very.loosely.org> wrote:
> Has anyone a better way? As Alan recently wrote in a different but > related context, surely a hack in bash / awk /perl would do better, and > that's what I'll do if I must, but I can't believe gentoo lacks a usable > tool for questions like this. This is pretty much IO bound, because you have to traverse hundreds of files without any sort of lookup index. Without vfs cache, this is really slow, because spinning rust. time find /var/db/pkg/ -name CONTENTS -print0 | LC_ALL=C xargs -P2 -0 grep 'usr/bin/equery' /var/db/pkg/app-portage/gentoolkit-0.4.0/CONTENTS:sym /usr/bin/equery -> ../lib/python-exec/python-exec2 1504719465 real 0m39.844s user 0m0.124s sys 0m0.889s cpu 2.54% With vfs cache, its much quicker: time find /var/db/pkg/ -name CONTENTS -print0 | LC_ALL=C xargs -P2 -0 grep 'usr/bin/equery' /var/db/pkg/app-portage/gentoolkit-0.4.0/CONTENTS:sym /usr/bin/equery -> ../lib/python-exec/python-exec2 1504719465 real 0m0.139s user 0m0.052s sys 0m0.090s cpu 102.20% Basically, everything you see is going to be using a more sophisticated version of that until we have a /var/db/pkg system with some basic database concepts like "indexing"
pgpN8z0lCMbFJ.pgp
Description: OpenPGP digital signature