summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2022-05-13 11:36:15 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2022-05-13 11:37:54 +0200
commitc399332d50f221d295e41eed10300211e8575b3c (patch)
tree7675c23ab03ff14226f646b95aaaaec861c4f7f2
parent875df65542f3e91a651080a2f9c3301632291d3e (diff)
downloadptxdist-c399332d50f221d295e41eed10300211e8575b3c.tar.gz
ptxdist-c399332d50f221d295e41eed10300211e8575b3c.tar.xz
ptxd_make_world_compile_commands_filter: allow spaces at the beginning of the 'command' string
In some cases the 'command' string has a space before the actuall compiler command. Make sure the regex matches such cases as well. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_make_world_compile_commands.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/ptxd_make_world_compile_commands.sh b/scripts/lib/ptxd_make_world_compile_commands.sh
index 9ea8d88a7..56d7378fa 100644
--- a/scripts/lib/ptxd_make_world_compile_commands.sh
+++ b/scripts/lib/ptxd_make_world_compile_commands.sh
@@ -31,8 +31,8 @@ ptxd_make_world_compile_commands_filter() {
ptxd_verbose "Generating '$(ptxd_print_path "${dst_cmds}")'"
sed \
- -e "s#\(\"command\": \"[^ ]*\(gcc\|clang\) \)#\1 ${PTXDIST_CROSS_CPPFLAGS} ${pkg_cflags} #" \
- -e "s#\(\"command\": \"[^ ]*++ \)#\1 ${PTXDIST_CROSS_CPPFLAGS} ${pkg_cxxflags} #" \
+ -e "s#\(\"command\": \" *[^ ]*\(gcc\|clang\) \)#\1 ${PTXDIST_CROSS_CPPFLAGS} ${pkg_cflags} #" \
+ -e "s#\(\"command\": \" *[^ ]*++ \)#\1 ${PTXDIST_CROSS_CPPFLAGS} ${pkg_cxxflags} #" \
"${src_cmds}" > "${dst_cmds}"
}
export -f ptxd_make_world_compile_commands_filter