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.
This commit is contained in:
Guy Harris 2021-04-28 03:00:43 -07:00 committed by Wireshark GitLab Utility
parent ebafa3a4b9
commit 0d12050e5e
1 changed files with 10 additions and 1 deletions

View File

@ -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