aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derived-path.cc
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2022-11-25 08:14:32 -0500
committerGitHub <noreply@github.com>2022-11-25 08:14:32 -0500
commit26534f141cb52adf0135e86c71628cdef844a57a (patch)
treedff8140578d26993973cb8baf334948664b36660 /src/libstore/derived-path.cc
parent13f2a6f38db44385ae1c7d3d01170149de328abb (diff)
parentbc9692a6b701fffe25d2e3b1d16f00edd596930f (diff)
Merge branch 'master' into indexed-store-path-outputs
Diffstat (limited to 'src/libstore/derived-path.cc')
-rw-r--r--src/libstore/derived-path.cc23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/libstore/derived-path.cc b/src/libstore/derived-path.cc
index f6a0c01df..7fe797aa1 100644
--- a/src/libstore/derived-path.cc
+++ b/src/libstore/derived-path.cc
@@ -53,28 +53,13 @@ StorePathSet BuiltPath::outPaths() const
);
}
-template<typename T>
-nlohmann::json stuffToJSON(const std::vector<T> & ts, ref<Store> store) {
- auto res = nlohmann::json::array();
- for (const T & t : ts) {
- std::visit([&res, store](const auto & t) {
- res.push_back(t.toJSON(store));
- }, t.raw());
- }
- return res;
-}
-
-nlohmann::json derivedPathsWithHintsToJSON(const BuiltPaths & buildables, ref<Store> store)
-{ return stuffToJSON<BuiltPath>(buildables, store); }
-nlohmann::json derivedPathsToJSON(const DerivedPaths & paths, ref<Store> store)
-{ return stuffToJSON<DerivedPath>(paths, store); }
-
-
-std::string DerivedPath::Opaque::to_string(const Store & store) const {
+std::string DerivedPath::Opaque::to_string(const Store & store) const
+{
return store.printStorePath(path);
}
-std::string DerivedPath::Built::to_string(const Store & store) const {
+std::string DerivedPath::Built::to_string(const Store & store) const
+{
return store.printStorePath(drvPath)
+ "!"
+ (outputs.empty() ? std::string { "*" } : concatStringsSep(",", outputs));