From 78acff7c11507c68b63ad289b2bbe396602b9dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 10 Jun 2015 10:31:47 +0200 Subject: guix system: init: Overwrite the items in the target store. Fixes . Reported by Eric Bavier . * guix/scripts/system.scm (copy-item): Check whether DEST exists and remove it if it does. --- guix/scripts/system.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index f7c9d83e9a..aa9b3f838a 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -76,6 +76,13 @@ (let ((dest (string-append target item)) (state (string-append target "/var/guix"))) (format log-port "copying '~a'...~%" item) + + ;; Remove DEST if it exists to make sure that (1) we do not fail badly + ;; while trying to overwrite it (see ), and + ;; (2) we end up with the right contents. + (when (file-exists? dest) + (delete-file-recursively dest)) + (copy-recursively item dest #:log (%make-void-port "w")) -- cgit v1.2.3