From d98e16226bfc2bdd3ad522daf72eab52e0e92d0d Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Wed, 22 Jan 2020 14:32:56 -0500 Subject: [PATCH] archive: change _download_file verify param to dscverify The param is specific to dsc-verifiable files, so name it accordingly. --- ubuntutools/archive.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ubuntutools/archive.py b/ubuntutools/archive.py index aeb8ab7..e8c7f5b 100644 --- a/ubuntutools/archive.py +++ b/ubuntutools/archive.py @@ -457,13 +457,12 @@ class SourcePackage(object): (downloaded / 1024.0 / 1024, size / 1024.0 / 1024)) - def _download_file(self, url, filename, verify=True, size=0): + def _download_file(self, url, filename, dscverify=False, size=0): "Download url to filename in workdir." pathname = os.path.join(self.workdir, filename) - if verify: - if self.dsc.verify_file(pathname): - Logger.debug('Using existing %s', filename) - return True + if dscverify and self.dsc.verify_file(pathname): + Logger.debug('Using existing %s', filename) + return True if urlparse(url).scheme in ["", "file"]: frompath = os.path.abspath(urlparse(url).path) @@ -494,7 +493,7 @@ class SourcePackage(object): return False raise e - if verify and not self.dsc.verify_file(pathname): + if dscverify and not self.dsc.verify_file(pathname): Logger.error('Checksum for %s does not match.', filename) return False return True @@ -506,7 +505,7 @@ class SourcePackage(object): name = entry['name'] for url in self._source_urls(name): try: - if self._download_file(url, name, size=int(entry['size'])): + if self._download_file(url, name, dscverify=True, size=int(entry['size'])): break except HTTPError as e: Logger.info('HTTP Error %i: %s', e.code, str(e))