aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-06 15:37:31 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-06 15:45:34 -0500
commit81727f85cb567c4d5282c330d63a74ed84d12783 (patch)
tree5808cba3e02ff55657355562007ddd3a20892dfb /src/libstore/misc.cc
parent7e1cfa97c6b410ed25ae0d3c3f10274aae9f6758 (diff)
parent46e942ff9e65755689ee72f93846d7118e1b8d45 (diff)
Merge branch 'path-info' into ca-drv-exotic
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index 3d8414174..9a38a0713 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -21,16 +21,16 @@ void Store::computeFSClosure(const StorePathSet & startPaths,
StorePathSet res;
StorePathSet referrers;
queryReferrers(path, referrers);
- for (auto& ref : referrers)
+ for (auto & ref : referrers)
if (ref != path)
res.insert(ref);
if (includeOutputs)
- for (auto& i : queryValidDerivers(path))
+ for (auto & i : queryValidDerivers(path))
res.insert(i);
if (includeDerivers && path.isDerivation())
- for (auto& [_, maybeOutPath] : queryPartialDerivationOutputMap(path))
+ for (auto & [_, maybeOutPath] : queryPartialDerivationOutputMap(path))
if (maybeOutPath && isValidPath(*maybeOutPath))
res.insert(*maybeOutPath);
return res;
@@ -40,11 +40,11 @@ void Store::computeFSClosure(const StorePathSet & startPaths,
std::future<ref<const ValidPathInfo>> & fut) {
StorePathSet res;
auto info = fut.get();
- for (auto& ref : info->references)
+ for (auto & ref : info->references.others)
res.insert(ref);
if (includeOutputs && path.isDerivation())
- for (auto& [_, maybeOutPath] : queryPartialDerivationOutputMap(path))
+ for (auto & [_, maybeOutPath] : queryPartialDerivationOutputMap(path))
if (maybeOutPath && isValidPath(*maybeOutPath))
res.insert(*maybeOutPath);
@@ -95,7 +95,7 @@ std::optional<ContentAddress> getDerivationCA(const BasicDerivation & drv)
return static_cast<TextHash>(ti);
},
[&](const FixedOutputInfo & fi) -> std::optional<ContentAddress> {
- if (fi.references != PathReferences<StorePath> {})
+ if (!fi.references.empty())
return std::nullopt;
return static_cast<FixedOutputHash>(fi);
},
@@ -235,7 +235,7 @@ void Store::queryMissing(const std::vector<DerivedPath> & targets,
state->narSize += info->second.narSize;
}
- for (auto & ref : info->second.references)
+ for (auto & ref : info->second.references.others)
pool.enqueue(std::bind(doPath, DerivedPath::Opaque { ref }));
},
}, req.raw());
@@ -253,7 +253,7 @@ StorePaths Store::topoSortPaths(const StorePathSet & paths)
return topoSort(paths,
{[&](const StorePath & path) {
try {
- return queryPathInfo(path)->references;
+ return queryPathInfo(path)->references.others;
} catch (InvalidPath &) {
return StorePathSet();
}
@@ -309,7 +309,7 @@ std::map<DrvOutput, StorePath> drvOutputReferences(
auto info = store.queryPathInfo(outputPath);
- return drvOutputReferences(Realisation::closure(store, inputRealisations), info->references);
+ return drvOutputReferences(Realisation::closure(store, inputRealisations), info->referencesPossiblyToSelf());
}
}