From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com [74.125.83.51]) by dpdk.org (Postfix) with ESMTP id 164A23257 for ; Wed, 12 Jul 2017 01:06:04 +0200 (CEST) Received: by mail-pg0-f51.google.com with SMTP id u62so3156941pgb.3 for ; Tue, 11 Jul 2017 16:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xRCQCoOoDfu6c0jBYM/+IxtW6STU7ebW/UVjCICyoCw=; b=g7Ib6Z2elxzyNCvRBp3Wlxian0HL6D0E0qsYQwYASlUJWbA5le+FWYFyHYNoy1hzPJ YWFm+y7Z/58IRWm1zHf1xsTr9sNXeDeWdJHRzb8dUqSaSu9bYcQVZUnZbuPkdLQZ6TI0 R01W5W05hcFmhKGqdoSow3/aPYFin4klag5ofksUG7PGE5cU+1RTUSrQwGRYJRXPEPya XdD1M4wz9DqosOlobB+SmLm1ZQb2WzPpQkV0o8XFGDP4qKzX51PXM9mzz6/mu5gtJEsV dmjrEXbWBSmGxzwPnZZRhgOh1CPfkMd78riMSRT3Ovny61+akWnKz5bzsef8npZB28dM 5+iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xRCQCoOoDfu6c0jBYM/+IxtW6STU7ebW/UVjCICyoCw=; b=GVaqe8FwRI0TAwAYTb5ezZf1OHa+P8jJt8A1bbnk9WKN2bag9OgyuYvZL+FXWU+iOw BVR6qZ6V60GCI1mn3VwUvVw0Grw/93aFYzqfvvv7EYerB8XA5ePnjK76usfzzbZqJyUY Yy4X1YM7sfgKjUMlLmVf/a8lsnLPkk11G5AruTcl7NuBd0egRJ0AXcb890mHS5uFak8o kplNZgPqo+6sdYyLJfIsnAMjEHbS/AJRm6MCNZt3tu/VOLpe7gyGbaSvSZBP4CrsZEQi hBh6tq54yICY5iWqrtKS0/P7NAhznQ6yWNq5NG8Q249HXHlHJcEifWSfle5WzWA+F3vG xvEg== X-Gm-Message-State: AIVw112IlzOxtgFEisfldoWsChfetj9UsXdNE/EJCARe8fwv0Db0gP5J /OW2Ge081wj7HsWPvMDsyw== X-Received: by 10.99.176.7 with SMTP id h7mr815026pgf.152.1499814364118; Tue, 11 Jul 2017 16:06:04 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id s123sm626993pgs.2.2017.07.11.16.06.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 16:06:03 -0700 (PDT) Date: Tue, 11 Jul 2017 16:05:57 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org Message-ID: <20170711160557.4774128e@xeon-e3> In-Reply-To: <2203089.SAOtEojdoZ@xps> References: <20170711185546.26138-1-stephen@networkplumber.org> <20170711185546.26138-2-stephen@networkplumber.org> <2203089.SAOtEojdoZ@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Tue, 11 Jul 2017 23:06:05 -0000 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.