Browse Source

download: add @GITHUB download facility

Define a new alias (@GITHUB) for downloading raw github repository files

Signed-off-by: Álvaro Fernández Rojas <[email protected]>

SVN-Revision: 49138
John Crispin 9 years ago
parent
commit
5c408ede6c
2 changed files with 6 additions and 1 deletions
  1. 1 1
      include/download.mk
  2. 5 0
      scripts/download.pl

+ 1 - 1
include/download.mk

@@ -13,7 +13,7 @@ DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
 define dl_method
 define dl_method
 $(strip \
 $(strip \
   $(if $(2),$(2), \
   $(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 git://%,$(1)),git, \
         $(if $(filter svn://%,$(1)),svn, \
         $(if $(filter svn://%,$(1)),svn, \
           $(if $(filter cvs://%,$(1)),cvs, \
           $(if $(filter cvs://%,$(1)),cvs, \

+ 5 - 0
scripts/download.pl

@@ -182,6 +182,11 @@ foreach my $mirror (@ARGV) {
 		push @mirrors, "http://mirrors.ocf.berkeley.edu/apache/$1";
 		push @mirrors, "http://mirrors.ocf.berkeley.edu/apache/$1";
 		push @mirrors, "http://mirror.cc.columbia.edu/pub/software/apache/$1";
 		push @mirrors, "http://mirror.cc.columbia.edu/pub/software/apache/$1";
 		push @mirrors, "http://ftp.jaist.ac.jp/pub/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\/(.+)$/) {
 	} elsif ($mirror =~ /^\@GNU\/(.+)$/) {
 		push @mirrors, "http://ftpmirror.gnu.org/$1";
 		push @mirrors, "http://ftpmirror.gnu.org/$1";
 		push @mirrors, "http://ftp.gnu.org/pub/gnu/$1";
 		push @mirrors, "http://ftp.gnu.org/pub/gnu/$1";