From: Hans-Christoph Steiner Date: Mon, 7 Nov 2016 20:21:32 +0000 (+0100) Subject: properly parse build metadata list types like gradle= X-Git-Tag: 0.8~145^2~5 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1f55a40caab2114fef088c683a86f47072be9e6f;p=fdroidserver.git properly parse build metadata list types like gradle= Something like `gradle: yes` in YAML will be parsed as a boolean, since 'yes' is officially defined as a boolean true in YAML. For metadata fields that need to be lists, this needs to be converted. Same goes for a single string like `gradle: customFlavor`. --- diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index ddfb19b5..0df2ece0 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -904,6 +904,11 @@ def post_metadata_parse(app): elif ftype == TYPE_STRING: if isinstance(v, bool) and v: build.__dict__[k] = 'yes' + elif ftype == TYPE_LIST: + if isinstance(v, bool) and v: + build.__dict__[k] = ['yes'] + elif isinstance(v, str): + build.__dict__[k] = [v] if not app.Description: app.Description = 'No description available' diff --git a/tests/metadata/net.osmand.plus.pickle b/tests/metadata/net.osmand.plus.pickle index cf9a39ec..76409710 100644 Binary files a/tests/metadata/net.osmand.plus.pickle and b/tests/metadata/net.osmand.plus.pickle differ diff --git a/tests/metadata/org.adaway.pickle b/tests/metadata/org.adaway.pickle index cc2907ab..4c35fe2e 100644 Binary files a/tests/metadata/org.adaway.pickle and b/tests/metadata/org.adaway.pickle differ diff --git a/tests/metadata/org.videolan.vlc.pickle b/tests/metadata/org.videolan.vlc.pickle index a1810e60..8a727bb5 100644 Binary files a/tests/metadata/org.videolan.vlc.pickle and b/tests/metadata/org.videolan.vlc.pickle differ