get_sources: download source again if file checksum has changed

This functionality requires use of option -c.

Signed-off-by: Tuomo Soini <tis@foobar.fi>
This commit is contained in:
Tuomo Soini 2016-11-15 15:16:21 +02:00 committed by Johnny Hughes
parent 696c29f5c9
commit bd83a7926b

View file

@ -8,6 +8,7 @@
# Mike McLean <mikem@redhat.com> # Mike McLean <mikem@redhat.com>
# Pat Riehecky <riehecky@fnal.gov> # Pat Riehecky <riehecky@fnal.gov>
# Tyler Parsons <tparsons@fnal.gov> # Tyler Parsons <tparsons@fnal.gov>
# Tuomo Soini <tis@foobar.fi>
##################################################################### #####################################################################
@ -200,6 +201,13 @@ while read -r fsha fname ; do
fi fi
fi 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 if [ ! -e "${fname}" ]; then
for br in "${branches[@]}" for br in "${branches[@]}"
do do