mirror of
https://github.com/NixOS/nix
synced 2025-07-03 02:01:48 +02:00
findRoots(): Add 'censor' parameter
This is less brittle than filtering paths after the fact in nix-daemon.
This commit is contained in:
parent
a3f37d87ea
commit
53522cb6ac
7 changed files with 40 additions and 53 deletions
|
@ -427,7 +427,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
|
|||
maybeUseOutputs(store->followLinksToStorePath(i), useOutput, forceRealise),
|
||||
referrers, true, settings.gcKeepOutputs, settings.gcKeepDerivations);
|
||||
}
|
||||
Roots roots = store->findRoots();
|
||||
Roots roots = store->findRoots(false);
|
||||
for (auto & [target, links] : roots)
|
||||
if (referrers.find(target) != referrers.end())
|
||||
for (auto & link : links)
|
||||
|
@ -591,7 +591,7 @@ static void opGC(Strings opFlags, Strings opArgs)
|
|||
if (!opArgs.empty()) throw UsageError("no arguments expected");
|
||||
|
||||
if (printRoots) {
|
||||
Roots roots = store->findRoots();
|
||||
Roots roots = store->findRoots(false);
|
||||
for (auto & [target, links] : roots)
|
||||
for (auto & link : links)
|
||||
cout << link << " -> " << target << std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue