1
0
Fork 0
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:
Eelco Dolstra 2019-03-14 13:50:07 +01:00
parent a3f37d87ea
commit 53522cb6ac
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 40 additions and 53 deletions

View file

@ -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;