meson: replace bashism is POSIX shell compliant code (#463)

This commit is contained in:
Baptiste Daroussin 2021-11-25 08:54:38 +01:00 committed by GitHub
parent 8fc0f6e531
commit 262327a795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -222,15 +222,15 @@ install_subdir(
# because configure_file strips the backslash in e.g. \@display,
# resulting in @display, breaking our Perl code:
# https://github.com/mesonbuild/meson/issues/7165
bash = find_program('bash')
sh = find_program('sh')
replace_dirs = [
bash, '-c', # Use bash to capture output and mark as executable
sh, '-c', # Use bash to capture output and mark as executable
'sed -e \'s,@abs_top_builddir@,'
+ meson.current_build_dir()
+ ',g;s,@abs_top_srcdir@,'
+ meson.current_source_dir()+',g\''
# Only mark files ending in .pl as executables
+ ' "$0" > "$1" && { [[ "${1##*.}" == pl ]] && chmod +x "$1" || true; }',
+ ' "$0" > "$1" && { [ "${1##*.}" = pl ] && chmod +x "$1" || true; }',
'@INPUT0@', # $0
'@OUTPUT0@', # $1
]