Skip to content
Snippets Groups Projects
Commit edca7850 authored by David Bauer's avatar David Bauer
Browse files

image-customization: allow negation of selections


This allows the negation of already activated features oder packages by
Gluon using the image-customization.

Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
parent 83923003
No related branches found
No related tags found
No related merge requests found
local M = {} local M = {}
local function collect_keys(t)
local ret = {}
for v in pairs(t) do
table.insert(ret, v)
end
return ret
end
local function file_exists(file) local function file_exists(file)
local f = io.open(file) local f = io.open(file)
if not f then if not f then
...@@ -33,7 +25,7 @@ local function evaluate_device(env, dev) ...@@ -33,7 +25,7 @@ local function evaluate_device(env, dev)
-- We depend on the fact both feature and package -- We depend on the fact both feature and package
-- are already initialized as empty tables -- are already initialized as empty tables
for _, element in ipairs(element_list) do for _, element in ipairs(element_list) do
selections[element_type][element] = true table.insert(selections[element_type], element)
end end
end end
...@@ -124,8 +116,8 @@ function M.get_selections(env, dev) ...@@ -124,8 +116,8 @@ function M.get_selections(env, dev)
local eval_result = evaluate_device(env, dev) local eval_result = evaluate_device(env, dev)
return_object = { return_object = {
features = collect_keys(eval_result.selections['feature']), features = eval_result.selections['feature'],
packages = collect_keys(eval_result.selections['package']), packages = eval_result.selections['package'],
} }
return return_object return return_object
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment