gluon/package/gluon-autoupdater/check_site.lua
lemoer b3c9ac8bce scripts: check_site_lib: need_table() now merges all keys before calling subcheck(...)
This also introduces an api change to the subcheck()!

Before:
-> subcheck(key, value, conf_name)

After:
-> subcheck(key, conf_name)

The idea is, that it's hard to submit a value, which should be then checked
again. It's wouldn't be clear (after merging) from which config the value
is, and so an helpful error message would be impossible.
2017-12-28 19:59:38 +01:00

15 lines
460 B
Lua

need_string(in_site('autoupdater.branch'))
local function check_branch(k, conf_name)
assert_uci_name(k, conf_name)
local prefix = string.format('autoupdater.branches[%q].', k)
need_string(in_site(prefix .. 'name'))
need_string_array_match(prefix .. 'mirrors', '^http://')
need_number(in_site(prefix .. 'good_signatures'))
need_string_array_match(in_site(prefix .. 'pubkeys'), '^%x+$')
end
need_table('autoupdater.branches', check_branch)