Not possible to get a list of packages in a component through the API

Bug #848097 reported by Ursula Junque
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Undecided
Jonathan Lange

Bug Description

<jelmer> Ursinha: actually, lp.distributions['ubuntu'].getSeries(name_or_version="oneiric").main_archive.getPublishedSources()
<Ursinha> main_archive is not just main
<Ursinha> it includes universe as well, I was told
<jelmer> ah
<jelmer> I guess you could filter out some packages based on section, though that would be quite slow
<jml> jelmer: not quite! lp.distributions['ubuntu'].main_archive.getPublishedSources(component="main", distro_series=lp.distributions['ubuntu'].getSeries(name_or_version="oneiric"), status="Published")
<Ursinha> In [41]: ubuntu.main_archive
<Ursinha> Out[41]: <archive at https://api.launchpad.net/1.0/ubuntu/+archive/primary>
<jml> oh crap
<Ursinha> ah
<jml> no "component" there
<jml> sorry
<james_w> yeah
* Ursinha looks for a bug

I'd like to get a list of packages in main component in ubuntu, but it's not possible do to that in Launchpad using the API unless iterating all packages like this:

<james_w> you you have to iterate over the return of getPublishedSources
<james_w> and do if publishing_record.component_name != "main": continue

It should be possible to search directly by component instead of doing this.

Tags: api qa-ok

Related branches

Jonathan Lange (jml)
Changed in launchpad:
status: New → In Progress
assignee: nobody → Jonathan Lange (jml)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
William Grant (wgrant)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.