about summary refs log tree commit diff
path: root/src/libmain
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/libmain
parent06699d4219019182d9e45ebc613ae1a1df23f257 (diff)
* Before a build, show the disk space that the downloaded store paths
  will approximately require.

Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/shared.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index d7879f035607..7c2d9203063e 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -54,25 +54,26 @@ void printGCWarning()
 
 void printMissing(const PathSet & paths)
 {
-    unsigned long long downloadSize;
+    unsigned long long downloadSize, narSize;
     PathSet willBuild, willSubstitute, unknown;
-    queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize);
+    queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
 
     if (!willBuild.empty()) {
-        printMsg(lvlInfo, format("the following derivations will be built:"));
+        printMsg(lvlInfo, format("these derivations will be built:"));
         foreach (PathSet::iterator, i, willBuild)
             printMsg(lvlInfo, format("  %1%") % *i);
     }
 
     if (!willSubstitute.empty()) {
-        printMsg(lvlInfo, format("the following paths will be downloaded/copied (%.2f MiB):") %
-            (downloadSize / (1024.0 * 1024.0)));
+        printMsg(lvlInfo, format("these paths will be downloaded/copied (%.2f MiB download, %.2f MiB unpacked):")
+            % (downloadSize / (1024.0 * 1024.0))
+            % (narSize / (1024.0 * 1024.0)));
         foreach (PathSet::iterator, i, willSubstitute)
             printMsg(lvlInfo, format("  %1%") % *i);
     }
 
     if (!unknown.empty()) {
-        printMsg(lvlInfo, format("don't know how to build the following paths%1%:")
+        printMsg(lvlInfo, format("don't know how to build these paths%1%:")
             % (readOnlyMode ? " (may be caused by read-only store access)" : ""));
         foreach (PathSet::iterator, i, unknown)
             printMsg(lvlInfo, format("  %1%") % *i);