]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use 'sh' variable everywhere
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 23 Aug 2023 10:23:50 +0000 (12:23 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 24 Aug 2023 09:17:50 +0000 (11:17 +0200)
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
hwdb.d/meson.build
meson.build
src/journal/meson.build

index 146daba1249e6eaff15ab1863676c138c2fe949d..3c62749cf982be69cc6a4ab96e24a95af119cd1a 100644 (file)
@@ -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))
index 64a7e7d5065226f184d37b527b0305fa53a07e75..32e6505bc61e21d543d7c85e8d79a9afc200bd6a 100644 (file)
@@ -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
 
index 8f7da1ec6e3412912c37b135ee3f71da1e9e4aaa..e8786c24c693b63459bf67d7da68d95edbc2bd37 100644 (file)
@@ -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
 
index 9b0dc2cf58479d47e3b3929dff1fca188fe58bb2..402522827f46563e247df9b6bfe9b9cd35a0fff5 100644 (file)
@@ -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