summaryrefslogtreecommitdiff
path: root/tools/buildman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-20 02:48:18 +0300
committerSimon Glass <sjg@chromium.org>2023-07-24 18:34:10 +0300
commita114c6153699d0a9f3730d630a04a3c6c648a775 (patch)
tree0002050a6b200ce742fc8e96595c6041c4cc2659 /tools/buildman
parent5df95cf197c7746d431cbada05c87e6e826d77be (diff)
downloadu-boot-a114c6153699d0a9f3730d630a04a3c6c648a775.tar.xz
buildman: Tidy up common code in parse_file()
Use a function to add to the maintainers database, to avoid duplicating the same code twice. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman')
-rw-r--r--tools/buildman/boards.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py
index 541c82ff99..df57f278da 100644
--- a/tools/buildman/boards.py
+++ b/tools/buildman/boards.py
@@ -345,6 +345,12 @@ class MaintainersDatabase:
srcdir (str): Directory containing source code (Kconfig files)
fname (str): MAINTAINERS file to be parsed
"""
+ def add_targets():
+ """Add any new targets"""
+ if targets:
+ for target in targets:
+ self.database[target] = (status, maintainers)
+
targets = []
maintainers = []
status = '-'
@@ -382,14 +388,11 @@ class MaintainersDatabase:
if match and not rear:
targets.append(front)
elif line == '\n':
- for target in targets:
- self.database[target] = (status, maintainers)
+ add_targets()
targets = []
maintainers = []
status = '-'
- if targets:
- for target in targets:
- self.database[target] = (status, maintainers)
+ add_targets()
class Boards: