aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-03-21 16:30:47 +0000
committerXavier Claessens <xclaesse@gmail.com>2023-03-21 19:17:05 -0400
commitb85ffbacb12701382da3404c9bd5aaf56e2c883f (patch)
treed23bb793da21911e22734c89215db60ce5ff11ce
parent3e7c08f358e9bd91808c8ff3b76c11aedeb82f85 (diff)
downloadmeson-b85ffbacb12701382da3404c9bd5aaf56e2c883f.zip
meson-b85ffbacb12701382da3404c9bd5aaf56e2c883f.tar.gz
meson-b85ffbacb12701382da3404c9bd5aaf56e2c883f.tar.bz2
Fix run_tool() when git is not installed
Previously, it would raise an exception.
-rw-r--r--mesonbuild/scripts/run_tool.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/scripts/run_tool.py b/mesonbuild/scripts/run_tool.py
index 88376dd..adf767a 100644
--- a/mesonbuild/scripts/run_tool.py
+++ b/mesonbuild/scripts/run_tool.py
@@ -19,7 +19,7 @@ from pathlib import Path
from concurrent.futures import ThreadPoolExecutor
from ..compilers import lang_suffixes
-from ..mesonlib import Popen_safe
+from ..mesonlib import quiet_git
import typing as T
if T.TYPE_CHECKING:
@@ -43,8 +43,8 @@ def run_tool(name: str, srcdir: Path, builddir: Path, fn: T.Callable[..., subpro
if patterns:
globs = [srcdir.glob(p) for p in patterns]
else:
- p, o, _ = Popen_safe(['git', 'ls-files'], cwd=srcdir)
- if p.returncode == 0:
+ r, o = quiet_git(['ls-files'], srcdir)
+ if r:
globs = [[Path(srcdir, f) for f in o.splitlines()]]
else:
globs = [srcdir.glob('**/*')]