Ok, that might be interesting for other people as well, so I'll post it: Because it takes ages to do emerge -s or especially emerge -S on my server (that serves the tree to the rest of my boxes) I've written a small script to create a search index and use that for searching. And because I was bored I integrated it into emerge

. The script can be found at
http://gentoo.devel-net.org/download/fastsearch, the patch (against portage-2.0.48-r1) at
http://gentoo.devel-net.org/download/emerge.patch (both can also be found in
this thread in the german forum, but I don't recommend copy+paste from there because of tab/space conversions)
A few hints for installation:
- the script can be used standalone without the patch
- don't try the patch if you don't know how to patch
- the patch can't be used without the script
- the patch needs fastsearch in /usr/lib/portage/bin/
- the patch enables the following functionality in emerge:
- if you set "fastsearch" in FEATURES the search file will be recreated on every emerge sync, mostly useful for cronjobs
- you can now use "emerge --fastsearch -s" and "emerge --fastsearch -S" to use the script instead of emerge's normal search method (long options work too)
- the default behavior of emerge is NOT changed
- the output format is completely different from normal emerge search output
- it might find fewer packages because only the latest ebuild of a package is indexed
The script is
very fast as it uses grep on a single text file, it does not even take a second on my server to get a result for a descripitionsearch

, but beware that this is a private script that needs testing.
If I get some positive feedback I'll improve it and put it in bugzilla.