From: Pat Riehecky riehecky@fnal.gov
Not too sure where it happened, but I got some bad source archives off of git.c.o. Could be the connection terminated and I didn't notice, could be something else.
Anyway, I've added an optional check to verify the SHA sum of downloaded files.
Pat Riehecky (1): Added optional check for sha1sum of downloaded source file
get_sources.sh | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
From: Pat Riehecky riehecky@fnal.gov
--- get_sources.sh | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/get_sources.sh b/get_sources.sh index b43cb51..5533cfe 100755 --- a/get_sources.sh +++ b/get_sources.sh @@ -19,6 +19,7 @@ fi #parse command line args BRANCH='' QUIET='' +CHECK=0 while (($# > 0)) do case $1 in @@ -32,6 +33,11 @@ do surl=$2 shift 2 ;; + --check) + #verify the sha1sum of the downloaded file + CHECK=1 + shift + ;; -q) # Be less chatty QUIET='--silent' @@ -103,5 +109,12 @@ while read -r fsha fname ; do else echo "${fname} exists. skipping" fi + if [ ${CHECK} -eq 1 ]; then + downsum=$(sha1sum ${fname} | awk '{print $1}') + if [ ${fsha} != ${downsum} ]; then + rm -f ${fname} + echo "failed to download ${fname}" >&2 + fi + fi fi done < "${meta}"
pushed
On 06/24/2014 08:46 AM, Pat Riehecky wrote:
From: Pat Riehecky riehecky@fnal.gov
get_sources.sh | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/get_sources.sh b/get_sources.sh index b43cb51..5533cfe 100755 --- a/get_sources.sh +++ b/get_sources.sh @@ -19,6 +19,7 @@ fi #parse command line args BRANCH='' QUIET='' +CHECK=0 while (($# > 0)) do case $1 in @@ -32,6 +33,11 @@ do surl=$2 shift 2 ;;
- --check)
#verify the sha1sum of the downloaded file
CHECK=1
shift
;; -q) # Be less chatty QUIET='--silent'
@@ -103,5 +109,12 @@ while read -r fsha fname ; do else echo "${fname} exists. skipping" fi
- if [ ${CHECK} -eq 1 ]; then
downsum=$(sha1sum ${fname} | awk '{print $1}')
if [ ${fsha} != ${downsum} ]; then
rm -f ${fname}
echo "failed to download ${fname}" >&2
fi
- fi fi
done < "${meta}"