bug#81508: 31.0.50; package.el archive contents download robustness issues

Philip Kaludercic <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
Sean Whitton <[email protected]> writes:

> If there is an ENOSPC in the middle of writing the archive-contents
> file, the truncated file is left behind.  This is because
> package--download-one-archive uses plain write-region instead of writing
> into a temporary file and then atomically renaming it into place.

I feel like this is not the only place where something like this could
go wrong, so it would be useful to perhaps have some functionality
directly in url.el to download a file and rename it atomically, since
IIRC there are a number of edge-cases to consider here.

> Worse, if a truncated file has been left behind,
> package--read-archive-file errors instead of trying to delete and
> re-download the file.

Assuming we fix the above, should we also make this function more robust
by e.g. trying to re-download the archive if it is malformed?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.