Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Klein via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Subject: [Buildroot] [PATCH 1/1] size-stats: count compiled python (.pyc) files
Date: Thu, 1 Sep 2022 13:40:07 +0200	[thread overview]
Message-ID: <YxCaF6FKRqXSPeWS@LLGMVZLB-0037> (raw)

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

             reply	other threads:[~2022-09-01 11:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 11:40 Michael Klein via buildroot [this message]
2022-09-24  8:35 ` [Buildroot] [PATCH 1/1] size-stats: count compiled python (.pyc) files Thomas Petazzoni
2022-09-30 15:11 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YxCaF6FKRqXSPeWS@LLGMVZLB-0037 \
    --to=buildroot@buildroot.org \
    --cc=m.klein@mvz-labor-lb.de \
    --cc=thomas.de_schampheleire@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox