Properly account for repo categorization in updateinfo

This commit is contained in:
Mustafa Gezen 2023-02-03 01:28:39 +01:00
parent 9b60921a42
commit c72684f08c
Signed by untrusted user who does not match committer: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -194,6 +194,8 @@ async def get_updateinfo(
# collections, and module RPMs need to go into their own collection based on # collections, and module RPMs need to go into their own collection based on
# module name, while non-module RPMs go into the main collection (if any) # module name, while non-module RPMs go into the main collection (if any)
for pkg in advisory.packages: for pkg in advisory.packages:
if pkg.repo_name != repo:
continue
if pkg.module_name: if pkg.module_name:
collection_short = f"{default_collection_short}__{pkg.module_name}" collection_short = f"{default_collection_short}__{pkg.module_name}"
if collection_short not in collections: if collection_short not in collections:
@ -209,11 +211,11 @@ async def get_updateinfo(
else: else:
if no_default_collection: if no_default_collection:
continue continue
if collection_short not in collections: if default_collection_short not in collections:
collections[collection_short] = { collections[default_collection_short] = {
"packages": [], "packages": [],
} }
collections[collection_short]["packages"].append(pkg) collections[default_collection_short]["packages"].append(pkg)
if no_default_collection and default_collection_short in collections: if no_default_collection and default_collection_short in collections:
del collections[default_collection_short] del collections[default_collection_short]