mirror of
https://github.com/resf/distro-tools.git
synced 2024-11-21 20:51:27 +00:00
Make OSV consistent
This commit is contained in:
parent
19d514830a
commit
47179f62f5
@ -106,20 +106,20 @@ def to_osv_advisory(ui_url: str, advisory: Advisory) -> OSVAdvisory:
|
|||||||
|
|
||||||
pkg_name_map = {}
|
pkg_name_map = {}
|
||||||
for pkg in advisory.packages:
|
for pkg in advisory.packages:
|
||||||
if pkg.package_name not in pkg_name_map:
|
product_name = slugify(pkg.product_name)
|
||||||
pkg_name_map[pkg.package_name] = {}
|
|
||||||
|
|
||||||
product_name = pkg.product_name
|
|
||||||
if pkg.supported_products_rh_mirror:
|
if pkg.supported_products_rh_mirror:
|
||||||
product_name = f"{pkg.supported_product.variant}:{pkg.supported_products_rh_mirror.match_major_version}"
|
product_name = f"{slugify(pkg.supported_product.variant)}:{pkg.supported_products_rh_mirror.match_major_version}"
|
||||||
if product_name not in pkg_name_map[pkg.package_name]:
|
|
||||||
pkg_name_map[pkg.package_name][product_name] = []
|
|
||||||
|
|
||||||
pkg_name_map[pkg.package_name][product_name].append(pkg)
|
if product_name not in pkg_name_map:
|
||||||
|
pkg_name_map[product_name] = {}
|
||||||
|
if pkg.package_name not in pkg_name_map[product_name]:
|
||||||
|
pkg_name_map[product_name][pkg.package_name] = []
|
||||||
|
|
||||||
|
pkg_name_map[product_name][pkg.package_name].append(pkg)
|
||||||
|
|
||||||
vendors = []
|
vendors = []
|
||||||
for pkg_name, affected_products in pkg_name_map.items():
|
for product_name, pkgs in pkg_name_map.items():
|
||||||
for product_name, affected_packages in affected_products.items():
|
for pkg_name, affected_packages in pkgs.items():
|
||||||
if not affected_packages:
|
if not affected_packages:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user