Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4443498ybg; Mon, 21 Oct 2019 09:05:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQet2s3FFu4nAY5WEZNU7BntpBmXWFgG/hv2aYsXwb00azrhHsBaAROZROgv2q7ViVLTm+ X-Received: by 2002:a7b:c7d4:: with SMTP id z20mr20476047wmk.145.1571673951111; Mon, 21 Oct 2019 09:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571673951; cv=none; d=google.com; s=arc-20160816; b=wHzqQEy/+f/n/L3oL8mpiI8gAfWgOYQnRHM7suw7cnCZLrsVMiTG/udXStdRldaOoB Y10/noa29UTcBK0LmJiPPju6J8gpzScqU8OK3aoHcyC5TQQgP/GeL9DqQJNGceN+DNLZ hTYTvR+uQAgrEIVIdiSn90PRFjeUyTQBshsdPGjlfm5O2lInskf7AflCjo6lQRKCkIQB ZaCNs8ftuVougTzzblkrtvI93tKFdqokeHjxUVB0U4Ojyk4gYIc+/kBXa9atNctoczw5 gkRTnN+yr7siH5690nOco5XpHOEofo+b6TBozLqSlHhNtS3lIB95xBI9FFtur6o0vx4w QP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=nYtD+2Yls7hbn426g66b/dlO1E8QUan8r5uw4Dy+/Iw=; b=okWd9g30y/gAbk3blj7ieBu0hTd3hEgFE2kBUO6urwKoQ9FqCQzSwaujc/faQJOH52 zH/nXb1a+ejtuvdOd2tmCp9o3CGCZ6/GWQMImyj/aumVTnXdhsYek6HcWrWM00CDpipN /MyQQB1tDLNqW7HI5LewDkbB8ys4UZWpoFxBCWUEGBeKrBZYbeCALGwAhd03jJgwusb9 XmYJJ3E3R2ceiXhObt/w0SYurpLIKnaYOUr8f7nJe7zdqXENArsTxsrlDyFxsBLtVE3I pNeeCz6ZjkrUjoMO4dxiXOyep60OtfguU84NpGrcA7VAbifC5EQwx4pIo2D7J1uR6IDc e3Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iPP5Mraq; 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 t49si10805885edd.198.2019.10.21.09.05.08; Mon, 21 Oct 2019 09:05:51 -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=iPP5Mraq; 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 S1727403AbfJUQFD (ORCPT + 99 others); Mon, 21 Oct 2019 12:05:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:33940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbfJUQFD (ORCPT ); Mon, 21 Oct 2019 12:05:03 -0400 Received: from linux-8ccs.suse.cz (ip5f5ade6e.dynamic.kabel-deutschland.de [95.90.222.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA5D1214AE; Mon, 21 Oct 2019 16:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571673902; bh=gV8c3T01F0BTyDBAf4oVsD8CetT4S5sEcniUAfvvffE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iPP5Mraq1qg4uu6Fnr//Q9K+pTAUuBHVWp8FyhcwDmuFls+fVEdTfQA0qDdHVF/9y /Y4S1MJeuhkA5ZW0i640O1JyEHY3B+NrnbFmCyvXtF5r6QDzK1YABH5bBWzK9kQpOZ kaqbgZOe/v4H4+mbMgUIbPbIQVTgxXX4bzZCqJcM= From: Jessica Yu To: linux-kernel@vger.kernel.org Cc: Matthias Maennich , Masahiro Yamada , Jessica Yu Subject: [PATCH v2] scripts/nsdeps: use alternative sed delimiter Date: Mon, 21 Oct 2019 18:04:19 +0200 Message-Id: <20191021160419.28270-1-jeyu@kernel.org> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191021145137.31672-1-jeyu@kernel.org> References: <20191021145137.31672-1-jeyu@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"` 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