diff options
author | fuzzard <fuzzard@kodi.tv> | 2022-05-09 07:41:37 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2022-05-23 15:53:22 +1000 |
commit | 5d909a185e87e87df080ec9899a24fc0a34f6637 (patch) | |
tree | 49c6bcede20595529866c95e4d6b753b709aec39 /tools/depends | |
parent | d85d2295bad5df2c5c7e44cb8c1cf87fb3cd3de8 (diff) |
[tools/depends] download-files.include cleanup failed tarball
if we fail retry 3 times, cleanup any downloaded artifacts as they are bad
Diffstat (limited to 'tools/depends')
-rw-r--r-- | tools/depends/download-files.include | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/depends/download-files.include b/tools/depends/download-files.include index 8bbccf0dab..3f41dfa1e9 100644 --- a/tools/depends/download-files.include +++ b/tools/depends/download-files.include @@ -41,6 +41,7 @@ endif ifeq ($(HASH_FOUND),yes) # we really need 2 spaces between sha hash and file name! # if the hash sum doesn't match we retry up to 3 times, add verbose curl output for diagnostics on retries +# if we fail 3 times, cleanup anything downloaded (eg bad tar) @cd $(TARBALLS_LOCATION); echo "$(HASH_SUM) $(ARCHIVE)" > $(ARCHIVE).$(HASH_TYPE) && $(HASH_TOOL) $(HASH_TOOL_FLAGS) $(ARCHIVE).$(HASH_TYPE) \ || {\ echo "Error: failed to verify hash sum of $(ARCHIVE), expected type: $(HASH_TYPE) value $(HASH_SUM), retrying.." ;\ @@ -52,6 +53,7 @@ ifeq ($(HASH_FOUND),yes) $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) -v $(BASE_URL)/$(ARCHIVE) ;\ $(HASH_TOOL) $(HASH_TOOL_FLAGS) $(ARCHIVE).$(HASH_TYPE) && exit 0 || tries=$$((tries + 1)) ;\ done ;\ + rm $(TARBALLS_LOCATION)/$(ARCHIVE) ;\ exit 1 ;\ } endif |