Commit 90899669 authored by Timo Teräs's avatar Timo Teräs

abuild: rename distfile copy when checksum does not match

The previous deletion of file did not work properly at all. Fix
this instead to rename the file, so we keep the previous download.
This allows builders to redownload upstream file if the checksum
has been changed in aports.
parent 580dd46c
...@@ -247,11 +247,14 @@ sumcheck() { ...@@ -247,11 +247,14 @@ sumcheck() {
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
endreturnval=1 endreturnval=1
is_remote $origin || continue 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." 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 "Renaming: ${file##*/} to ${file##*/}.$csum"
echo "Deleting: $file" mv "$file" "$file.$csum"
rm $file
fi fi
done done
unset IFS unset IFS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment