1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 22:01:15 +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

@ -46,8 +46,11 @@ Path findOutput(const Derivation & drv, string id)
void queryMissing(const PathSet & targets,
PathSet & willBuild, PathSet & willSubstitute, PathSet & unknown)
PathSet & willBuild, PathSet & willSubstitute, PathSet & unknown,
unsigned long long & downloadSize)
{
downloadSize = 0;
PathSet todo(targets.begin(), targets.end()), done;
while (!todo.empty()) {
@ -86,6 +89,7 @@ void queryMissing(const PathSet & targets,
SubstitutablePathInfo info;
if (store->querySubstitutablePathInfo(p, info)) {
willSubstitute.insert(p);
downloadSize += info.downloadSize;
todo.insert(info.references.begin(), info.references.end());
} else
unknown.insert(p);