From ada640a508f7beecae66cdeabf008917109ef12c Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 15 Jun 2017 23:33:11 -0700 Subject: [PATCH] libs.mk: retry partial testdata download attempt retry on transient failures uncaught by --retry Change-Id: I7cd8846ff88daf0f521af9ee182e30bfd79f51f3 --- libs.mk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs.mk b/libs.mk index f1e9242..42b24a6 100644 --- a/libs.mk +++ b/libs.mk @@ -406,8 +406,16 @@ CLEAN-OBJS += libvpx_test_srcs.txt $(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;\ -- 2.7.4