From 3dfab89c1f4c94115110b17b9a98efdfb0590a55 Mon Sep 17 00:00:00 2001 From: Kayou Date: Thu, 7 Sep 2023 14:59:08 +0200 Subject: [PATCH] check and re-download a prefetched file that doesn't match the checksum --- helpers/utils | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helpers/utils b/helpers/utils index 52d7c734f..4694dd724 100644 --- a/helpers/utils +++ b/helpers/utils @@ -244,9 +244,11 @@ ynh_setup_source() { if [ "$src_format" = "docker" ]; then src_platform="${src_platform:-"linux/$YNH_ARCH"}" - elif test -e "$local_src"; then - cp $local_src $src_filename else + if test -e "$local_src"; then + cp $local_src $src_filename + fi + [ -n "$src_url" ] || ynh_die "Couldn't parse SOURCE_URL from $src_file_path ?" # If the file was prefetched but somehow doesn't match the sum, rm and redownload it