Stackable Profile Example

Introduction
By default Gentoo uses cascading/stackable profiles which certainly have their advantages, especially from a maintenance standpoint. Understanding the basic principles isn't hard either. To get started read the portage man page as well as http://www.gentoo.org/proj/en/releng/docs/cascading-profiles.xml.

Nevertheless, in practice it is sometimes not so easy to quickly determine where a particular configuration is made. To make this a bit easier this page provides an example of how a particular profile (possibly the most commonly used) inherits from its direct and indirect parents.

An example profile: default/linux/x86/2008.0/desktop/
In the following simplified tree, each relevant profile (corresponding to a directory) is listed together with the files it contains. Each profile is annotated with a number. Variables defined in the profile N can be overwritten in any profile > N and can overwrite any variable in any profile labled < N.

[N] is used to indicate that a profile contains files other than and therefore actually does define some variables.  on the other hand indicates that the profile only contains and therefore is only used to specify one or more parent profiles.

Additionally, an arrow is drawn from the file in any profile to each directory containing a parent profile.

Tree for profile default/linux/x86/2008.0/desktop

The following table gives a quick overview of what profiles contain what files.

File summary for default/linux/x86/2008.0/desktop

The above tree omits some files that also affect Portage's behaviour, but that are only to be found in and not in any profile itself.

other relevant files

And then it is also good to know what you can forget about:

irrelevant files for default/linux/x86/2008.0/desktop