From 8fd5297f76d3b61ce0c4c89db7fd1a5d31f16a29 Mon Sep 17 00:00:00 2001 From: "Marty E. Plummer" Date: Mon, 17 Sep 2018 12:23:39 -0500 Subject: [PATCH] i18n: replace path separator with @ using state.subdir will cause / or \ to be inserted into the target name. Replace them with @ to future-proof it. Signed-off-by: Marty E. Plummer --- mesonbuild/modules/i18n.py | 2 +- test cases/frameworks/6 gettext/data/data3/meson.build | 9 +++++++++ .../frameworks/6 gettext/data/data3/test.desktop.in | 6 ++++++ test cases/frameworks/6 gettext/data/meson.build | 2 ++ test cases/frameworks/6 gettext/installed_files.txt | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 test cases/frameworks/6 gettext/data/data3/meson.build create mode 100644 test cases/frameworks/6 gettext/data/data3/test.desktop.in diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py index 8b5e18162..686164ef5 100644 --- a/mesonbuild/modules/i18n.py +++ b/mesonbuild/modules/i18n.py @@ -94,7 +94,7 @@ class I18nModule(ExtensionModule): values = mesonlib.get_filenames_templates_dict([ifile_abs], None) outputs = mesonlib.substitute_values([output], values) output = outputs[0] - ct = build.CustomTarget(output + '_' + state.subdir + '_merge', state.subdir, state.subproject, kwargs) + ct = build.CustomTarget(output + '_' + state.subdir.replace('/', '@').replace('\\', '@') + '_merge', state.subdir, state.subproject, kwargs) return ModuleReturnValue(ct, [ct]) @FeatureNewKwargs('i18n.gettext', '0.37.0', ['preset']) diff --git a/test cases/frameworks/6 gettext/data/data3/meson.build b/test cases/frameworks/6 gettext/data/data3/meson.build new file mode 100644 index 000000000..a09f3fca2 --- /dev/null +++ b/test cases/frameworks/6 gettext/data/data3/meson.build @@ -0,0 +1,9 @@ +# Use filename substitution +i18n.merge_file( + input: 'test.desktop.in', + output: 'test4.desktop', + type: 'desktop', + po_dir: '../../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications') +) diff --git a/test cases/frameworks/6 gettext/data/data3/test.desktop.in b/test cases/frameworks/6 gettext/data/data3/test.desktop.in new file mode 100644 index 000000000..33b9a9fd8 --- /dev/null +++ b/test cases/frameworks/6 gettext/data/data3/test.desktop.in @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Test +GenericName=Application +Comment=Test Application +Type=Application + diff --git a/test cases/frameworks/6 gettext/data/meson.build b/test cases/frameworks/6 gettext/data/meson.build index a6b0a8b08..0a7811bda 100644 --- a/test cases/frameworks/6 gettext/data/meson.build +++ b/test cases/frameworks/6 gettext/data/meson.build @@ -26,3 +26,5 @@ i18n.merge_file( install: true, install_dir: join_paths(get_option('datadir'), 'applications') ) + +subdir('data3') diff --git a/test cases/frameworks/6 gettext/installed_files.txt b/test cases/frameworks/6 gettext/installed_files.txt index 929890912..868f4c106 100644 --- a/test cases/frameworks/6 gettext/installed_files.txt +++ b/test cases/frameworks/6 gettext/installed_files.txt @@ -4,3 +4,4 @@ usr/share/locale/fi/LC_MESSAGES/intltest.mo usr/share/applications/test.desktop usr/share/applications/test2.desktop usr/share/applications/test3.desktop +usr/share/applications/test4.desktop