summary refs log tree commit diff
path: root/src/nix-store
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-06-27 16:58:15 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-06-27 16:58:15 -0400
commit1aba0bf0fa831ffee628ae50730eade5b19a544f (patch)
tree802eb8026a8357d87123a73fc49282381b5fd734 /src/nix-store
parent42f5a2fc297f841d982f07062c653b27557a3cd5 (diff)
downloadguix-1aba0bf0fa831ffee628ae50730eade5b19a544f.tar.gz
nix-store -r: do substitutions in parallel
I.e. when multiple non-derivation arguments are passed to ‘nix-store
-r’ to be substituted, do them in parallel.
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 4768c2e7a2..23863525fe 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -62,7 +62,7 @@ static Path useDeriver(Path path)
 static PathSet realisePath(const Path & path)
 {
     if (isDerivation(path)) {
-        store->buildDerivations(singleton<PathSet>(path));
+        store->buildPaths(singleton<PathSet>(path));
         Derivation drv = derivationFromPath(*store, path);
 
         PathSet outputs;
@@ -101,13 +101,11 @@ static void opRealise(Strings opFlags, Strings opArgs)
     
     if (dryRun) return;
     
-    /* Build all derivations at the same time to exploit parallelism. */
-    PathSet drvPaths;
-    foreach (Strings::iterator, i, opArgs)
-        if (isDerivation(*i)) drvPaths.insert(*i);
-    store->buildDerivations(drvPaths);
+    /* Build all paths at the same time to exploit parallelism. */
+    PathSet paths(opArgs.begin(), opArgs.end());
+    store->buildPaths(paths);
 
-    foreach (Strings::iterator, i, opArgs) {
+    foreach (Paths::iterator, i, opArgs) {
         PathSet paths = realisePath(*i);
         foreach (PathSet::iterator, j, paths)
             cout << format("%1%\n") % *j;