diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2018-02-15 17:37:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-15 17:37:21 +0100 |
commit | 3a5a241b3209f14f8801b902ba20b5cb0666c9df (patch) | |
tree | 5e763196ddad940b5d8c34bedb91cc9df86d790b /src | |
parent | d26b71fda61196033c27cbac0ffed2a94fd1fe4c (diff) | |
parent | 8f186722a97882ba41330684f37bfe8b8637eba8 (diff) |
Merge pull request #1873 from matthewbauer/fix-manpath
Set MANPATH in case man path isn’t set correctly.
Diffstat (limited to 'src')
-rw-r--r-- | src/libmain/shared.cc | 1 | ||||
-rw-r--r-- | src/libstore/globals.cc | 1 | ||||
-rw-r--r-- | src/libstore/globals.hh | 3 | ||||
-rw-r--r-- | src/libstore/local.mk | 1 |
4 files changed, 6 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 90a486716..7d888202b 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -262,6 +262,7 @@ void printVersion(const string & programName) void showManPage(const string & name) { restoreSignals(); + setenv("MANPATH", settings.nixManDir.c_str(), 1); execlp("man", "man", name.c_str(), NULL); throw SysError(format("command 'man %1%' failed") % name.c_str()); } diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index c6b508cbe..247040606 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -38,6 +38,7 @@ Settings::Settings() , nixConfDir(canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR))) , nixLibexecDir(canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR))) , nixBinDir(canonPath(getEnv("NIX_BIN_DIR", NIX_BIN_DIR))) + , nixManDir(canonPath(NIX_MAN_DIR)) , nixDaemonSocketFile(canonPath(nixStateDir + DEFAULT_SOCKET_PATH)) { buildUsersGroup = getuid() == 0 ? "nixbld" : ""; diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 508084d08..fd3fbec9f 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -82,6 +82,9 @@ public: /* The directory where the main programs are stored. */ Path nixBinDir; + /* The directory where the man pages are stored. */ + Path nixManDir; + /* File name of the socket the daemon listens to. */ Path nixDaemonSocketFile; diff --git a/src/libstore/local.mk b/src/libstore/local.mk index 239356aee..c7ac534e2 100644 --- a/src/libstore/local.mk +++ b/src/libstore/local.mk @@ -38,6 +38,7 @@ libstore_CXXFLAGS = \ -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ -DNIX_BIN_DIR=\"$(bindir)\" \ + -DNIX_MAN_DIR=\"$(mandir)\" \ -DSANDBOX_SHELL="\"$(sandbox_shell)\"" \ -DLSOF=\"$(lsof)\" |