[feature request] provide a way to retrieve all source packages for a distribution

Bug #1983515 reported by Dan Ryan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

following up on LP#1983514 -- I am looking for a way to retrieve all of the source packages associated with a private distribution.

I have experimented with the distribution's `searchSourcePackages()` operation hoping that I could pass for example single letter substrings or a wildcard, but no matter what I pass to the operation I receive 0 results (yes I am authenticated).

It seems that individual source packages do have a key pointing directly to the distribution itself:

>>> pkg = distro.getSourcePackage(name="python-urllib3")
>>> assert pkg.distribution is not None
>>> pkg.distribution.resource_type_link
'https://api.launchpad.net/devel/#distribution'

However, the distribution exposes no API for traversing its source packages unless you already know what they are.

Tags: api
Dan Ryan (techalchemy)
description: updated
Revision history for this message
Colin Watson (cjwatson) wrote :

Does this need to be a separate bug from bug 1983514? It'd be difficult to implement without fixing that bug (because we'd fundamentally need to have something like `DistributionSourcePackageCache` to look at anyway) and if that bug were fixed then you could just do `distribution.searchSourcePackages(source_match="")` (possibly with us additionally adding a `DISTINCT` or something to the query to avoid getting duplicate results back).

Revision history for this message
Dan Ryan (techalchemy) wrote (last edit ):

> Does this need to be a separate bug from bug 1983514?

not strictly speaking, but I did want to disambiguate the request from the bug in case the implementation details were important.

The syntax you describe does align with my first attempt which was to provide an empty string as the match value.

Jürgen Gmach (jugmac00)
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
tags: added: api
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.