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
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"
program_required "python" ""
program_required "perl" ""
program_required "diff" ""
+program_required "tar" ""
for defconfig in $defconfigs; do
cross="$(leave_third "$defconfig")";
# 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
# 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="$!"