diff options
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/build.cc | 4 | ||||
-rw-r--r-- | src/libstore/globals.cc | 8 | ||||
-rw-r--r-- | src/libstore/globals.hh | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 0d290d7879b0..8e328bae3815 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1792,8 +1792,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('='); diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index b410cea2ee76..c5abeee282a3 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -136,6 +136,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"); diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 55f082e56e63..c17e10d7c32d 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -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(); |