Add the file_md5 to the download function so it can cache and verify

This commit is contained in:
Stephan Kulow
2022-11-02 13:35:45 +01:00
parent a1ead29734
commit 05cf792b26
3 changed files with 11 additions and 4 deletions

View File

@@ -66,6 +66,7 @@ class GitExporter:
name,
revision.srcmd5,
self.git.path,
file_md5=file_md5,
)
# Validate the MD5 of the downloaded file
if md5(self.git.path / name) != file_md5:
@@ -137,7 +138,7 @@ class GitExporter:
if not self.limit_download(file):
continue
self.git.remove(file)
for file in to_download:
for file, md5 in to_download:
if not self.limit_download(file):
continue
self.obs.download(
@@ -146,6 +147,7 @@ class GitExporter:
file,
flat.commit.expanded_srcmd5,
self.git.path,
file_md5=md5,
)
self.git.add(file)