From c3c5320ce28b059ff7913a6468b2133b6cf8f16e Mon Sep 17 00:00:00 2001 From: Daniel Lang Date: Fri, 1 Sep 2023 21:27:10 +0200 Subject: [PATCH] support/scripts/pkg-stats: check all files for warnings Instead of only checking .mk and Config.in{,.host}, check all files in a package directory. .checkpackageignore isn't considered here, therefore the shown number includes ignored warnings as well. Add another css class to signal some warning, compared to a lot (>5), similar to patches. Signed-off-by: Daniel Lang Signed-off-by: Thomas Petazzoni --- support/scripts/pkg-stats | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index eca638f396..9349a0df57 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -272,8 +272,7 @@ class Package: self.status['pkg-check'] = ("error", "Missing") for root, dirs, files in os.walk(pkgdir): for f in files: - if f.endswith(".mk") or f.endswith(".hash") or f == "Config.in" or f == "Config.in.host": - cmd.append(os.path.join(root, f)) + cmd.append(os.path.join(root, f)) o = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[1] lines = o.splitlines() for line in lines: @@ -876,7 +875,7 @@ function expandField(fieldId){ .wrong, .lotsofpatches, .invalid_url, .version-needs-update, .cpe-nok, .cve-nok { background: #ff9a69; } - .somepatches, .missing_url, .version-unknown, .cpe-unknown, .cve-unknown { + .somepatches, .somewarnings, .missing_url, .version-unknown, .cpe-unknown, .cve-unknown { background: #ffd870; } .cve_ignored, .version-error { @@ -1033,6 +1032,8 @@ def dump_html_pkg(f, pkg): div_class.append(f'_{pkg_css_class}') if pkg.warnings == 0: div_class.append("correct") + elif pkg.warnings < 5: + div_class.append("somewarnings") else: div_class.append("wrong") f.write(f'
{pkg.warnings}
\n')