Often I find myself needing a particular program, but being unsure of what particular ebuild provides it.
I know that it is likely a complicated task, but I think it would be very useful if there was a mechanism in place to determine which ebuilds provide which files without actually emerging them.
Unfortunately, as far as I understand, this would require *someone* (or a group) to emerge every single ebuild in the tree and then look at what it provides. A tall order, but probably wouldn't be so bad once the initial set it done.
One data storage format that I can envision would be something like this:
where provides would have subdirs and files which match the actual filesystem but whose files are a listing of packages which provide that particular file. For example:
might contain the following:
I'm assuming such a feature would have to include versions since different versions of the same package may have different sets of files they provide.
Obviously this is not the only way, but it would make it very easy to write tools to work with this.
Honestly, the ubuntu feature where typing a command that doesn't exist recommends a package is kinda nice ;-).
You are looking for a third party service, http://www.portagefilelist.de/index.php/Main_Page ex: http://www.portagefilelist.de/index.php/Special:PFLQuery2?file=%2Fbin%2Fbash&searchfile=lookup&lookup=file#result (for /bin/bash)
The set of installed files depends on the use flag configuration, the versions of the installed dependencies, etc. To create a database you would have to install all packages with all use flag combinations. This means it's impossible to create a reliable database.
Having said that, there is  and app-portage/pfl in which you might be interested.