]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use find_program() for add-git-hook.sh
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 28 Mar 2020 08:30:51 +0000 (09:30 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 28 Mar 2020 11:37:28 +0000 (12:37 +0100)
On azure systemd.systemd ci, the build would fail with:
meson.build:53:0: ERROR: Program or command '/home/appuser/fuzzer/tools/add-git-hook.sh' not found or not executable

We use find_program() for all helpers, so let's do it for this one too.
This should solve the issue, whatever it exactly is.

meson.build

index d3bdfada8557f7ecede15ac3ee91933d90fd9792..28042f0ae6674cd63c4bd92a4a30342fbe68ed27 100644 (file)
@@ -50,9 +50,12 @@ fuzzer_build = want_ossfuzz or want_libfuzzer or want_fuzzbuzz
 #####################################################################
 
 # Try to install the git pre-commit hook
-git_hook = run_command(join_paths(project_source_root, 'tools/add-git-hook.sh'))
-if git_hook.returncode() == 0
-        message(git_hook.stdout().strip())
+add_git_hook_sh = find_program('tools/add-git-hook.sh', required : false)
+if add_git_hook_sh.found()
+        git_hook = run_command(add_git_hook_sh)
+        if git_hook.returncode() == 0
+                message(git_hook.stdout().strip())
+        endif
 endif
 
 #####################################################################