* [Buildroot] [PATCH 1/1] support/scripts/pkg-stats: add unsure_cves to cve_total calculation
@ 2024-10-23 9:52 Sen Hastings
2024-10-23 20:11 ` Thomas Petazzoni via buildroot
2024-11-09 16:28 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Sen Hastings @ 2024-10-23 9:52 UTC (permalink / raw)
To: buildroot; +Cc: Sen Hastings
When I initially made the CVE cells collapsible, I neglected to
count the unsure CVEs. This patch adds unsure CVEs to the cell collapsing
calcualation to ensure that cells with lots of unsure CVEs actually get collapsed.
This patch also removes the "+ 1" from the cve_total calculation,
which fixes the cve_total being off-by-one.
I'm not sure *why* I did that in the first place.
demo:
https://sen-h.codeberg.page/pkg-stats-demos/@pages/add-unsure_cves-to-cve_total-calc.html
Signed-off-by: Sen Hastings <sen@hastings.org>
---
support/scripts/pkg-stats | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
index f143af6446..33c21e77b4 100755
--- a/support/scripts/pkg-stats
+++ b/support/scripts/pkg-stats
@@ -1043,7 +1043,8 @@ def dump_html_pkg(f, pkg):
data_field_id = f'cves__{pkg_css_class}'
div_class = ["centered cves data"]
div_class.append(f'_{pkg_css_class}')
- if len(pkg.cves) > 10:
+ cve_total = len(pkg.cves) + len(pkg.unsure_cves)
+ if cve_total > 10:
div_class.append("collapse")
if pkg.is_status_ok("cve"):
div_class.append("cve-ok")
@@ -1054,8 +1055,7 @@ def dump_html_pkg(f, pkg):
else:
div_class.append("cve-unknown")
f.write(f' <div id="{data_field_id}" class="{" ".join(div_class)}">\n')
- if len(pkg.cves) > 10:
- cve_total = len(pkg.cves) + 1
+ if cve_total > 10:
f.write(f' <div onclick="expandField(\'{data_field_id}\')" \
class="see-more centered cve_ignored">see all ({cve_total}) ▾</div>\n')
if pkg.is_status_error("cve"):
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] support/scripts/pkg-stats: add unsure_cves to cve_total calculation
2024-10-23 9:52 [Buildroot] [PATCH 1/1] support/scripts/pkg-stats: add unsure_cves to cve_total calculation Sen Hastings
@ 2024-10-23 20:11 ` Thomas Petazzoni via buildroot
2024-11-09 16:28 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-10-23 20:11 UTC (permalink / raw)
To: Sen Hastings; +Cc: buildroot
On Wed, 23 Oct 2024 02:52:52 -0700
Sen Hastings <sen@hastings.org> wrote:
> When I initially made the CVE cells collapsible, I neglected to
> count the unsure CVEs. This patch adds unsure CVEs to the cell collapsing
> calcualation to ensure that cells with lots of unsure CVEs actually get collapsed.
>
> This patch also removes the "+ 1" from the cve_total calculation,
> which fixes the cve_total being off-by-one.
> I'm not sure *why* I did that in the first place.
>
> demo:
> https://sen-h.codeberg.page/pkg-stats-demos/@pages/add-unsure_cves-to-cve_total-calc.html
>
>
> Signed-off-by: Sen Hastings <sen@hastings.org>
> ---
> support/scripts/pkg-stats | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] support/scripts/pkg-stats: add unsure_cves to cve_total calculation
2024-10-23 9:52 [Buildroot] [PATCH 1/1] support/scripts/pkg-stats: add unsure_cves to cve_total calculation Sen Hastings
2024-10-23 20:11 ` Thomas Petazzoni via buildroot
@ 2024-11-09 16:28 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-11-09 16:28 UTC (permalink / raw)
To: buildroot
On 10/23/24 11:52, Sen Hastings wrote:
> When I initially made the CVE cells collapsible, I neglected to
> count the unsure CVEs. This patch adds unsure CVEs to the cell collapsing
> calcualation to ensure that cells with lots of unsure CVEs actually get collapsed.
>
> This patch also removes the "+ 1" from the cve_total calculation,
> which fixes the cve_total being off-by-one.
> I'm not sure *why* I did that in the first place.
>
> demo:
> https://sen-h.codeberg.page/pkg-stats-demos/@pages/add-unsure_cves-to-cve_total-calc.html
>
>
> Signed-off-by: Sen Hastings <sen@hastings.org>
Committed to 2024.02.x and 2024.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-09 16:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 9:52 [Buildroot] [PATCH 1/1] support/scripts/pkg-stats: add unsure_cves to cve_total calculation Sen Hastings
2024-10-23 20:11 ` Thomas Petazzoni via buildroot
2024-11-09 16:28 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox