Skip to content
Snippets Groups Projects
Commit 493476c9 authored by Simona Vetter's avatar Simona Vetter
Browse files

dim: extract warn_or_fail


I plan to add more of these ...

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parent 78558bf4
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,16 @@ DRY_RUN= ...@@ -102,6 +102,16 @@ DRY_RUN=
DRY= DRY=
FORCE= FORCE=
function warn_or_fail
{
if [[ $FORCE ]] ; then
echo WARNING: $1, but continuing
else
echo ERROR: $1, aborting
exit 1
fi
}
while getopts df opt; do while getopts df opt; do
case "$opt" in case "$opt" in
d) d)
...@@ -177,12 +187,7 @@ function update_nightly ...@@ -177,12 +187,7 @@ function update_nightly
cd $rerere cd $rerere
if [[ `git status --porcelain | grep -v "^[ ?][ ?]" | wc -l` -gt 0 ]]; then if [[ `git status --porcelain | grep -v "^[ ?][ ?]" | wc -l` -gt 0 ]]; then
if [[ $FORCE ]] ; then warn_or_fail "-nightly configuration file not commited"
echo WARNING: -nightly configuration file not commited, but continuing with rebuild
else
echo ERROR: -nightly configuration file not commited, aborting
exit 1
fi
fi fi
source $rerere/nightly.conf source $rerere/nightly.conf
...@@ -334,12 +339,7 @@ function dim_checkpatch ...@@ -334,12 +339,7 @@ function dim_checkpatch
git --no-pager log --oneline -1 $commit git --no-pager log --oneline -1 $commit
git show $commit --pretty=email | scripts/checkpatch.pl -q --strict - || true git show $commit --pretty=email | scripts/checkpatch.pl -q --strict - || true
if git show $commit | grep '^\+.*\WBUG' > /dev/null; then if git show $commit | grep '^\+.*\WBUG' > /dev/null; then
if [[ $FORCE ]] ; then warn_or_fail "New BUG macro added"
echo "WARNING: New BUG macro added"
else
echo "ERROR: New BUG macro added"
return 1
fi
fi fi
git show $commit | grep '^\+.*drm_i915_private_t' > /dev/null && echo "WARNING: New drm_i915_private_t added" || true git show $commit | grep '^\+.*drm_i915_private_t' > /dev/null && echo "WARNING: New drm_i915_private_t added" || true
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment