From a47caacaf37e57389acc7618f23a7e64afaa9d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 27 Nov 2020 21:56:30 +0100 Subject: [PATCH] download.pl: properly cleanup intermediate .hash file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- scripts/download.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download.pl b/scripts/download.pl index c1623bf91f..2876ae5807 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -273,11 +273,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(); }; }