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

@ -223,8 +223,12 @@ class FlatpakBuilder:
def build(self):
log = pj(self.platform.buildEnv.log_dir, 'cmd_build_flatpak.log')
context = Context('build', log, False)
command = "flatpak-builder --user --ccache --force-clean --keep-build-dirs --disable-rofiles-fuse --repo=repo builddir {id}.json"
command = command.format(id = MANIFEST['app-id'])
command = [
"flatpak-builder",
"--user", "--ccache", "--force-clean", "--keep-build-dirs",
"--disable-rofiles-fuse", "--repo=repo", "builddir",
f"{MANIFEST['app-id']}.json"
]
try:
run_command(command, self.platform.buildEnv.build_dir, context, env=self.platform.get_env())
context._finalise()
@ -236,8 +240,12 @@ class FlatpakBuilder:
def bundle(self):
log = pj(self.platform.buildEnv.log_dir, 'cmd_bundle_flatpak.log')
context = Context('bundle', log, False)
command = "flatpak build-bundle repo {id}.flatpak {id}"
command = command.format(id = MANIFEST['app-id'])
app_id = MANIFEST['app-id']
command = [
"flatpak", "build-bundle", "repo",
f"{app_id}.flatpak",
app_id
]
try:
run_command(command, self.platform.buildEnv.build_dir, context, env=self.platform.get_env())
context._finalise()