On 10/09/2016 04:33 AM, Anand J wrote: >>> grep -r --exclude-dir=bin/ "#include" | sort | uniq -c | awk '{if ($1 > >> 1) >>> print $2}' >> >> Seems simple enough that we ought to make it part of the >> scripts/clean-includes, rather than remembering to manually run it. >> > > scripts/clean-includes does an in place modification of the duplicate > entries in the files. > There is no guarantee that my script with return all genuine duplicate > entries. Some can be false positive as well.
If you don't trust an in-place modification, then maybe it is simple enough to just make scripts/clean-includes fail with non-zero status and flag that the files need manual attention, then rerunning the script. But still, having the script be able to flag the problems, whether or not it can fix them, is better than making it a comment where no one remembers to manually run the comment. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature