vk/update-aliases.py: handle "no match" grep call

This was not necessary before because there was always at least the
vk.xml file itself in the `src/` search path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
This commit is contained in:
Eric Engestrom
2022-08-07 19:44:58 +01:00
committed by Marge Bot
parent c6ebf9d643
commit d8b38ec4a3
+8 -2
View File
@@ -88,12 +88,18 @@ def main(paths: list[str]):
# be extremely slow.
files_with_aliases = set()
for aliases_chunk in chunks([*aliases], 500):
search_output = subprocess.check_output([
grep_cmd = [
'git',
'grep',
'-rlP',
'|'.join(aliases_chunk),
] + paths, stderr=subprocess.DEVNULL).decode()
] + paths
search_output = subprocess.run(
grep_cmd,
check=False,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
).stdout.decode()
files_with_aliases.update(search_output.splitlines())