[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191023101340.GA27616@google.com>
Date: Wed, 23 Oct 2019 11:13:40 +0100
From: Matthias Maennich <maennich@...gle.com>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: Jessica Yu <jeyu@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
David Laight <David.Laight@...lab.com>
Subject: Re: [PATCH v3] scripts/nsdeps: use alternative sed delimiter
On Wed, Oct 23, 2019 at 10:23:39AM +0900, Masahiro Yamada wrote:
>On Tue, Oct 22, 2019 at 8:04 PM Jessica Yu <jeyu@...nel.org> wrote:
>>
>> 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.
>>
>> Signed-off-by: Jessica Yu <jeyu@...nel.org>
>> ---
>>
>> v3: don't need to escape '/' since we're using a different delimiter.
>>
>> scripts/nsdeps | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/nsdeps b/scripts/nsdeps
>> index 3754dac13b31..dda6fbac016e 100644
>> --- a/scripts/nsdeps
>> +++ b/scripts/nsdeps
>> @@ -33,7 +33,7 @@ generate_deps() {
>> if [ ! -f "$ns_deps_file" ]; then return; fi
>> local mod_source_files=`cat $mod_file | sed -n 1p \
>> | sed -e 's/\.o/\.c/g' \
>> - | sed "s/[^ ]* */${srctree}\/&/g"`
>> + | sed "s|[^ ]* *|${srctree}/&|g"`
>> for ns in `cat $ns_deps_file`; do
>> echo "Adding namespace $ns to module $mod_name (if needed)."
>> generate_deps_for_ns $ns $mod_source_files
>> --
>> 2.16.4
>>
>
>Reviewed-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
>
Tested-by: Matthias Maennich <maennich@...gle.com>
Cheers,
Matthias
Powered by blists - more mailing lists