Skip to content

Commit

Permalink
feat: purl in productinfo (intel#4185)
Browse files Browse the repository at this point in the history
  • Loading branch information
mastersans committed Jun 13, 2024
1 parent e9f1ea8 commit 129cce2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cve_bin_tool/parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,17 @@ def find_vendor_from_purl(self, purl, ver) -> Tuple[List[ScanInfo], bool]:
vendors.add((vendor, product))
else:
return vendorlist, False

purl_with_ver = f"{str(purl)}@{ver}"
for vendor, product in vendors:
vendorlist.append(
ScanInfo(
ProductInfo(vendor, product, ver, "/usr/local/bin/product"),
ProductInfo(
vendor,
product,
ver,
"/usr/local/bin/product",
purl=purl_with_ver,
),
self.filename,
)
)
Expand Down
2 changes: 2 additions & 0 deletions cve_bin_tool/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,14 @@ class ProductInfo(NamedTuple):
product: str
version: str
location: str
purl: Optional[str]
"""

vendor: str
product: str
version: str
location: str
purl: str | None = None


class ScanInfo(NamedTuple):
Expand Down

0 comments on commit 129cce2

Please sign in to comment.