Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4361041ybg; Mon, 21 Oct 2019 07:52:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBCA1Qg2lVa2TZ2rzomrcihlNMOyC3fIRPLIlao3IoZfjTyRTOhc5RDYdTkmyZPN2/CT7k X-Received: by 2002:a17:906:c4a:: with SMTP id t10mr22459270ejf.290.1571669558475; Mon, 21 Oct 2019 07:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571669558; cv=none; d=google.com; s=arc-20160816; b=TiFE/t8kcgUnxwouuRTSGtZFLh9A8ASpxfIFAc8BVPmOgti2146GunQf3XC3erOLHU DS4X1F5xl+f0RPXTy/SfgJDxoH1Y1dwNOzMln34QvF/34LlMGWph/DENQqO//8hVP35C l1HJVmBHFgOAn8E3tTKfZyCWiWizH+RqXuM+/x7tCB5HGM3JUnJmYXRpwNcAIIC0fUvi ZETVeaR5h/En1/8Q3bxy3o4KO+iEVBZSHl6N/A5UzHpV5CDAtwOx/mbyTRfj+NBX79Es ljPeckxeHjeS0f5Xjh7Y8FlDgS9OHTPXwj6HKKI/gPw9eZ4podS/6Fy13kbaY+Kt6u63 0uAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=NExTqQUwBxyLdPQyKac8lQq2cqjoiM7sueRyb0+0pP4=; b=T3e2pw7Fdbbu1oNF/EwTtldVhVqRonE3DGxQGxPqGK47a7BnbGG43Xedk0Cx2tZPCd pSW85jSozRVgB+sFV5b2fuFA6b5d+KU0hDd3872hEXBEMh294qyOjI6n+xwmCmSPWO+t 8WedwP1ybu93pXLs977EAnqyIe/eDVA25rsCeobAgRUbMq/FJPWCuT8bK433mLFAQE5e jLlW4fywnoRsh4DQ1NH/NEyT+5iwix8cpZj5K1svTEMKR/YCGflr8Tpff3RXgpQbNDrk eujE10ErvF0551lMoaHrvpDW6RZzdfE+WU0A+KADuOe7l6mvoNNrb+B6PYakDIZx2hxp DzQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wg0A2ltH; 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 q22si8423581eja.178.2019.10.21.07.52.15; Mon, 21 Oct 2019 07:52:38 -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=wg0A2ltH; 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 S1727755AbfJUOwI (ORCPT + 99 others); Mon, 21 Oct 2019 10:52:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:46398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726847AbfJUOwH (ORCPT ); Mon, 21 Oct 2019 10:52:07 -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 625C82053B; Mon, 21 Oct 2019 14:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571669527; bh=IJjqMzMCR7TlygDWewMfRIRPUgGypokucoRIev+kOmk=; h=From:To:Cc:Subject:Date:From; b=wg0A2ltHziyYzjzYOHozPCzXve7tDd671rWiPRE4l1UrtfwCZpodTcb/TzyHjcANn CN0vRK14WtL9BX00cIApRFRITUb88Mw8xok/FQx+rMX7pU7OGMVlk0zOUkmkFJmx9m lu7MYFHifZX5Gv69mLD95+NopZWSxVrVKUAZrFYQ= From: Jessica Yu To: linux-kernel@vger.kernel.org Cc: Matthias Maennich , Masahiro Yamada , Jessica Yu Subject: [PATCH] scripts/nsdeps: escape '/' for module source files Date: Mon, 21 Oct 2019 16:51:37 +0200 Message-Id: <20191021145137.31672-1-jeyu@kernel.org> X-Mailer: git-send-email 2.16.4 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. So use bash in-variable substitution to escape all forward slashes for sed. Signed-off-by: Jessica Yu --- scripts/nsdeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nsdeps b/scripts/nsdeps index 3754dac13b31..79f96e596a0b 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