From 7a108d904e9d3bb9ef94487c37b35a050c315a52 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 31 Aug 2017 17:57:04 +0200 Subject: Fix verbosity level for nix build --dry-run --- src/libmain/shared.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/libmain/shared.cc') diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index aa28ff2e53a4..6393d80bbf00 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -34,40 +34,40 @@ void printGCWarning() } -void printMissing(ref store, const PathSet & paths) +void printMissing(ref store, const PathSet & paths, Verbosity lvl) { unsigned long long downloadSize, narSize; PathSet willBuild, willSubstitute, unknown; store->queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize); - printMissing(store, willBuild, willSubstitute, unknown, downloadSize, narSize); + printMissing(store, willBuild, willSubstitute, unknown, downloadSize, narSize, lvl); } void printMissing(ref store, const PathSet & willBuild, const PathSet & willSubstitute, const PathSet & unknown, - unsigned long long downloadSize, unsigned long long narSize) + unsigned long long downloadSize, unsigned long long narSize, Verbosity lvl) { if (!willBuild.empty()) { - printInfo(format("these derivations will be built:")); + printMsg(lvl, "these derivations will be built:"); Paths sorted = store->topoSortPaths(willBuild); reverse(sorted.begin(), sorted.end()); for (auto & i : sorted) - printInfo(format(" %1%") % i); + printMsg(lvl, fmt(" %s", i)); } if (!willSubstitute.empty()) { - printInfo(format("these paths will be fetched (%.2f MiB download, %.2f MiB unpacked):") - % (downloadSize / (1024.0 * 1024.0)) - % (narSize / (1024.0 * 1024.0))); + printMsg(lvl, fmt("these paths will be fetched (%.2f MiB download, %.2f MiB unpacked):", + downloadSize / (1024.0 * 1024.0), + narSize / (1024.0 * 1024.0))); for (auto & i : willSubstitute) - printInfo(format(" %1%") % i); + printMsg(lvl, fmt(" %s", i)); } if (!unknown.empty()) { - printInfo(format("don't know how to build these paths%1%:") - % (settings.readOnlyMode ? " (may be caused by read-only store access)" : "")); + printMsg(lvl, fmt("don't know how to build these paths%s:", + (settings.readOnlyMode ? " (may be caused by read-only store access)" : ""))); for (auto & i : unknown) - printInfo(format(" %1%") % i); + printMsg(lvl, fmt(" %s", i)); } } -- cgit 1.4.1