From e8dcebf4597d74dc12c86535118ae0bd16d272a0 Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Sun, 26 Apr 2026 17:33:32 +0200 Subject: [PATCH] support/scripts/pkg-stats: fix host/target infra filter The filter is supposed to exclude host/target infra from output if the respective package is not built with the current configuration. However, excluding host packages did not work correctly: If keep_host is False because the host package is not built, the next branch was checked and included the host infra in output with "target" type if the target package is built. For a package that support host and target build, but gets built only for the target, this leads to output like (Meson example): meson (target) host-meson (target) Skip host infra in the target branch instead. Also include Package.infra in Package.__str__() result, which was needed for debugging this bug. Signed-off-by: Fiona Klute Signed-off-by: Arnout Vandecappelle --- 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 a87bb23a8e..bbd1e3e6f0 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -205,7 +205,7 @@ class Package: infra = match.group(1) if infra.startswith("host-") and keep_host: self.infras.append(("host", infra[5:])) - elif keep_target: + elif not infra.startswith("host-") and keep_target: self.infras.append(("target", infra)) def set_license(self): @@ -342,9 +342,10 @@ class Package: return self.path < other.path def __str__(self): - return "%s (path='%s', license='%s', license_files='%s', hash='%s', patches=%d)" % \ + return "%s (path='%s', license='%s', license_files='%s', hash='%s', patches=%d, infras=%r)" % \ (self.name, self.path, self.is_status_ok('license'), - self.is_status_ok('license-files'), self.status['hash'], self.patch_count) + self.is_status_ok('license-files'), self.status['hash'], self.patch_count, + self.infras) def get_pkglist(trees, npackages, package_list):