summaryrefslogtreecommitdiff
path: root/tools/dtoc/src_scan.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-03 06:00:52 -0700
committerSimon Glass <sjg@chromium.org>2021-03-22 19:23:27 +1300
commit36b2220cbd62c7829b8e845777318f323a963e47 (patch)
tree8054740ca697d6e38cf84dc3af9c6761a25eed41 /tools/dtoc/src_scan.py
parenta32eb7dca7c3ea8d23e1bc0ce927ad2a00d8bf45 (diff)
dtoc: Ignore unwanted files when scanning for drivers
We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/src_scan.py')
-rw-r--r--tools/dtoc/src_scan.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/dtoc/src_scan.py b/tools/dtoc/src_scan.py
index 095fb6d4766..761164a9c9a 100644
--- a/tools/dtoc/src_scan.py
+++ b/tools/dtoc/src_scan.py
@@ -345,6 +345,11 @@ class Scanner:
This procedure will populate self._drivers and self._driver_aliases
"""
for (dirpath, _, filenames) in os.walk(self._basedir):
+ rel_path = dirpath[len(self._basedir):]
+ if rel_path.startswith('/'):
+ rel_path = rel_path[1:]
+ if rel_path.startswith('build') or rel_path.startswith('.git'):
+ continue
for fname in filenames:
if not fname.endswith('.c'):
continue