freebsd-update: allow user to break out of conflict resolution loop

When a conflict marker is found during update allow the user to confirm
they want it to remain in the file.

Suggested by:	Tim Hogard
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Fixes: ceb5f28ba5 ("freebsd-update: re-edit files if merge confli...")
Differential Revision: https://reviews.freebsd.org/D38896
This commit is contained in:
Ed Maste 2023-03-03 12:32:51 -05:00
parent 3b5c984572
commit 3d44241546

View file

@ -2544,7 +2544,11 @@ Press Enter to edit this file in ${EDITOR} and resolve the conflicts
manually...
EOF
while true; do
read dummy </dev/tty
read response </dev/tty
if expr "${response}" : '[Aa][Cc][Cc][Ee][Pp][Tt]' > /dev/null; then
echo
break
fi
${EDITOR} `pwd`/merge/new/${F} < /dev/tty
if ! grep -qE '^(<<<<<<<|=======|>>>>>>>)([[:space:]].*)?$' $(pwd)/merge/new/${F} ; then
@ -2555,7 +2559,8 @@ manually...
Merge conflict markers remain in: ${F}
These must be resolved for the system to be functional.
Press Enter to return to editing this file.
Press Enter to return to editing this file, or type "ACCEPT" to carry on with
these lines remaining in the file.
EOF
done
done < failed.merges