mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
Merge pull request #4906 from NixOS/collect-garbage-ca
Make `computeFSClosure` ca-aware
This commit is contained in:
commit
26d2c62225
4 changed files with 29 additions and 7 deletions
|
@ -29,9 +29,9 @@ void Store::computeFSClosure(const StorePathSet & startPaths,
|
|||
res.insert(i);
|
||||
|
||||
if (includeDerivers && path.isDerivation())
|
||||
for (auto& i : queryDerivationOutputs(path))
|
||||
if (isValidPath(i) && queryPathInfo(i)->deriver == path)
|
||||
res.insert(i);
|
||||
for (auto& [_, maybeOutPath] : queryPartialDerivationOutputMap(path))
|
||||
if (maybeOutPath && isValidPath(*maybeOutPath))
|
||||
res.insert(*maybeOutPath);
|
||||
return res;
|
||||
};
|
||||
else
|
||||
|
@ -44,9 +44,9 @@ void Store::computeFSClosure(const StorePathSet & startPaths,
|
|||
res.insert(ref);
|
||||
|
||||
if (includeOutputs && path.isDerivation())
|
||||
for (auto& i : queryDerivationOutputs(path))
|
||||
if (isValidPath(i))
|
||||
res.insert(i);
|
||||
for (auto& [_, maybeOutPath] : queryPartialDerivationOutputMap(path))
|
||||
if (maybeOutPath && isValidPath(*maybeOutPath))
|
||||
res.insert(*maybeOutPath);
|
||||
|
||||
if (includeDerivers && info->deriver && isValidPath(*info->deriver))
|
||||
res.insert(*info->deriver);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue