[PATCH] aiaiai-checker: add another coccinelle work-around

dedekind1 at gmail.com dedekind1 at gmail.com
Fri Apr 25 16:10:08 PDT 2014


From: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>

Unfortunately, coccinelle is nasty when it prints out error messages related to
syntax errors in its input files. For some reasons it prints all the
diagnostics to stderr, but one line still goes to stdout, and may show up in
diffs. Let's filter that junk line.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
---
 helpers/aiaiai-checker | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/helpers/aiaiai-checker b/helpers/aiaiai-checker
index b265b45..f5492c6 100755
--- a/helpers/aiaiai-checker
+++ b/helpers/aiaiai-checker
@@ -83,9 +83,19 @@ run_coccinelle()
 		#
 		# Also redirect stderr to /dev/null since it crashes sometimes
 		# and prints different kind of uninteresting debugging
-		# information to stderr
+		# information to stderr.
+		#
+		# The "grep" part is a work-around for broken spatch output
+		# which one can observe with kernel version 3.14, where the
+		# 'badzero.cocci' script has a syntax error and spatch prints
+		# something like '644 647' to stdout, while the rest of the
+		# diagnostic messages are printed to stderr. We ignore stderr,
+		# but unfortunately, those '644 647' lines slip into the logs.
+		# And this is a problem is we are dealing with a patch which
+		# adds a new file - those junk lines show up in the build log.
 		aiaiai-locker -s -l "$tmpdir/lockfile" -c \
-			"spatch $flags --sp-file $spatch $file_to_check" 2> /dev/null ||: &
+			"spatch $flags --sp-file $spatch $file_to_check 2>/dev/null" \
+			| grep -v '^[[:digit:]]\+ [[:digit:]]\+$' ||: &
 		pids="$pids $!"
 	done
 
-- 
1.9.0




More information about the aiaiai mailing list