After the upgrade from gcc-5.x to gcc-6.4 all Gentoo Linux users were advised to run

emerge -e @world

which will recompile all packages on a system and takes on my i7 with 16 GB around 30 h in theory. This will work in some simple situations, but in many cases the task stops after say 80 of 2000 packages due to a problem at some point. The user tries to fix it and starts from zero again. I tried

emerge --resume --skipfirst

and --keep-going but this does not work, if the problem was not caused by the first package.

A second problem is, that all packages, which are listed in packages.provided must be ignored. The packages.provided is important for users, who need a recent TeXlive for example and install via tlmgr.

My idea was to start with a list of packages which were not compiled after 2017-12-01, which is the day, I start to recompile.

genlop -ln --date 1999-01-01 --date 2017-12-01  | perl -ne '/>>> (.*)/ and print " =$1";'

Ideally the system would compile all packages which raise no error. On the next day the user can fix a problem and compiles the fixed package one after the other.

How can I recompile all packages, which were really installed from the tree (excluding the packages.provided) without starting at point zero after each problem?

edit: This is obviously no duplicate of List all packages on a Gentoo system, which were not recompiled since a date, however its results could be help for the solution of this question.

  • @PiedPiper As already written in my question and your comment, the keep-going does not really solve the problem. But I fixed the typo. – Jonas Stein Dec 3 '17 at 13:34

Here's one way to do it:

Save your start time before you begin

date +%s >emergestart && emerge -e --keep-going @world

Then when the emerge inevitably stops you can resume with this script (after fixing any problematic builds)

starttime=`cat emergestart`
eix '-I*' --format '<installedversions:DATESORT>' | cut -f1,3 >tmplist
echo $starttime >>tmplist
sort -n tmplist | sed -e/$starttime/q | sed -e'/[0-9]*\t*/s///' | sort | comm -23 - <(sort omitlist) | comm -23 - <(sort /etc/portage/profile/package.provided) >buildlist
rm tmplist
emerge -a `cat buildlist` --keep-going

The script removes all packages from packages.provided from the list, and also other packages you don't want to emerge (either because they are causing problems or they don't need re-emerging) from a file called omitlist

Example omitlist:


You'll probably need to do several iterations of the resume script

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.