From 0d12050e5e7970a7ea1ddf9d645d6bf8e263df8d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 28 Apr 2021 03:00:43 -0700 Subject: [PATCH] validate-clang-check: fix some issues. Not all shells support [[ ]] compound commands; it's not in the most recent Single UNIX Specification I could see, and the ubuntu-clang-other-tests job is reporting tools/validate-clang-check.sh: 18: [[: not found Don't use [[ ]]. In addition, if you change extcap/etl.c, it tries to run clang-check on it, but that file builds, and is only built, on Windows, so clang-check fails dismally on UN*Xes. Omit it for now. --- tools/validate-clang-check.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/validate-clang-check.sh b/tools/validate-clang-check.sh index 933d8f50e1..53401ba9f4 100755 --- a/tools/validate-clang-check.sh +++ b/tools/validate-clang-check.sh @@ -14,8 +14,17 @@ COMMIT_FILES=$( git diff-index --cached --name-status HEAD^ | grep -v "^D" | cut for FILE in $COMMIT_FILES; do # Skip some special cases + FILE_BASENAME="$(basename file)" # iLBC: the file is not even compiled when ilbc is not installed - [[ $FILE =~ /iLBC/ ]] && continue + if test "$FILE_BASENAME" = "iLBCdecode.c" + then + continue + fi + # extcap/etl.c: that compiles, and is compiled, only on Windows + if test "$FILE_BASENAME" = "etl.c" + then + continue + fi clang-check ../$FILE clang-check -analyze ../$FILE