Skip to content

Commit

Permalink
Prevent commitcheck.sh from running twice
Browse files Browse the repository at this point in the history
A stray semicolon was causing commitcheck.sh
to run twice when running make checkstyle.
Updated regexes for matching tagged lines.

Signed-off-by: Giuseppe Di Natale <[email protected]>
  • Loading branch information
dinatale2 committed Apr 3, 2017
1 parent cb524aa commit 09f57af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ shellcheck:
shellcheck --exclude=SC1090 --format gcc scripts/paxcheck.sh \
scripts/zloop.sh \
scripts/zfs-tests.sh \
scripts/zfs.sh; \
scripts/zfs.sh \
scripts/commitcheck.sh; \
(find cmd/zed/zed.d/*.sh -type f) | \
grep -v 'zfs-script-config' | \
Expand Down
6 changes: 4 additions & 2 deletions scripts/commitcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ function test_url()
echo "\"$url\" is unreachable"
return 1
fi

return 0
}

# check for a 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")
if [ -z "$foundline" ]; then
echo "error: missing \"$1\""
Expand All @@ -29,7 +31,7 @@ function check_tagged_line()
# check for a tagged line and check that the link is valid
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")
if [ -z "$foundline" ]; then
echo "error: missing \"$1\""
Expand Down

0 comments on commit 09f57af

Please sign in to comment.