ref: ed56ddfef8b854bb4a244c3f1240a11c3cbeb5b8
parent: bf41a982b4e36c92cb8f8932e5231151f7506aa3
parent: ada640a508f7beecae66cdeabf008917109ef12c
author: James Zern <[email protected]>
date: Mon Jun 19 18:15:06 EDT 2017
Merge "libs.mk: retry partial testdata download"
--- a/libs.mk
+++ b/libs.mk
@@ -406,8 +406,16 @@
$(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1
@echo " [DOWNLOAD] $@"
- $(qexec)trap 'rm -f $@' INT TERM &&\
- curl --retry 1 -L -o $@ $(call libvpx_test_data_url,$(@F))
+ # Attempt to download the file using curl, retrying once if it fails for a
+ # partial file (18).
+ $(qexec)( \
+ trap 'rm -f $@' INT TERM; \
+ curl="curl --retry 1 -L -o $@ $(call libvpx_test_data_url,$(@F))"; \
+ $$curl; \
+ case "$$?" in \
+ 18) $$curl -C -;; \
+ esac \
+ )
testdata:: $(LIBVPX_TEST_DATA)
$(qexec)[ -x "$$(which sha1sum)" ] && sha1sum=sha1sum;\