Your firewall does not like keyserver.ubuntu.com ...

... or any other non-80 service on the web

No problem, if you can access a server which is not submitted to the same access restrictions here is one solution.

First make the service hostname to resolve as localhost in your system editing /etc/hosts so its first line looks like:

{{{

127.0.0.1    localhost keyserver.ubuntu.com

}}}

That done, you can setup an secure ad-hoc tunnel with SSH in a terminal.

{{{

ssh <username>@<server> -L 11371:keyserver.ubuntu.com:11371 -N

}}}

You can put that in a script and run it for you session OR if you like GUI apps, try installing gstm (read more).

 

 

 

 

Launchpad API for PPAs - part 2

Continuing with Launchpad APIs for PPAs, let's illustrate how to find sources within a PPA.

Sources can be found, basically, by name, version, distroseries and status by calling getPublishedSources on a target archive.

>>> def test_source_lookup(lp): ...     ppa = lp.people['ubuntu-mozilla-daily'].archive ...    ubuntu = lp.distributions['ubuntu'] ...    jaunty = ubuntu.getSeries(name_or_version='jaunty') ...    last_firefox = ppa.getPublishedSources( ...        source_name='firefox-3.5', status='Published', distro_series=jaunty, ...        exact_match=True)[0] ...    print last_firefox.displayname

When it run, the output is:

firefox-3.5 3.5~b4~hg20090415r24712+nobinonly-0ubuntu1~umd1 in jaunty

Play with the arguments, also instead of fetching the first item (most recent one) from the collection you may iterate over it.

Launchpad API for PPAs

I've received few complains about how hard it is to extract information from the Launchpad API documentation for managing PPAs.

I will start a series of post with useful actions for PPA users and owner.

Start by reading the Launchpad API help page and familirize yourself with it. For experiments, I usually use a setup script and jump into a interactive python section.

$ python -i lpapi_setup.py>>> launchpad<launchpadlib.launchpad.Launchpad object at 0x13eb0d0>

Now, we can find out what's my PPA signing-key fingerprint:

>>> ppa = launchpad.people['cprov'].archive>>> print ppa.displaynamePPA for Celso Providelo>>> print ppa.signing_key_fingerprintDCAC43EE807ADF67495AD95809C5BECB0DC0F66Cto be continued ...