]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: quote paths in generated systemd-runtest.env
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 28 Jun 2025 13:10:00 +0000 (15:10 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 28 Jun 2025 13:10:00 +0000 (15:10 +0200)
Looking at aecb6eaed7d39d73f296c86a882c644b18b7e634, 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.

meson.build

index 0c2cb66fc32efa90c553c63dca77d531b30731ea..5ef61010fa6cf7f553e0bddd58b5f8c3f234b68a 100644 (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)