[Buildroot] [PATCH v2 2/6] support/scripts/pkg-stats: format upstream URL info consistently in HTML

Thomas Perale thomas.perale at mind.be
Fri May 15 17:46:34 UTC 2026


In reply of:
> 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 2025.02.x & 2026.02.x. 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]
> -    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
> -- 
> 2.53.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot


More information about the buildroot mailing list