meson: quote paths in generated systemd-runtest.env

Looking at aecb6eaed7, it seems that we
want build paths with spaces to be supported. Let's use 'printf %q' here
to make that work. Also, use capture:true to make the command less complicated.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-06-28 15:10:00 +02:00
parent 90b14808f2
commit 0a580dee6b

View File

@@ -2145,10 +2145,11 @@ endif
runtest_env = custom_target(
'systemd-runtest.env',
output : 'systemd-runtest.env',
command : [sh, '-c',
'{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@'.format(
meson.project_source_root() / 'test',
meson.project_build_root() / 'catalog')],
command : ['printf',
'SYSTEMD_TEST_DATA=%q\nSYSTEMD_CATALOG_DIR=%q\n',
meson.project_source_root() / 'test',
meson.project_build_root() / 'catalog'],
capture: true,
depends : catalogs,
build_by_default : true)