From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 36B602E83 for ; Wed, 12 Jul 2017 08:41:49 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A7CDE2075E; Wed, 12 Jul 2017 02:41:48 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 12 Jul 2017 02:41:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=B0WUkrdPrGx4j7N l5I6k0WoiPVTiElncJz5nV1rR6IU=; b=TT8jv/mWsaiOb3u9Y1wkWLhNZ9LB14G ZzP9PA75frKJN6bqkYnpurwdVKNUfDRaAF055UU1Qs+A01FOfO5wclIJB6sv+dsj 6xZ/CUyHG+s9Ke/N2M4eQpKQ+tYOVswmuOA2WtMeBhnyFTdR4/rSsPVl/DkAHhnh rTAIzGWFbQeY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=B0WUkrdPrGx4j7Nl5I6k0WoiPVTiElncJz5nV1rR6IU=; b=c5YNQgg2 8jmGCcBCmth984BIdjqAllD6LY5t33qGllUOuOWAOGK/n/kaIecN2/tbtV2PdZWX 9ikNX+V4O/0X8Lmr5Tr9zEjThqivFpt/j//cXfvpaCi4ubf5b9XOOQrHHzFxMwpj j4cSEP3oYRRJ4LZ07Llak2OyI6KJpBtu+5xiTKkpIsycIWNZ0ACZiM4tnKB/bEq0 4m+MG6GzcCmdmLDS9vGak91ftLgKlR7pJIIW1N7YtavpZ6AnM0VYxhdpr+JgzMtU UtDSTF1NpCGIFLYdUA9Vxb16cb+7bZQA6WN8HyM9N5H3nPSRzJkN5U9YtQP5Xivj EGT4EZpi63sbuQ== X-ME-Sender: X-Sasl-enc: m9bMkbsqBvhEXvBuEf4qw8uE+gE/F/JZgRCWnFuGVhVD 1499841708 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 57F12242CE; Wed, 12 Jul 2017 02:41:48 -0400 (EDT) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org Date: Wed, 12 Jul 2017 08:41:47 +0200 Message-ID: <1863889.1goa7A5KV5@xps> In-Reply-To: <20170711160557.4774128e@xeon-e3> References: <20170711185546.26138-1-stephen@networkplumber.org> <2203089.SAOtEojdoZ@xps> <20170711160557.4774128e@xeon-e3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 01/19] devtools: add simple script to find duplicate includes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 06:41:49 -0000 12/07/2017 01:05, Stephen Hemminger: > On Tue, 11 Jul 2017 22:33:55 +0200 > Thomas Monjalon wrote: > > > Hi Stephen, > > > > 11/07/2017 20:55, Stephen Hemminger: > > > This is just a simple check script to find obvious duplications. > > > > > > Signed-off-by: Stephen Hemminger > > > --- > > > devtools/dup_include.pl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 64 insertions(+) > > > create mode 100755 devtools/dup_include.pl > > > > Thank you for this script, but... it is written in Perl! > > I don't think it is a good idea to add yet another language to DPDK. > > We already have shell and python scripts. > > And I am not sure a lot of (young) people are able to parse it ;) > > > > I would like to propose this shell script: > > > > dirs='app buildtools drivers examples lib test' > > pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*' > > > > for file in $(git ls $dirs) ; do > > dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d) > > [ -n "$dups" ] || continue > > echo "$file" > > echo "$dups" | sed 's,^,\t,' > > done > > Sorry, it is quick and easy. After all it is optional, just like > coccinelle and not part of the build. Plus checkpatch is in Perl. checkpatch is not in the repository ;) I prefer my shell script because - I am able to maintain it - the regexp is more tolerant with #include line - it checks the whole repository