1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-08-15 10:50:09 +02:00

update: skip packages without metadata in index V1

If a package does not have a matching "app" metadata file, then it should
not be added to the index. index V0 already does this properly.
This commit is contained in:
Hans-Christoph Steiner 2017-05-15 20:11:41 +02:00
parent a17b95a860
commit 77a65be9db

View File

@ -169,7 +169,7 @@ def make_v1(apps, packages, repodir, repodict, requestsdict):
appslist = []
output['apps'] = appslist
for appid, appdict in apps.items():
for packageName, appdict in apps.items():
d = collections.OrderedDict()
appslist.append(d)
for k, v in sorted(appdict.items()):
@ -190,7 +190,7 @@ def make_v1(apps, packages, repodir, repodict, requestsdict):
elif k == 'CurrentVersion': # TODO make SuggestedVersionName the canonical name
k = 'suggestedVersionName'
elif k == 'AutoName':
if 'Name' not in apps[appid]:
if 'Name' not in apps[packageName]:
d['name'] = v
continue
else:
@ -201,6 +201,9 @@ def make_v1(apps, packages, repodir, repodict, requestsdict):
output['packages'] = output_packages
for package in packages:
packageName = package['packageName']
if packageName not in apps:
logging.info('Ignoring package without metadata: ' + package['apkName'])
continue
if packageName in output_packages:
packagelist = output_packages[packageName]
else: