]> git.proxmox.com Git - mirror_frr.git/blobdiff - tools/checkpatch.sh
Merge branch 'master' into stylechecker
[mirror_frr.git] / tools / checkpatch.sh
index 73421784fa812b7a42c2917bc7c1ba4cfba4765b..e6110f0c7ac6f16a2fa3889354e2e69d3a6029f3 100755 (executable)
@@ -69,15 +69,20 @@ else
   done
   echo "Done."
   for file in /tmp/f1/*_cp; do
-    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" | grep -A2 -B2 '/tmp/f1' 1>&2
+      result=$(diff $file /tmp/f2/$(basename $file) | grep -A3 "ERROR\|WARNING" | grep -A2 -B2 '/tmp/f1')
     else
-      cat $file | grep -v "normally be const" | grep -A3 "ERROR\|WARNING" 1>&2
+      result=$(cat $file | grep -A3 "ERROR\|WARNING" | grep -A2 -B2 '/tmp/f1')
     fi
     if [ "$?" -eq "0" ]; then
-      stat=1
+      echo "Report for $(basename $file _cp)" 1>&2
+      echo "===============================================" 1>&2
+      echo "$result" 1>&2
+      if echo $result | grep -q "ERROR"; then
+        stat=2
+      elif [ "$stat" -eq "0" ]; then
+        stat=1
+      fi
     fi
   done
 fi