summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-10-25 07:14:16 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2025-10-25 07:14:16 +0200
commit6698f655161e25471b0c62c73dd92c548519b4f8 (patch)
tree9a76380ad07159facc750a3e21c96a026df96963
parentd705599e2a0fa99e791af9b349e901b54cb93304 (diff)
nfpvalues, size: handle missing sections in size output
-rwxr-xr-xscript/nfpvalues.py6
-rwxr-xr-xscript/size.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/script/nfpvalues.py b/script/nfpvalues.py
index d82a124..0680fa6 100755
--- a/script/nfpvalues.py
+++ b/script/nfpvalues.py
@@ -24,15 +24,15 @@ def main(size_executable, rom_sections, ram_sections):
section_size = dict()
for line in status.stdout.split("\n"):
- match = re.match("[.](\S+)\s+(\d+)", line)
+ match = re.match(r"[.](\S+)\s+(\d+)", line)
if match:
section = match.group(1)
size = int(match.group(2))
section_size[section] = size
total = {
- "ROM": sum(map(lambda section: section_size[section], rom_sections)),
- "RAM": sum(map(lambda section: section_size[section], ram_sections)),
+ "ROM": sum(map(lambda section: section_size.get(section, 0), rom_sections)),
+ "RAM": sum(map(lambda section: section_size.get(section, 0), ram_sections)),
}
output = {"OS Image": total}
diff --git a/script/size.py b/script/size.py
index e1f6605..c11e4cd 100755
--- a/script/size.py
+++ b/script/size.py
@@ -31,8 +31,8 @@ def main(size_executable, rom_sections, ram_sections):
section_size[section] = size
total = {
- "ROM": sum(map(lambda section: section_size[section], rom_sections)),
- "RAM": sum(map(lambda section: section_size[section], ram_sections)),
+ "ROM": sum(map(lambda section: section_size.get(section, 0), rom_sections)),
+ "RAM": sum(map(lambda section: section_size.get(section, 0), ram_sections)),
}
output = {"section": section_size, "total": total}