From 4b0371bff3b72e96e2931b7bea956c322a2eb044 Mon Sep 17 00:00:00 2001 From: rootile Date: Mon, 15 Jun 2026 22:09:15 +0200 Subject: [PATCH] libstore/machines: add name attribute Change-Id: Ie0f246dee219ffb3cade7e8b9a9596eb2a06f2dd --- lix/libstore/machines.cc | 7 +++++-- lix/libstore/machines.hh | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lix/libstore/machines.cc b/lix/libstore/machines.cc index 0d57ec072..adcb4e9da 100644 --- a/lix/libstore/machines.cc +++ b/lix/libstore/machines.cc @@ -167,6 +167,7 @@ static Machine parseBuilderLine(const std::string & line) } return { + storeUri, storeUri, systemTypes, sshKey, @@ -262,7 +263,8 @@ static toml::result getSpeedFactor(const toml::value & data) return toml::success(1.0f); } -static toml::result> parseMachine(const toml::value & data) +static toml::result> +parseMachine(const std::string name, const toml::value & data) { std::vector errs; @@ -339,6 +341,7 @@ static toml::result> parseMachine(const toml:: return toml::failure(errs); } return toml::success({ + name, storeUri.unwrap(), std::set(systemTypes.unwrap().begin(), systemTypes.unwrap().end()), sshKey.unwrap(), @@ -404,7 +407,7 @@ static toml::result> parseToml(const toml::va } for (const auto & [name, machine] : data.at(array_name).as_table()) { - auto const res = parseMachine(machine); + auto const res = parseMachine(name, machine); if (res.is_err()) { auto err = res.as_err(); parserErrors.push_back(fmt("for machine %s:", name)); diff --git a/lix/libstore/machines.hh b/lix/libstore/machines.hh index f1b25e8ed..cb0cca90f 100644 --- a/lix/libstore/machines.hh +++ b/lix/libstore/machines.hh @@ -14,6 +14,7 @@ class Store; struct Machine { + const std::string name; const std::string storeUri; const std::set systemTypes; const std::string sshKey;