retry download in case partial downloads are unsupported
abuild-fetch should delete .part file and retry download rather than exit with error if byte ranges are unsupported.
To reproduce, press ctrl-c during download so a .part
file is created, then re-run the fetch. It will exit with error rather than delete the .part
and retry.
>>> vault: Cleaning up srcdir
>>> vault: Cleaning up pkgdir
>>> vault: Fetching https://distfiles.alpinelinux.org/distfiles/v3.12/vault-1.4.3.tar.gz
Waiting for /var/cache/distfiles/v3.12/vault-1.4.3.tar.gz.lock ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404
>>> vault: Fetching vault-1.4.3.tar.gz::https://github.com/hashicorp/vault/archive/v1.4.3.tar.gz
Partial download found. Trying to resume.
** Resuming transfer from byte position 278528
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 123 100 123 0 0 2673 0 --:--:-- --:--:-- --:--:-- 2673
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
>>> ERROR: vault: fetch failed
>>> vault: Uninstalling dependencies...