From be6e09a02ba4a438f6b7fe5b395a09984ef0aae6 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Tue, 13 Jul 2021 13:58:27 -0400 Subject: [PATCH] archive: don't use existing file if no verification methods provided we shouldn't use an existing file if we aren't checking its checksums --- ubuntutools/archive.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ubuntutools/archive.py b/ubuntutools/archive.py index c0f9230..75902b5 100644 --- a/ubuntutools/archive.py +++ b/ubuntutools/archive.py @@ -385,7 +385,8 @@ class SourcePackage(ABC): else: pathname = os.path.join(self.workdir, filename) - if self._verify_file(pathname, dscverify, sha1sum, sha256sum, size): + can_verify = any((dscverify, sha1sum, sha256sum)) + if can_verify and self._verify_file(pathname, dscverify, sha1sum, sha256sum, size): Logger.info('Using existing file %s', filename) return True