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
This commit is contained in:
Dan Streetman 2021-07-13 13:58:27 -04:00
parent 86276665cd
commit be6e09a02b

View File

@ -385,7 +385,8 @@ class SourcePackage(ABC):
else: else:
pathname = os.path.join(self.workdir, filename) 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) Logger.info('Using existing file %s', filename)
return True return True