archive: allow pull_binaries() to accept arch=None

This commit is contained in:
Dan Streetman 2020-02-07 07:10:40 -05:00
parent ebe460aad1
commit 3d7f542e49

View File

@ -519,22 +519,23 @@ class SourcePackage(object):
else: else:
raise DownloadError('File %s could not be found' % name) raise DownloadError('File %s could not be found' % name)
def pull_binaries(self, arch, name=None, ext=None): def pull_binaries(self, arch=None, name=None, ext=None):
"""Pull binary debs into workdir. """Pull binary debs into workdir.
If name is specified, only binary packages matching the regex are included. If name is specified, only binary packages matching the regex are included.
If ext is specified, only binary packages with that ext are included; for If ext is specified, only binary packages with that ext are included; for
example to only download dbgsym ddebs, specify ext='ddeb'. example to only download dbgsym ddebs, specify ext='ddeb'.
Must specify arch, or use 'all' to pull all archs. If arch is not specified or is 'all', pull all archs.
Returns the number of files downloaded. Returns the number of files downloaded.
""" """
total = 0 total = 0
Logger.debug("pull_binaries(arch=%s, name=%s, ext=%s)" % (arch, name, ext)) Logger.debug("pull_binaries(arch=%s, name=%s, ext=%s)" % (arch, name, ext))
if not arch: if arch == 'all':
raise RuntimeError("Must specify arch") arch = None
for (fname, furls, fsize) in self._binary_files_info(arch, name, ext): for (fname, furls, fsize) in self._binary_files_info(arch, name, ext):
found = False found = False