From bd83a7926b3134ad9909d673ffa6418c98da4de8 Mon Sep 17 00:00:00 2001 From: Tuomo Soini Date: Nov 15 2016 14:47:05 +0000 Subject: get_sources: download source again if file checksum has changed This functionality requires use of option -c. Signed-off-by: Tuomo Soini --- diff --git a/get_sources.sh b/get_sources.sh index 47d9010..8177f5a 100755 --- a/get_sources.sh +++ b/get_sources.sh @@ -8,6 +8,7 @@ # Mike McLean # Pat Riehecky # Tyler Parsons +# Tuomo Soini ##################################################################### @@ -200,6 +201,13 @@ while read -r fsha fname ; do fi fi fi + if [ -e ${fname} -a ${CHECK} -eq 1 ]; then + # check hash sum and force download if wrong + downsum=$(${hashType} ${fname} | awk '{print $1}') + if [ "${fsha}" != "${downsum}" ]; then + rm -f ${fname} + fi + fi if [ ! -e "${fname}" ]; then for br in "${branches[@]}" do