Ebuild repository/fr

Un arbre alternatif (parfois appelé surcouche) est un dépôt additionnel que Portage prend en compte lorsqu'il s'occupe des logiciels.

Au cœur de Gentoo, les utilisateurs disposent déjà d'un dépôt des paquets principal, appelé arbre de Portage. Ce dépôt principal contient tous les paquets logiciels (encore nommés ebuilds) qui sont maintenus par les développeurs de Gentoo. Les utilisateurs peuvent cependant disposer de dépôts qui, en s'y ajoutant, constitue une alternative  à l'arbre de Portage d'où leur nom d'arbres alternatifs.

Comme les dépôts de paquets ne sont rien de plus (ou de moins) que des jeux de fichiers (ebuilds, fichiers de méta-données, entrées de journaux de modifications -changelogs-, etc...), ces dépôts peuvent être tirés de dépôts publics(git, cvs, svn...) ou téléchargés en tant qu'archives tar et désarchivés à la main sur le système. Il est cependant recommandé d'utiliser des dépôts gérés par des tiers  de confiance car tout arbre alternatif installé sera analysé par Portage au moment de décider quel logiciel installer.

Traitement des arbres alternatifs
Portage uses the  variable to link to the installed overlays on the system. This variable uses a space-delimited list of paths on the system where Portage can find the roots of the additional repositories.

Manually setting overlay locations
When you want to create an overlay yourself, create a location (say ) in which you will put the packages you want Portage to look into as well. Then add  to your  file:

Using crossdev
crossdev will automatically place the ebuilds/categories it generates into the first overlay found in. You might want to prevent crossdev from disturbing layman's overlays or your personal per-machine overlay (normally created at ). You can create an overlay specifically for crossdev's use:

Then you can instruct portage and crossdev to use this overlay:

Using layman
To make management of multiple overlays simple, a tool called layman is developed. This tool knows about popular user- and developer managed overlays and is able to install & synchronize them as well as add them to the  location.

Local overlay
For instructions on setting up a local overlay, see Overlay/Local_overlay.

Overlay priorities
Each overlay has its unique priority. This makes sure that in the case of a specific version being found in several overlays, the resolution is unambiguous. Ebuilds from overlays with higher priorities take precedence over ebuilds from overlays with lower priorities.

The list of overlays with their priorities can be obtained through the output of the following command

Unless the  variable has been modified as described below, the default gentoo portage tree will have a priority of -1000. That means that all other overlays take precedence. That is the default behavior, because overlays are designed to "lay over/on top" of the portage tree.

Setting overlay priorities
The overlay priority is calculated from the order of overlay entries in the  variable. Portage "walks" through the variable from left to right and increments the priority on the way. The leftmost entry starts with a priority of 1, the next entry has a priority of 2 and so on.

Unless the  contains the portage tree entry, the portage tree will always be assigned a priority of -1000. This can be easily changed by putting  in the   variable:

In the example above the user overlay will be assigned a priority of 1 and the portage tree will be assigned a priority of 2.

Using unsafe overlays
When using huge overlays or those with unknown/low quality it is best practice to hardmask the whole overlay.

After that you can unmask the packages you specifically want to emerge.

This way nothing weird will happen on updates and it is safer than using priorities.

Cache generation
When large overlays are installed, portage may take a long time to perform operations like dependency resolution. This is because overlays do not usually contain a metadata cache.

You may generate a local metadata cache by running  after syncing your overlays.

eix-sync
eix-sync can run  after syncing your overlays and portage tree.

eix-update
eix-update can utilize the metadata cache generated by  for a speedup and better accuracy. To enable this, set the  to " " in.