From c5aa3c5883aec704050c15c97adde920e58856bb Mon Sep 17 00:00:00 2001 From: Matt Weber Date: Thu, 22 Apr 2021 14:45:56 -0500 Subject: [PATCH] support/scripts/pkg-stats: add CPE searching links For cases of a CPE having a unknown version or when there hasn't been a CPE verified, proposed a search criteria to help the user research an update. (libcurl has NIST dict entries but not this version) cpe:2.3:a:haxx:libcurl:7.76.1:*:*:*:*:*:*:* CPE identifier unknown in CPE database (Search) (jitterentropy-library package doesn't have any NIST dict entries) no verified CPE identifier (Search) Signed-off-by: Matthew Weber [yann.morin.1998@free.fr: fix flake8 issues] Signed-off-by: Yann E. MORIN --- support/scripts/pkg-stats | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index 6f3ddc561f..76bc88b0ba 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -921,7 +921,13 @@ def dump_html_pkg(f, pkg): if pkg.cpeid: f.write(" %s\n" % pkg.cpeid) if not pkg.is_status_ok("cpe"): - f.write(" %s%s\n" % ("
" if pkg.cpeid else "", pkg.status['cpe'][1])) + if pkg.cpeid: + f.write("
%s (Search)\n" % # noqa: E501 + (pkg.status['cpe'][1], ":".join(pkg.cpeid.split(":")[0:5]))) + else: + f.write(" %s (Search)\n" % + (pkg.status['cpe'][1], pkg.name)) + f.write(" \n") f.write(" \n") -- 2.30.2