August 12th 2011

Careful what you wish for...

Via #241343:

* Package name    : apt-gentoo
  Version         : 0.0.1
* URL             :
* License         : GPL version 2 or above
  Description     : enhanced package installation

 apt-gentoo enhances the Debian package installation experience to make
 it fully competitive with newly-popular source-based distributions.

 As packages are installed, apt-gentoo automatically downloads their
 build logs from the buildd network. The logs are then slowly scrolled
 past on the user's terminal to simulate building the software on the
 local machine.


So, something like:

#!/usr/bin/env python
# Insert into /etc/apt/conf.d/50apt-gentoo:
# DPkg {
#         Pre-Install-Pkgs { "/path/to/apt-gentoo || true"; };
# };

import time
import random
import urllib
import urllib2
import urlparse
import fileinput

from lxml import etree
from debian import debfile

for filename in fileinput.input():
    pkg_data = debfile.DebFile(filename.strip()).debcontrol()

    url = "" % urllib.urlencode({
        'pkg': pkg_data['Package'],
        'ver': pkg_data['Version'],
        'arch': pkg_data['Architecture'],

    html = etree.parse(urllib2.urlopen(url), etree.HTMLParser())
    link = html.xpath("//table[@class='data logs']//td[3]/a")

        fetch_url = urlparse.urljoin(
    except IndexError:

    html = etree.parse(urllib2.urlopen(fetch_url), etree.HTMLParser())

        log = html.xpath('//pre')[0].text.split('\n')
    except IndexError:

    for line in log:
        print line
        time.sleep(random.random() * 0.09)

Package/source and example installation transcript.

You can subscribe to new posts via email or RSS.