1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

* nix-env --dry-run: show the total size of the substituter

downloads.
This commit is contained in:
Eelco Dolstra 2008-08-04 12:29:04 +00:00
parent 03427e76f1
commit c4f98941ed
4 changed files with 15 additions and 5 deletions

View file

@ -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);
}