about summary refs log tree commit diff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-11-17T14·31+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-11-17T14·31+0000
commitbdf089f46362b8c9defefa0a14e3198582e12818 (patch)
tree08ca2824d09cee5b00cbf9b9fc9294f326120598 /src/libstore/misc.cc
parent06699d4219019182d9e45ebc613ae1a1df23f257 (diff)
* Before a build, show the disk space that the downloaded store paths
  will approximately require.

Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index d52dd6346c7a..01d6a97ae6fb 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -48,9 +48,9 @@ Path findOutput(const Derivation & drv, string id)
 
 void queryMissing(const PathSet & targets,
     PathSet & willBuild, PathSet & willSubstitute, PathSet & unknown,
-    unsigned long long & downloadSize)
+    unsigned long long & downloadSize, unsigned long long & narSize)
 {
-    downloadSize = 0;
+    downloadSize = narSize = 0;
     
     PathSet todo(targets.begin(), targets.end()), done;
 
@@ -88,6 +88,7 @@ void queryMissing(const PathSet & targets,
             if (store->querySubstitutablePathInfo(p, info)) {
                 willSubstitute.insert(p);
                 downloadSize += info.downloadSize;
+                narSize += info.narSize;
                 todo.insert(info.references.begin(), info.references.end());
             } else
                 unknown.insert(p);