2022-05-15 00:39:36 +00:00
|
|
|
local branches = table_keys(need_table({'autoupdater', 'branches'}, function(branch)
|
2018-01-19 09:12:43 +00:00
|
|
|
need_alphanumeric_key(branch)
|
2015-10-11 17:31:44 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string(in_site(extend(branch, {'name'})))
|
|
|
|
need_string_array_match(extend(branch, {'mirrors'}), '^http://')
|
2022-05-26 20:26:19 +00:00
|
|
|
|
|
|
|
local pubkeys = need_string_array_match(in_site(extend(branch, {'pubkeys'})), '^%x+$')
|
2018-01-19 09:12:43 +00:00
|
|
|
need_number(in_site(extend(branch, {'good_signatures'})))
|
2022-05-26 20:26:19 +00:00
|
|
|
need(in_site(extend(branch, {'good_signatures'})), function(good_signatures)
|
|
|
|
return good_signatures <= #pubkeys
|
|
|
|
end, nil, string.format('be less than or equal to the number of public keys (%d)', #pubkeys))
|
|
|
|
|
2019-04-28 12:38:08 +00:00
|
|
|
obsolete(in_site(extend(branch, {'probability'})), 'Use GLUON_PRIORITY in site.mk instead.')
|
2022-05-15 00:39:36 +00:00
|
|
|
end))
|
|
|
|
|
|
|
|
need_one_of(in_site({'autoupdater', 'branch'}), branches, false)
|
|
|
|
|
|
|
|
-- Check GLUON_AUTOUPDATER_BRANCH
|
|
|
|
local default_branch
|
|
|
|
local f = io.open((os.getenv('IPKG_INSTROOT') or '') .. '/lib/gluon/autoupdater/default_branch')
|
|
|
|
if f then
|
|
|
|
default_branch = f:read('*line')
|
|
|
|
f:close()
|
|
|
|
end
|
|
|
|
need_one_of(value('GLUON_AUTOUPDATER_BRANCH', default_branch), branches, false)
|