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: /usr/portage/provides/ 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: /usr/portage/provides/bin/bash might contain the following: app-shells/bash-3.1_p17 app-shells/bash-3.2_p51 app-shells/bash-4.0_p38 app-shells/bash-4.1_p10 app-shells/bash-4.1_p11 app-shells/bash-4.1_p7 app-shells/bash-4.1_p9 app-shells/bash-4.2_p10 app-shells/bash-4.2_p8-r1 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 ;-). Reproducible: Always
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 [1] and app-portage/pfl in which you might be interested. [1] http://www.portagefilelist.de/