forked from lix-project/lix
nix-store --gc --print-roots: Sort output
This commit is contained in:
parent
578ed7a259
commit
86f3b94c8c
|
@ -592,9 +592,13 @@ static void opGC(Strings opFlags, Strings opArgs)
|
||||||
|
|
||||||
if (printRoots) {
|
if (printRoots) {
|
||||||
Roots roots = store->findRoots(false);
|
Roots roots = store->findRoots(false);
|
||||||
|
std::set<std::pair<Path, Path>> roots2;
|
||||||
|
// Transpose and sort the roots.
|
||||||
for (auto & [target, links] : roots)
|
for (auto & [target, links] : roots)
|
||||||
for (auto & link : links)
|
for (auto & link : links)
|
||||||
cout << link << " -> " << target << std::endl;
|
roots2.emplace(link, target);
|
||||||
|
for (auto & [link, target] : roots2)
|
||||||
|
std::cout << link << " -> " << target << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue