Commit 33ed290b authored by goroutine's avatar goroutine Committed by GitHub

Merge pull request #55 from andelf/retry-download

bibrocksdb_sys/build.sh: add retries in download
parents 93f4208e e274d834
...@@ -26,15 +26,16 @@ function md5_check() { ...@@ -26,15 +26,16 @@ function md5_check() {
[[ "$hash" == "$2" ]] || error $1: hash not correct, expect $2, got $hash [[ "$hash" == "$2" ]] || error $1: hash not correct, expect $2, got $hash
} }
retry=3
function download() { function download() {
if [[ -f $2 ]] && md5_check $2 $3; then if [[ -f $2 ]] && md5_check $2 $3; then
return return
fi fi
if which wget &>/dev/null; then if which curl &>/dev/null; then
wget $1 -O $2 curl --retry $retry -L $1 -o $2
elif which curl &>/dev/null; then elif which wget &>/dev/null; then
curl -L $1 -o $2 wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries $retry $1 -O $2
else else
error can\'t find wget and curl. error can\'t find wget and curl.
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment