Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] size-stats: count compiled python (.pyc) files
@ 2022-09-01 11:40 Michael Klein via buildroot
  2022-09-24  8:35 ` Thomas Petazzoni
  2022-09-30 15:11 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Klein via buildroot @ 2022-09-01 11:40 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas De Schampheleire

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 <m.klein@mvz-labor-lb.de>
---
 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):
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-30 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-01 11:40 [Buildroot] [PATCH 1/1] size-stats: count compiled python (.pyc) files Michael Klein via buildroot
2022-09-24  8:35 ` Thomas Petazzoni
2022-09-30 15:11 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox