From a434925fa81446ed7b4a670f6e8f0fd2d58fcc9c Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 9 Dec 2023 21:02:24 +0100 Subject: [PATCH] fixup! build: implement flexible site-selection system --- scripts/image_customization_lib.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/image_customization_lib.lua b/scripts/image_customization_lib.lua index fc20bc0d35..fcadefd8f4 100644 --- a/scripts/image_customization_lib.lua +++ b/scripts/image_customization_lib.lua @@ -8,9 +8,10 @@ local function collect_keys(t) return ret end -function M.get_selection(selection_type, files, env, dev) +local function evaluate_device(files, env, dev) local selections = {} local funcs = {} + local device_disabled = false local function add_elements(element_type, element_list) for _, element in ipairs(element_list) do @@ -74,7 +75,15 @@ function M.get_selection(selection_type, files, env, dev) f() end - return collect_keys(selections[selection_type] or {}) + return { + selections = selections, + device_disabled = device_disabled, + } +end + +function M.get_selection(selection_type, files, env, dev) + local eval_result = evaluate_device(files, env, dev) + return collect_keys(eval_result.selections[selection_type] or {}) end return M