summaryrefslogtreecommitdiff
path: root/usr.sbin/etcupdate
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2016-08-05 19:22:33 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2016-08-05 19:22:33 +0000
commita7212e5721baeb31eb104c4829cdf20c58969463 (patch)
treeaa17da954e2c22006f5e1bb842d0a59fdcd48be3 /usr.sbin/etcupdate
parent9dc3843e673eae179ce6b77c8b76305815caf797 (diff)
downloadsrc-test2-a7212e5721baeb31eb104c4829cdf20c58969463.tar.gz
src-test2-a7212e5721baeb31eb104c4829cdf20c58969463.zip
Notes
Diffstat (limited to 'usr.sbin/etcupdate')
-rwxr-xr-xusr.sbin/etcupdate/etcupdate.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index bb12d3669126..6330c60da854 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -814,15 +814,17 @@ merge_file()
local res
# Try the merge to see if there is a conflict.
- merge -q -p ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 >/dev/null 2>&3
+ diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > /dev/null 2>&3
res=$?
case $res in
0)
# No conflicts, so just redo the merge to the
# real file.
- log "merge ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1"
+ log "diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1"
if [ -z "$dryrun" ]; then
- merge ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1
+ temp=$(mktemp -t etcupdate)
+ diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > ${temp}
+ mv -f ${temp} ${DESTDIR}$1
fi
post_install_file $1
echo " M $1"
@@ -832,10 +834,10 @@ merge_file()
# the conflicts directory.
if [ -z "$dryrun" ]; then
install_dirs $NEWTREE $CONFLICTS $1
- log "cp -Rp ${DESTDIR}$1 ${CONFLICTS}$1"
- cp -Rp ${DESTDIR}$1 ${CONFLICTS}$1 >&3 2>&1
- merge -A -q -L "yours" -L "original" -L "new" \
- ${CONFLICTS}$1 ${OLDTREE}$1 ${NEWTREE}$1
+ log "diff3 -m -A ${DESTDIR}$1 ${CONFLICTS}$1"
+ diff3 -m -A -L "yours" -L "original" -L "new" \
+ ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > \
+ ${CONFLICTS}$1
fi
echo " C $1"
;;