diff options
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r-- | mesonbuild/scripts/commandrunner.py | 21 | ||||
-rw-r--r-- | mesonbuild/scripts/meson_install.py | 5 |
2 files changed, 18 insertions, 8 deletions
diff --git a/mesonbuild/scripts/commandrunner.py b/mesonbuild/scripts/commandrunner.py index 87e3b8b..f99cddb 100644 --- a/mesonbuild/scripts/commandrunner.py +++ b/mesonbuild/scripts/commandrunner.py @@ -15,13 +15,14 @@ """This program is a wrapper to run external commands. It determines what to run, sets up the environment and executes the command.""" -import sys, os, subprocess, shutil +import sys, os, subprocess, shutil, shlex -def run_command(source_dir, build_dir, subdir, mesonintrospect, command, arguments): +def run_command(source_dir, build_dir, subdir, meson_command, command, arguments): env = {'MESON_SOURCE_ROOT': source_dir, 'MESON_BUILD_ROOT': build_dir, 'MESON_SUBDIR': subdir, - 'MESONINTROSPECT': mesonintrospect} + 'MESONINTROSPECT': ' '.join([shlex.quote(x) for x in meson_command + ['introspect']]), + } cwd = os.path.join(source_dir, subdir) child_env = os.environ.copy() child_env.update(env) @@ -47,10 +48,16 @@ def run(args): src_dir = args[0] build_dir = args[1] subdir = args[2] - mesonintrospect = args[3] - command = args[4] - arguments = args[5:] - pc = run_command(src_dir, build_dir, subdir, mesonintrospect, command, arguments) + meson_command = args[3] + if 'python' in meson_command: # Hack. + meson_command = [meson_command, args[4]] + command = args[5] + arguments = args[6:] + else: + meson_command = [meson_command] + command = args[4] + arguments = args[5:] + pc = run_command(src_dir, build_dir, subdir, meson_command, command, arguments) pc.wait() return pc.returncode diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py index 01ea771..dadb85a 100644 --- a/mesonbuild/scripts/meson_install.py +++ b/mesonbuild/scripts/meson_install.py @@ -13,6 +13,7 @@ # limitations under the License. import sys, pickle, os, shutil, subprocess, gzip, platform, errno +import shlex from glob import glob from . import depfixer from . import destdir_join @@ -247,7 +248,9 @@ def run_install_script(d): 'MESON_BUILD_ROOT': d.build_dir, 'MESON_INSTALL_PREFIX': d.prefix, 'MESON_INSTALL_DESTDIR_PREFIX': d.fullprefix, - 'MESONINTROSPECT': d.mesonintrospect} + 'MESONINTROSPECT': ' '.join([shlex.quote(x) for x in d.mesonintrospect]), + } + print(env) child_env = os.environ.copy() child_env.update(env) |