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.master
parent
70236bae9e
commit
4a6ec23a97
|
@ -693,6 +693,13 @@ otherwise simply ignore them."
|
|||
(()
|
||||
(format (current-error-port) "failed to download ~s from ~s~%"
|
||||
file url)
|
||||
|
||||
;; Remove FILE in case we made an incomplete download, for example due
|
||||
;; to ENOSPC.
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(delete-file file))
|
||||
(const #f))
|
||||
#f))))
|
||||
|
||||
;;; download.scm ends here
|
||||
|
|
Reference in New Issue