From c31ba5cfe9edc9b354967dc8e69be09b9c735481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 23 Aug 2023 12:23:50 +0200 Subject: [PATCH] meson: use 'sh' variable everywhere We went back-and-forth a bit on this. Very old meson would print a message about detecting the program if a quoted argument was used, leading to a lot of noise. So we started to convert various places to use the variable, but then it turned out that meson < 0.56.2 doesn't handle this correctly and we reverted to using strings everywhere in 7c22f07cbd86b39e78990057687e5509fa299672. Then at some point we stopped supporting old meson and over time we started using the variable in various places again, somewhat inconsistently. Then most calls to 'sh' were removed in 9289e093ae6fd5484f9119e1ee07d1dffe37cd10 when install_emptydir() builtin started being used. Now meson allows either the string or variable to be used, and doesn't print a message if the string is used. Let's use the variable everywhere. For 'sh', we could do either, but for other variables, we _do_ want the detection to happen, for example for git, find, awk, which might not be installed and we want to detect that early, before we start the build. It would be ugly to use quotes for some programs, but not for others. Also, a string is still refused for test(), so we couldn't use the string version even if we didn't care about detection. --- catalog/meson.build | 2 +- hwdb.d/meson.build | 2 +- meson.build | 2 +- src/journal/meson.build | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/catalog/meson.build b/catalog/meson.build index 146daba124..3c62749cf9 100644 --- a/catalog/meson.build +++ b/catalog/meson.build @@ -34,5 +34,5 @@ foreach file : in_files install_dir : catalogdir) endforeach -meson.add_install_script('sh', '-c', +meson.add_install_script(sh, '-c', 'test -n "$DESTDIR" || @0@/journalctl --update-catalog'.format(bindir)) diff --git a/hwdb.d/meson.build b/hwdb.d/meson.build index 64a7e7d506..32e6505bc6 100644 --- a/hwdb.d/meson.build +++ b/hwdb.d/meson.build @@ -53,7 +53,7 @@ if conf.get('ENABLE_HWDB') == 1 if install_sysconfdir install_emptydir(sysconfdir / 'udev/hwdb.d') - meson.add_install_script('sh', '-c', + meson.add_install_script(sh, '-c', 'test -n "$DESTDIR" || @0@/systemd-hwdb update'.format(bindir)) endif diff --git a/meson.build b/meson.build index 8f7da1ec6e..e8786c24c6 100644 --- a/meson.build +++ b/meson.build @@ -2707,7 +2707,7 @@ foreach dict : modules if is_nss # We cannot use shared_module because it does not support version suffix. # Unfortunately shared_library insists on creating the symlink… - meson.add_install_script('sh', '-c', 'rm $DESTDIR@0@/lib@1@.so'.format(libdir, name), + meson.add_install_script(sh, '-c', 'rm $DESTDIR@0@/lib@1@.so'.format(libdir, name), install_tag : 'nss') endif diff --git a/src/journal/meson.build b/src/journal/meson.build index 9b0dc2cf58..402522827f 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -188,12 +188,12 @@ if get_option('create-log-dirs') install_mode : [ 'rwxr-xr-x', 'root', 'root' ]) if get_option('adm-group') meson.add_install_script( - 'sh', '-c', + sh, '-c', 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :') endif if get_option('wheel-group') meson.add_install_script( - 'sh', '-c', + sh, '-c', 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :') endif endif