aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/itstool.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-05 20:07:10 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-03-06 10:48:34 -0500
commit768616b0f8c0a0349e84517b51b1b8e51c79d6b6 (patch)
treeaee0e9eb61a93e21f9fd6976ab615583d3848255 /mesonbuild/scripts/itstool.py
parente67fd1f55135c2a80257efcb9a19607024568f8d (diff)
downloadmeson-768616b0f8c0a0349e84517b51b1b8e51c79d6b6.zip
meson-768616b0f8c0a0349e84517b51b1b8e51c79d6b6.tar.gz
meson-768616b0f8c0a0349e84517b51b1b8e51c79d6b6.tar.bz2
scripts: accept the path of the gettext commands to run as an argument
Don't assume itstool, msgfmt et al. are just magically on the path. Normally for commands being processed in build.ninja we'd look up the program in order to run it. Offer the same guarantee for programs being passed through an awkward script wrapper.
Diffstat (limited to 'mesonbuild/scripts/itstool.py')
-rw-r--r--mesonbuild/scripts/itstool.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/scripts/itstool.py b/mesonbuild/scripts/itstool.py
index fa3b0fa..72ac3e5 100644
--- a/mesonbuild/scripts/itstool.py
+++ b/mesonbuild/scripts/itstool.py
@@ -24,11 +24,13 @@ parser.add_argument('command')
parser.add_argument('--build-dir', default='')
parser.add_argument('-i', '--input', default='')
parser.add_argument('-o', '--output', default='')
+parser.add_argument('--itstool', default='itstool')
parser.add_argument('--its', action='append', default=[])
parser.add_argument('mo_files', nargs='+')
-def run_join(build_dir: str, its_files: T.List[str], mo_files: T.List[str], in_fname: str, out_fname: str) -> int:
+def run_join(build_dir: str, itstool: str, its_files: T.List[str], mo_files: T.List[str],
+ in_fname: str, out_fname: str) -> int:
if not mo_files:
print('No mo files specified to use for translation.')
return 1
@@ -53,7 +55,7 @@ def run_join(build_dir: str, its_files: T.List[str], mo_files: T.List[str], in_f
shutil.copy(mo_file, tmp_mo_fname)
locale_mo_files.append(tmp_mo_fname)
- cmd = ['itstool']
+ cmd = [itstool]
if its_files:
for fname in its_files:
cmd.extend(['-i', fname])
@@ -73,6 +75,7 @@ def run(args: T.List[str]) -> int:
if command == 'join':
return run_join(build_dir,
+ options.itstool,
options.its,
options.mo_files,
options.input,