<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE sections SYSTEM "/dtd/book.dtd">

<!-- The content of this document is licensed under the CC-BY-SA license -->
<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->

<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-portage-branches.xml,v 1.18 2011/03/02 09:46:22 nightmorph Exp $ -->

<sections>

<abstract>
Gentoo provides software separated in several branches, depending on stability
and architectural support. "Mixing Software Branches" inform you how these
branches can be configured and how you can override this separation
individually.
</abstract>

<version>3</version>
<date>2011-03-02</date>

<section>
<title>Using One Branch</title>
<subsection>
<title>The Stable Branch</title>
<body>

<p>
The ACCEPT_KEYWORDS variable defines what software branch you use on your
system. It defaults to the stable software branch for your architecture, for
instance <c>x86</c>.
</p>

<p>
We recommend that you only use the stable branch. However, if you don't care
about stability this much and you want to help out Gentoo by submitting
bugreports to <uri>http://bugs.gentoo.org</uri>, read on.
</p>

</body>
</subsection>
<subsection>
<title>The Testing Branch</title>
<body>

<p>
If you want to use more recent software, you can consider using the testing
branch instead. To have Portage use the testing branch, add a ~ in front of your
architecture.
</p>

<p>
The testing branch is exactly what it says - <e>Testing</e>. If a package is in
testing, it means that the developers feel that it is functional but has not
been thoroughly tested. You could very well be the first to discover a bug in
the package in which case you could file a <uri
link="http://bugs.gentoo.org">bugreport</uri> to let the developers know about
it.
</p>

<p>
Beware though, you might notice stability issues, imperfect package handling
(for instance wrong/missing dependencies), too frequent updates (resulting in
lots of building) or broken packages. If you do not know how Gentoo works and
how to solve problems, we recommend that you stick with the stable and tested
branch.
</p>

<p>
For example, to select the testing branch for the x86 architecture, edit
<path>/etc/make.conf</path> and set:
</p>

<pre caption="Setting the ACCEPT_KEYWORDS variable">
ACCEPT_KEYWORDS="~x86"
</pre>

<p>
If you update your system now, you will find out that <e>lots</e> of packages
will be updated. Mind you though: when you have updated your system to use the
testing branch there is usually no easy way back to the stable, official branch 
(except for using backups of course).
</p>

</body>
</subsection>
</section>
<section>
<title>Mixing Stable with Testing</title>
<subsection>
<title>The package.accept_keywords location</title>
<body>

<p>
You can ask Portage to allow the testing branch for particular packages but use
the stable branch for the rest of the system. To achieve this, add the package
category and name you want to use the testing branch of in
<path>/etc/portage/package.accept_keywords</path>. You can also create a
directory (with the same name) and list the package in the files under that
directory. For instance, to use the testing branch for <c>gnumeric</c>:
</p>

<pre caption="/etc/portage/package.accept_keywords setting for gnumeric">
app-office/gnumeric
</pre>

</body>
</subsection>
<subsection id="versions">
<title>Test Particular Versions</title>
<body>

<p>
If you want to use a specific software version from the testing branch but you
don't want Portage to use the testing branch for subsequent versions, you can
add in the version in the <path>package.accept_keywords</path> location. In this
case you <e>must</e> use the = operator. You can also enter a version range
using the &lt;=, &lt;, &gt; or &gt;= operators.
</p>

<p>
In any case, if you add version information, you <e>must</e> use an operator. If
you leave out version information, you <e>cannot</e> use an operator.
</p>

<p>
In the following example we ask Portage to accept gnumeric-1.2.13:
</p>

<pre caption="Enabling a particular gnumeric test version">
=app-office/gnumeric-1.2.13
</pre>

</body>
</subsection>
</section>
<section>
<title>Using Masked Packages</title>
<subsection>
<title>The package.unmask location</title>
<body>

<impo>
The Gentoo developers do <b>not</b> support the use of this location. Please
exercise due caution when doing so. Support requests related to
<c>package.unmask</c> and/or <c>package.mask</c> will not be answered. You have
been warned.
</impo>

<p>
When a package has been masked by the Gentoo developers and you still want to
use it despite the reason mentioned in the <path>package.mask</path> file
(situated in <path>/usr/portage/profiles</path> by default), add the
desired version (usually this will be the exact same line from
<path>profiles</path>) in the <path>/etc/portage/package.unmask</path> file
(or in a file in that directory if it is a directory). 
</p>

<p>
For instance, if <c>=net-mail/hotwayd-0.8</c> is masked, you can unmask it by
adding the exact same line in the <path>package.unmask</path> location:
</p>

<pre caption="/etc/portage/package.unmask">
=net-mail/hotwayd-0.8
</pre>

<note>
If an entry in <path>/usr/portage/profiles/package.mask</path> contains a range
of package versions, you will need to unmask only the version(s) you actually
want. Please read the <uri link="#versions">previous section</uri> to learn how
to specify versions in <path>package.unmask</path>.
</note>

</body>
</subsection>
<subsection>
<title>The package.mask location</title>
<body>

<p>
When you don't want Portage to take a certain package or a specific version of a
package into account you can mask it yourself by adding an appropriate line to
the <path>/etc/portage/package.mask</path> location (either in that file or
in a file in this directory).
</p>

<p>
For instance, if you don't want Portage to install newer kernel sources than
<c>gentoo-sources-2.6.8.1</c>, you add the following line at the
<path>package.mask</path> location:
</p>

<pre caption="/etc/portage/package.mask example">
&gt;sys-kernel/gentoo-sources-2.6.8.1
</pre>

</body>
</subsection>
</section>
</sections>
