Return the exit code to let callers make better decisions on what to do.

Signed-off-by: Jani Nikula <jani.nik...@intel.com>
---
 dim | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/dim b/dim
index e6943d34c43f..c282782b429d 100755
--- a/dim
+++ b/dim
@@ -697,7 +697,7 @@ function dim_apply_branch
                echo "No message-id found in the patch file."
        fi
 
-       checkpatch_commit HEAD
+       checkpatch_commit HEAD || true
        check_maintainer $branch HEAD
 
        eval $DRY $DIM_POST_APPLY_ACTION
@@ -893,7 +893,7 @@ dim_alias_ar=apply-resolved
 function dim_apply_resolved
 {
        make $DIM_MAKE_OPTIONS && git add -u && git am --resolved
-       checkpatch_commit HEAD
+       checkpatch_commit HEAD || true
 
        eval $DRY $DIM_POST_APPLY_ACTION
 }
@@ -1103,17 +1103,22 @@ function check_maintainer
 # $1 is the git sha1 to check
 function checkpatch_commit
 {
-       local commit cmd bug_lines non_i915_files
+       local commit cmd bug_lines non_i915_files rv
 
        commit=$1
        cmd="git show --pretty=email $commit"
 
        git --no-pager log --oneline -1 $commit
-       $cmd | scripts/checkpatch.pl -q --emacs --strict - || true
+       if ! $cmd | scripts/checkpatch.pl -q --emacs --strict -; then
+               rv=1
+       fi
 
        if bug_lines=$($cmd | grep -m 1 -B 1 '^\+.*\WBUG' | grep -c 
'^[+-].*\WBUG') && [[ "$bug_lines" = "1" ]]; then
                echoerr "WARNING: New BUG macro added"
+               rv=1
        fi
+
+       return $rv
 }
 
 # turn $1 in to a git commit range
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to