[openwrt/openwrt] download.pl: properly cleanup intermediate .hash file

LEDE Commits lede-commits at lists.infradead.org
Fri Nov 27 16:27:24 EST 2020


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/52a5d0d27f2557db99fc5435fbd7783b649cb9b2

commit 52a5d0d27f2557db99fc5435fbd7783b649cb9b2
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Fri Nov 27 21:56:30 2020 +0100

    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 at iki.fi>
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 scripts/download.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/download.pl b/scripts/download.pl
index 2d87f47f84..84d10dbe5f 100755
--- a/scripts/download.pl
+++ b/scripts/download.pl
@@ -272,11 +272,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();
 	};
 }
 



More information about the lede-commits mailing list