aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2020-11-27 21:56:30 +0100
committerPetr Štetiar <ynezz@true.cz>2020-12-05 20:50:19 +0100
commita47caacaf37e57389acc7618f23a7e64afaa9d8c (patch)
treec1641e77ef106aa02bec024027f7400ccaf0ce21
parent605adb1023efda0c29d160839fccc20801b717cd (diff)
downloadupstream-a47caacaf37e57389acc7618f23a7e64afaa9d8c.tar.gz
upstream-a47caacaf37e57389acc7618f23a7e64afaa9d8c.tar.bz2
upstream-a47caacaf37e57389acc7618f23a7e64afaa9d8c.zip
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 <hannu.nyman@iki.fi> Signed-off-by: Petr Štetiar <ynezz@true.cz> (cherry picked from commit 52a5d0d27f2557db99fc5435fbd7783b649cb9b2)
-rwxr-xr-xscripts/download.pl2
1 files changed, 1 insertions, 1 deletions
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();
};
}