diff options
author | Jeremy Thomerson <jeremy@thomersonfamily.com> | 2010-11-06 12:25:06 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-29 06:02:54 +0000 |
commit | a632d08fd2e87bb4951a99d208684bd6180cf41d (patch) | |
tree | bc0165ff62fcea3f6b36fc785c6aa5e62fb8e765 /abuild.in | |
parent | 9ee1b361e40ebe8a7aa82841839fb9f5f8f74e7f (diff) | |
download | abuild-a632d08fd2e87bb4951a99d208684bd6180cf41d.tar.gz abuild-a632d08fd2e87bb4951a99d208684bd6180cf41d.tar.bz2 abuild-a632d08fd2e87bb4951a99d208684bd6180cf41d.tar.xz abuild-a632d08fd2e87bb4951a99d208684bd6180cf41d.zip |
delete remote source files that fail the md5 checksum test
Currently, if the build server downloads a file that fails the md5sum check
for some reason (perhaps interrupted download, etc), the file is never deleted
so the build can not succeed until someone manually deletes the bad file. This
change deletes any file that is a remote source file / package that fails the
md5sum check. The subsequent rebuild will then be forced to download the file
again.
Diffstat (limited to 'abuild.in')
-rwxr-xr-x | abuild.in | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -155,7 +155,7 @@ sanitycheck() { } md5check() { - local dummy f + local dummy f endreturnval originalparams origin file if [ -z "$source" ]; then return 0 fi @@ -167,7 +167,26 @@ md5check() { fi fetch || return 1 msg "Checking md5sums..." - cd "$srcdir" && echo "$md5sums" | md5sum -c + IFS=$'\n' + endreturnval=0 + originalparams=$@ + set -- $source + for src in $md5sums; do + origin=$1; shift + echo "$src" | md5sum -c + if [ $? -ne 0 ]; then + is_remote $origin || continue + echo "Because the remote file above failed the md5sum check it will be deleted." + 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 + endreturnval=1 + fi + done + unset IFS + set -- $originalparams + return $endreturnval } # verify upstream sources |