about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-04-04T09·16+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-04-04T09·16+0200
commit258897c265a6d6575f1669a896ab6f5ab92337c3 (patch)
treed904bafc05a246d50abe2cedf30515e1bccd6907
parent239841787bfbf499256c0bb9358f058a8243d60a (diff)
Complain if /homeless-shelter exists
-rw-r--r--src/libstore/build.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 73223bc1ad84..137056810925 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1697,7 +1697,8 @@ void DerivationGoal::startBuilder()
        if HOME is not set, but they will just assume that the settings file
        they are looking for does not exist if HOME is set but points to some
        non-existing path. */
-    env["HOME"] = "/homeless-shelter";
+    Path homeDir = "/homeless-shelter";
+    env["HOME"] = homeDir;
 
     /* Tell the builder where the Nix store is.  Usually they
        shouldn't care, but this is useful for purity checking (e.g.,
@@ -1946,6 +1947,9 @@ void DerivationGoal::startBuilder()
 
     else {
 
+        if (pathExists(homeDir))
+            throw Error(format("directory `%1%' exists; please remove it") % homeDir);
+
         /* We're not doing a chroot build, but we have some valid
            output paths.  Since we can't just overwrite or delete
            them, we have to do hash rewriting: i.e. in the