aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/gettext.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-05 22:12:03 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-03-06 10:48:34 -0500
commite67fd1f55135c2a80257efcb9a19607024568f8d (patch)
treeb9925b5c6e82440fc975021f964b2c839be67173 /mesonbuild/scripts/gettext.py
parente80a9c2cbac3080dad6e55c070c83cac47d6d7f8 (diff)
downloadmeson-e67fd1f55135c2a80257efcb9a19607024568f8d.zip
meson-e67fd1f55135c2a80257efcb9a19607024568f8d.tar.gz
meson-e67fd1f55135c2a80257efcb9a19607024568f8d.tar.bz2
i18n module: fix bug that made msgfmthelper die on combinations of args
Due to misuse of argparse in commit 82492f5d765b70cc87385fb887008df89fac878e it was impossible to use both --datadirs and extra args passed directly to msgfmt at the same time. I'm not sure anyone actually knows how argparse works, so misusing it is easy. What is definitely known is that argparse is NOT a POSIX compliant parser and doesn't behave the way you'd expect a standards based parser to handle options. Instead it caters to the easy use case, and hopes and prays you don't need to do anything too complicated "with the wrong kind of complicated". Apparently, this particular type of complicated is when you have mixed option_arguments and operands while simultaneously passing some operands as nargs after a --. It totally breaks, and interprets --datadirs, which is supposed to be an option_argument, as an operand, eats it up as a msgfmt wrapped argument, and breaks. But if you don't pass additional arguments with -- then it interprets --datadirs after operands as an option_argument. This is what we were doing. Instead pass option_arguments before all operands (including the ones specified via `-- ...`). Add test case to pass meaningless datadirs (we don't actually care if $GETTEXTDATADIRS is set to something that doesn't contain gettext data).
Diffstat (limited to 'mesonbuild/scripts/gettext.py')
0 files changed, 0 insertions, 0 deletions