aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/realisation.cc10
-rw-r--r--src/libstore/realisation.hh2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/libstore/realisation.cc b/src/libstore/realisation.cc
index 638065547..27ad6c150 100644
--- a/src/libstore/realisation.cc
+++ b/src/libstore/realisation.cc
@@ -22,10 +22,14 @@ std::string DrvOutput::to_string() const {
}
nlohmann::json Realisation::toJSON() const {
+ nlohmann::json jsonDrvOutputDeps;
+ for (auto & dep : drvOutputDeps)
+ jsonDrvOutputDeps.push_back(dep.to_string());
return nlohmann::json{
{"id", id.to_string()},
{"outPath", outPath.to_string()},
{"signatures", signatures},
+ {"drvOutputDeps", jsonDrvOutputDeps},
};
}
@@ -51,10 +55,16 @@ Realisation Realisation::fromJSON(
if (auto signaturesIterator = json.find("signatures"); signaturesIterator != json.end())
signatures.insert(signaturesIterator->begin(), signaturesIterator->end());
+ std::set <DrvOutput> drvOutputDeps;
+ if (auto jsonDependencies = json.find("drvOutputDeps"); jsonDependencies != json.end())
+ for (auto & jsonDep : *jsonDependencies)
+ drvOutputDeps.insert(DrvOutput::parse(jsonDep.get<std::string>()));
+
return Realisation{
.id = DrvOutput::parse(getField("id")),
.outPath = StorePath(getField("outPath")),
.signatures = signatures,
+ .drvOutputDeps = drvOutputDeps,
};
}
diff --git a/src/libstore/realisation.hh b/src/libstore/realisation.hh
index f5049c9e9..1e2808ce3 100644
--- a/src/libstore/realisation.hh
+++ b/src/libstore/realisation.hh
@@ -28,6 +28,8 @@ struct Realisation {
StringSet signatures;
+ std::set<DrvOutput> drvOutputDeps;
+
nlohmann::json toJSON() const;
static Realisation fromJSON(const nlohmann::json& json, const std::string& whence);