From 3d7f542e4985436178baecc8d386d5d7bca3dba5 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Fri, 7 Feb 2020 07:10:40 -0500 Subject: [PATCH] archive: allow pull_binaries() to accept arch=None --- ubuntutools/archive.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ubuntutools/archive.py b/ubuntutools/archive.py index 8d6d329..7a4706b 100644 --- a/ubuntutools/archive.py +++ b/ubuntutools/archive.py @@ -519,22 +519,23 @@ class SourcePackage(object): else: 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. 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 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. """ total = 0 Logger.debug("pull_binaries(arch=%s, name=%s, ext=%s)" % (arch, name, ext)) - if not arch: - raise RuntimeError("Must specify arch") + if arch == 'all': + arch = None for (fname, furls, fsize) in self._binary_files_info(arch, name, ext): found = False