]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
aiaiai-test-patchset: check for coccinelle scripts first
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 17 Apr 2014 23:26:19 +0000 (16:26 -0700)
committerJacob Keller <jacob.e.keller@intel.com>
Tue, 27 May 2014 18:17:38 +0000 (11:17 -0700)
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 <jacob.e.keller@intel.com>
aiaiai-test-patchset

index 45527f90b4ae6cbd1927df6d6f88632ac332729c..90c790098e388be823e1ff22d7eacfce49e0e186 100755 (executable)
@@ -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.