support/pkg-stats: fix regression after cleanup in show-info

Commit 471ecea5ee (core/show-info: 'name' only applies to packages)
removed the 'name' field for rootfs (really, for non-package) entries,
thus breaking the pkg-stats processing.

We fix that by excluding any entry that has no 'name', on the assumption
that if it has no name, it is not a package.

Reported-by: Xogium on IRC
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Yann E. MORIN 2022-02-12 19:41:55 +01:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent d7b999e947
commit 0319170f50

View File

@ -371,7 +371,7 @@ def get_pkglist(npackages, package_list):
def get_config_packages(): def get_config_packages():
cmd = ["make", "--no-print-directory", "show-info"] cmd = ["make", "--no-print-directory", "show-info"]
js = json.loads(subprocess.check_output(cmd)) js = json.loads(subprocess.check_output(cmd))
return set([v["name"] for v in js.values()]) return set([v["name"] for v in js.values() if 'name' in v])
def package_init_make_info(): def package_init_make_info():