aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/commandrunner.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-03-25 08:07:46 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-03-28 00:55:01 +0530
commit27f5f0a9633b310f537f09ba0fdd79d86fcb962a (patch)
treef785006e3f80095df05d09bf3b7aa50f0def82fe /mesonbuild/scripts/commandrunner.py
parent53795d89df48ca722b018ff8720669deb6209be4 (diff)
downloadmeson-27f5f0a9633b310f537f09ba0fdd79d86fcb962a.zip
meson-27f5f0a9633b310f537f09ba0fdd79d86fcb962a.tar.gz
meson-27f5f0a9633b310f537f09ba0fdd79d86fcb962a.tar.bz2
Export MESONINTROSPECT to postconf/install/run_command scripts
Points to the `mesonintrospect.py` script corresponding to the currently-running version of Meson. Includes a test for all three methods of running scripts/commands. Closes https://github.com/mesonbuild/meson/issues/1385
Diffstat (limited to 'mesonbuild/scripts/commandrunner.py')
-rw-r--r--mesonbuild/scripts/commandrunner.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/mesonbuild/scripts/commandrunner.py b/mesonbuild/scripts/commandrunner.py
index cf2770d..87e3b8b 100644
--- a/mesonbuild/scripts/commandrunner.py
+++ b/mesonbuild/scripts/commandrunner.py
@@ -17,11 +17,11 @@ what to run, sets up the environment and executes the command."""
import sys, os, subprocess, shutil
-def run_command(source_dir, build_dir, subdir, command, arguments):
+def run_command(source_dir, build_dir, subdir, mesonintrospect, command, arguments):
env = {'MESON_SOURCE_ROOT': source_dir,
'MESON_BUILD_ROOT': build_dir,
'MESON_SUBDIR': subdir,
- }
+ 'MESONINTROSPECT': mesonintrospect}
cwd = os.path.join(source_dir, subdir)
child_env = os.environ.copy()
child_env.update(env)
@@ -47,9 +47,10 @@ def run(args):
src_dir = args[0]
build_dir = args[1]
subdir = args[2]
- command = args[3]
- arguments = args[4:]
- pc = run_command(src_dir, build_dir, subdir, command, arguments)
+ mesonintrospect = args[3]
+ command = args[4]
+ arguments = args[5:]
+ pc = run_command(src_dir, build_dir, subdir, mesonintrospect, command, arguments)
pc.wait()
return pc.returncode