2005-04-12 16:40:20 +08:00
|
|
|
#!/bin/sh
|
|
|
|
##
|
|
|
|
## "dotest" is my stupid name for my patch-application script, which
|
|
|
|
## I never got around to renaming after I tested it. We're now on the
|
|
|
|
## second generation of scripts, still called "dotest".
|
|
|
|
##
|
|
|
|
## You give it a mbox-format collection of emails, and it will try to
|
|
|
|
## apply them to the kernel using "applypatch"
|
|
|
|
##
|
2005-04-20 23:23:00 +08:00
|
|
|
## dotest [ -q ] mail_archive [Signoff_file]
|
|
|
|
##
|
2005-04-12 16:40:20 +08:00
|
|
|
rm -rf .dotest
|
|
|
|
mkdir .dotest
|
2005-04-20 23:23:00 +08:00
|
|
|
case $1 in
|
|
|
|
|
|
|
|
-q) touch .dotest/.query_apply
|
|
|
|
shift;;
|
|
|
|
esac
|
2005-04-12 16:40:20 +08:00
|
|
|
mailsplit $1 .dotest || exit 1
|
|
|
|
for i in .dotest/*
|
|
|
|
do
|
2005-06-24 00:40:23 +08:00
|
|
|
mailinfo .dotest/msg .dotest/patch < $i > .dotest/info || exit 1
|
2005-05-01 01:58:41 +08:00
|
|
|
stripspace < .dotest/msg > .dotest/msg-clean
|
2005-06-24 00:40:23 +08:00
|
|
|
applypatch .dotest/msg-clean .dotest/patch .dotest/info "$2"
|
2005-04-20 23:23:00 +08:00
|
|
|
ret=$?
|
|
|
|
if [ $ret -ne 0 ]; then
|
|
|
|
# 2 is a special exit code from applypatch to indicate that
|
|
|
|
# the patch wasn't applied, but continue anyway
|
|
|
|
[ $ret -ne 2 ] && exit $ret
|
|
|
|
fi
|
2005-04-12 16:40:20 +08:00
|
|
|
done
|
2005-04-20 23:23:00 +08:00
|
|
|
# return to pristine
|
|
|
|
rm -fr .dotest
|