aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/built-path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd/built-path.cc')
-rw-r--r--src/libcmd/built-path.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libcmd/built-path.cc b/src/libcmd/built-path.cc
index c6cc7fa9c..9a2dce806 100644
--- a/src/libcmd/built-path.cc
+++ b/src/libcmd/built-path.cc
@@ -58,6 +58,28 @@ StorePathSet BuiltPath::outPaths() const
);
}
+SingleDerivedPath::Built SingleBuiltPath::Built::discardOutputPath() const
+{
+ return SingleDerivedPath::Built {
+ .drvPath = make_ref<SingleDerivedPath>(drvPath->discardOutputPath()),
+ .output = output.first,
+ };
+}
+
+SingleDerivedPath SingleBuiltPath::discardOutputPath() const
+{
+ return std::visit(
+ overloaded{
+ [](const SingleBuiltPath::Opaque & p) -> SingleDerivedPath {
+ return p;
+ },
+ [](const SingleBuiltPath::Built & b) -> SingleDerivedPath {
+ return b.discardOutputPath();
+ },
+ }, raw()
+ );
+}
+
nlohmann::json BuiltPath::Built::toJSON(const Store & store) const
{
nlohmann::json res;