[Buildroot] [PATCH v2 2/6] support/scripts/pkg-stats: format upstream URL info consistently in HTML
Arnout Vandecappelle
arnout at rnout.be
Tue May 5 19:44:01 UTC 2026
On 26/04/2026 17:33, Fiona Klute via buildroot wrote:
> Use only one of the classes for "error" or "warning" status so they
> look different, and format the error/warning text for both. Do not
> make the text a link if the URL is None.
>
> Signed-off-by: Fiona Klute <fiona.klute at gmx.de>
Applied to master, thanks.
> ---
> support/scripts/pkg-stats | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
> index efb85a7405..a87bb23a8e 100755
> --- a/support/scripts/pkg-stats
> +++ b/support/scripts/pkg-stats
> @@ -1057,14 +1057,19 @@ def dump_html_pkg(f, pkg):
> div_class = ["centered upstream_url data"]
> div_class.append(f'_{pkg_css_class}')
> url_str = pkg.status['url'][1]
It looks like this could have been used below instead of repeating
pkg.status['url'][1]. But I'm too lazy to test so I left it unchanged.
Regards,
Arnout
> - if pkg.status['url'][0] in ("error", "warning"):
> - div_class.append("missing_url")
> - if pkg.status['url'][0] == "error":
> - div_class.append("invalid_url")
> - url_str = f"""<a href="{pkg.url}">{pkg.status['url'][1]}</a>"""
> - else:
> + if pkg.status['url'][0] == "ok":
> div_class.append("good_url")
> url_str = f'<a href="{pkg.url}">Link</a>'
> + else:
> + if pkg.status['url'][0] == "warning":
> + div_class.append("missing_url")
> + else:
> + # "error" status
> + div_class.append("invalid_url")
> + if pkg.url is not None:
> + url_str = f"""<a href="{pkg.url}">{pkg.status['url'][1]}</a>"""
> + else:
> + url_str = pkg.status['url'][1]
> f.write(f' <div id="{data_field_id}" class="{" ".join(div_class)}">{url_str}</div>\n')
>
> # CVEs
More information about the buildroot
mailing list