summaryrefslogtreecommitdiffstats
path: root/test/meson.build
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-08-16 21:22:57 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-08-17 13:50:26 +0200
commitcc2a0d85d2733b0a3285e16ca8a869cad84a03ec (patch)
tree814ecca38a9c217cbc0f88f2048eb99b8e783dbd /test/meson.build
parentbus-polkit: don't propagate error from polkit (diff)
downloadsystemd-cc2a0d85d2733b0a3285e16ca8a869cad84a03ec.tar.xz
systemd-cc2a0d85d2733b0a3285e16ca8a869cad84a03ec.zip
meson: Use rsync to copy test data directories
install_subdir() does not copy symlinks but copies the file they point to. We also get a very ugly warning in the meson install output: """ Warning: trying to copy a symlink that points to a file. This will copy the file, but this will be changed in a future version of Meson to copy the symlink as is. Please update your build definitions so that it will not break when the change happens. """ Let's fix both problems at once by using rsync which does the right thing. Verified by running systemd-dissect --mtree on both the install output before and after and all the symlinks are now correctly preserved.
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/meson.build b/test/meson.build
index 836a506ed8..73a8ae2b1c 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -23,9 +23,18 @@ if install_tests
'testsuite-63.units',
'testsuite-80.units',
]
- install_subdir(subdir,
- exclude_files : '.gitattributes',
- install_dir : testdata_dir)
+ # install_subdir() does not handle symlinks correctly which causes a very ugly warning when
+ # installing, so if rsync is available we use that instead. See
+ # https://github.com/mesonbuild/meson/issues/9233.
+ if rsync.found()
+ rsync_r = rsync.full_path() + ' -rlpt --exclude .gitattributes -- "@0@" "${DESTDIR:-}@1@"'
+ meson.add_install_script(sh, '-c',
+ rsync_r.format(meson.current_source_dir() / subdir, testdata_dir))
+ else
+ install_subdir(subdir,
+ exclude_files : '.gitattributes',
+ install_dir : testdata_dir)
+ endif
endforeach
install_data(kbd_model_map,