aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04 12:29:04 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04 12:29:04 +0000
commitc4f98941ed7e5e07786d92fc0be4435878f9b3cd (patch)
tree55d95e84f9ac65711144dd9456f71b0acc516ef8 /src/libstore/misc.cc
parent03427e76f11fe1d918020d28bdb69b2fb348ee96 (diff)
* nix-env --dry-run: show the total size of the substituter
downloads.
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index 1759f521c..85197adcf 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -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);