Skip to contentSkip to conversation

buildman: Ignore blank lines during size checks

PATCH New Tom Rini 2 participants 2 messages Dec 6, 2019

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 buildman: Ignore blank lines during size checks

Today when parsing the .sizes files we get a warning about an invalid line in the file as it's blank. Solve this by checking that we have a non-blank line prior to processing.

---
 tools/buildman/builder.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/buildman/builder.py +2 -1
index cfbe4c26b1a9..784c64122ba6 100644
@@ -577,7 +577,8 @@ class Builder:
         sym = {}
         for line in fd.readlines():
             try:
-                size, type, name = line[:-1].split()
+                if line.strip():
+                    size, type, name = line[:-1].split()
             except:
                 Print("Invalid line in file '%s': '%s'" % (fname, line[:-1]))
                 continue
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 buildman: Ignore blank lines during size checks

Hi Tom,

Quoted 10 lines · Tom Rini

Today when parsing the .sizes files we get a warning about an invalid line in the file as it's blank. Solve this by checking that we have a non-blank line prior to processing.

---
 tools/buildman/builder.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

I haven't seen this problem, but certainly this is safer.

Regards,
Simon