FreddieChopin / bleeding-edge-toolchain

All-in-one script to build bleeding-edge-toolchain for ARM microcontrollers
71 stars 24 forks source link

Always check that downloads are complete #13

Closed triffid closed 7 years ago

triffid commented 7 years ago

curl can leave partial downloads after network errors and the script will not retry (despite -C -) due to if ! -e $1 on the previous line

This pullreq makes curl always retry, since we don't have upstream filesize information available to compare against stat -c %s $1

Since curl returns error code 33 when the file is complete (claiming that server doesn't seem to support byte ranges), we trap this error, consider it a success, and continue

FreddieChopin commented 7 years ago

Hello again!

Thanks for your second contribution, which fixes the problem with partial downloads. I've pushed your change with very minor modifications:

I hope that my additions/changes are OK - if I messed something up, just let me know!

triffid commented 6 years ago

Looks lovely 👍 thanks!