mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 03:09:35 +01:00
WIP: store separate hasValidPath bool
This commit is contained in:
parent
1722ae6ece
commit
71e4c9c505
17 changed files with 119 additions and 69 deletions
|
|
@ -58,7 +58,7 @@ void printDotGraph(ref<Store> store, StorePathSet && roots)
|
|||
|
||||
cout << makeNode(std::string(path.to_string()), path.name(), "#ff0000");
|
||||
|
||||
for (auto & p : store->queryPathInfo(path)->references) {
|
||||
for (auto & p : store->queryPathInfo(path)->referencesPossiblyToSelf()) {
|
||||
if (p != path) {
|
||||
workList.insert(p);
|
||||
cout << makeEdge(std::string(p.to_string()), std::string(path.to_string()));
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void printGraphML(ref<Store> store, StorePathSet && roots)
|
|||
auto info = store->queryPathInfo(path);
|
||||
cout << makeNode(*info);
|
||||
|
||||
for (auto & p : info->references) {
|
||||
for (auto & p : info->referencesPossiblyToSelf()) {
|
||||
if (p != path) {
|
||||
workList.insert(p);
|
||||
cout << makeEdge(path.to_string(), p.to_string());
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue