]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
test-patchset: stop using own copy of checkpatch.pl
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 4 Feb 2014 17:18:16 +0000 (19:18 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 4 Feb 2014 17:33:07 +0000 (19:33 +0200)
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@linux.intel.com>
aiaiai-test-patchset

index 260d6b35955f917bc04acbcce835281bcf238760..58287cc590a073a33d3fc8e5bd630e9dd3c34e85 100755 (executable)
@@ -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="$!"