mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-12 02:00:28 +03:00
metadata: normalize TYPE_BOOL to YAML 1.2 booleans
This makes the internal representation always be a boolean, and that also means that YAML 1.2 booleans will be written out, e.g. rewritemeta.
This commit is contained in:
parent
aa98d67c86
commit
8374842faa
3 changed files with 15 additions and 10 deletions
|
|
@ -979,6 +979,8 @@ def post_parse_yaml_metadata(yamldata):
|
|||
elif _fieldtype == TYPE_STRINGMAP:
|
||||
if v or v == 0: # TODO probably want just `if v:`
|
||||
yamldata[k] = _normalize_type_stringmap(k, v)
|
||||
elif _fieldtype == TYPE_BOOL:
|
||||
yamldata[k] = bool(v)
|
||||
else:
|
||||
if type(v) in (float, int):
|
||||
yamldata[k] = str(v)
|
||||
|
|
@ -1017,6 +1019,8 @@ def post_parse_yaml_metadata(yamldata):
|
|||
elif _flagtype == TYPE_STRINGMAP:
|
||||
if v or v == 0:
|
||||
build[k] = _normalize_type_stringmap(k, v)
|
||||
elif _flagtype == TYPE_BOOL:
|
||||
build[k] = bool(v)
|
||||
|
||||
builds.append(build)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue