1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-20 09:19:36 +01:00

WIP: store separate hasValidPath bool

This commit is contained in:
John Ericson 2020-06-24 22:46:27 +00:00
parent 1722ae6ece
commit 71e4c9c505
17 changed files with 119 additions and 69 deletions

View file

@ -245,7 +245,7 @@ static void printTree(const StorePath & path,
closure(B). That is, if derivation A is an (possibly indirect)
input of B, then A is printed first. This has the effect of
flattening the tree, preventing deeply nested structures. */
auto sorted = store->topoSortPaths(info->references);
auto sorted = store->topoSortPaths(info->referencesPossiblyToSelf());
reverse(sorted.begin(), sorted.end());
for (const auto &[n, i] : enumerate(sorted)) {
@ -328,7 +328,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
for (auto & j : ps) {
if (query == qRequisites) store->computeFSClosure(j, paths, false, includeOutputs);
else if (query == qReferences) {
for (auto & p : store->queryPathInfo(j)->references)
for (auto & p : store->queryPathInfo(j)->referencesPossiblyToSelf())
paths.insert(p);
}
else if (query == qReferrers) {
@ -859,7 +859,7 @@ static void opServe(Strings opFlags, Strings opArgs)
auto info = store->queryPathInfo(i);
out << store->printStorePath(info->path)
<< (info->deriver ? store->printStorePath(*info->deriver) : "");
writeStorePaths(*store, out, info->references);
writeStorePaths(*store, out, info->referencesPossiblyToSelf());
// !!! Maybe we want compression?
out << info->narSize // downloadSize
<< info->narSize;
@ -949,7 +949,7 @@ static void opServe(Strings opFlags, Strings opArgs)
if (deriver != "")
info.deriver = store->parseStorePath(deriver);
info.narHash = Hash(readString(in), htSHA256);
info.references = readStorePaths<StorePathSet>(*store, in);
info.setReferencesPossiblyToSelf(readStorePaths<StorePathSet>(*store, in));
in >> info.registrationTime >> info.narSize >> info.ultimate;
info.sigs = readStrings<StringSet>(in);
info.ca = parseContentAddressOpt(readString(in));