From 22adda16179e11dd7e5ca34a34e6286afcf6c0c9 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 20 Nov 2017 23:38:26 +0200 Subject: [PATCH] Review fixes. --- mesonbuild/backend/vs2010backend.py | 4 ++-- mesonbuild/backend/xcodebackend.py | 2 +- mesonbuild/environment.py | 2 +- mesonbuild/mesonlib.py | 4 ++-- mesonbuild/scripts/regen_checker.py | 11 ++++++----- msi/createmsi.py | 1 - 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index efa432990..69ee3e53a 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -23,7 +23,7 @@ from .. import dependencies from .. import mlog from .. import compilers from ..compilers import CompilerArgs -from ..mesonlib import MesonException, File +from ..mesonlib import MesonException, File, python_command from ..environment import Environment def autodetect_vs_version(build): @@ -396,7 +396,7 @@ class Vs2010Backend(backends.Backend): action = ET.SubElement(root, 'ItemDefinitionGroup') customstep = ET.SubElement(action, 'PostBuildEvent') cmd_raw = [target.command] + target.args - cmd = mesonlib.python_command + + cmd = python_command + \ [os.path.join(self.environment.get_script_dir(), 'commandrunner.py'), self.environment.get_build_dir(), self.environment.get_source_dir(), diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index ea9be308b..aca3aeae9 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -567,7 +567,7 @@ class XCodeBackend(backends.Backend): self.write_line('shellPath = /bin/sh;') script_root = self.environment.get_script_dir() test_script = os.path.join(script_root, 'meson_test.py') - cmd = mesonlib.python_command[test_script, test_data, '--wd', self.environment.get_build_dir()] + cmd = mesonlib.python_command + [test_script, test_data, '--wd', self.environment.get_build_dir()] cmdstr = ' '.join(["'%s'" % i for i in cmd]) self.write_line('shellScript = "%s";' % cmdstr) self.write_line('showEnvVarsInLog = 0;') diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 90450074b..58cc9b979 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -327,7 +327,7 @@ class Environment: def get_build_command(self, unbuffered=False): cmd = mesonlib.meson_command[:] if unbuffered and 'python' in cmd[0]: - cmd = [cmd[0],'-u'] + cmd[1:] + cmd.insert(1, '-u') return cmd def is_header(self, fname): diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 35aa03667..83bfdbe29 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -22,12 +22,12 @@ import collections from glob import glob -if sys.executable.endswith('meson.exe'): +if os.path.basename(sys.executable) == 'meson.exe': # In Windows and using the MSI installed executable. meson_command = [sys.executable] python_command = [sys.executable, 'runpython'] else: - meson_command = [sys.executable, os.path.join(os.path.split(__file__)[0], '..', 'meson.py')] + meson_command = [sys.executable, os.path.join(os.path.dirname(__file__), '..', 'meson.py')] python_command = [sys.executable] diff --git a/mesonbuild/scripts/regen_checker.py b/mesonbuild/scripts/regen_checker.py index e8fbd1963..a9b00c7b4 100644 --- a/mesonbuild/scripts/regen_checker.py +++ b/mesonbuild/scripts/regen_checker.py @@ -14,6 +14,7 @@ import sys, os import pickle, subprocess +from mesonbuild.mesonlib import meson_command # This could also be used for XCode. @@ -32,11 +33,11 @@ def need_regen(regeninfo, regen_timestamp): return False def regen(regeninfo, mesonscript, backend): - cmd = mesonlib.meson_command + ['--internal', - 'regenerate', - regeninfo.build_dir, - regeninfo.source_dir, - '--backend=' + backend] + cmd = meson_command + ['--internal', + 'regenerate', + regeninfo.build_dir, + regeninfo.source_dir, + '--backend=' + backend] subprocess.check_call(cmd) def run(args): diff --git a/msi/createmsi.py b/msi/createmsi.py index 4f1fd5bab..3ea09587d 100755 --- a/msi/createmsi.py +++ b/msi/createmsi.py @@ -17,7 +17,6 @@ import sys, os, subprocess, shutil, uuid from glob import glob import platform -import shutil import xml.etree.ElementTree as ET sys.path.append(os.getcwd())