aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd')
-rw-r--r--src/libcmd/installables.cc18
-rw-r--r--src/libcmd/installables.hh9
2 files changed, 24 insertions, 3 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index a9d25671c..f40136411 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -674,7 +674,7 @@ BuiltPaths Installable::toBuiltPaths(
}
}
-StorePathSet Installable::toStorePaths(
+StorePathSet Installable::toStorePathSet(
ref<Store> evalStore,
ref<Store> store,
Realise mode, OperateOn operateOn,
@@ -688,13 +688,27 @@ StorePathSet Installable::toStorePaths(
return outPaths;
}
+StorePaths Installable::toStorePaths(
+ ref<Store> evalStore,
+ ref<Store> store,
+ Realise mode, OperateOn operateOn,
+ const Installables & installables)
+{
+ StorePaths outPaths;
+ for (auto & path : toBuiltPaths(evalStore, store, mode, operateOn, installables)) {
+ auto thisOutPaths = path.outPaths();
+ outPaths.insert(outPaths.end(), thisOutPaths.begin(), thisOutPaths.end());
+ }
+ return outPaths;
+}
+
StorePath Installable::toStorePath(
ref<Store> evalStore,
ref<Store> store,
Realise mode, OperateOn operateOn,
ref<Installable> installable)
{
- auto paths = toStorePaths(evalStore, store, mode, operateOn, {installable});
+ auto paths = toStorePathSet(evalStore, store, mode, operateOn, {installable});
if (paths.size() != 1)
throw Error("argument '%s' should evaluate to one store path", installable->what());
diff --git a/src/libcmd/installables.hh b/src/libcmd/installables.hh
index b0dc0dc02..ad5b4f759 100644
--- a/src/libcmd/installables.hh
+++ b/src/libcmd/installables.hh
@@ -166,7 +166,14 @@ struct Installable
const Installables & installables,
BuildMode bMode = bmNormal);
- static std::set<StorePath> toStorePaths(
+ static std::set<StorePath> toStorePathSet(
+ ref<Store> evalStore,
+ ref<Store> store,
+ Realise mode,
+ OperateOn operateOn,
+ const Installables & installables);
+
+ static std::vector<StorePath> toStorePaths(
ref<Store> evalStore,
ref<Store> store,
Realise mode,