download.pl: use http://sources.lede-project.org as download mirror
[openwrt/openwrt.git] / scripts / download.pl
index 20f38f17e6db556ad6739c16fdd67ce084f4675d..548eb7a14f2c1442705e8dd71a3db560aa67ffb3 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/env perl
 # 
 # Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2016 LEDE project
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -182,6 +183,11 @@ foreach my $mirror (@ARGV) {
                push @mirrors, "http://mirrors.ocf.berkeley.edu/apache/$1";
                push @mirrors, "http://mirror.cc.columbia.edu/pub/software/apache/$1";
                push @mirrors, "http://ftp.jaist.ac.jp/pub/apache/$1";
+       } elsif ($mirror =~ /^\@GITHUB\/(.+)$/) {
+               # give github a few more tries (different mirrors)
+               for (1 .. 5) {
+                       push @mirrors, "https://raw.githubusercontent.com/$1";
+               }
        } elsif ($mirror =~ /^\@GNU\/(.+)$/) {
                push @mirrors, "http://ftpmirror.gnu.org/$1";
                push @mirrors, "http://ftp.gnu.org/pub/gnu/$1";
@@ -219,6 +225,7 @@ 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';