distribution.searchSourcePackages doesn't work for distributions without primary archives

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

Bug Description

I was attempting to traverse the API today to get from a private distribution to all of its member source packages. While I know the following functionality works (using e.g. `python-urllib3` as an example):

>>> pkg = distro.getSourcePackage(name="python-urllib3")
>>> assert pkg is not None
>>>

I was experimenting with the `distro.searchSourcePackages()` operation. According to the API docs @ https://launchpad.net/+apidoc/devel.html#distribution

> source_match
> (required)
> Source package name substring match

Given that explanation, I would expect a search for a substring contained within the target package name to return a list that includes the target package. So, in this case, I would expect a search for, e.g., 'python', to include 'python-urllib3'. Here is what happens:

>>> source_packages = list(distro.searchSourcePackages(source_match="python"))
>>> len(source_packages)
0

Revision history for this message
Colin Watson (cjwatson) wrote :

The problem isn't substrings - it's that the private distribution in question has no primary archive, and `Distribution.searchSourcePackages` only looks for package names published in the primary archive (and the mostly-obsolete primary archive).

I'm not sure what to do about this - we may need to invent a way to designate certain PPAs as "official", which is something I thought about early on but there didn't seem to be a pressing need for it at the time.

summary: - distribution.searchSourcePackages does not match substrings
+ distribution.searchSourcePackages doesn't work for distributions without
+ primary archives
tags: added: api lp-registry
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Dan Ryan (techalchemy) wrote :

FWIW I also tried to search the archive(s) in soss, but:

>>> archives = list(distro.archives)
>>> len(archives)
1
>>> archives[0].name
primary

I tried looking on DistroSeries, DistroArchSeries etc but couldn't find anything useful.

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.