]> git.ipfire.org Git - thirdparty/git.git/commitdiff
meson: prevent finding sed(1) in a loop
authorPatrick Steinhardt <ps@pks.im>
Wed, 26 Feb 2025 08:22:20 +0000 (09:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Feb 2025 17:09:36 +0000 (09:09 -0800)
We're searching for the sed(1) executable in a loop, which will make us
try to find it multiple times. Starting with the preceding commit we
already declare a variable for that program in the top-level build file.
Use it so that we only need to search for the program once.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/howto/meson.build
meson.build

index c023c104161e61ca0399b5390d59e20343746621..92a08b13eed444536dbf6da70cc5e2866c4f3c21 100644 (file)
@@ -41,7 +41,7 @@ custom_target(
 foreach howto : howto_sources
   howto_stripped = custom_target(
     command: [
-      find_program('sed'),
+      sed,
       '-e',
       '1,/^$/d',
       '@INPUT@',
index ed857aaa4abdba0897f803913ac2350cc9b79ee5..5bf6a914ead1a87550dc2bca3eb90ba6211feb67 100644 (file)
@@ -201,11 +201,12 @@ endif
 cygpath = find_program('cygpath', dirs: program_path, required: false)
 diff = find_program('diff', dirs: program_path)
 git = find_program('git', dirs: program_path, required: false)
+sed = find_program('sed', dirs: program_path)
 shell = find_program('sh', dirs: program_path)
 tar = find_program('tar', dirs: program_path)
 
 # Sanity-check that programs required for the build exist.
-foreach tool : ['cat', 'cut', 'grep', 'sed', 'sort', 'tr', 'uname']
+foreach tool : ['cat', 'cut', 'grep', 'sort', 'tr', 'uname']
   find_program(tool, dirs: program_path)
 endforeach