pmerge: download to temp files then rename on completion
Any particular reason? This would have implications for the resume logic (we want the partial to hang around in a known place).
I didn't mean temp files with randomly generated names in /tmp or similar, more like how the Chrome browser names downloads in progress ($filename.crdownload).
This is mostly because I don't like how portage works when you cancel an emerge via SIGINT or similar that was trying to download a file but hadn't started pulling data down yet. In that case, the empty file isn't removed and then causes issues when you try to re-emerge the package last I checked.
Clearly this can be handled by cleaning up properly in those cases, but it would be nice to easily see distfiles that aren't completely downloaded via a glance at filenames.
For pkgcore, we should handle the empty file case without issue- it's just a resume. Portage wipes the file in that case and forces a FETCHCOMMAND rather than RESUMECOMMAND (it'll force FETCHCOMMAND if the fragment downloaded is below PORTAGE_FETCH_RESUME_MIN_SIZE in addition); both will wipe the file and start a fresh if the fragement on disk is greater in size than what checksums say it should be also.
If portage is choking on an empty file- then it's a bug in it's fetch implementation. Checking the code (portage/ebuild/fetch.py), it is supposed to handle this. Was this distfiles, or binpkgs?
Offhand, I don't hugely mind the notion of a mangled filename for partial downloads- or using a directory. That'll run into some issues w/ overlay fs's though- it'll complicate the logic for calculating if a download is worth trying (if you're grabbing a 1GB distfile and you have 1MB available in the fs, it's pointless to try).