about summary refs log tree commit diff
path: root/src/nix-env
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04T12·29+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04T12·29+0000
commitc4f98941ed7e5e07786d92fc0be4435878f9b3cd (patch)
tree55d95e84f9ac65711144dd9456f71b0acc516ef8 /src/nix-env
parent03427e76f11fe1d918020d28bdb69b2fb348ee96 (diff)
* nix-env --dry-run: show the total size of the substituter
  downloads.

Diffstat (limited to 'src/nix-env')
-rw-r--r--src/nix-env/nix-env.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index ee870f690668..085d83a5b98a 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -540,7 +540,8 @@ static void printMissing(EvalState & state, const DrvInfos & elems)
             targets.insert(i->queryOutPath(state));
     }
 
-    queryMissing(targets, willBuild, willSubstitute, unknown);
+    unsigned long long downloadSize;
+    queryMissing(targets, willBuild, willSubstitute, unknown, downloadSize);
 
     if (!willBuild.empty()) {
         printMsg(lvlInfo, format("the following derivations will be built:"));
@@ -549,7 +550,8 @@ static void printMissing(EvalState & state, const DrvInfos & elems)
     }
 
     if (!willSubstitute.empty()) {
-        printMsg(lvlInfo, format("the following paths will be downloaded/copied:"));
+        printMsg(lvlInfo, format("the following paths will be downloaded/copied (%.2f MiB):") %
+            (downloadSize / (1024.0 * 1024.0)));
         foreach (PathSet::iterator, i, willSubstitute)
             printMsg(lvlInfo, format("  %1%") % *i);
     }