Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3513300ybg; Mon, 28 Oct 2019 14:08:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCV6HgSdK4PjQeNFG/Ahp9a7b7hSmaC6vyUajJ+cWRdNZ4li589ztqAo6bZXERv2sZMpGX X-Received: by 2002:a17:906:76d2:: with SMTP id q18mr7685607ejn.232.1572296925560; Mon, 28 Oct 2019 14:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572296925; cv=none; d=google.com; s=arc-20160816; b=ALn0dQD9G+CPLGsoOQrnRUg1+61a+vI2czvRnz8VkBZMRTvUW23LuJDRMAJAdvDnRd Zh/YIAFT6/JLi7gcQ3ISpBmjctkOMhgOA42KsBvIi68d5dd67Aeug79HQmpWm6cZvDVJ 4eSe1wJcRFAf9qWqC9isGGKcfnVWTuuDV+2gcuVuob9IOaC0CEnt/knm7QGZf9NikeRG vsd7YRGrUpk4kxQyPClMYPfHxnGGApJyoCUPqSZK7NxC8UcCA77CFCN702BEFI5hwUhz xMeV+wLqBQslO61F5IHg/b1GKqdFyQ77e56r6jZRlQ9whMA1u3a21vlmtz2oVSAqmwQT CiQQ== 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=gEAypfDHfuidknmQR7DMTXxmjKEF7We8qUDsFWsKhpI=; b=Jo6z+CivII92BaRndjrr2dRHJpvAsZwUaxwfhmdKF9oMsCsmfENa0YSQ7BmbJ4JrkG vNxs1u0nzpgiHjE+JfUJ3QVGDn+S/D4zyokt0oA5vQeeXhtKmaKCof5OP4G+KAVU/sNC gxFsQKWXBU+TSBWlPUNfgqf9Wxme29AhisSeofNn6VJjoa/Y8tI6iPukbEbZDZrOyXil vUT5GZTeSONLSBOXgHGOmwJmPm/jZk/jTNG5RZz6YFCP9y5ITOQQew4iD01Qt3xpG5ur cdui5u98rsQtWzeDBDCNbpF7nBRXxKDX7k7yd8Q0jBitEHwqqqZe6tnozd7EqgBeiPSb NPPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r+bVc7au; 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 f4si6963641ejc.218.2019.10.28.14.08.22; Mon, 28 Oct 2019 14:08:45 -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=r+bVc7au; 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 S2390608AbfJ1POl (ORCPT + 99 others); Mon, 28 Oct 2019 11:14:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:48630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbfJ1POk (ORCPT ); Mon, 28 Oct 2019 11:14:40 -0400 Received: from linux-8ccs.suse.cz (charybdis-ext.suse.de [195.135.221.2]) (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 807EB20830; Mon, 28 Oct 2019 15:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572275680; bh=iGJhZZvWzc81rBbu1L5ll3Y6yFxp0f7lhnL7sJDWN84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r+bVc7aueSK51nQIzm5mYymgMEP+C6PTs66YQrHj8M3ZRHGO0c0azgQKUvXAZvMqf 0VNj6ymo+Wt4audxgGhuZkUNmrBzaxdZ6fOFtQZaojSOFJ4wCNdeOUgT7VbsCinHKe 6JFIBc1ioaMiKcCjrbpT+Cpd2wxXNbjluZcSvegE= From: Jessica Yu To: linux-kernel@vger.kernel.org Cc: Matthias Maennich , Masahiro Yamada , Jessica Yu Subject: [PATCH 2/4] scripts/nsdeps: don't prepend $srctree if *.mod already contains full paths Date: Mon, 28 Oct 2019 16:14:25 +0100 Message-Id: <20191028151427.31612-2-jeyu@kernel.org> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191028151427.31612-1-jeyu@kernel.org> References: <20191028151427.31612-1-jeyu@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building in-tree modules, the *.mod file contains relative paths. When building external modules, the resulting *.mod file contains absolute paths. Allow for the nsdeps script to account for both types of paths and only prepend $srctree in the case of relative paths. Otherwise, the script will append $srctree to the path regardless and it will error out with file not found errors if the path was already absolute to begin with. Signed-off-by: Jessica Yu --- The sed regex is getting more ugly. It's not my strong point :/ If anyone has a better regex to prepend $srctree for every relative path encountered while ignoring absolute paths, I'm all ears. scripts/nsdeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nsdeps b/scripts/nsdeps index 54d2ab8f9e5c..9ddcd5cb96b1 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 -E "s%(^|\s)([^/][^ ]*)%\1$srctree/\2%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