From: Ondřej Surý Date: Tue, 16 Jul 2019 14:50:09 +0000 (+0200) Subject: Revert to patch generating check-cocci script X-Git-Tag: v9.15.3~32^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f828a213c0e0a1d0ebf0c8aeb8b0a854e76084e;p=thirdparty%2Fbind9.git Revert to patch generating check-cocci script The coccinelle and util/update_copyright script have different idea about how the whitespace should look like. Revert the script to the previous version, so it doesn't mangle the files in place, and deal with just whitespace changes. --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d76d407b4c..b7067c89628 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -228,7 +228,9 @@ misc:sid:amd64: 🐞:sid:amd64: <<: *precheck_job - script: util/check-cocci + script: + - util/check-cocci + - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi # Jobs for doc builds on Debian Sid (amd64) diff --git a/util/check-cocci b/util/check-cocci index e6d501d7bf2..48bd1327733 100755 --- a/util/check-cocci +++ b/util/check-cocci @@ -1,10 +1,18 @@ #!/bin/sh -set -e +ret=0 for spatch in cocci/*.spatch; do + patch="$(dirname "$spatch")/$(basename "$spatch" .spatch).patch" + : > "$patch" for dir in bin lib fuzz; do - spatch --sp-file="$spatch" --use-gitgrep --dir "$dir" --in-place --quiet + spatch --sp-file="$spatch" --use-gitgrep --dir "$dir" --very-quiet --include-headers >> "$patch"; done + if [ "$(< "$patch" wc -l)" -gt "0" ]; then + cat "$patch" + ret=1 + else + rm "$patch" + fi done -exit 0 +exit $ret