Possible to implement resumable port fetch?

Johan Kütt johan.kytt at gmail.com
Sat Mar 29 22:11:21 UTC 2025


>> On Mar 24, 2025, at 12:48, Sergey Fedorov wrote:
>> 
>> Is it something trivially doable or is it gonna require some rewrites?
> 
> I haven't looked at the code. But enabling the option to continue where it left off should be just a few lines of code, possibly in multiple places (once for distfiles, once for archives).
> 
> https://curl.se/libcurl/c/CURLOPT_RESUME_FROM.html
> 
> If MacPorts deletes the incomplete file, then that would have to be changed to keep the file. If MacPorts uses the final filename when downloading, it would probably need to change to using a temporary filename and renaming it to the final name when it's done. 

I would also expose the curl --limit-rate option via the “port" interface. In some places (some hotels for example) companies try to limit the bandwidth a user gets for large files and this may eventually interrupt an installation. I just recently had a case where a port fetch failed twice in a row. I then downloaded it manually using curl and limited download rate and it worked fine.



More information about the macports-dev mailing list