SilverWav's Journal

The best is yet to come…

Listing latest published packages in a PPA

leave a comment »

OK so now I have a way of listing the latest published packages in a PPA. :-)

The key is that I can specify the series e.g. lucid or karmic and get results for each.

Note: Learning python as I go… :-)
Yes a better function is called for but this will do for now.

Advantages over the web interface:
It is easy to see the 8 packages I am interested in (out of the 50 in the ppa).
I can also quickly confirm when all the packages have been built (I just check the date).

___

Code

#! /usr/bin/env python

from launchpadlib.launchpad import Launchpad
launchpad = Launchpad.login_with('bot100', 'edge')

distro = launchpad.distributions["ubuntu"]
ppa = launchpad.people['ubuntu-mozilla-daily'].archive

def getPS(seri, source):
    series = distro.getSeries(name_or_version = seri)

    last_app = ppa.getPublishedSources(
		exact_match=True,
		source_name=source,
		distro_series=series
		)[0]
    apptemp = last_app.source_package_version

    print apptemp
    return apptemp

appff10 = getPS('lucid','firefox')
appff20 = getPS('lucid','firefox-3.7')
appff30 = getPS('lucid','xulrunner-1.9.2')
appff40 = getPS('lucid','xulrunner-1.9.3')
print
appff1 = getPS('karmic','firefox')
appff2 = getPS('karmic','firefox-3.7')
appff3 = getPS('karmic','xulrunner-1.9.2')
appff4 = getPS('karmic','xulrunner-1.9.3')

___

Results:

$ ./lp-getPublishedSources_one-daily-a-month.py
3.6.5~hg20100428r34143+nobinonly-0ubuntu1~umd1
3.7~a5~hg20100429r41513+nobinonly-0ubuntu1~umd1
1.9.2.5~hg20100428r34143+nobinonly-0ubuntu1~umd1
1.9.3~a5~hg20100429r41513+nobinonly-0ubuntu1~umd1

3.6.5~hg20100428r34143+nobinonly-0ubuntu1~umd1~karmic
3.7~a5~hg20100429r41513+nobinonly-0ubuntu1~umd1~karmic
1.9.2.5~hg20100428r34143+nobinonly-0ubuntu1~umd1~karmic
1.9.3~a5~hg20100429r41513+nobinonly-0ubuntu1~umd1~karmic
$

___

Advertisements

Written by SilverWav

April 29, 2010 at 5:28 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: