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: d391236269 ("download.pl: add aria2c support")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi
2022-09-25 21:43:43 +02:00
parent 582c098c09
commit 5df60f5c24

View File

@@ -93,6 +93,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',
@@ -321,7 +322,6 @@ while (!-f "$target/$filename") {
if (!-f "$target/$filename" && $url_filename ne $filename) {
download($mirror, $filename, @mirrors);
}
@mirrors=();
}
$SIG{INT} = \&cleanup;