X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=include%2Fdownload.mk;h=d1d2027bb1e39d85dc712a0e2f61784532be9b3d;hp=adaa2e6ac5ed9b05b7e832309d6de8ad3bea9fd7;hb=694f060550a90de0903830f210f0388f4171a774;hpb=b0a1c7dc0d825d5435111a8c005e1e8d5449ebee diff --git a/include/download.mk b/include/download.mk index adaa2e6ac5..d1d2027bb1 100644 --- a/include/download.mk +++ b/include/download.mk @@ -1,17 +1,20 @@ # # 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. # +OPENWRT_GIT = http://git.openwrt.org + DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED) # Try to guess the download method from the URL define dl_method $(strip \ $(if $(2),$(2), \ - $(if $(filter @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, \ @@ -42,11 +45,11 @@ define DownloadMethod/unknown endef define DownloadMethod/default - $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MD5SUM)" $(foreach url,$(URL),"$(url)") + $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MD5SUM)" "$(URL_FILE)" $(foreach url,$(URL),"$(url)") endef define wrap_mirror - $(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" || ( $(1) ),$(1)) +$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" "" || ( $(1) ),$(1)) endef define DownloadMethod/cvs @@ -88,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)) && \ @@ -155,6 +159,7 @@ Validate/darcs=VERSION SUBDIR define Download/Defaults URL:= FILE:= + URL_FILE:= PROTO:= MD5SUM:= SUBDIR:= @@ -179,6 +184,6 @@ define Download $(DL_DIR)/$(FILE): mkdir -p $(DL_DIR) - $(if $(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/unknown)) + $(call locked,$(if $(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/$(call dl_method,$(URL),$(PROTO))),$(DownloadMethod/unknown)),$(FILE)) endef