From: Jacob Keller Date: Thu, 17 Apr 2014 23:26:19 +0000 (-0700) Subject: aiaiai-test-patchset: check for coccinelle scripts first X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=02e21533ebb77adc67ffd2d045dad41d9fc47062;p=users%2Fdedekind%2Faiaiai.git aiaiai-test-patchset: check for coccinelle scripts first Rather than always archiving the coccinelle scripts, check to ensure they exist first. This prevents issues when attempting to build a non-kernel tree, (ie: ethtool). Will display a warning if coccinelle was requested but no scripts were found. Signed-off-by: Jacob Keller --- diff --git a/aiaiai-test-patchset b/aiaiai-test-patchset index 45527f9..90c7900 100755 --- a/aiaiai-test-patchset +++ b/aiaiai-test-patchset @@ -428,10 +428,15 @@ git show "$commit_id1:scripts/checkpatch.pl" > "$checkpatch_pl" chmod $verbose u+x "$checkpatch_pl" >&2 if [ -n "$coccinelle" ]; then - mkdir -p $verbose "$tmpdir/coccinelle" >&2 - git archive "$commit_id1" scripts/coccinelle | \ - tar $verbose --strip-components=2 -C "$tmpdir/coccinelle" -x >&2 - coccinelle="--coccinelle=$tmpdir/coccinelle" + if git cat-file -e "$commit_id1:scripts/coccinelle"; then + mkdir -p $verbose "$tmpdir/coccinelle" >&2 + git archive "$commit_id1" scripts/coccinelle | \ + tar $verbose --strip-components=2 -C "$tmpdir/coccinelle" -x >&2 + coccinelle="--coccinelle=$tmpdir/coccinelle" + else + verbose "Can't find coccinelle scripts.. disabling coccinelle tests." + coccinelle= + fi fi # Run checkpatch.pl in backgound.