utils/get-developers: bail out on parsing errors

Currently 4 types of parsing errors/warnings can be found:
- entry for a file that is not in the tree anymore (warning)
- developer entry with no file entry (error)
- file entry with no developer (error)
- entry that is not a developer, a file or a comment (hard error)

Currently only the last one ends the script with -v with error code.

Make all 3 error types into hard errors and bail out at the first error
found, because the rest of the state machine is not designed to handle
malformed input.
Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Ricardo Martincoski
2022-11-27 11:48:18 -03:00
committed by Thomas Petazzoni
parent ce3d349384
commit 5ee1dd85a3
2 changed files with 5 additions and 5 deletions

View File

@@ -243,6 +243,7 @@ def parse_developers(filename=None):
if name is not None or len(files) != 0:
print("Syntax error in DEVELOPERS file, line %d" % linen,
file=sys.stderr)
return None
name = line[2:].strip()
elif line.startswith("F:"):
fname = line[2:].strip()