retryable_download: preserve partial download on network errors
`RetryableDownload#fetch` cleared the download cache before every retry, which removes the `.incomplete` file that `CurlDownloadStrategy` uses for resumable downloads. As a result `--continue-at -` never kicked in: each retry restarted from zero, making installs on unstable networks effectively impossible once a bottle was large enough to never finish within one uninterrupted session. Only clear the cache when the fully-downloaded file is known-bad (`ChecksumMismatchError` or `Resource::BottleManifest::Error`). For network-level `DownloadError`, keep the partial `.incomplete` file so the next attempt can resume via `--continue-at`. If that partial was itself corrupted mid-flight, the post-download checksum check will catch it on a later iteration and clear the cache via the existing path, so the loop is self-healing. Closes #21518. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
L
liukun committed
a2d76a841be78a4273775f1135facbb089e46837
Parent: 2983f2e