* Global configuration option `env-keep-derivations' to store pointer
to derivations in user environments. Nice for developers (since it prevents build-time-only dependencies from being GC'ed, in conjunction with `gc-keep-outputs'). Turned off by default.
This commit is contained in:
parent
b0aba6ec2a
commit
6a8ef36fe6
5 changed files with 72 additions and 35 deletions
|
|
@ -52,7 +52,7 @@ static void readSettings()
|
|||
string name, sep, value;
|
||||
is >> name >> sep >> value;
|
||||
if (sep != "=" || !is)
|
||||
throw Error(format("illegal configuration line `%1%'") % line);
|
||||
throw Error(format("illegal configuration line `%1%' in `%2%'") % line % settingsFile);
|
||||
|
||||
settings[name] = value;
|
||||
};
|
||||
|
|
@ -67,3 +67,13 @@ string querySetting(const string & name, const string & def)
|
|||
map<string, string>::iterator i = settings.find(name);
|
||||
return i == settings.end() ? def : i->second;
|
||||
}
|
||||
|
||||
|
||||
bool queryBoolSetting(const string & name, bool def)
|
||||
{
|
||||
string value = querySetting(name, def ? "true" : "false");
|
||||
if (value == "true") return true;
|
||||
else if (value == "false") return false;
|
||||
else throw Error(format("configuration option `%1%' should be either `true' or `false', not `%2%'")
|
||||
% name % value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue