download: Delete the output file upon failure.
authorLudovic Courtès <ludo@gnu.org>
Sat, 21 Mar 2020 22:08:04 +0000 (23:08 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sat, 21 Mar 2020 23:02:23 +0000 (00:02 +0100)
commit4a6ec23a9780bd75a7e527bd0dfb1943347869bb
treedb3317449ea9ddebc7423e6cc428229100823d15
parent70236bae9ea7b23191a5fc452323b6fa20f31242
download: Delete the output file upon failure.

This allows ENOSPC conditions to be properly reported as such rather
than as a hash mismatch due to the availability of a truncated file.

Fixes <https://bugs.gnu.org/39993>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* guix/build/download.scm (url-fetch): In the failure case, delete FILE.
guix/build/download.scm