Skip to content

Commit

Permalink
Transform \ path into / to please xapian configure.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr committed Nov 23, 2023
1 parent 08fba39 commit a88ab91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kiwixbuild/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ def extract_archive(archive_path, dest_dir, topdir=None, name=None):
if archive is not None:
archive.close()

def transform_path(path):
if path.startswith('C:'):
path = "/c" + path[2:].replace("\\", "/")
return path

def run_command(command, cwd, context, *, env=None, input=None, shell=False):
os.makedirs(cwd, exist_ok=True)
Expand All @@ -285,7 +289,8 @@ def run_command(command, cwd, context, *, env=None, input=None, shell=False):
if not option('verbose'):
log = open(context.log_file, 'w')
if shell:
command = shlex.join(command)
commands = (transform_path(p) for p in command)
command = shlex.join(commands)
print("run command '{}'".format(command), file=log)
print("current directory is '{}'".format(cwd), file=log)
print("env is :", file=log)
Expand Down

0 comments on commit a88ab91

Please sign in to comment.