mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-11 09:40:28 +03:00
category with no apps should be ignored, even if defined in config
https://gitlab.com/fdroid/fdroidclient/-/issues/2619#note_1421280589 The test needed to change because the test index files contained category definitions that were not ever used in the "copy tests/repo, generate java/gpg keys, update, and gpgsign" test in tests/run-tests.
This commit is contained in:
parent
2c566cf68f
commit
48559ecec5
9 changed files with 44 additions and 3 deletions
|
|
@ -743,9 +743,16 @@ def make_v2(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_
|
|||
|
||||
if categories_used_by_apps and not output['repo'].get(CATEGORIES_CONFIG_NAME):
|
||||
output['repo'][CATEGORIES_CONFIG_NAME] = dict()
|
||||
# include definitions for "auto-defined" categories, e.g. just used in app metadata
|
||||
for category in sorted(categories_used_by_apps):
|
||||
if category not in output['repo'][CATEGORIES_CONFIG_NAME]:
|
||||
output['repo'][CATEGORIES_CONFIG_NAME][category] = dict()
|
||||
# do not include defined categories if no apps use them
|
||||
for category in list(output['repo'].get(CATEGORIES_CONFIG_NAME, list())):
|
||||
if category not in categories_used_by_apps:
|
||||
del output['repo'][CATEGORIES_CONFIG_NAME][category]
|
||||
msg = _('Category "{category}" defined but not used for any apps!')
|
||||
logging.warning(msg.format(category=category))
|
||||
|
||||
entry = {}
|
||||
entry["timestamp"] = repodict["timestamp"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue