aboutsummaryrefslogtreecommitdiff
path: root/src/libmain/shared.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-01 15:15:32 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-01 15:15:32 -0400
commitf7f44f7c96eaa65b096e1448591e5790a58f3ad9 (patch)
tree1fdcfbbc31a1496075dd6796043c75426ee8da1c /src/libmain/shared.cc
parent5abd643c6d10f2cfa6e26652a9688a0263310094 (diff)
parentaa99005004bccc9be506a2a2f162f78bad4bcb41 (diff)
Merge commit 'aa99005004bccc9be506a2a2f162f78bad4bcb41' into ca-drv-exotic
Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r--src/libmain/shared.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index d4871a8e2..37664c065 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -84,8 +84,18 @@ void printMissing(ref<Store> store, const StorePathSet & willBuild,
downloadSizeMiB,
narSizeMiB);
}
- for (auto & i : willSubstitute)
- printMsg(lvl, " %s", store->printStorePath(i));
+ std::vector<const StorePath *> willSubstituteSorted = {};
+ std::for_each(willSubstitute.begin(), willSubstitute.end(),
+ [&](const StorePath &p) { willSubstituteSorted.push_back(&p); });
+ std::sort(willSubstituteSorted.begin(), willSubstituteSorted.end(),
+ [](const StorePath *lhs, const StorePath *rhs) {
+ if (lhs->name() == rhs->name())
+ return lhs->to_string() < rhs->to_string();
+ else
+ return lhs->name() < rhs->name();
+ });
+ for (auto p : willSubstituteSorted)
+ printMsg(lvl, " %s", store->printStorePath(*p));
}
if (!unknown.empty()) {
@@ -347,7 +357,7 @@ void parseCmdLine(const std::string & programName, const Strings & args,
void printVersion(const std::string & programName)
{
- std::cout << format("%1% (Nix) %2%") % programName % nixVersion << std::endl;
+ std::cout << fmt("%1% (Nix) %2%", programName, nixVersion) << std::endl;
if (verbosity > lvlInfo) {
Strings cfg;
#if HAVE_BOEHMGC