[dpdk-dev] [PATCH 01/19] devtools: add simple script to find duplicate includes

Thomas Monjalon thomas at monjalon.net
Thu Jul 13 14:36:46 CEST 2017


13/07/2017 14:19, Wiles, Keith:
> 
> > On Jul 13, 2017, at 1:56 AM, Thomas Monjalon <thomas at monjalon.net> wrote:
> > 
> > 12/07/2017 23:59, Stephen Hemminger:
> >> On Tue, 11 Jul 2017 22:33:55 +0200
> >> Thomas Monjalon <thomas at monjalon.net> wrote:
> >> 
> >>> 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
> >> 
> >> There is no "git ls" command in current version, 
> >> 
> >> Using find instead works.
> > 
> > Yes, both work if specifying source code directories as above.
> 
> ‘git ls’ I had to change it to ‘git ls-files’ to make it work. I think you have a git alias setup for ls-files.

Ah yes, you're right!
Thanks, I has not well understood the original comment :)

> Can this be added to the patch testing?

Yes sure, I will do.



More information about the dev mailing list