mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
lpapicache: allow getBinaries(arch=None) to get all archs
this was the previous behavior and some scripts still call with no args. LP: #1862286
This commit is contained in:
parent
5553d98e47
commit
ebe460aad1
@ -608,7 +608,7 @@ class DebianSPPH(SourcePackagePublishingHistory):
|
||||
"""
|
||||
resource_type = 'source_package_publishing_history'
|
||||
|
||||
def getBinaries(self, arch, name=None, ext=None):
|
||||
def getBinaries(self, arch=None, name=None, ext=None):
|
||||
Logger.info('Using Snapshot to find binary packages')
|
||||
srcpkg = Snapshot.getSourcePackage(self.getPackageName(),
|
||||
version=self.getVersion())
|
||||
@ -1228,7 +1228,7 @@ class SnapshotSPPH(object):
|
||||
new_entries.append(str(block))
|
||||
return ''.join(new_entries)
|
||||
|
||||
def getBinaries(self, arch, name=None, ext=None):
|
||||
def getBinaries(self, arch=None, name=None, ext=None):
|
||||
return [b.getBPPH()
|
||||
for b in self._pkg.getBinaryFiles(arch=arch, name=name, ext=ext)]
|
||||
|
||||
|
@ -794,17 +794,19 @@ class SourcePackagePublishingHistory(BaseWrapper):
|
||||
new_entries.append(str(block))
|
||||
return ''.join(new_entries)
|
||||
|
||||
def getBinaries(self, arch, name=None, ext=None):
|
||||
def getBinaries(self, arch=None, name=None, ext=None):
|
||||
'''
|
||||
Returns the resulting BinaryPackagePublishingHistorys.
|
||||
Must specify arch, or use 'all' to get all archs.
|
||||
If arch is specified, it returns binaries for only that arch,
|
||||
plus any binaries with arch 'all'. If arch is not specified, or
|
||||
if arch is specified as 'all', all archs are returned.
|
||||
|
||||
If name is specified, only returns BPPH matching that (regex) name.
|
||||
|
||||
If ext is specified, only returns BPPH matching that (regex) ext.
|
||||
'''
|
||||
if not arch:
|
||||
raise RuntimeError("Must specify arch")
|
||||
if arch == 'all':
|
||||
arch = None
|
||||
|
||||
if self.status in ["Pending", "Published"]:
|
||||
# Published, great! Directly query the list of binaries
|
||||
|
Loading…
x
Reference in New Issue
Block a user