1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02:00

Support 0 as versionCode

See: !1230
This commit is contained in:
Jochen Sprickerhof 2022-10-25 12:55:44 +02:00
parent 8533c9cb4b
commit b86d815743
No known key found for this signature in database
GPG Key ID: 5BFFDCC258E69433

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