[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/10: guix system: Make 'init' idempotent again.
From: |
Ludovic Courtès |
Subject: |
05/10: guix system: Make 'init' idempotent again. |
Date: |
Tue, 3 Jul 2018 11:50:14 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit f3f1d0a5578b4ad6d85494283eedfaa62b28fe2c
Author: Ludovic Courtès <address@hidden>
Date: Tue Jul 3 11:24:32 2018 +0200
guix system: Make 'init' idempotent again.
This fixes a regression introduced in
df2f6400b1fbc282ef4d6dd7124ea1c17adc23c2: since the new
'register-path' (actually 'reset-timestamps') would make files
read-only, 'delete-file-recursively' would fail to delete them. Thus,
re-running 'guix system init' on an already-populated store would fail
with a 'delete-file' EPERM.
* guix/scripts/system.scm (copy-item): Use 'lstat' instead of
'file-exists?'. Call 'make-file-writable' on each directory below
DEST.
---
guix/scripts/system.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 92e9223..69bd05b 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -126,7 +126,11 @@ REFERENCES as its set of references."
;; 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)
+ (when (false-if-exception (lstat dest))
+ (for-each make-file-writable
+ (find-files dest (lambda (file stat)
+ (eq? 'directory (stat:type stat)))
+ #:directories? #t))
(delete-file-recursively dest))
(copy-recursively item dest
- branch master updated (13f5eb3 -> a51cf16), Ludovic Courtès, 2018/07/03
- 02/10: syscalls: Define AT_SYMLINK_NOFOLLOW et al., Ludovic Courtès, 2018/07/03
- 01/10: deduplication: Remove 'false-if-system-error', now unused., Ludovic Courtès, 2018/07/03
- 03/10: database: 'reset-timestamps' now correctly handles symlinks., Ludovic Courtès, 2018/07/03
- 04/10: ui: Report file names in 'system-error' exceptions from 'delete-file'., Ludovic Courtès, 2018/07/03
- 05/10: guix system: Make 'init' idempotent again.,
Ludovic Courtès <=
- 07/10: tests: basic: Wait for /var/run/shepherd/socket to be ready., Ludovic Courtès, 2018/07/03
- 06/10: Revert "packages: Optimize 'package-transitive-supported-systems'.", Ludovic Courtès, 2018/07/03
- 10/10: gnu: Update stellarium to 0.18.0., Ludovic Courtès, 2018/07/03
- 08/10: gnu: Add pocl., Ludovic Courtès, 2018/07/03
- 09/10: gnu: emacs-helm-system-packages: Update to 1.10.0., Ludovic Courtès, 2018/07/03