chiark / gitweb /
ensure fdroiddata metadata file overrides .fdroid.yml in source
authorHans-Christoph Steiner <hans@eds.org>
Wed, 11 Jan 2017 21:42:41 +0000 (22:42 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 11 Jan 2017 21:42:41 +0000 (22:42 +0100)
If the already parsed App instance from metadata/*.* has a field, then the
value coming from .fdroid.yml should not override it.

fdroidserver/metadata.py

index c70b1642becc2fcb378e9dae18f6ddd883a32e89..9af8a10713ace643d3a840f3b6095d418fd536d2 100644 (file)
@@ -996,7 +996,11 @@ def parse_metadata(metadatapath, check_vcs=False):
                 vcs.gotorevision('HEAD')  # HEAD since we can't know where else to go
         if os.path.isfile(metadata_in_repo):
             logging.debug('Including metadata from ' + metadata_in_repo)
-            app.update(parse_metadata(metadata_in_repo))
+            # do not include fields already provided by main metadata file
+            app_in_repo = parse_metadata(metadata_in_repo).field_dict()
+            for k, v in app_in_repo.items():
+                if k not in app.field_dict():
+                    app.set_field(k, v)
 
     post_metadata_parse(app)