aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/installables.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd/installables.hh')
-rw-r--r--src/libcmd/installables.hh11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libcmd/installables.hh b/src/libcmd/installables.hh
index 79931ad3e..ced6b3f10 100644
--- a/src/libcmd/installables.hh
+++ b/src/libcmd/installables.hh
@@ -33,10 +33,15 @@ struct Installable
{
virtual ~Installable() { }
- virtual std::string what() = 0;
+ virtual std::string what() const = 0;
virtual DerivedPaths toDerivedPaths() = 0;
+ virtual StorePathSet toDrvPaths(ref<Store> store)
+ {
+ throw Error("'%s' cannot be converted to a derivation path", what());
+ }
+
DerivedPath toDerivedPath();
UnresolvedApp toApp(EvalState & state);
@@ -81,6 +86,8 @@ struct InstallableValue : Installable
virtual std::vector<DerivationInfo> toDerivations() = 0;
DerivedPaths toDerivedPaths() override;
+
+ StorePathSet toDrvPaths(ref<Store> store) override;
};
struct InstallableFlake : InstallableValue
@@ -99,7 +106,7 @@ struct InstallableFlake : InstallableValue
Strings && prefixes,
const flake::LockFlags & lockFlags);
- std::string what() override { return flakeRef.to_string() + "#" + *attrPaths.begin(); }
+ std::string what() const override { return flakeRef.to_string() + "#" + *attrPaths.begin(); }
std::vector<std::string> getActualAttrPaths();