Resume a part file only for the file it was begun for.

A part left by a download of other bytes under the same name was resumed, and the result failed its sha256 check
as if the download were damaged. A note beside the part now names the file it belongs to by the expected sha256;
a part of another file is deleted with a log line and the download starts over, and the same file is still resumed
from another server.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 22:30:46 -05:00
parent 9dcd73eebc
commit e0870b87b4
6 changed files with 92 additions and 18 deletions

View File

@@ -269,7 +269,7 @@ def install(layout, lock, progress=None, cancel=None, log=print, version='dev'):
try:
net.download(mirror + p['filename'], dest, sha256=p['sha256'], size=p['csize'], cancel=cancel,
progress=(lambda d, t, base=done_before: progress and progress('download', base + d, total)),
version=version)
version=version, log=lambda line: log(f'toolchain: {line}'))
last_error = None
break
except net.NoSpace as e: # another server has the same file for the same full disk