3 ## "dotest" is my stupid name for my patch-application script, which
4 ## I never got around to renaming after I tested it. We're now on the
5 ## second generation of scripts, still called "dotest".
7 ## Update: Ryan Anderson finally shamed me into naming this "applymbox".
9 ## You give it a mbox-format collection of emails, and it will try to
10 ## apply them to the kernel using "applypatch"
12 ## applymbox [ -c .dotest/msg-number ] [ -q ] mail_archive [Signoff_file]"
14 ## The patch application may fail in the middle. In which case:
15 ## (1) look at .dotest/patch and fix it up to apply
16 ## (2) re-run applymbox with -c .dotest/msg-number for the current one.
17 ## Pay a special attention to the commit log message if you do this and
18 ## use a Signoff_file, because applypatch wants to append the sign-off
19 ## message to msg-clean every time it is run.
21 query_apply
= continue= resume
=t
22 while case "$#" in 0) break ;; esac
26 -c) continue="$2"; resume
=f
; shift ;;
37 mailsplit
"$1" .dotest ||
exit 1
40 case "$query_apply" in
41 t
) touch .dotest
/.query_apply
46 case "$resume,$continue" in
50 mailinfo .dotest
/msg .dotest
/patch <$i >.dotest
/info ||
exit 1
51 git-stripspace
< .dotest
/msg
> .dotest
/msg-clean
54 applypatch .dotest
/msg-clean .dotest
/patch .dotest
/info
"$2"
56 if [ $ret -ne 0 ]; then
57 # 2 is a special exit code from applypatch to indicate that
58 # the patch wasn't applied, but continue anyway
59 [ $ret -ne 2 ] && exit $ret