mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
yaml parsing: script build flags can now be lists
This commit is contained in:
parent
c15a7508e7
commit
31ca2092a1
2 changed files with 70 additions and 8 deletions
|
|
@ -1091,14 +1091,23 @@ def parse_yaml_metadata(mf, app):
|
|||
_("Unrecognised build flag '{build_flag}' "
|
||||
"in '{path}'").format(build_flag=build_flag,
|
||||
path=mf.name))
|
||||
|
||||
if 'prebuild' in build and type(build['prebuild']) == list:
|
||||
build['prebuild'] = ' && '.join(build['prebuild'])
|
||||
|
||||
post_parse_yaml_metadata(yamldata)
|
||||
app.update(yamldata)
|
||||
return app
|
||||
|
||||
|
||||
def post_parse_yaml_metadata(yamldata):
|
||||
"""transform yaml metadata to our internal data format"""
|
||||
for build in yamldata.get('Builds', []):
|
||||
for flag in build.keys():
|
||||
_flagtype = flagtype(flag)
|
||||
|
||||
# concatenate script flags into a single string if they are stored as list
|
||||
if _flagtype is TYPE_SCRIPT:
|
||||
if isinstance(build[flag], list):
|
||||
build[flag] = ' && '.join(build[flag])
|
||||
|
||||
|
||||
def write_yaml(mf, app):
|
||||
"""Write metadata in yaml format.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue