download: add @GITHUB download facility
[openwrt/staging/florian.git] / scripts / download.pl
index 20f38f17e6db556ad6739c16fdd67ce084f4675d..749c762eec37f6423a169c0833857b3b3f087d20 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";