From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 01/19] devtools: add simple script to find duplicate includes Date: Wed, 12 Jul 2017 08:41:47 +0200 Message-ID: <1863889.1goa7A5KV5@xps> References: <20170711185546.26138-1-stephen@networkplumber.org> <2203089.SAOtEojdoZ@xps> <20170711160557.4774128e@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Stephen Hemminger 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) In-Reply-To: <20170711160557.4774128e@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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