Skip to content

Commit

Permalink
Run the command without using shell=True.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
mgautierfr committed Nov 8, 2023
1 parent 1ed7fc4 commit 3b93d80
Show file tree
Hide file tree
Showing 36 changed files with 326 additions and 300 deletions.
23 changes: 10 additions & 13 deletions kiwixbuild/buildenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self):
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()
Expand Down Expand Up @@ -59,7 +59,7 @@ def _detect_binary(self, *bin_variants):
# Doesn't exist in PATH or isn't executable
continue
if retcode == 0:
return n
return [n]


def _detect_ninja(self):
Expand Down Expand Up @@ -165,17 +165,14 @@ def get_env(self, *, cross_comp_flags, cross_compilers, cross_path):

@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
4 changes: 2 additions & 2 deletions kiwixbuild/dependencies/aria2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class Source(ReleaseDownload):

def _post_prepare_script(self, context):
context.try_skip(self.extract_path)
command = "autoreconf -i"
command = ["autoreconf", "-i"]
run_command(command, self.extract_path, context)

class Builder(MakeBuilder):
dependencies = ['zlib']
configure_option = "--disable-libaria2 --disable-websocket --without-sqlite3"
configure_options = ["--disable-libaria2", "--disable-websocket", "--without-sqlite3"]
Loading

0 comments on commit 3b93d80

Please sign in to comment.