diff options
author | Domen Kožar <domen@dev.si> | 2014-10-01 13:58:42 +0200 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2014-10-01 13:58:42 +0200 |
commit | fd48e801d29adc327fd943e849651b9c85cd7320 (patch) | |
tree | 5e579c76c48da95ef225974bac29ed8ca7ec452f /pkgs/build-support | |
parent | 21c12b40652d4aee0f3b58bcd8993c66733f9bbe (diff) |
fetchurl: resume download of curl exits with status code 18
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/fetchurl/builder.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh index 0c6e16551b4a3..48881bdb2844f 100644 --- a/pkgs/build-support/fetchurl/builder.sh +++ b/pkgs/build-support/fetchurl/builder.sh @@ -25,8 +25,16 @@ tryDownload() { local url="$1" echo header "trying $url" + local curlexit=18; + + # if we get error code 18, resume partial download + while [ $curlexit -eq 18 ]; do + $curl -C - --fail "$url" --output "$downloadedFile" + local curlexit=$?; + done + success= - if $curl --fail "$url" --output "$downloadedFile"; then + if [ $curlexit -eq 0 ]; then success=1 fi stopNest |