Making ServWise
50% off all hosting at servwise

Sabayon Stabiliser 2

This article is a follow on from my previous go at putting together a technique for encouraging Sabayon to move away from using packages that are masked for testing, and to use stable packages instead. I posted a link to the original at http://www.sabayonlinux.org forums, and voxiac pointed out the obvious: If you want to get to a stable environment, then the goal should be to change the ACCEPT_KEYWORDS from accepting all test masked packages to using stables. The rest can follow from there. So this is how do to it.

Note: All references to ~amd64 should be changed to reflect your architecture – probably x86 if not amd64

First things first, edit /etc/make.conf and either comment out, remove, or change the ACCEPT_KEYWORDS line to:

ACCEPT_KEYWORDS=amd64

If you do this, you must do the rest, otherwise you could be in trouble next time you get to emerge something. This line tells emerge that all packages must be stable, unless explicitly stated in /etc/portage/package.keywords

Next we need to get the list of packages that are currently masked as test packages, and create a file that we can use to add to the package.keywords to let emerge know that they can remain as test packages.

We use three commands piped together to do this. You can try these out stage by stage so that you can see exactly what is going on. The first part is:

equery -i -N list

This shows a list of installed packages, such as:

[I--] [ ~] x11-wm/twm-1.0.3 (0)

The second column will contain a tilde ‘~’ if the package is masked. These are the packages we need, so we will pipe the output into grep to pull out only those lines that contain a tilde:

equery -i -N list | grep \~

The output will now only contain the masked packages. We need to manipulate each line a little to pull out just the package name, and then add the prefix and suffix we need ready for the package.keywords file:

equery -i -N list | grep \~ | sed 's/.* \(.*\) (.*/=\1 ~amd64/'

This transforms the above line:

[I--] [ ~] x11-wm/twm-1.0.3 (0)

into:

=x11-wm/twm-1.0.3 ~amd64

This means “permit use of a masked package for x11-wm/twm, for version 1.0.3 only.”

We just need to output the results of that to a file, and append it to /etc/portage/package.keywords

Output to a file:

equery -i -N list | grep \~ | sed 's/.* \(.*\) (.*/<=\1 ~amd64/' > testpackages

Append to the end of /etc/portage/package.keywords (take a backup first):

cp /etc/portage/package.keywords /etc/portage/package.keywords.back

cat testpackages >> /etc/portage/package.keywords

This last command will need to be done with root privileges. If you followed the previous article’s approach, you will have a bunch of old entries in their from the previous method. These will need to be removed first.

Once you have done this, you can effectively leave it alone. As new packages are released into the stable tree, they will supercede the ones you have installed, and the package.keywords entries will be ignored. voxiac suggested a cron job that would clean up the package.keywords file over time. I’ll have a go at putting something together down the line, depending on what level of hassle the cleanup is.

By the way, this command will give you a count of the current test packages you have installed:

equery -i -N list | grep \~ | wc -l

Versus total installed:

equery -i -N list | grep \/ | wc -l

My count is:

Total: 1347, of which are unstable: 852.

Quite a way to go….

One Response to “Sabayon Stabiliser 2”

  1. Paul Says:

    Hi John,

    Could you try running

    equery -N list | grep M~

    This will list any hard masked packages, which are those that have failed QA and are not considered stable.

    What is happening is that the above technique states that we will only accept the currently installed test packages. And anything else needs to be a stable package. But some of the installed packages will fail QA and be defined as unstable. When –update happens, it will find that an installed package needs to be updated because the currently installed version is hard masked, but there isn’t a stable newer version, so it attempts to downgrade.

    The downgrading can be detrimental and lead to dependency madness. So it is safer to allow hard masked packages to update to newer test packages than to leave them where they are, or to downgrade.

    I am working on a new technique, that will need to be a script, that will manage the package.keywords file to cater for this – but to also allow for those packages, like beryl, that you would want to continue installing test packages for.

    The workaround for the moment is to allow the packages in your hard mask list above to update by including them without version constraints in your package.keywords.