aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-06-23 10:07:08 +0200
committerGitHub <noreply@github.com>2021-06-23 10:07:08 +0200
commit26d2c62225b3c8a33dbee3cf83f8d2acd1675aa8 (patch)
treef5321ed02f695b8e43f3891762bfa32f0085f6cf /src/libstore/misc.cc
parentd9a43d3137ad2b4d1bce546a21164dbad3eb764c (diff)
parenta3ce88725b44a30184cbe8706fc3a53a8610cc47 (diff)
Merge pull request #4906 from NixOS/collect-garbage-ca
Make `computeFSClosure` ca-aware
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index 96d73b70e..b4929b445 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -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);