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
guix/build
|
@ -693,6 +693,13 @@ otherwise simply ignore them."
|
||||||
(()
|
(()
|
||||||
(format (current-error-port) "failed to download ~s from ~s~%"
|
(format (current-error-port) "failed to download ~s from ~s~%"
|
||||||
file url)
|
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))))
|
#f))))
|
||||||
|
|
||||||
;;; download.scm ends here
|
;;; download.scm ends here
|
||||||
|
|
Reference in New Issue