diff options
author | Dan Radez <dradez@redhat.com> | 2016-11-03 12:29:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-11-03 12:29:45 +0000 |
commit | 3da4fac9065a2c3c0f2f945ab857ace4a457e7cd (patch) | |
tree | bfaa285eb03e6eab6c7b4b0e20764a5450a1df43 /build/cache.sh | |
parent | 8b58d7ecc5b546ee3c52a8862a553bdbaeaccaf9 (diff) | |
parent | 449e8f1e1dfc9c7a678941a74bf7c59edd4ea981 (diff) |
Merge "Enabling alternalte method to get remote md5"
Diffstat (limited to 'build/cache.sh')
-rw-r--r-- | build/cache.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/build/cache.sh b/build/cache.sh index 4d41a7a2..5c7e5e73 100644 --- a/build/cache.sh +++ b/build/cache.sh @@ -38,12 +38,15 @@ function curl_file { } # $1 = download url +# $2 = remote md5 function populate_cache { local my_md5 cache_dir # get the file name filename="${1##*/}" + # copy passed in md5 + remote_md5=$2 # check if the cache file exists # and if it has an md5 compare that @@ -53,7 +56,9 @@ function populate_cache { curl_file $1 $filename else echo "Cache file exists...comparing MD5 checksum" - remote_md5="$(curl -sf -L ${1}.md5 | awk {'print $1'})" + if [ -z $remote_md5 ]; then + remote_md5="$(curl -sf -L ${1}.md5 | awk {'print $1'})" + fi if [ -z "$remote_md5" ]; then echo "Got empty MD5 from remote for $filename, skipping MD5 check" curl_file $1 $filename |