1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01:00

Merge branch 'fix_int_field_0' into 'master'

Support 0 as versionCode

See merge request fdroid/fdroidserver!1231
This commit is contained in:
Hans-Christoph Steiner 2022-10-25 11:40:15 +00:00
commit fdeab70c03

View File

@ -965,16 +965,17 @@ def write_yaml(mf, app):
build = Build(build)
b = ruamel.yaml.comments.CommentedMap()
for field in build_flags:
value = getattr(build, field)
if hasattr(build, field) and value:
if hasattr(build, field):
value = getattr(build, field)
if field == 'gradle' and value == ['off']:
value = [ruamel.yaml.scalarstring.SingleQuotedScalarString('off')]
if field in ('maven', 'buildozer'):
if value == 'no':
continue
elif value == 'yes':
value = 'yes'
b.update({field: _field_to_yaml(flagtype(field), value)})
typ = flagtype(field)
# don't check value == True for TYPE_INT as it could be 0
if value is not None and (typ == TYPE_INT or value):
b.update({field: _field_to_yaml(typ, value)})
builds.append(b)
# insert extra empty lines between build entries