From a52127c052974abeb88daf300d3a173e5e25333a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 18 Jul 2014 11:07:33 +0200 Subject: [PATCH] guix system: init: Always use /var/guix as the target state directory. Fixes . Reported by Marek Benc . * guix/scripts/system.scm (copy-closure): Pass #:state-directory to 'register-path'. --- guix/scripts/system.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 10bf7e0c96..66ad9192c1 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -99,14 +99,19 @@ (define* (copy-closure item target #:key (log-port (current-error-port))) "Copy ITEM to the store under root directory TARGET and register it." (mlet* %store-monad ((refs (references* item))) - (let ((dest (string-append target item))) + (let ((dest (string-append target item)) + (state (string-append target "/var/guix"))) (format log-port "copying '~a'...~%" item) (copy-recursively item dest #:log (%make-void-port "w")) ;; Register ITEM; as a side-effect, it resets timestamps, etc. + ;; Explicitly use "TARGET/var/guix" as the state directory, to avoid + ;; reproducing the user's current settings; see + ;; . (unless (register-path item #:prefix target + #:state-directory state #:references refs) (leave (_ "failed to register '~a' under '~a'~%") item target))