X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/19b7cd172992a8dc97ee20064dd1d38c2c04072a..daf43d15778d0424d307eadefd72f17ae67d3d9c:/include/download.mk diff --git a/include/download.mk b/include/download.mk index 2d3f35fee..d1b3fc8f8 100644 --- a/include/download.mk +++ b/include/download.mk @@ -11,7 +11,7 @@ DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED) define dl_method $(strip \ $(if $(2),$(2), \ - $(if $(filter @GNOME/% @GNU/% @KERNEL/% @SF/% ftp://% http://% file://%,$(1)),default, \ + $(if $(filter @GNOME/% @GNU/% @KERNEL/% @SF/% ftp://% http://% https://% file://%,$(1)),default, \ $(if $(filter git://%,$(1)),git, \ $(if $(filter svn://%,$(1)),svn, \ $(if $(filter cvs://%,$(1)),cvs, \ @@ -28,7 +28,7 @@ $(strip \ ) endef -# code for creating tarballs from cvs/svn/git/bzr/hg checkouts - useful for mirror support +# 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/unknown=echo "ERROR: Unknown pack format for file $(1)"; false @@ -63,12 +63,6 @@ define DownloadMethod/cvs ) endef -SVN_VERSION=$(shell svn --version | head -1 | awk '{ print $3 }' | cut -d. -f2) -ifeq ($(SVN_VERSION),5) -else -SVN_OPTS:=--trust-server-cert -endif - define DownloadMethod/svn $(call wrap_mirror, \ echo "Checking out files from the svn repository..."; \ @@ -76,7 +70,9 @@ define DownloadMethod/svn cd $(TMP_DIR)/dl && \ rm -rf $(SUBDIR) && \ [ \! -d $(SUBDIR) ] && \ - svn export --non-interactive $(SVN_OPTS) -r$(VERSION) $(URL) $(SUBDIR) && \ + ( svn help export | grep -q trust-server-cert && \ + svn export --non-interactive --trust-server-cert -r$(VERSION) $(URL) $(SUBDIR) || \ + svn export --non-interactive -r$(VERSION) $(URL) $(SUBDIR) ) && \ echo "Packing checkout..." && \ $(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \ mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \ @@ -108,10 +104,10 @@ define DownloadMethod/bzr cd $(TMP_DIR)/dl && \ rm -rf $(SUBDIR) && \ [ \! -d $(SUBDIR) ] && \ - bzr export -r$(VERSION) $(URL) $(SUBDIR) && \ + bzr export -r$(VERSION) $(SUBDIR) $(URL) && \ echo "Packing checkout..." && \ $(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \ - mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && + mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \ rm -rf $(SUBDIR); \ ) endef @@ -132,11 +128,28 @@ define DownloadMethod/hg ) endef +define DownloadMethod/darcs + $(call wrap_mirror, \ + echo "Checking out files from the darcs repository..."; \ + mkdir -p $(TMP_DIR)/dl && \ + cd $(TMP_DIR)/dl && \ + rm -rf $(SUBDIR) && \ + [ \! -d $(SUBDIR) ] && \ + darcs get -t $(VERSION) $(URL) $(SUBDIR) && \ + find $(SUBDIR) -name _darcs | xargs rm -rf && \ + echo "Packing checkout..." && \ + $(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \ + mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \ + rm -rf $(SUBDIR); \ + ) +endef + Validate/cvs=VERSION SUBDIR Validate/svn=VERSION SUBDIR Validate/git=VERSION SUBDIR Validate/bzr=VERSION SUBDIR Validate/hg=VERSION SUBDIR +Validate/darcs=VERSION SUBDIR define Download/Defaults URL:=