[PATCH 1/3] aiaiai-test-patchset: check for coccinelle scripts first

Jacob Keller jacob.e.keller at intel.com
Tue May 27 10:56:34 PDT 2014


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 at intel.com>
---
 aiaiai-test-patchset | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/aiaiai-test-patchset b/aiaiai-test-patchset
index 45527f90b4ae..90c790098e38 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.
-- 
1.9.0




More information about the aiaiai mailing list