[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
100/118: Settings: Add bool get()
From: |
Ludovic Courtès |
Subject: |
100/118: Settings: Add bool get() |
Date: |
Tue, 19 May 2015 14:45:58 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit 55939b1a4b34b904eedba90ac6c14efc6258f40d
Author: Eelco Dolstra <address@hidden>
Date: Wed Sep 17 15:18:13 2014 +0200
Settings: Add bool get()
---
nix/libstore/build.cc | 4 ++--
nix/libstore/globals.cc | 8 ++++++++
nix/libstore/globals.hh | 2 ++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 6d90ce9..36c6ea8 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -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('=');
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index 1cbe912..bb08a7d 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -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");
diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh
index 55f082e..c17e10d 100644
--- a/nix/libstore/globals.hh
+++ b/nix/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();
- 102/118: Remove bogus comment, (continued)
- 102/118: Remove bogus comment, Ludovic Courtès, 2015/05/19
- 80/118: Make readDirectory() return inode / file type, Ludovic Courtès, 2015/05/19
- 94/118: Doh, Ludovic Courtès, 2015/05/19
- 96/118: fix disappearing bash arguments, Ludovic Courtès, 2015/05/19
- 104/118: createDirs(): Handle ‘path’ being a symlink, Ludovic Courtès, 2015/05/19
- 103/118: nix-daemon: Close unnecessary fd, Ludovic Courtès, 2015/05/19
- 97/118: Introduce allowedRequisites feature, Ludovic Courtès, 2015/05/19
- 113/118: Clean up temp roots in a more C++ way, Ludovic Courtès, 2015/05/19
- 105/118: Remove some duplicate code, Ludovic Courtès, 2015/05/19
- 108/118: Improve error message if the daemon worker fails to start, Ludovic Courtès, 2015/05/19
- 100/118: Settings: Add bool get(),
Ludovic Courtès <=
- 106/118: Improved error message when encountering unsupported file types, Ludovic Courtès, 2015/05/19
- 114/118: nix-daemon: Call exit(), not _exit(), Ludovic Courtès, 2015/05/19
- 99/118: Add an 'optimiseStore' remote procedure call., Ludovic Courtès, 2015/05/19
- 107/118: Fix build on gcc < 4.7, Ludovic Courtès, 2015/05/19
- 98/118: Add disallowedReferences / disallowedRequisites, Ludovic Courtès, 2015/05/19
- 110/118: Make ~DerivationGoal more reliable, Ludovic Courtès, 2015/05/19
- 111/118: Don't use ADDR_LIMIT_3GB, Ludovic Courtès, 2015/05/19
- 115/118: Disable vacuuming the DB after garbage collection, Ludovic Courtès, 2015/05/19
- 117/118: Build derivations in a more predictable order, Ludovic Courtès, 2015/05/19
- 109/118: nix-store --gc: Don't warn about missing manifests directory, Ludovic Courtès, 2015/05/19