X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=include%2Fdownload.mk;h=63af9081145c84f2f41eca8222d7b3ace9fa53dd;hb=7ef03b71c7953bba0a399f14815395c977e91416;hp=7009bfcd44c58d18fb8b92fdbe72aea84fbce515;hpb=45e42754c7e705c8e999a9db9fc380390af259f4;p=openwrt.git diff --git a/include/download.mk b/include/download.mk index 7009bfcd44..63af908114 100644 --- a/include/download.mk +++ b/include/download.mk @@ -1,17 +1,19 @@ # -# Copyright (C) 2006-2010 OpenWrt.org +# Copyright (C) 2006-2012 OpenWrt.org # # 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/% ftp://% http://% https://% file://%,$(1)),default, \ + $(if $(filter @APACHE/% @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, \ @@ -29,8 +31,9 @@ $(strip \ endef # code for creating tarballs from cvs/svn/git/bzr/hg/darcs checkouts - useful for mirror support -dl_pack/bz2=$(TAR) cfj $(1) $(2) -dl_pack/gz=$(TAR) cfz $(1) $(2) +dl_pack/bz2=$(TAR) cjf $(1) $(2) +dl_pack/gz=$(TAR) czf $(1) $(2) +dl_pack/xz=$(TAR) c $(2) | xz -zc > $(1) dl_pack/unknown=echo "ERROR: Unknown pack format for file $(1)"; false define dl_pack $(if $(dl_pack/$(call ext,$(1))),$(dl_pack/$(call ext,$(1))),$(dl_pack/unknown)) @@ -41,11 +44,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 $(MIRROR),@$(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,7 +91,8 @@ define DownloadMethod/git rm -rf $(SUBDIR) && \ [ \! -d $(SUBDIR) ] && \ git clone $(URL) $(SUBDIR) && \ - (cd $(SUBDIR) && git checkout $(VERSION)) && \ + (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)) && \ @@ -154,6 +158,7 @@ Validate/darcs=VERSION SUBDIR define Download/Defaults URL:= FILE:= + URL_FILE:= PROTO:= MD5SUM:= SUBDIR:= @@ -178,6 +183,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