mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
warn on all unrecognized build flags
No need to put the list of keys in a set beforehand, just report all build flags that are invalid.
This commit is contained in:
parent
1166258145
commit
41972e6525
1 changed files with 6 additions and 13 deletions
|
|
@ -768,19 +768,12 @@ def parse_yaml_metadata(mf, app):
|
||||||
metapath=mf.name))
|
metapath=mf.name))
|
||||||
del yamldata[deprecated_field]
|
del yamldata[deprecated_field]
|
||||||
|
|
||||||
if yamldata.get('Builds', None):
|
msg = _("Unrecognised build flag '{build_flag}' in '{path}'")
|
||||||
for build in yamldata.get('Builds', []):
|
for build in yamldata.get('Builds', []):
|
||||||
# put all build flag keywords into a set to avoid
|
for build_flag in build:
|
||||||
# excessive looping action
|
|
||||||
build_flag_set = set()
|
|
||||||
for build_flag in build.keys():
|
|
||||||
build_flag_set.add(build_flag)
|
|
||||||
for build_flag in build_flag_set:
|
|
||||||
if build_flag not in build_flags:
|
if build_flag not in build_flags:
|
||||||
_warn_or_exception(
|
_warn_or_exception(msg.format(build_flag=build_flag, path=mf.name))
|
||||||
_("Unrecognised build flag '{build_flag}' "
|
|
||||||
"in '{path}'").format(build_flag=build_flag,
|
|
||||||
path=mf.name))
|
|
||||||
post_parse_yaml_metadata(yamldata)
|
post_parse_yaml_metadata(yamldata)
|
||||||
app.update(yamldata)
|
app.update(yamldata)
|
||||||
return app
|
return app
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue