← Back to team overview

launchpad-dev team mailing list archive

Re: Getting the source package from a Build via the API

 

On Thursday 29 July 2010 22:58:14 Barry Warsaw wrote:
> I'm writing a script against the API to more or less mimic what you see on
> https://launchpad.net/~user/+archive/ppa/+packages but I *think* that not
> all the information I want is exported.
> 
> What I'm doing is iterating through all the Build records returned from
> .getbuildRecords(pocket='Release') and looking for records with a
> .buildstate != 'Successfully built'.  However, I also want to get the
> source package information that was requested to be built.  As near as I
> can tell, I can often get this off of Build.current_source_publication,
> but that's often None, for reasons I do not fully understand.

It only returns the publication if the publication is active.  If it's been 
superseded or deleted then None is returned.  I think you should change that 
buildstate filter to be inclusive of the states that you need (because you're 
including the "superseded" state right now).

> 
> E.g. system-config-printer from here:
> 
> https://launchpad.net/~pythoneers/+archive/py27stack4/+packages?start=100&b
> atch=50
> 
> (hopefully that's the right batch, you apparently cannot generate a url
> directly to that build record via the web ui)
> 
> What I think I really want is the .source_package_release, but that's not
> exported.  I could file a bug against that if that would help (both you and
> me

I doubt we'll export that since all the important information is present on 
the publication, and also source package release doesn't have an obvious URL 
on its own.  We've taken the strategy so far of putting exported SPR data on 
the publication instead.

> Any suggestions?

First, ask yourself if builds for superseded sources are relevant?

Cheers
J



Follow ups

References