Prevent commitcheck.sh from running twice

A stray semicolon was causing commitcheck.sh
to run twice when running make checkstyle.
Updated regexes for matching tagged lines.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #5952
This commit is contained in:
Giuseppe Di Natale 2017-04-03 14:20:01 -07:00 committed by Brian Behlendorf
parent e55ebf6afd
commit 3f2da6cb73
2 changed files with 5 additions and 3 deletions

View File

@ -55,7 +55,7 @@ shellcheck:
shellcheck --exclude=SC1090 --format gcc scripts/paxcheck.sh \ shellcheck --exclude=SC1090 --format gcc scripts/paxcheck.sh \
scripts/zloop.sh \ scripts/zloop.sh \
scripts/zfs-tests.sh \ scripts/zfs-tests.sh \
scripts/zfs.sh; \ scripts/zfs.sh \
scripts/commitcheck.sh; \ scripts/commitcheck.sh; \
(find cmd/zed/zed.d/*.sh -type f) | \ (find cmd/zed/zed.d/*.sh -type f) | \
grep -v 'zfs-script-config' | \ grep -v 'zfs-script-config' | \

View File

@ -11,12 +11,14 @@ function test_url()
echo "\"$url\" is unreachable" echo "\"$url\" is unreachable"
return 1 return 1
fi fi
return 0
} }
# check for a tagged line # check for a tagged line
function check_tagged_line() function check_tagged_line()
{ {
regex='^\s*'"$1"':\s+\S+\s+\<\S+\>' regex='^\s*'"$1"':\s[[:print:]]+\s<[[:graph:]]+>$'
foundline=$(git log -n 1 "$REF" | egrep -m 1 "$regex") foundline=$(git log -n 1 "$REF" | egrep -m 1 "$regex")
if [ -z "$foundline" ]; then if [ -z "$foundline" ]; then
echo "error: missing \"$1\"" echo "error: missing \"$1\""
@ -29,7 +31,7 @@ function check_tagged_line()
# check for a tagged line and check that the link is valid # check for a tagged line and check that the link is valid
function check_tagged_line_with_url () function check_tagged_line_with_url ()
{ {
regex='^\s*'"$1"':\s+\K(\S+)' regex='^\s*'"$1"':\s\K([[:graph:]]+)$'
foundline=$(git log -n 1 "$REF" | grep -Po "$regex") foundline=$(git log -n 1 "$REF" | grep -Po "$regex")
if [ -z "$foundline" ]; then if [ -z "$foundline" ]; then
echo "error: missing \"$1\"" echo "error: missing \"$1\""