← Back to team overview

launchpad-dev team mailing list archive

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

 

Thanks for the reply Julian!

On Jul 30, 2010, at 11:48 AM, Julian Edwards wrote:

>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).

I'm looking at the API documentation for getBuildRecords().  It seems that the
build_state parameter only accepts one of the several enums, so if I cared
about e.g. Successfully built and Currently building, I'd have to make
multiple calls to getBuildRecord().  It might be better to not filter on
buildstate until I start iterating through the loop.

Thanks for the explanation about active publications.  I don't actually see an
explicit state for "deleted", so I'm guessing that's just an implicit state
that's not directly represented.

>> 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?

They're not.  Thanks very much for the explanation.  I give it a shot.
-Barry

Attachment: signature.asc
Description: PGP signature


Follow ups

References