From ec376b5c9ef9119f701b995d1bc13dd617502756 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Mon, 15 Dec 2014 11:23:30 +0000 Subject: [PATCH] build/common: Add remote_fetch curl wrapper This patch purpose remote_fetch in order to make curl/wget usage consistent between calls. The main point is to use the curl retry mechanism to bypass temporary remote failures. --- build/common | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/common b/build/common index f0c32b717..f056ddf4b 100644 --- a/build/common +++ b/build/common @@ -43,6 +43,13 @@ check_usage() { fi } +remote_fetch() { + local remote_location=$1 + local local_location=$2 + # We retry 12 times with 10 seconds delay between retries + curl --silent --show-error --retry 12 --retry-delay 10 -L -o ${dir}/$local_location $remote_location +} + install_mellanox() { RELEASE=$1 CHROOT=$2