diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-14T10·42+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-14T10·42+0100 |
commit | 61fd494d760d667649fa48665f9aa75ba88a1eb6 (patch) | |
tree | 2ce091b595c70f47af9eb50007fdcdcc0b032808 /src/libstore/globals.cc | |
parent | f9fc6acbf4eadd2d9018d3da14394fdfbddde5f6 (diff) | |
parent | f67f52751f21b2fe70b5a7352053f130eb6f0f59 (diff) |
Merge remote-tracking branch 'shlevy/ssh-substituter'
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 68add1982f43..1d4bcd94f7b8 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -79,6 +79,7 @@ void Settings::processEnvironment() #endif substituters.push_back(nixLibexecDir + "/nix/substituters/download-using-manifests.pl"); substituters.push_back(nixLibexecDir + "/nix/substituters/download-from-binary-cache.pl"); + substituters.push_back(nixLibexecDir + "/nix/substituters/download-via-ssh"); } else substituters = tokenizeString<Strings>(subs, ":"); } @@ -151,6 +152,7 @@ void Settings::update() get(gcKeepDerivations, "gc-keep-derivations"); get(autoOptimiseStore, "auto-optimise-store"); get(envKeepDerivations, "env-keep-derivations"); + get(sshSubstituterHosts, "ssh-substituter-hosts"); } @@ -182,6 +184,13 @@ void Settings::get(StringSet & res, const string & name) res.insert(ss.begin(), ss.end()); } +void Settings::get(Strings & res, const string & name) +{ + SettingsMap::iterator i = settings.find(name); + if (i == settings.end()) return; + res = tokenizeString<Strings>(i->second); +} + template<class N> void Settings::get(N & res, const string & name) { @@ -206,6 +215,17 @@ string Settings::pack() } +void Settings::unpack(const string &pack) { + Strings lines = tokenizeString<Strings>(pack, "\n"); + foreach (Strings::iterator, i, lines) { + string::size_type eq = i->find('='); + if (eq == string::npos) + throw Error("illegal option name/value"); + set(i->substr(0, eq), i->substr(eq + 1)); + } +} + + Settings::SettingsMap Settings::getOverrides() { return overrides; |