about summary refs log tree commit diff
path: root/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-11T21·52-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-11T21·52-0400
commit09a6321aeb7393cdb4b5af62d2e4106d83124fdf (patch)
treedc7066fa0145a37b4a82edd7b8a64430293a3bfa /src/nix-env/nix-env.cc
parent58ef4d9a95584fb89ebcf6222fbac6e698aa6b0b (diff)
Replace hasSubstitutes() with querySubstitutablePaths()
querySubstitutablePaths() takes a set of paths, so this greatly
reduces daemon <-> client latency.
Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r--src/nix-env/nix-env.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index 91b82c0d09e6..f06f23dad523 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -211,9 +211,12 @@ static int comparePriorities(EvalState & state,
 
 static bool isPrebuilt(EvalState & state, const DrvInfo & elem)
 {
+    assert(false);
+#if 0
     return
         store->isValidPath(elem.queryOutPath(state)) ||
         store->hasSubstitutes(elem.queryOutPath(state));
+#endif
 }
 
 
@@ -931,8 +934,7 @@ static void opQuery(Globals & globals,
 
 
     /* Query which paths have substitutes. */
-    SubstitutablePathInfos subs;
-    PathSet validPaths;
+    PathSet validPaths, substitutablePaths;
     if (printStatus) {
         PathSet paths;
         foreach (vector<DrvInfo>::iterator, i, elems2)
@@ -943,7 +945,7 @@ static void opQuery(Globals & globals,
                 i->setFailed();
             }
         validPaths = store->queryValidPaths(paths);
-        store->querySubstitutablePathInfos(paths, subs);
+        substitutablePaths = store->querySubstitutablePaths(paths);
     }
 
     
@@ -969,7 +971,7 @@ static void opQuery(Globals & globals,
 
             if (printStatus) {
                 Path outPath = i->queryOutPath(globals.state);
-                bool hasSubs = subs.find(outPath) != subs.end();
+                bool hasSubs = substitutablePaths.find(outPath) != substitutablePaths.end();
                 bool isInstalled = installed.find(outPath) != installed.end();
                 bool isValid = validPaths.find(outPath) != validPaths.end();
                 if (xmlOutput) {