Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5610590ybg; Tue, 22 Oct 2019 06:00:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZBdh2MSSO0XognwjkBbrGxXA6m8I0rZvsOgMQD0MmzES6OHDsld9IXFFyLtuda4R1dP2W X-Received: by 2002:a05:6402:290:: with SMTP id l16mr3072137edv.190.1571749224089; Tue, 22 Oct 2019 06:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571749224; cv=none; d=google.com; s=arc-20160816; b=kbHOr5espaeBqQWdumEh6lDfmmx+3Fu139K4CGwcQEGv5SYZ8eEH+1v4qJ66dHLhCL sNA05BOICcv6f3qpfbzsYJyfvMUhfsb4RPFq+0UR6tJtTrB8GXczVB7gS0relHGpn946 oaqDQk+22AXz6ka54lWZGRnTG/mTpt4Y0YODO9MAT8FQljoC13JO903FyhSpQzxJS6L+ ocC+4/RyxLoe4nyvWpWBxIsXFarUL1KeX83dUydBwlZNPp8MyT+LQCZs704aq96mmtST kJQO9kN43dLczjlWDRG/4xkTSbQc90tDVROzJRGQ3H0U085Y0KcT2RHR4lwss/BoF6uM 4W8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Bk7yOjDhMLM6gXym304f2CdsnNPuWPYQoMA0kkQemoA=; b=t1nql5GHHYFkOm2ElC4df+NGewg1GKO/aW21NN7gmMvZlfTdk/d8dpAh4IcdgEcrlR +re6MkEFQcv4YsdvALPr++tuWZ3LdbVP/xc6rta61Ij99DfVVtCKbFX18jXkCR0mW6aU XPOmq/7g4p+xp5WPeykwmGVZe9qfEfOiwaIHwO6XTPMyFIyBQkJptxHOK3hCZV58ZvT8 AkQqSgB32qn2Fl/Kg6SDwSOGN0Gg4AEeZmkls4xlDXkd/EpXNXT8XiOrUZ24zsz5pZyC FlSeiiQ34VuRziIjpqkbMu8N+WYKtUDCeDNEJI/r26s0wxZjVgVv7i8Mr4U/nbIpTkNT D/bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Ava/VTxt"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si11382115edm.54.2019.10.22.06.00.00; Tue, 22 Oct 2019 06:00:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Ava/VTxt"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731704AbfJVKBA (ORCPT + 99 others); Tue, 22 Oct 2019 06:01:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:39022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731439AbfJVKBA (ORCPT ); Tue, 22 Oct 2019 06:01:00 -0400 Received: from linux-8ccs (ip5f5ade81.dynamic.kabel-deutschland.de [95.90.222.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3AE702064B; Tue, 22 Oct 2019 10:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571738459; bh=AdQe0gGo14eIDSVM0wSBk8e4bCtGfDEpUhLfTezYUjU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ava/VTxtIzD5abhD0wTUJJaiUHfh+Qdp9L5L6+fJhn6DePfM9rVLR6oGHT5mdzbnh BUMcTrWFnZfbT/YIbMf3w2rOmA/V+osTSL2h47LU3g4nGdNXFmPO8mj6AJyL+rwZ3O fvwMz8LkkK/Jyqk+UN5xsHhvwWwF/GgTDe74fo9s= Date: Tue, 22 Oct 2019 12:00:49 +0200 From: Jessica Yu To: Masahiro Yamada Cc: Linux Kernel Mailing List , Matthias Maennich Subject: Re: [PATCH v2] scripts/nsdeps: use alternative sed delimiter Message-ID: <20191022100049.GA21299@linux-8ccs> References: <20191021145137.31672-1-jeyu@kernel.org> <20191021160419.28270-1-jeyu@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-OS: Linux linux-8ccs 4.12.14-lp150.12.28-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Masahiro Yamada [22/10/19 13:37 +0900]: >On Tue, Oct 22, 2019 at 1:05 AM Jessica Yu 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 in ${srctree}, we can use '|' as an alternative delimiter for >> sed to avoid this error. >> >> Signed-off-by: Jessica Yu >> --- >> >> This is an alternative to my first patch here: >> >> http://lore.kernel.org/r/20191021145137.31672-1-jeyu@kernel.org >> >> Matthias suggested using an alternative sed delimiter instead to avoid the >> ugly/unreadable ${srctree//\//\\\/} substitution. >> >> scripts/nsdeps | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/scripts/nsdeps b/scripts/nsdeps >> index 3754dac13b31..63da30a33422 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"` > > >You no longer need to escape the '/'. > >s|[^ ]* *|${srctree}/&|g > >is enough. Ah yeah, I missed that. Thanks for catching that!