[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/07: guix system: init: Overwrite the items in the target store.
From: |
Ludovic Courtès |
Subject: |
04/07: guix system: init: Overwrite the items in the target store. |
Date: |
Wed, 10 Jun 2015 12:00:45 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 78acff7c11507c68b63ad289b2bbe396602b9dcf
Author: Ludovic Courtès <address@hidden>
Date: Wed Jun 10 10:31:47 2015 +0200
guix system: init: Overwrite the items in the target store.
Fixes <http://bugs.gnu.org/20722>.
Reported by Eric Bavier <address@hidden>.
* guix/scripts/system.scm (copy-item): Check whether DEST exists and remove
it
if it does.
---
guix/scripts/system.scm | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index f7c9d83..aa9b3f8 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 <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"))
- branch master updated (329d13b -> 8ac0368), Ludovic Courtès, 2015/06/10
- 05/07: tests: Make the daemon socket explicit in guix-register test., Ludovic Courtès, 2015/06/10
- 02/07: ui: Replace the global 'symlink' binding., Ludovic Courtès, 2015/06/10
- 04/07: guix system: init: Overwrite the items in the target store.,
Ludovic Courtès <=
- 07/07: guix-register: Use C++11 range 'for' loop instead of 'foreach' macro., Ludovic Courtès, 2015/06/10
- 06/07: guix-register: Perform deduplication even when --prefix is passed., Ludovic Courtès, 2015/06/10
- 03/07: install: Really overwrite TARGET/var/guix/profiles/system-1-link., Ludovic Courtès, 2015/06/10
- 01/07: doc: Add 'help2man' to HACKING., Ludovic Courtès, 2015/06/10