Skip to content
Snippets Groups Projects
Unverified Commit db48b6b6 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-autoupdater: check default branch name

Check the default branch (both from site.conf and GLUON_AUTOUPDATER_BRANCH)
against the list of configured branch names to avoid misconfiguration.
parent d24ae563
No related branches found
No related tags found
No related merge requests found
need_string(in_site({'autoupdater', 'branch'}), false) local branches = table_keys(need_table({'autoupdater', 'branches'}, function(branch)
need_table({'autoupdater', 'branches'}, function(branch)
need_alphanumeric_key(branch) need_alphanumeric_key(branch)
need_string(in_site(extend(branch, {'name'}))) need_string(in_site(extend(branch, {'name'})))
...@@ -8,4 +6,15 @@ need_table({'autoupdater', 'branches'}, function(branch) ...@@ -8,4 +6,15 @@ need_table({'autoupdater', 'branches'}, function(branch)
need_number(in_site(extend(branch, {'good_signatures'}))) need_number(in_site(extend(branch, {'good_signatures'})))
need_string_array_match(in_site(extend(branch, {'pubkeys'})), '^%x+$') need_string_array_match(in_site(extend(branch, {'pubkeys'})), '^%x+$')
obsolete(in_site(extend(branch, {'probability'})), 'Use GLUON_PRIORITY in site.mk instead.') obsolete(in_site(extend(branch, {'probability'})), 'Use GLUON_PRIORITY in site.mk instead.')
end) 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)
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