guix system: Invoking 'guix system init' twice keeps timestamps zeroed.
Fixes a bug whereby running 'guix system init config.scm /mnt' twice
would, on the second run, change timestamps in /mnt/gnu/store from the
Epoch to now. This is because the 'register-path' call would bypass the
'reset-timestamps' phase altogether in that case, as a consequence of
commit bb3b6ccb05
.
Reported by Christopher Baines.
* guix/scripts/system.scm (install): When TARGET/var/guix exists, delete
it. As a side-effect, this ensures that later on, the 'register-path'
call invokes 'reset-timestamps' on all the copied store items.
This commit is contained in:
parent
652163154c
commit
6c843907e9
|
@ -235,6 +235,13 @@ When INSTALL-BOOTLOADER? is true, install bootloader using BOOTCFG."
|
||||||
the ownership of '~a' may be incorrect!~%")
|
the ownership of '~a' may be incorrect!~%")
|
||||||
target))
|
target))
|
||||||
|
|
||||||
|
;; If a previous installation was attempted, make sure we start anew; in
|
||||||
|
;; particular, we don't want to keep a store database that might not
|
||||||
|
;; correspond to what we're actually putting in the store.
|
||||||
|
(let ((state (string-append target "/var/guix")))
|
||||||
|
(when (file-exists? state)
|
||||||
|
(delete-file-recursively state)))
|
||||||
|
|
||||||
(chmod target #o755)
|
(chmod target #o755)
|
||||||
(let ((os-dir (derivation->output-path os-drv))
|
(let ((os-dir (derivation->output-path os-drv))
|
||||||
(format (lift format %store-monad))
|
(format (lift format %store-monad))
|
||||||
|
|
Loading…
Reference in New Issue