Ticket #31698: count_include_checks.sh

File count_include_checks.sh, 544 bytes (added by nickm, 3 months ago)
Line 
1
2git grep -h '#include <' src |perl -ne '/<(.*)>/; print "$1\n";' |sort |uniq > sys_includes
3
4
5for name in $(cat sys_includes); do
6    guard=$(echo $name |perl -ne 'chomp; s/[\.\/]/_/g; $_=uc; print "HAVE_${_}\n";')
7
8    if grep "$guard" orconfig.h >/dev/null; then
9        N1=$(git grep -B1 "#include <$name>" | grep -c "$guard")
10        N2=$(git grep "#include <$name>" | grep -c "$name")
11        #echo "Found $N2 instances of $name with $N1 guards."
12        echo "$N1       $N2     $name"
13    else
14        : #echo "No guard $guard found."
15    fi
16done