1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

metadata: remove redundant build flags list creation

picked out of fdroid/fdroidserver!559
This commit is contained in:
Michael Pöhn 2018-08-19 13:18:12 +02:00 committed by Hans-Christoph Steiner
parent 67e46694d3
commit aea2589c67

View File

@ -1096,6 +1096,11 @@ def parse_yaml_metadata(mf, app):
def write_yaml(mf, app):
"""Write metadata in yaml format.
:param mf: active file discriptor for writing
:param app: app metadata to written to the yaml file
"""
# import rumael.yaml and check version
try:
@ -1176,12 +1181,10 @@ def write_yaml(mf, app):
return cm
def _builds_to_yaml(app):
fields = ['versionName', 'versionCode']
fields.extend(build_flags_order)
builds = ruamel.yaml.comments.CommentedSeq()
for build in app.builds:
b = ruamel.yaml.comments.CommentedMap()
for field in fields:
for field in build_flags:
if hasattr(build, field) and getattr(build, field):
value = getattr(build, field)
if field == 'gradle' and value == ['off']: