mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
Merge pull request #4350 from NixOS/curl_partial_download
fetchurl: resume download of curl exits with status code 18
This commit is contained in:
commit
ecf5a08831
|
@ -25,8 +25,16 @@ tryDownload() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
echo
|
echo
|
||||||
header "trying $url"
|
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=
|
success=
|
||||||
if $curl --fail "$url" --output "$downloadedFile"; then
|
if [ $curlexit -eq 0 ]; then
|
||||||
success=1
|
success=1
|
||||||
fi
|
fi
|
||||||
stopNest
|
stopNest
|
||||||
|
|
Loading…
Reference in a new issue