From 49135eb09e02409907734aa2232be80531a221d2 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 21 Jul 2026 14:34:24 +0200 Subject: [PATCH] fix: Remove invalid downloads after checksum failures (#1925) --- src/mido.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mido.sh b/src/mido.sh index 8e16cbf7..5953ac81 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -819,7 +819,12 @@ tryDownload() { fi # Status 2 means the completed download failed deterministic validation. - verifyFile "$iso" "$size" "$total" "$sum" || return 2 + if ! verifyFile "$iso" "$size" "$total" "$sum"; then + if ! rm -f -- "$iso" "$iso.aria2"; then + warn "failed to remove invalid download \"$iso\"!" + fi + return 2 + fi # Extract the .iso from the compressed archive if needed. isCompressed "$url" && UNPACK="Y"