]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Run spatch jobs in parallel
authorMichal Nowak <mnowak@isc.org>
Wed, 24 Feb 2021 13:55:28 +0000 (14:55 +0100)
committerMichal Nowak <mnowak@isc.org>
Mon, 14 Feb 2022 19:25:38 +0000 (20:25 +0100)
Also make the script more verbose to identify which patch is being
processed and check for failures in spatch standard error output.

(cherry picked from commit 48c44fe6d43a05b37597070719011ab1e91eb79e)

util/check-cocci

index 61792bd12e3319f23460963da021e69f0665bc70..6f67437f98210a063ec448b44111bfa83f49990d 100755 (executable)
@@ -3,7 +3,13 @@
 ret=0
 for spatch in cocci/*.spatch; do
     patch="$(dirname "$spatch")/$(basename "$spatch" .spatch).patch"
-    spatch --sp-file="$spatch" --use-gitgrep --dir . --very-quiet > "$patch";
+    : > "$patch"
+    echo "Applying semantic patch $spatch..."
+    spatch --jobs "${TEST_PARALLEL_JOBS:-1}" --sp-file "$spatch" --use-gitgrep --dir "." --very-quiet --include-headers "$@" >> "$patch" 2> cocci.stderr
+    cat cocci.stderr
+    if grep -q -e "parse error" cocci.stderr; then
+        ret=1
+    fi
     if [ "$(< "$patch" wc -l)" -gt "0" ]; then
        cat "$patch"
        ret=1
@@ -12,4 +18,6 @@ for spatch in cocci/*.spatch; do
     fi
 done
 
+rm -f cocci.stderr
+
 exit $ret