download: add @GITHUB download facility
authorJohn Crispin <john@openwrt.org>
Sat, 9 Apr 2016 10:25:34 +0000 (10:25 +0000)
committerJohn Crispin <john@openwrt.org>
Sat, 9 Apr 2016 10:25:34 +0000 (10:25 +0000)
Define a new alias (@GITHUB) for downloading raw github repository files

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
SVN-Revision: 49138

include/download.mk
scripts/download.pl

index 63af9081145c84f2f41eca8222d7b3ace9fa53dd..a3595140026e6ac060b858d8508d28704bf01a42 100644 (file)
@@ -13,7 +13,7 @@ DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
 define dl_method
 $(strip \
   $(if $(2),$(2), \
-    $(if $(filter @APACHE/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
+    $(if $(filter @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
       $(if $(filter git://%,$(1)),git, \
         $(if $(filter svn://%,$(1)),svn, \
           $(if $(filter cvs://%,$(1)),cvs, \
index 20f38f17e6db556ad6739c16fdd67ce084f4675d..a1bd0133ca354a1600ec43a0bd8abdc618c5236c 100755 (executable)
@@ -182,6 +182,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";