about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-04T13·09+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-04T13·09+0000
commit1e16d2065503e213189d58db14de893f51545597 (patch)
tree746216248fb862e733c39b2213ef651f47c6d13e /src/libstore
parent9322b399f3a6fe3e0d60dfa991b06012c35b72f8 (diff)
* Install the worker in bindir, not libexecdir.
* Allow the worker path to be overriden through the NIX_WORKER
  environment variable.

Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/globals.cc1
-rw-r--r--src/libstore/globals.hh3
-rw-r--r--src/libstore/remote-store.cc5
3 files changed, 8 insertions, 1 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 466d0e0b26d7..e8c033db2ec1 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -15,6 +15,7 @@ string nixStateDir = "/UNINIT";
 string nixDBPath = "/UNINIT";
 string nixConfDir = "/UNINIT";
 string nixLibexecDir = "/UNINIT";
+string nixBinDir = "/UNINIT";
 
 bool keepFailed = false;
 bool keepGoing = false;
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index b93f5d62c1ef..fbb9e19d6ab6 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -32,6 +32,9 @@ extern string nixConfDir;
    stored. */
 extern string nixLibexecDir;
 
+/* nixBinDir is the directory where the main programs are stored. */
+extern string nixBinDir;
+
 
 /* Misc. global flags. */
 
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 0ed96bd23976..d8b629af63d0 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -3,6 +3,7 @@
 #include "remote-store.hh"
 #include "worker-protocol.hh"
 #include "archive.hh"
+#include "globals.hh"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -27,7 +28,9 @@ RemoteStore::RemoteStore()
 
     
     /* Start the worker. */
-    string worker = "nix-worker";
+    Path worker = getEnv("NIX_WORKER");
+    if (worker == "")
+        worker = nixBinDir + "/nix-worker";
 
     child = fork();