]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: fix that filters issues on resulting file only 1792/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 23 Feb 2018 15:16:30 +0000 (16:16 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 23 Feb 2018 15:16:30 +0000 (16:16 +0100)
Because checkpatch result is applied to original and new file, the
analysis also parses what may be wrong with the original file.
Whereas the script should limit to analyse only what is wrong on new
file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
tools/checkpatch.sh

index f55692096fc45159956dd3853db6611704425a77..73421784fa812b7a42c2917bc7c1ba4cfba4765b 100755 (executable)
@@ -72,7 +72,7 @@ else
     echo "Report for $(basename $file _cp)" 1>&2
     echo "===============================================" 1>&2
     if [ -a /tmp/f2/$(basename $file) ]; then
-      diff $file /tmp/f2/$(basename $file) | grep -v "normally be const" | grep -A3 "ERROR\|WARNING" 1>&2
+      diff $file /tmp/f2/$(basename $file) | grep -v "normally be const" | grep -A3 "ERROR\|WARNING" | grep -A2 -B2 '/tmp/f1' 1>&2
     else
       cat $file | grep -v "normally be const" | grep -A3 "ERROR\|WARNING" 1>&2
     fi