Skip to content

Commit 16c89dc

Browse files
pks-tgitster
authored andcommitted
meson: prevent finding sed(1) in a loop
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 42846ef commit 16c89dc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Documentation/howto/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ custom_target(
4141
foreach howto : howto_sources
4242
howto_stripped = custom_target(
4343
command: [
44-
find_program('sed'),
44+
sed,
4545
'-e',
4646
'1,/^$/d',
4747
'@INPUT@',

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ endif
201201
cygpath = find_program('cygpath', dirs: program_path, required: false)
202202
diff = find_program('diff', dirs: program_path)
203203
git = find_program('git', dirs: program_path, required: false)
204+
sed = find_program('sed', dirs: program_path)
204205
shell = find_program('sh', dirs: program_path)
205206
tar = find_program('tar', dirs: program_path)
206207

207208
# Sanity-check that programs required for the build exist.
208-
foreach tool : ['cat', 'cut', 'grep', 'sed', 'sort', 'tr', 'uname']
209+
foreach tool : ['cat', 'cut', 'grep', 'sort', 'tr', 'uname']
209210
find_program(tool, dirs: program_path)
210211
endforeach
211212

0 commit comments

Comments
 (0)