diff --git a/abuild.in b/abuild.in index 49e2630..d4614d1 100644 --- a/abuild.in +++ b/abuild.in @@ -247,11 +247,14 @@ sumcheck() { if [ $? -ne 0 ]; then endreturnval=1 is_remote $origin || continue - echo "Because the remote file above failed the ${algo}sum check it will be deleted." + + local csum="${src:0:8}" + local file="$SRCDEST/$(filename_from_uri $origin)" + + echo "Because the remote file above failed the ${algo}sum check it will be renamed." echo "Rebuilding will cause it to re-download which in some cases may fix the problem." - file=`echo "$src" | sed 's/.*[ \t\n]\(.*\)/\1/'` - echo "Deleting: $file" - rm $file + echo "Renaming: ${file##*/} to ${file##*/}.$csum" + mv "$file" "$file.$csum" fi done unset IFS