forked from importers/git-importer
Only validate the MD5 if we downloaded - trust the file system
This commit is contained in:
parent
0bcc0183c9
commit
4e1d5b42ca
@ -168,14 +168,15 @@ class OBS:
|
|||||||
if not self.in_cache(name, cachedir, file_md5):
|
if not self.in_cache(name, cachedir, file_md5):
|
||||||
with (dirpath / name).open("wb") as f:
|
with (dirpath / name).open("wb") as f:
|
||||||
f.write(self._download(project, package, name, revision).read())
|
f.write(self._download(project, package, name, revision).read())
|
||||||
|
|
||||||
shutil.copy(dirpath / name, cached_file)
|
shutil.copy(dirpath / name, cached_file)
|
||||||
|
|
||||||
|
# Validate the MD5 of the downloaded file
|
||||||
|
if md5(cached_file) != file_md5:
|
||||||
|
raise Exception(f"Download error in {name}")
|
||||||
else:
|
else:
|
||||||
shutil.copy(cached_file, dirpath / name)
|
shutil.copy(cached_file, dirpath / name)
|
||||||
|
|
||||||
# Validate the MD5 of the downloaded file
|
|
||||||
if md5(dirpath / name) != file_md5:
|
|
||||||
raise Exception(f"Download error in {name}")
|
|
||||||
|
|
||||||
def list(self, project, package, srcmd5, linkrev):
|
def list(self, project, package, srcmd5, linkrev):
|
||||||
params = {"rev": srcmd5, "expand": "1"}
|
params = {"rev": srcmd5, "expand": "1"}
|
||||||
if linkrev:
|
if linkrev:
|
||||||
|
Loading…
Reference in New Issue
Block a user