Skip to content

Commit 6ed420d

Browse files
committed
Add md5sum checksum for meta-recipe download
1 parent 477b6f4 commit 6ed420d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ggd/utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,10 @@ def get_meta_recipe_pkg(pkg_name, jdict, ggd_channel, prefix):
973973
platform = subdir
974974
newest_tar = pkg_tar
975975

976+
977+
## Get the md5sum
978+
md5 = repodata_dict[channel_key][newest_tar]["md5"]
979+
976980
## Remove the repodata files
977981
del repodata_dict
978982
del name2tar
@@ -1022,6 +1026,12 @@ def get_meta_recipe_pkg(pkg_name, jdict, ggd_channel, prefix):
10221026
target_path = os.path.join(dest_dir,newest_tar)
10231027
assert (os.path.exists(target_path) and os.path.isfile(target_path)), "\n:ggd:meta-recipe: !!ERROR!! There was a problem downloading the meta-recipe pkg. It is missing from the target dir"
10241028

1029+
## Check the the downloaded meta-recipe is was downloaded correctly using mf5sum
1030+
print("\n:ggd:meta-recipe: Checking md5sum")
1031+
1032+
downloaded_md5sum = get_file_md5sum(target_path)
1033+
assert downloaded_md5sum == md5, "\n:ggd:meta-recipe: !!ERROR!! The downloaded meta-recipe's md5 sum does not match the reference: {} != {}".format(downloaded_md5sum, md5)
1034+
10251035
print("\n:ggd:meta-recipe: Successfully downloaded {} to {}".format(newest_tar, dest_dir))
10261036

10271037
return(dest_dir, newest_tar, target_path)

0 commit comments

Comments
 (0)