mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-12 02:00:28 +03:00
parse yaml: ignore (and warn) deprecated field: Provides
This commit is contained in:
parent
6e48663230
commit
dcf3837bcb
2 changed files with 20 additions and 6 deletions
|
|
@ -1071,12 +1071,25 @@ def parse_json_metadata(mf, app):
|
|||
def parse_yaml_metadata(mf, app):
|
||||
yamldata = yaml.safe_load(mf)
|
||||
|
||||
deprecated_in_yaml = ['Provides']
|
||||
|
||||
if yamldata:
|
||||
for field in yamldata:
|
||||
if field not in yaml_app_fields:
|
||||
warn_or_exception(_("Unrecognised app field '{fieldname}' "
|
||||
"in '{path}'").format(fieldname=field,
|
||||
path=mf.name))
|
||||
if field not in deprecated_in_yaml:
|
||||
warn_or_exception(_("Unrecognised app field "
|
||||
"'{fieldname}' in '{path}'")
|
||||
.format(fieldname=field,
|
||||
path=mf.name))
|
||||
|
||||
for deprecated_field in deprecated_in_yaml:
|
||||
if deprecated_field in yamldata:
|
||||
logging.warning(_("Ignoring '{field}' in '{metapath}' "
|
||||
"metadata because it is deprecated.")
|
||||
.format(field=deprecated_field,
|
||||
metapath=mf.name))
|
||||
del(yamldata[deprecated_field])
|
||||
|
||||
if yamldata.get('Builds', None):
|
||||
for build in yamldata.get('Builds', []):
|
||||
# put all build flag keywords into a set to avoid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue