osv: Only show src.rpm once in affected

This commit is contained in:
Mustafa Gezen 2023-03-06 06:19:23 +01:00
parent f3b76fdcec
commit 11de73dbd1

View File

@ -127,6 +127,8 @@ def to_osv_advisory(ui_url: str, advisory: Advisory) -> OSVAdvisory:
pkg_name_map[product_name][arch][name].append((pkg, nevra)) pkg_name_map[product_name][arch][name].append((pkg, nevra))
processed_nvra = {}
for product_name, arches in pkg_name_map.items(): for product_name, arches in pkg_name_map.items():
for _, affected_arches in arches.items(): for _, affected_arches in arches.items():
if not affected_arches: if not affected_arches:
@ -139,6 +141,9 @@ def to_osv_advisory(ui_url: str, advisory: Advisory) -> OSVAdvisory:
# Only process "src" packages # Only process "src" packages
if nevra.group(5) != "src": if nevra.group(5) != "src":
continue continue
if x.nevra in processed_nvra:
continue
processed_nvra[x.nevra] = True
ver_rel = f"{nevra.group(3)}-{nevra.group(4)}" ver_rel = f"{nevra.group(3)}-{nevra.group(4)}"
slugified = slugify(x.supported_product.variant) slugified = slugify(x.supported_product.variant)