summary refs log tree commit diff
path: root/guix/build/download.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/build/download.scm')
-rw-r--r--guix/build/download.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm
index c647d00f6b..46af149b2f 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -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