aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/machines.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-04 08:39:24 +0100
committereldritch horrors <pennae@lix.systems>2024-03-04 08:39:24 +0100
commit20d7b93b0c83db3d620009e440263d7ab8faeec6 (patch)
treef932ebaf085114a1377f6f14ec3c305199fb8c74 /src/libstore/machines.cc
parentfad1a25e17350e67fc9857ba6ec80ac829efd2ed (diff)
Merge pull request #9838 from obsidiansystems/systemTypes-set
Make `Machine::systemTypes` a set not vector (cherry picked from commit f1b030415376e81c5804647c055d71eaba4aa725) Change-Id: I6d4f5c0bfc226e9bd66c58c360cd99e3fac9a129
Diffstat (limited to 'src/libstore/machines.cc')
-rw-r--r--src/libstore/machines.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc
index e87f46980..0aa497357 100644
--- a/src/libstore/machines.cc
+++ b/src/libstore/machines.cc
@@ -39,6 +39,11 @@ Machine::Machine(decltype(storeUri) storeUri,
sshPublicHostKey(sshPublicHostKey)
{}
+bool Machine::systemSupported(const std::string & system) const
+{
+ return system == "builtin" || (systemTypes.count(system) > 0);
+}
+
bool Machine::allSupported(const std::set<std::string> & features) const
{
return std::all_of(features.begin(), features.end(),
@@ -146,7 +151,7 @@ static Machine parseBuilderLine(const std::string & line)
return {
tokens[0],
- isSet(1) ? tokenizeString<std::vector<std::string>>(tokens[1], ",") : std::vector<std::string>{settings.thisSystem},
+ isSet(1) ? tokenizeString<std::set<std::string>>(tokens[1], ",") : std::set<std::string>{settings.thisSystem},
isSet(2) ? tokens[2] : "",
isSet(3) ? parseUnsignedIntField(3) : 1U,
isSet(4) ? parseUnsignedIntField(4) : 1U,