From: Petr Štetiar Date: Fri, 27 Nov 2020 20:56:30 +0000 (+0100) Subject: download.pl: properly cleanup intermediate .hash file X-Git-Tag: v1.5.4-20201214~7 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3e8eb3768e987314b06471f6ff8b3b196a0a842b;p=librecmc%2Flibrecmc.git download.pl: properly cleanup intermediate .hash file It seems like after a build the /dl dir seems to now contain a .hash file for each source file due to inproper cleanup so fix it by removing those intermediate files before leaving the download action. Fixes: 4e19cbc55335 ("download: handle possibly invalid local tarballs") Reported-by: Hannu Nyman Signed-off-by: Petr Štetiar (cherry picked from commit 52a5d0d27f2557db99fc5435fbd7783b649cb9b2) --- diff --git a/scripts/download.pl b/scripts/download.pl index 44a24b8d6f..99b26990db 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -281,11 +281,11 @@ if (-f "$target/$filename") { $sum =~ /^(\w+)\s*/ or die "Could not generate file hash\n"; $sum = $1; + cleanup(); exit 0 if $sum eq $file_hash; die "Hash of the local file $filename does not match (file: $sum, requested: $file_hash) - deleting download.\n"; unlink "$target/$filename"; - cleanup(); }; }