[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
199/376: Settings: Add bool get()
From: |
Ludovic Courtès |
Subject: |
199/376: Settings: Add bool get() |
Date: |
Wed, 28 Jan 2015 22:05:00 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit d37d0127742a7574d4f48860de2e82fb523e508a
Author: Eelco Dolstra <address@hidden>
Date: Wed Sep 17 15:18:13 2014 +0200
Settings: Add bool get()
---
src/download-via-ssh/download-via-ssh.cc | 2 +-
src/libstore/build.cc | 4 ++--
src/libstore/globals.cc | 8 ++++++++
src/libstore/globals.hh | 2 ++
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/download-via-ssh/download-via-ssh.cc
b/src/download-via-ssh/download-via-ssh.cc
index d221fa8..b64455e 100644
--- a/src/download-via-ssh/download-via-ssh.cc
+++ b/src/download-via-ssh/download-via-ssh.cc
@@ -108,7 +108,7 @@ int main(int argc, char * * argv)
/* Pass on the location of the daemon client's SSH
authentication socket. */
- string sshAuthSock = settings.get("ssh-auth-sock", "");
+ string sshAuthSock = settings.get("ssh-auth-sock", string(""));
if (sshAuthSock != "") setenv("SSH_AUTH_SOCK", sshAuthSock.c_str(), 1);
string host = settings.sshSubstituterHosts.front();
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 0d290d7..8e328ba 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 b410cea..c5abeee 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 55f082e..c17e10d 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();
- 186/376: Remove pointless "license" section, (continued)
- 186/376: Remove pointless "license" section, Ludovic Courtès, 2015/01/28
- 190/376: Undocument NIX_OTHER_STORES, Ludovic Courtès, 2015/01/28
- 184/376: Nicer file names for the release notes, Ludovic Courtès, 2015/01/28
- 198/376: Derive Emacs nix-mode from prog-mode., Ludovic Courtès, 2015/01/28
- 179/376: Fix JAR installation, Ludovic Courtès, 2015/01/28
- 194/376: Style tweak, Ludovic Courtès, 2015/01/28
- 192/376: Fix references to version.txt, Ludovic Courtès, 2015/01/28
- 188/376: Drop "service deployment" bla bla, Ludovic Courtès, 2015/01/28
- 185/376: Release notes: Use a section per version, Ludovic Courtès, 2015/01/28
- 191/376: Drop separate release notes, Ludovic Courtès, 2015/01/28
- 199/376: Settings: Add bool get(),
Ludovic Courtès <=
- 193/376: Fix parallel make of manpages, Ludovic Courtès, 2015/01/28
- 195/376: Make troubleshooting an appendix, Ludovic Courtès, 2015/01/28
- 197/376: Remove unhelpful suggestion, Ludovic Courtès, 2015/01/28
- 196/376: Delete bugs.xml, Ludovic Courtès, 2015/01/28
- 183/376: Manual build fixes, Ludovic Courtès, 2015/01/28
- 203/376: Remove unused w3m dependency, Ludovic Courtès, 2015/01/28
- 182/376: Merge branch 'master' of github.com:thatdocslady/nix, Ludovic Courtès, 2015/01/28
- 207/376: Remove debug statement, Ludovic Courtès, 2015/01/28
- 204/376: Install some pkgconfig files, Ludovic Courtès, 2015/01/28
- 206/376: Store.so: Add dependency on libnixutil, Ludovic Courtès, 2015/01/28