Making ServWise
50% off all hosting at servwise

Archive for April, 2007

Sabayon Stabiliser 2

Friday, April 27th, 2007

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….

Sabayon Stabiliser

Saturday, April 21st, 2007


The following talks about how you can gradually move Sabayon from the testing tree to the stable tree of portage.

Sabayon. Very cool. However, it is a bit disturbing that it bases everything on the testing tree of portage.

In make.conf, there is a line:

ACCEPT_KEYWORDS=~amd64

That last part may read ~x86 if you are on a 32bit platform. In gentoo speak a package is “masked” in the portage tree (the software repository) until it has completed testing. The ~x86 or ~amd64 keyword identifies a packages as being in testing. Once testing is complete, the keyword changes to “x86″. Ie, without the tilda.

The line above is essentially saying that whenever you install a package, it should install the latest testing version.

This can lead to problems, as the packages in testing haven’t been tested to see if they are ready for release – that they haven’t been QAed to work with everything else you may have installed.

So just remove the line from make.conf right? Wrong. The dependencies that packages have on each other are far too complex for this to work. Another strategy would be to work out groups of packages that work together, and roll them back to stable using /etc/portage/package.keywords and /etc/portage/package.mask

Forget it. Portage is the tangled web we weave.

The following approach works on this principle: You accept that you currently have a bunch of testing packages installed,but everything seems to be working. Then take advantage of the fact that lots of people are volunteering their time to ensure that these packages are suitable for release, or fixing them so that they are. So if you could say “Ok, no package can be upgraded from now on until they are in the release tree”.

So look at this:

equery -i list | sed 's/(.*)/\>\=$1 -~amd64 amd64/' > packages

This command will get a list all of your currently installed packages, add a “>” to the beginning of each line, and add ” -~amd64 amd64″ to the end of each line, and output them all to a file called “packages”

So if the package was this:

media-video/vlc-0.8.6-r1

Now it looks like this:

>media-video/vlc-0.8.6-r1 -~amd64 amd64

If this line were put into /etc/portage/package.keywords, it would be saying “remove the “~amd64″ mask from this package, and add the release mask, if the version number is greater than the one shown. In other words, don’t install any more test versions for this package.

So if the file you generated is added to the end of /etc/portage/keywords then any updates to these packages will not be installed unless they are in the release tree. So now, all you need to do is wait until enough packages are in release that you feel confident you can remove the ACCEPT_KEYWORDS line from make.conf.

Note that for the above file, the first line of the “packages” file will not be valid. Remove the first line. You can append the file to package.keywords with (as root):

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

Note that this is not a fire and forget solution. There are likely to be dependency tweaks you need to make as you go along, and you will have to enter a line in package.keywords for any new packages you install, but this at least will stop “emerge world” from ensuring your system is never stable.