From a54a7bf805424dacb02a17b7de5a5ebacec7356e Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Thu, 1 Sep 2022 13:40:07 +0200 Subject: [PATCH] support/scripts/size-stats: count compiled python (.pyc) files Any .pyc files generated by the pycompile script during target finalization are currently counted in the "Unknown" package, because packages-file-list.txt only contains the source .py file. If a .py file is added to filesdict, add the corresponding .pyc file as well. Signed-off-by: Michael Klein Signed-off-by: Thomas Petazzoni --- support/scripts/size-stats | 3 +++ 1 file changed, 3 insertions(+) diff --git a/support/scripts/size-stats b/support/scripts/size-stats index e4389e99b5..79c0dc571e 100755 --- a/support/scripts/size-stats +++ b/support/scripts/size-stats @@ -54,6 +54,9 @@ class Config: # pkg: package to which the file belongs # def add_file(filesdict, relpath, abspath, pkg): + if relpath.endswith(".py"): + # also check for compiled .pyc file + add_file(filesdict, relpath + "c", abspath + "c", pkg) if not os.path.exists(abspath): return if os.path.islink(abspath):