diff options
author | John Ericson <git@JohnEricson.me> | 2022-11-25 08:14:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-25 08:14:32 -0500 |
commit | 26534f141cb52adf0135e86c71628cdef844a57a (patch) | |
tree | dff8140578d26993973cb8baf334948664b36660 /src/libstore/derived-path.cc | |
parent | 13f2a6f38db44385ae1c7d3d01170149de328abb (diff) | |
parent | bc9692a6b701fffe25d2e3b1d16f00edd596930f (diff) |
Merge branch 'master' into indexed-store-path-outputs
Diffstat (limited to 'src/libstore/derived-path.cc')
-rw-r--r-- | src/libstore/derived-path.cc | 23 |
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)); |