X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=scripts%2Fdownload.pl;h=bd62b6b9566ce729f78f54e3ea3ea0003c91b52b;hp=645ac8546c44d033ea10e93f8662e98e32ec902c;hb=a929c1bad028ef71477685f1d71c2ded4f737d1a;hpb=99c429512622566ee2bbde69fa8efb0f2bcda33e diff --git a/scripts/download.pl b/scripts/download.pl index 645ac8546c..bd62b6b956 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -16,7 +16,7 @@ use Text::ParseWords; @ARGV > 2 or die "Syntax: $0 [ ...]\n"; my $url_filename; -my $target = shift @ARGV; +my $target = glob(shift @ARGV); my $filename = shift @ARGV; my $file_hash = shift @ARGV; $url_filename = shift @ARGV unless $ARGV[0] =~ /:\/\//; @@ -88,6 +88,7 @@ sub download_cmd($) { } my $hash_cmd = hash_cmd(); +$hash_cmd or ($file_hash eq "skip") or die "Cannot find appropriate hash command, ensure the provided hash is either a MD5 or SHA256 checksum.\n"; sub download { @@ -190,7 +191,7 @@ foreach my $mirror (@ARGV) { if ($mirror =~ /^\@SF\/(.+)$/) { # give sourceforge a few more tries, because it redirects to different mirrors for (1 .. 5) { - push @mirrors, "http://downloads.sourceforge.net/$1"; + push @mirrors, "https://downloads.sourceforge.net/$1"; } } elsif ($mirror =~ /^\@APACHE\/(.+)$/) { push @mirrors, "https://mirror.netcologne.de/apache.org/$1"; @@ -256,10 +257,9 @@ foreach my $mirror (@ARGV) { } } -#push @mirrors, 'http://mirror1.openwrt.org'; -push @mirrors, 'http://sources.lede-project.org'; -push @mirrors, 'http://mirror2.openwrt.org/sources'; -push @mirrors, 'http://downloads.openwrt.org/sources'; +#push @mirrors, 'https://mirror1.openwrt.org'; +push @mirrors, 'https://sources.openwrt.org'; +push @mirrors, 'https://mirror2.openwrt.org/sources'; while (!-f "$target/$filename") { my $mirror = shift @mirrors;