[PATCH 12/14] test-patchset: stop using own copy of checkpatch.pl

Artem Bityutskiy dedekind1 at gmail.com
Tue Feb 4 09:28:08 PST 2014


From: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>

Own copy of checkpatch.pl tends to be out-of-date. Start using
checkpatch.pl from the tree we test against instead.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
---
 aiaiai-test-patchset | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/aiaiai-test-patchset b/aiaiai-test-patchset
index 260d6b3..58287cc 100755
--- a/aiaiai-test-patchset
+++ b/aiaiai-test-patchset
@@ -110,7 +110,7 @@ test_checkpatch()
 
 		formail +$n -1 -s < "$mbox" > "$tmp_mbox"
 		truncate -s0 "$tmp_out"
-		checkpatch.pl $opts - < "$tmp_mbox" > "$tmp_out" ||:
+		"$checkpatch_pl" $opts - < "$tmp_mbox" > "$tmp_out" ||:
 		n="$(($n+1))"
 
 		[ -s "$tmp_out" ] || continue
@@ -127,7 +127,7 @@ test_checkpatch()
 	if [ "$patch_cnt" -gt 1 ]; then
 		# Check the squashed patch
 		truncate -s0 "$tmp_out"
-		checkpatch.pl --no-signoff $opts - < "$tmpdir/diff-for-checkpatch" > "$tmp_out" ||:
+		"$checkpatch_pl" --no-signoff $opts - < "$tmpdir/diff-for-checkpatch" > "$tmp_out" ||:
 		[ -s "$tmp_out" ] || return 0
 
 		printf "\n" >> "$tmpdir/checkpatch.results"
@@ -344,6 +344,7 @@ program_required "formail" ""
 program_required "python" ""
 program_required "perl" ""
 program_required "diff" ""
+program_required "tar" ""
 
 for defconfig in $defconfigs; do
 	cross="$(leave_third "$defconfig")";
@@ -400,7 +401,6 @@ verbose "Commit after applying the patch(es): $(git log -1 --oneline "$commit_id
 
 # Re-generate the patch. Note, we prefer to not use the input mbox directly
 # because it may be encoded (e.g., with quoted-printable).
-#
 git format-patch -M --patience --stdout "$commit_id1".."$commit_id2" > "$mbox"
 
 # Generate a diff for aiaiai-diff-log
@@ -409,6 +409,14 @@ git diff -U0 -M "$commit_id1".."$commit_id2" > "$tmpdir/diff-for-diff-log"
 # Generate a diff for checkpatch.pl
 git diff -M "$commit_id1".."$commit_id2" > "$tmpdir/diff-for-checkpatch"
 
+# Make a copy of 'checlpatch.pl'. This is safer than using it directly from the
+# git tree because we'll apply patches under test there, and the patches may
+# also change 'checlpatch.pl'.
+mkdir -p $verbose "$tmpdir/checkpatch" >&2
+checkpatch_pl="$tmpdir/checkpatch/checkpatch.pl"
+git show "$commit_id1:scripts/checkpatch.pl" > "$checkpatch_pl"
+chmod $verbose u+x "$checkpatch_pl" >&2
+
 # Run checkpatch.pl in backgound.
 test_checkpatch &
 pid_checkpatch="$!"
-- 
1.8.5.2




More information about the aiaiai mailing list