about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-04T16·00+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-04T16·00+0200
commitd5a076c36f6588366fd9766c1054807bbbfd8559 (patch)
treea22f662fca27e2ae43bf87aa5c81288cd704a538 /src/libstore/build.cc
parent4d73e2e893850d032770373b026854228c61dc8e (diff)
Add option ‘build-extra-chroot-dirs’
This is useful for extending (rather than overriding) the default set
of chroot paths.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index e3d96d931ff9..5c672227bca4 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1792,12 +1792,15 @@ void DerivationGoal::startBuilder()
 
         /* Bind-mount a user-configurable set of directories from the
            host file system. */
-        foreach (StringSet::iterator, i, settings.dirsInChroot) {
-            size_t p = i->find('=');
+        PathSet dirs = tokenizeString<StringSet>(settings.get(string("build-chroot-dirs"), DEFAULT_CHROOT_DIRS));
+        PathSet dirs2 = tokenizeString<StringSet>(settings.get(string("build-extra-chroot-dirs"), ""));
+        dirs.insert(dirs2.begin(), dirs2.end());
+        for (auto & i : dirs) {
+            size_t p = i.find('=');
             if (p == string::npos)
-                dirsInChroot[*i] = *i;
+                dirsInChroot[i] = i;
             else
-                dirsInChroot[string(*i, 0, p)] = string(*i, p + 1);
+                dirsInChroot[string(i, 0, p)] = string(i, p + 1);
         }
         dirsInChroot[tmpDir] = tmpDir;