SilverWav's Journal

The best is yet to come…

Launchpad syncSources missing “from series”

leave a comment »

OK a new project involving PPA’s, Launchpad, launchpadlib, Soyuz.

Lets start documenting some of this stuff while its fresh.

Tag the project “onedailyamonth” so I can find it later.

This may be a rather brutal introduction to python for me…
Oh well learning something new is always fun :-)

It works… everything else is bonus points.

Onwards…

$ python
##Start up the Launchpad command line.
>>> from launchpadlib.launchpad import Launchpad

##Start up your application and login.
launchpad = Launchpad.login_with('bot100', 'edge')
##Authorise the app in Launchpad and away you go...

Run the script or paste each command in turn to test it.

#! /usr/bin/env python

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

{{{
    from_archive = launchpad.people['ubuntu-mozilla-daily'].archive
    to_archive = launchpad.me.getPPAByName(name='one-daily-a-month')
    sources_to_be_copied = ['firefox','xulrunner-1.9.2']
    print to_archive.syncSources(
        source_names=sources_to_be_copied,
        from_archive=from_archive,
        to_pocket='release',
        to_series=None,include_binaries=True,
        )
    sources_to_be_copied = ['firefox-3.7', 'xulrunner-1.9.3']
    to_archive = launchpad.me.getPPAByName(name='one-daily-a-month-1')
    print to_archive.syncSources(
        source_names=sources_to_be_copied,
        from_archive=from_archive,
        to_pocket='release',
        to_series=None,
        include_binaries=True,
        )
}}}

___

This is great except it will not do a series, e.g. karmic, separately :-(
“API for copying packages (syncSources) needs a “from series” parameter” Bug #493914

So I will need to use syncSource instead.

This further means, that I will need a way to find the specific version name, for each of the packages.

Looking at the examples gives me something I can use…

“Listing the current package versions in a particular distroseries” here API/Examples.

OK we have a plan :-)

Advertisements

Written by SilverWav

April 29, 2010 at 1:42 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: