From 5ae6c9be691778a7e4ccc6f429b92a98ea0e79a4 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 25 Sep 2022 21:43:43 +0200 Subject: [PATCH] scripts/download.pl: fix mirrors regression for curl and wget With the introduction of aria2c support, curl and wget no longer try to download the file from mirrors. Fix this regression by emptying the remaining mirrors list only when aria2c is used. Fixes: d39123626931 ("download.pl: add aria2c support") Signed-off-by: Christian Marangi --- scripts/download.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download.pl b/scripts/download.pl index ceaa88627..b5ae8608a 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -95,6 +95,7 @@ sub download_cmd { } if ($have_aria2c) { + @mirrors=(); return join(" ", "touch /dev/shm/${rfn}_spp;", qw(aria2c --stderr -c -x2 -s10 -j10 -k1M), $url, $additional_mirrors, $check_certificate ? () : '--check-certificate=false', @@ -334,7 +335,6 @@ while (!-f "$target/$filename") { if (!-f "$target/$filename" && $url_filename ne $filename) { download($mirror, $filename, @mirrors); } - @mirrors=(); } $SIG{INT} = \&cleanup;