* Install the worker in bindir, not libexecdir.

* Allow the worker path to be overriden through the NIX_WORKER
  environment variable.
This commit is contained in:
Eelco Dolstra 2006-12-04 13:09:16 +00:00
parent 9322b399f3
commit 1e16d20655
6 changed files with 11 additions and 2 deletions

View file

@ -9,6 +9,7 @@ AM_CXXFLAGS = \
-DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \ -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
-DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \
-DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
-DNIX_BIN_DIR=\"$(bindir)\" \
-DNIX_VERSION=\"$(VERSION)\" \ -DNIX_VERSION=\"$(VERSION)\" \
-I$(srcdir)/.. ${aterm_include} -I$(srcdir)/../libutil \ -I$(srcdir)/.. ${aterm_include} -I$(srcdir)/../libutil \
-I$(srcdir)/../libstore -I$(srcdir)/../libstore

View file

@ -91,6 +91,7 @@ static void initAndRun(int argc, char * * argv)
nixDBPath = getEnv("NIX_DB_DIR", nixStateDir + "/db"); nixDBPath = getEnv("NIX_DB_DIR", nixStateDir + "/db");
nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR)); nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR));
nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR)); nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR));
nixBinDir = canonPath(getEnv("NIX_BIN_DIR", NIX_BIN_DIR));
/* Get some settings from the configuration file. */ /* Get some settings from the configuration file. */
thisSystem = querySetting("system", SYSTEM); thisSystem = querySetting("system", SYSTEM);

View file

@ -15,6 +15,7 @@ string nixStateDir = "/UNINIT";
string nixDBPath = "/UNINIT"; string nixDBPath = "/UNINIT";
string nixConfDir = "/UNINIT"; string nixConfDir = "/UNINIT";
string nixLibexecDir = "/UNINIT"; string nixLibexecDir = "/UNINIT";
string nixBinDir = "/UNINIT";
bool keepFailed = false; bool keepFailed = false;
bool keepGoing = false; bool keepGoing = false;

View file

@ -32,6 +32,9 @@ extern string nixConfDir;
stored. */ stored. */
extern string nixLibexecDir; extern string nixLibexecDir;
/* nixBinDir is the directory where the main programs are stored. */
extern string nixBinDir;
/* Misc. global flags. */ /* Misc. global flags. */

View file

@ -3,6 +3,7 @@
#include "remote-store.hh" #include "remote-store.hh"
#include "worker-protocol.hh" #include "worker-protocol.hh"
#include "archive.hh" #include "archive.hh"
#include "globals.hh"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -27,7 +28,9 @@ RemoteStore::RemoteStore()
/* Start the worker. */ /* Start the worker. */
string worker = "nix-worker"; Path worker = getEnv("NIX_WORKER");
if (worker == "")
worker = nixBinDir + "/nix-worker";
child = fork(); child = fork();

View file

@ -1,4 +1,4 @@
libexec_PROGRAMS = nix-worker bin_PROGRAMS = nix-worker
nix_worker_SOURCES = main.cc help.txt nix_worker_SOURCES = main.cc help.txt
nix_worker_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \ nix_worker_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \