mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
guix system: init: Overwrite the items in the target store.
Fixes <http://bugs.gnu.org/20722>. Reported by Eric Bavier <ericbavier@openmailbox.org>. * guix/scripts/system.scm (copy-item): Check whether DEST exists and remove it if it does.
This commit is contained in:
parent
aea9b23213
commit
78acff7c11
1 changed files with 7 additions and 0 deletions
|
@ -76,6 +76,13 @@ (define* (copy-item item target
|
|||
(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 <http://bugs.gnu.org/20722>), 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"))
|
||||
|
||||
|
|
Loading…
Reference in a new issue