mirror of
https://github.com/NixOS/nix
synced 2025-07-02 05:11:47 +02:00
nix-store -q --roots: Respect the gc-keep-outputs/gc-keep-derivations settings
So if a path is not garbage solely because it's reachable from a root due to the gc-keep-outputs or gc-keep-derivations settings, ‘nix-store -q --roots’ now shows that root.
This commit is contained in:
parent
06f62defe6
commit
2754a07ead
9 changed files with 63 additions and 24 deletions
|
@ -334,6 +334,7 @@ static void performOp(unsigned int clientVersion,
|
|||
|
||||
case wopQueryReferences:
|
||||
case wopQueryReferrers:
|
||||
case wopQueryValidDerivers:
|
||||
case wopQueryDerivationOutputs: {
|
||||
Path path = readStorePath(from);
|
||||
startWork();
|
||||
|
@ -342,6 +343,8 @@ static void performOp(unsigned int clientVersion,
|
|||
store->queryReferences(path, paths);
|
||||
else if (op == wopQueryReferrers)
|
||||
store->queryReferrers(path, paths);
|
||||
else if (op == wopQueryValidDerivers)
|
||||
paths = store->queryValidDerivers(path);
|
||||
else paths = store->queryDerivationOutputs(path);
|
||||
stopWork();
|
||||
writeStrings(paths, to);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue