Settings: Add bool get()

This commit is contained in:
Eelco Dolstra 2014-09-17 15:18:13 +02:00 committed by Ludovic Courtès
parent 6621195e48
commit 55939b1a4b
3 changed files with 12 additions and 2 deletions

View File

@ -1811,8 +1811,8 @@ void DerivationGoal::startBuilder()
/* Bind-mount a user-configurable set of directories from the
host file system. */
PathSet dirs = tokenizeString<StringSet>(settings.get("build-chroot-dirs", DEFAULT_CHROOT_DIRS));
PathSet dirs2 = tokenizeString<StringSet>(settings.get("build-extra-chroot-dirs", ""));
PathSet dirs = tokenizeString<StringSet>(settings.get("build-chroot-dirs", string(DEFAULT_CHROOT_DIRS)));
PathSet dirs2 = tokenizeString<StringSet>(settings.get("build-extra-chroot-dirs", string("")));
dirs.insert(dirs2.begin(), dirs2.end());
for (auto & i : dirs) {
size_t p = i.find('=');

View File

@ -130,6 +130,14 @@ Strings Settings::get(const string & name, const Strings & def)
}
bool Settings::get(const string & name, bool def)
{
bool res = def;
_get(res, name);
return res;
}
void Settings::update()
{
_get(tryFallback, "build-fallback");

View File

@ -25,6 +25,8 @@ struct Settings {
Strings get(const string & name, const Strings & def);
bool get(const string & name, bool def);
void update();
string pack();