diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2020-06-19 14:22:06 -0400 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2020-06-19 14:22:06 -0400 |
commit | 2796b01e863bf3a6d28cc89bb46c6388d8b73fbc (patch) | |
tree | 20fec553f605b3a6f7474cd337eb457c9a8a56f1 /src/libmain | |
parent | 5e631e3304aaf00b912c12025debfd35942a0ca9 (diff) | |
parent | 424bb5819f736af7413c343d462663474222eaac (diff) |
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
Diffstat (limited to 'src/libmain')
-rw-r--r-- | src/libmain/shared.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index dc6d5e413..1cb422967 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -48,7 +48,10 @@ void printMissing(ref<Store> store, const StorePathSet & willBuild, unsigned long long downloadSize, unsigned long long narSize, Verbosity lvl) { if (!willBuild.empty()) { - printMsg(lvl, "these derivations will be built:"); + if (willBuild.size() == 1) + printMsg(lvl, fmt("this derivation will be built:")); + else + printMsg(lvl, fmt("these %d derivations will be built:", willBuild.size())); auto sorted = store->topoSortPaths(willBuild); reverse(sorted.begin(), sorted.end()); for (auto & i : sorted) @@ -56,9 +59,18 @@ void printMissing(ref<Store> store, const StorePathSet & willBuild, } if (!willSubstitute.empty()) { - printMsg(lvl, fmt("these paths will be fetched (%.2f MiB download, %.2f MiB unpacked):", - downloadSize / (1024.0 * 1024.0), - narSize / (1024.0 * 1024.0))); + const float downloadSizeMiB = downloadSize / (1024.f * 1024.f); + const float narSizeMiB = narSize / (1024.f * 1024.f); + if (willSubstitute.size() == 1) { + printMsg(lvl, fmt("this path will be fetched (%.2f MiB download, %.2f MiB unpacked):", + downloadSizeMiB, + narSizeMiB)); + } else { + printMsg(lvl, fmt("these %d paths will be fetched (%.2f MiB download, %.2f MiB unpacked):", + willSubstitute.size(), + downloadSizeMiB, + narSizeMiB)); + } for (auto & i : willSubstitute) printMsg(lvl, fmt(" %s", store->printStorePath(i))); } |