module_deps: Fix minor bugs with GN command Bug: b/522852278 Change-Id: Ia7602dc6d23670b340d2298cfa66e13015639c8f Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/426552
diff --git a/recipes/module_deps.py b/recipes/module_deps.py index 3cf2b53..a8be216 100644 --- a/recipes/module_deps.py +++ b/recipes/module_deps.py
@@ -105,7 +105,7 @@ query_result = api.step( 'gn desc', - ['gn', 'desc', 'out', '//...', 'deps', '--all', '--as=label'], + ['gn', 'desc', 'out', ':default', 'deps', '--all', '--as=label'], stdout=api.raw_io.output_text(add_output_log=True), ) @@ -113,10 +113,8 @@ deps = set() for line in stdout.splitlines(): line = line.strip() - if '//pw_' in line or '/pw_' in line: - match = re.search(r'/(pw_[^/:]+)', line) - if match: - deps.add(match.group(1)) + for match in re.finditer(r'/(pw_[^/:]+)', line): + deps.add(match.group(1)) sorted_deps = sorted(deps) if sorted_deps: