Skip to content

Commit 5c408ed

Browse files
author
John Crispin
committed
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
1 parent 0039bc6 commit 5c408ed

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

include/download.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
1313
define dl_method
1414
$(strip \
1515
$(if $(2),$(2), \
16-
$(if $(filter @APACHE/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
16+
$(if $(filter @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
1717
$(if $(filter git://%,$(1)),git, \
1818
$(if $(filter svn://%,$(1)),svn, \
1919
$(if $(filter cvs://%,$(1)),cvs, \

scripts/download.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ sub cleanup
182182
push @mirrors, "http://mirrors.ocf.berkeley.edu/apache/$1";
183183
push @mirrors, "http://mirror.cc.columbia.edu/pub/software/apache/$1";
184184
push @mirrors, "http://ftp.jaist.ac.jp/pub/apache/$1";
185+
} elsif ($mirror =~ /^\@GITHUB\/(.+)$/) {
186+
# give github a few more tries (different mirrors)
187+
for (1 .. 5) {
188+
push @mirrors, "https://raw.githubusercontent.com/$1";
189+
}
185190
} elsif ($mirror =~ /^\@GNU\/(.+)$/) {
186191
push @mirrors, "http://ftpmirror.gnu.org/$1";
187192
push @mirrors, "http://ftp.gnu.org/pub/gnu/$1";

0 commit comments

Comments
 (0)