Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp266816ybg; Tue, 22 Oct 2019 20:20:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTwfcCb5BkHo1pnqb4v0wRGroylj82gKdOuaDX0vpLD2eaceaRUKvx9sR73ys2MRY/MktG X-Received: by 2002:a50:bac2:: with SMTP id x60mr34646134ede.96.1571800812964; Tue, 22 Oct 2019 20:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571800812; cv=none; d=google.com; s=arc-20160816; b=Wnp1EKJgOF6GXx7gHcp9TxMWW00ONzsQkjNAJ5gyG6RuLw3Dp7iRGu6svCLK64g7IM P9e5MtVVb+br0fBoHuLV+dxWSYmiVzhxci0oBAphrdNohDFJyphE+oUmwbczyoo3czqg pWvfrTrl8v+/E9TKrHUg7V+3EYxL2NR/ZXbI4XYRa34E6FYCXT7di+CXoQeeMDY/Yenf wrqhjbe3TAov/1rfxrxPNn9fycKZeUwi6eylded1goX0Cmvcu20arSOE8JZl+lPXvvIx PmP0toeG3ZKxOUTix7CYsMix6NpovzjJMpS0s8zv/N68h1WOVbBFU4w7052zL97n6EHx RCfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=BtdIFLzjSF0M2qZMCrwtECZtdItHeicakXIfe0ZLK1g=; b=wsELscrrnnijcZenMroID6iu0zmwllGA23dx3PqMo7KTX3nkeuR5hlvhTxPV+SjvZp GDxEQFuSKSKAmE/gtyLSI5xcMB2AYDpteDCDLpK+1JUY79dGy3k8ev/mXPMG3wSuzcJl Whzw+i78lyB7LxVVQyz6/If8ZxVh6hU57thQrwqmgg+yJMpLAjdxtHxFSBawwLEByyCZ +XbRaV3cOz43xqhaXhp87RICXHQA2GS4JJoaZDkN6tQpbAL/6kiK3FOMN3scYs20c5PH BEd2hjXRyEqCCEaAUBtOceVwRRhmntpVYrvEouDCsriKF1UO9/LjspN7O/wx4/YRTztp 5yEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=tLZW+9iu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si11986346ejd.118.2019.10.22.20.19.48; Tue, 22 Oct 2019 20:20:12 -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=@nifty.com header.s=dec2015msa header.b=tLZW+9iu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733049AbfJWBYj (ORCPT + 99 others); Tue, 22 Oct 2019 21:24:39 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:40090 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727881AbfJWBYj (ORCPT ); Tue, 22 Oct 2019 21:24:39 -0400 Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) (authenticated) by conssluserg-04.nifty.com with ESMTP id x9N1OGrk001511 for ; Wed, 23 Oct 2019 10:24:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com x9N1OGrk001511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1571793857; bh=BtdIFLzjSF0M2qZMCrwtECZtdItHeicakXIfe0ZLK1g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tLZW+9iu20JkdNHoXZf6lFj5MjNtqWIes0I7cwWYXPnpkxxf22gevgi6ZJb+A76px H1BS1F1MPVXv2Vw7DSwI6RsKohohdrtRjDAHpdtr4Fm6WsiIA1atMbxBUkwcunJO3L MSY+8SO85sijFiv4VzNzzaj1aLIkZtCvf0rhgVRR0bU1Pkn7c9VzQyaCMPBUtlmUN5 BvwbJMHoRhA+84Tw5JM8F5yj0V30ywqxHdFOjkp5wObu7zNiTerjyhexFMc1wj0VNP Q/Y/lPYn1BUcW7Bfqmc2r5kzL80eBN9xm0ciKBmq00znef+9P87bhSNX5ytwyvxI/X lFYzNA7hXbA2g== X-Nifty-SrcIP: [209.85.217.44] Received: by mail-vs1-f44.google.com with SMTP id b123so12672825vsb.5 for ; Tue, 22 Oct 2019 18:24:16 -0700 (PDT) X-Gm-Message-State: APjAAAXHf64d8bGAYIG2wRkqOhjUTWH7EUAj0N/jFSan1HcPtFipNQfq k3tShHx4LHcq9Uxzw145JOnO2Z14xjoMhbrvTSU= X-Received: by 2002:a67:ff86:: with SMTP id v6mr3902386vsq.181.1571793855568; Tue, 22 Oct 2019 18:24:15 -0700 (PDT) MIME-Version: 1.0 References: <20191021160419.28270-1-jeyu@kernel.org> <20191022110403.29715-1-jeyu@kernel.org> In-Reply-To: <20191022110403.29715-1-jeyu@kernel.org> From: Masahiro Yamada Date: Wed, 23 Oct 2019 10:23:39 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] scripts/nsdeps: use alternative sed delimiter To: Jessica Yu Cc: Linux Kernel Mailing List , Matthias Maennich , David Laight Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 22, 2019 at 8:04 PM 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 ${srctree}, we can use '|' as an alternative delimiter for > sed instead to avoid this error. > > Signed-off-by: Jessica Yu > --- > > 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 -- Best Regards Masahiro Yamada