Run the command without using shell=True.

It mainly allow to run command in directory containing space.
(Hello, `C:\Program Files\...`)
It would also allow to work on directory containning spaces
(`C:\Users\John Doe`) but xapian configure (at least) expressly doesn't
support it :/

- Run the command without shell=True
- The command must be a list instead of a string.
- All options must also be a list (or an iterable).
This commit is contained in:
Matthieu Gautier
2018-06-19 11:27:07 +02:00
parent e87835c61d
commit c99a9bd91f
36 changed files with 326 additions and 298 deletions

View File

@ -30,7 +30,7 @@ class PlatformNeutralEnv:
self.qmake_command = self._detect_qmake()
if not self.qmake_command:
print("WARNING: qmake command not found.", file=sys.stderr)
self.mesontest_command = "{} test".format(self.meson_command)
self.mesontest_command = [*self.meson_command, "test"]
def detect_platform(self):
_platform = platform.system()
@ -59,7 +59,7 @@ class PlatformNeutralEnv:
# Doesn't exist in PATH or isn't executable
continue
if retcode == 0:
return n
return [n]
def _detect_ninja(self):
@ -165,17 +165,14 @@ class BuildEnv:
@property
def configure_wrapper(self):
wrapper = getattr(self.platformInfo, "configure_wrapper", "")
if wrapper:
return "{} ".format(wrapper)
else:
return ""
try:
yield self.platformInfo.configure_wrapper
except AttributeError:
pass
@property
def make_wrapper(self):
wrapper = getattr(self.platformInfo, "make_wrapper", "")
if wrapper:
return "{} ".format(wrapper)
else:
return ""
try:
yield self.platformInfo.make_wrapper
except AttributeError:
pass