From: "Yann E. MORIN" <[email protected]>
Signed-off-by: Yann E. MORIN <[email protected]>
Cc: Michael Klein <[email protected]>
Cc: Vincent Fazio <[email protected]>
---
support/scripts/size-stats | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index 79c0dc571e..fdcaeaa546 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -54,9 +54,8 @@ 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)
+ for relpath2, abspath2 in get_associated_files(relpath, abspath):
+ add_file(filesdict, relpath2, abspath2, pkg)
if not os.path.exists(abspath):
return
if os.path.islink(abspath):
@@ -65,6 +64,22 @@ def add_file(filesdict, relpath, abspath, pkg):
filesdict[relpath] = (pkg, sz)
+#
+# Returns an iterator over the files associated with the given one
+# as a 2-tuple of (relpath, abspath).
+#
+# Supported files:
+# *.py => yields the list of corresponding pre-compiled .pyc files
+#
+# relpath: relative path of the file
+# fullpath: absolute path to the file
+#
+def get_associated_files(relpath, abspath):
+ # also check for compiled .pyc file
+ if relpath.endswith(".py"):
+ yield (relpath + "c", abspath + "c")
+
+
#
# This function returns a dict where each key is the path of a file in
# the root filesystem, and the value is a tuple containing two
--
2.43.0
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.