mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
Merge pull request #7889 from sidkshatriya/sorted-fetch-paths
Print the store paths to be fetched sorted by StorePath name()
This commit is contained in:
commit
ba0486f045
1 changed files with 12 additions and 2 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue