guix system: Make 'init' idempotent again.
authorLudovic Courtès <ludo@gnu.org>
Tue, 3 Jul 2018 09:24:32 +0000 (11:24 +0200)
committerLudovic Courtès <ludo@gnu.org>
Tue, 3 Jul 2018 15:50:04 +0000 (17:50 +0200)
commitf3f1d0a5578b4ad6d85494283eedfaa62b28fe2c
tree7fb0f73afbfe4e6efb5db521d735fbdd011291f1
parent90b144d22d001a832a8fb345a7d71e9c657c0c86
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