for nn in `sed -n 's/^patching file //p' ,patch.output`; do
[ -f ../,cvsdir/$nn ] || new="$new $nn"
done
+ if grep "^Hunk #[0-9]* FAILED" ,patch.output >/dev/null; then
+ default=F
+ elif grep "^Hunk #[0-9]* succeeded at [0-9]* (offset" ,patch.output >/dev/null; then
+ default=E
+ else
+ default=N
+ fi
apply=n
fi
echo -e "\nFix rejects, Make proto, Edit both diffs, Update patch,"
- echo -n "Apply patch again, Next, Quit: [n] "
+ echo -n "Apply patch again, Next, Quit: [$default] "
read ans
+ [ -z "$ans" ] && ans=$default
case "$ans" in
[Ee]*)
[ ! -z "$new" ] && cvs add $new
grep -v '^RCS file: ' |
grep -v '^retrieving revision ' >>,new.patch
vim -d $xx ,new.patch
+ default=U
;;
[Ff]*)
vim *.rej
+ default=E
;;
[Mm]*)
cat *.c lib/compat.c | awk -f mkproto.awk >proto.h
echo -e "\nRegenerated proto.h"
+ default=E
;;
[Uu]*)
if [ -f ,new.patch ]; then
cp -p ,new.patch $xx
echo -e "\nCopied ,new.patch to $xx"
+ default=A
else
echo -e "\n*** Edit the diffs first. ***"
+ default=E
fi
;;
[Aa]*)
apply=y
;;
- [Nn]*|'')
+ [Nn]*)
break
;;
[Qq]*)