aboutsummaryrefslogtreecommitdiff
path: root/depends/funcs.mk
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-03-03 01:01:30 -0500
committerCory Fields <cory-nospam-@coryfields.com>2016-04-04 19:26:44 -0400
commitfe740f14690f70fbb84287595049afc719a5bd3b (patch)
tree9572aee5ce3308f117bf090c37f903df0910b591 /depends/funcs.mk
parentdc4ec6d3dbb5018cdc059eebb55994fab5d23679 (diff)
depends: fix fallback downloads
In some cases, failed downloads wouldn't trigger a fallback download attempt. Namely, checksum mismatches.
Diffstat (limited to 'depends/funcs.mk')
-rw-r--r--depends/funcs.mk16
1 files changed, 10 insertions, 6 deletions
diff --git a/depends/funcs.mk b/depends/funcs.mk
index 45bb96dd44..15e404e42d 100644
--- a/depends/funcs.mk
+++ b/depends/funcs.mk
@@ -19,15 +19,19 @@ define int_get_all_dependencies
$(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dependencies))))
endef
-define fetch_file
-(test -f $$($(1)_source_dir)/$(4) || \
- ( mkdir -p $$($(1)_download_dir) && echo Fetching $(1)... && \
- ( $(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(2)/$(3)" || \
- $(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(FALLBACK_DOWNLOAD_PATH)/$(3)" ) && \
+define fetch_file_inner
+ ( mkdir -p $$($(1)_download_dir) && echo Fetching $(3) from $(2) && \
+ $(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(2)/$(3)" && \
echo "$(5) $$($(1)_download_dir)/$(4).temp" > $$($(1)_download_dir)/.$(4).hash && \
$(build_SHA256SUM) -c $$($(1)_download_dir)/.$(4).hash && \
mv $$($(1)_download_dir)/$(4).temp $$($(1)_source_dir)/$(4) && \
- rm -rf $$($(1)_download_dir) ))
+ rm -rf $$($(1)_download_dir) )
+endef
+
+define fetch_file
+ ( test -f $$($(1)_source_dir)/$(4) || \
+ ( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \
+ $(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5))))
endef
define int_get_build_recipe_hash