Skip to content

Commit 0968495

Browse files
author
Jessica Yu
committed
scripts/nsdeps: use alternative sed delimiter
When doing an out of tree build with O=, the nsdeps script constructs the absolute pathname of the module source file so that it can insert MODULE_IMPORT_NS statements in the right place. However, ${srctree} contains an unescaped path to the source tree, which, when used in a sed substitution, makes sed complain: ++ sed 's/[^ ]* *//home/jeyu/jeyu-linux\/&/g' sed: -e expression #1, char 12: unknown option to `s' The sed substitution command 's' ends prematurely with the forward slashes in the pathname, and sed errors out when it encounters the 'h', which is an invalid sed substitution option. To avoid escaping forward slashes ${srctree}, we can use '|' as an alternative delimiter for sed instead to avoid this error. Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Matthias Maennich <maennich@google.com> Tested-by: Matthias Maennich <maennich@google.com> Signed-off-by: Jessica Yu <jeyu@kernel.org>
1 parent 6992320 commit 0968495

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/nsdeps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ generate_deps() {
3333
if [ ! -f "$ns_deps_file" ]; then return; fi
3434
local mod_source_files=`cat $mod_file | sed -n 1p \
3535
| sed -e 's/\.o/\.c/g' \
36-
| sed "s/[^ ]* */${srctree}\/&/g"`
36+
| sed "s|[^ ]* *|${srctree}/&|g"`
3737
for ns in `cat $ns_deps_file`; do
3838
echo "Adding namespace $ns to module $mod_name (if needed)."
3939
generate_deps_for_ns $ns $mod_source_files

0 commit comments

Comments
 (0)