Comment 3 for bug 1648000

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1648000] Re: need API to discover where a given package is copied from

On Fri, Feb 24, 2017 at 06:45:57PM -0000, Robert Bruce Park wrote:
> Here's a reproducer using lp-shell instead of wget:

> >>> lp.load('ubuntu/+archive/primary').getPublishedSources(pocket='Proposed', source_name='lib', distro_series='/ubuntu/zesty')[0].packageupload
> >>>

>>> obj=lp.load('ubuntu/+archive/primary').getPublishedSources(pocket='Proposed', source_name='lib', distro_series='/ubuntu/zesty')[0]
>>> obj
<source_package_publishing_history at https://api.launchpad.net/devel/ubuntu/+archive/primary/+sourcepub/7369578>
>>> obj.display_name
u'afflib 3.7.15-1 in zesty'
>>>

This isn't an upload, it's a sync.

>>> obj=lp.load('ubuntu/+archive/primary').getPublishedSources(pocket='Proposed', source_name='glibc', distro_series='/ubuntu/zesty')[0]
>>> obj.packageupload
<package_upload at https://api.launchpad.net/devel/ubuntu/zesty/+upload/13928233>
>>>

Picking a package that *was* uploaded does result in a link to a
packageupload record.

> This happens on every source_package_publishing_history, without
> exception.

So, not exactly.

But this does appear to affect synced packages, including those that were
synced from ppas.

>>> obj=lp.load('ubuntu/+archive/primary').getPublishedSources(pocket='Proposed', source_name='unity8', exact_match=True, distro_series='/ubuntu/zesty')[0]
>>> obj.packageupload
>>>

But what you can do is:

>>> src=lp.load('ubuntu/+archive/primary').getPublishedSources(pocket='Proposed', source_name='unity8', exact_match=True, distro_series='/ubuntu/zesty')[0]
>>> bin = src.getPublishedBinaries()[0]
>>> bin.build.archive.self_link
u'https://api.launchpad.net/devel/~ci-train-ppa-service/+archive/ubuntu/2405-deletedppa'
>>>

Would this unblock you?