From: Wayne Davison Date: Sat, 24 Apr 2004 07:57:19 +0000 (+0000) Subject: Set a better default command based on what just happened. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/b68abdceeefd160433a238504dbdf81c40546781 Set a better default command based on what just happened. --- diff --git a/verify-patches b/verify-patches index e620619..849034c 100755 --- a/verify-patches +++ b/verify-patches @@ -42,11 +42,19 @@ for xx in "${@}"; do 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 @@ -59,26 +67,31 @@ for xx in "${@}"; do 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]*)