summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-06-18 23:19:01 +0200
committerLudovic Courtès <ludo@gnu.org>2014-06-19 23:35:41 +0200
commiteef4096c14568deae818287d23ad5da6a2f41d92 (patch)
treef533af531cea2e6be7709e2a4801119b83a0669f
parentdc34393569aa4e5db4e4da8d8be8e827d2e94ab3 (diff)
downloadguix-eef4096c14568deae818287d23ad5da6a2f41d92.tar.gz
guix system: 'init' makes sure the target store directory exists.
* guix/scripts/system.scm (install): Before calling 'copy-closure', make
  sure directory (%store-prefix) under TARGET exists.
-rw-r--r--guix/scripts/system.scm10
1 files changed, 7 insertions, 3 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 345d8c3e5f..7a4a2a6a06 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -100,9 +100,13 @@ When GRUB? is true, install GRUB on DEVICE, using GRUB.CFG."
 
   (if (string=? target "/")
       (warning (_ "initializing the current root file system~%"))
-      ;; Copy items to the new store.
-      (for-each (cut copy-closure store <> target #:log-port log-port)
-                to-copy))
+      (begin
+        ;; Make sure the target store exists.
+        (mkdir-p (string-append target (%store-prefix)))
+
+        ;; Copy items to the new store.
+        (for-each (cut copy-closure store <> target #:log-port log-port)
+                  to-copy)))
 
   ;; Create a bunch of additional files.
   (format log-port "populating '~a'...~%" target)