mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
freebsd-update: re-edit files if merge conflict markers remain
freebsd-update will open ${EDITOR} if conflicts occur while merging
updates to config files. Inform the user if they've left conflict
markers behind, and go back to editing the file.
PR: 185546
PR: 229689
Reviewed by: delphij
Approved by: re (cperciva, expedited MFC)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37703
(cherry picked from commit ceb5f28ba5
)
This commit is contained in:
parent
5e9b79c4e6
commit
c7e3703352
|
@ -2543,8 +2543,21 @@ The following file could not be merged automatically: ${F}
|
|||
Press Enter to edit this file in ${EDITOR} and resolve the conflicts
|
||||
manually...
|
||||
EOF
|
||||
read dummy </dev/tty
|
||||
${EDITOR} `pwd`/merge/new/${F} < /dev/tty
|
||||
while true; do
|
||||
read dummy </dev/tty
|
||||
${EDITOR} `pwd`/merge/new/${F} < /dev/tty
|
||||
|
||||
if ! egrep -q '^(<<<<<<<|=======|>>>>>>>)([[:space:]].*)?$' $(pwd)/merge/new/${F} ; then
|
||||
break
|
||||
fi
|
||||
cat <<-EOF
|
||||
|
||||
Merge conflict markers remain in: ${F}
|
||||
These must be resolved for the system to be functional.
|
||||
|
||||
Press Enter to return to editing this file.
|
||||
EOF
|
||||
done
|
||||
done < failed.merges
|
||||
rm failed.merges
|
||||
|
||||
|
|
Loading…
Reference in a new issue