download: add @GITHUB download facility
[openwrt/openwrt.git] / include / download.mk
index 988542f95aca7bf533341ca20988259ef0f01a8e..d1d2027bb1e39d85dc712a0e2f61784532be9b3d 100644 (file)
@@ -1,5 +1,6 @@
 #
 # Copyright (C) 2006-2012 OpenWrt.org
+# Copyright (C) 2016 LEDE project
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -13,7 +14,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, \
@@ -90,8 +91,9 @@ define DownloadMethod/git
                cd $(TMP_DIR)/dl && \
                rm -rf $(SUBDIR) && \
                [ \! -d $(SUBDIR) ] && \
-               git clone $(URL) $(SUBDIR) --recursive && \
-               (cd $(SUBDIR) && git checkout $(VERSION) && git submodule update) && \
+               git clone $(URL) $(SUBDIR) && \
+               (cd $(SUBDIR) && git checkout $(VERSION) && \
+               git submodule update --init --recursive) && \
                echo "Packing checkout..." && \
                rm -rf $(SUBDIR)/.git && \
                $(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \