gentoo.LinuxHowtos.orgedit this article

Portage magic

/var/log/emerge.log is well-known as the central reporitory of information about all emerge activity going on in system.

Lesser known are some tricks you can do with the content of that log file. For example, when you start an upgrade, you generally don't know how much time it will take to finish compiling. You probably don't remember how long your last mplayer installation took, but Portage does, and if you'd decipher the Unix time stamps in /var/log/emerge.log, you'd get a pretty good idea, too.

Or you could let app-portage/genlop do it for you. Emerge (the unstable, ~arch version of) genlop with:

Code Listing 1: Emerge genlop

#emerge -av genlop

Now run a pretended world upgrade and pipe it to genlop for an estimation of your upgrade schedule:

Code Listing 2: Estimate upgrade time

#emerge -pu world | genlop --pretend 
These are the pretended packages: (this may take a while; wait...) 
 
 * media-libs/tiff 
 * x11-base/xorg-x11 
 * app-sci/stellarium 
 * app-arch/gzip 
 * dev-libs/libIDL 
 * net-www/mozilla-firefox 
 * sys-boot/lilo 
 * app-doc/abs-guide 
 * app-arch/unarj 
 * app-emulation/wine 
 * app-admin/sudo 
 
Estimated update time: 4 hours, 38 minutes.

A look at the mechanism explains how Portage can double as an oracle. It uses the statistics stored in the emerge.log file, take an average of compilation times for given packages, and summarize the results. There are some uncertainties, of course, for example if you use the CCACHE feature, then compile times for a minor version bump may be much faster than the original package took compiling the first time. On the other hand, if an application has been extended with new features, the old average compile time can be shorter than the version you're about to emerge.

Another brilliant feature of genlop is its --current option, the perfect companion to the estimated compile-time from --pretend:

Code Listing 3: How much time spent since the beginning of an emerge

# genlop --current 
 * app-portage/splat-0.07  
       current merge time: 12 seconds.

Now you can say how long time you have to wait.

From http://www.gentoo.org/news/en/gwn/20041122-newsletter.xml


rate this article:
current rating: average rating: 1.1 (78 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back