summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-07-18 11:07:33 +0200
committerLudovic Courtès <ludo@gnu.org>2014-07-18 20:40:51 +0200
commita52127c052974abeb88daf300d3a173e5e25333a (patch)
treecc5d655be5c739e3fae5f6b724fbc336813012dd
parent689142cd759457f375230a00dc719ddc00dc2fe4 (diff)
downloadguix-a52127c052974abeb88daf300d3a173e5e25333a.tar.gz
guix system: init: Always use /var/guix as the target state directory.
Fixes <http://bugs.gnu.org/18049>.
Reported by Marek Benc <merkur32@gmail.com>.

* guix/scripts/system.scm (copy-closure): Pass #:state-directory to
  'register-path'.
-rw-r--r--guix/scripts/system.scm7
1 files changed, 6 insertions, 1 deletions
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 @@
                        #: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
+      ;; <http://bugs.gnu.org/18049>.
       (unless (register-path item
                              #:prefix target
+                             #:state-directory state
                              #:references refs)
         (leave (_ "failed to register '~a' under '~a'~%")
                item target))