diff options
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 296cc4ac8029..907627b6591c 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -34,6 +34,9 @@ static bool settingsRead = false; static std::map<string, Strings> settings; +/* Overriden settings. */ +std::map<string, Strings> settingsCmdline; + string & at(Strings & ss, unsigned int n) { @@ -73,6 +76,8 @@ static void readSettings() advance(i, 2); settings[name] = Strings(i, tokens.end()); }; + + settings.insert(settingsCmdline.begin(), settingsCmdline.end()); settingsRead = true; } @@ -118,6 +123,13 @@ unsigned int queryIntSetting(const string & name, unsigned int def) } +void overrideSetting(const string & name, const Strings & value) +{ + if (settingsRead) settings[name] = value; + settingsCmdline[name] = value; +} + + void reloadSettings() { settingsRead = false; |