From c4f98941ed7e5e07786d92fc0be4435878f9b3cd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Aug 2008 12:29:04 +0000 Subject: * nix-env --dry-run: show the total size of the substituter downloads. --- src/nix-env/nix-env.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/nix-env') diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index ee870f6906..085d83a5b9 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); } -- cgit 1.4.1