aboutsummaryrefslogtreecommitdiff
path: root/test cases
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 /test cases
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 'test cases')
-rw-r--r--test cases/frameworks/6 gettext/data/meson.build1
-rw-r--r--test cases/frameworks/6 gettext/data2/meson.build1
2 files changed, 2 insertions, 0 deletions
diff --git a/test cases/frameworks/6 gettext/data/meson.build b/test cases/frameworks/6 gettext/data/meson.build
index 1afb403..698eeec 100644
--- a/test cases/frameworks/6 gettext/data/meson.build
+++ b/test cases/frameworks/6 gettext/data/meson.build
@@ -4,6 +4,7 @@ i18n.merge_file(
output: '@BASENAME@',
type: 'desktop',
po_dir: '../po',
+ data_dirs: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
diff --git a/test cases/frameworks/6 gettext/data2/meson.build b/test cases/frameworks/6 gettext/data2/meson.build
index b8c90a1..9a992c9 100644
--- a/test cases/frameworks/6 gettext/data2/meson.build
+++ b/test cases/frameworks/6 gettext/data2/meson.build
@@ -3,6 +3,7 @@ i18n.merge_file(
output: 'test.plugin',
type: 'desktop',
po_dir: '../po',
+ data_dirs: '../po',
args: ['--keyword=Description'],
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')