Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MFC: automatically upgrade files that only differ in CVS Id tag.
  • Loading branch information
sobomax authored and sobomax committed Dec 10, 2008
1 parent e426134 commit d2560e5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions usr.sbin/mergemaster/mergemaster.sh
Expand Up @@ -947,6 +947,25 @@ for COMPFILE in `find . -type f -size +0`; do
echo " *** Temp ${COMPFILE} and installed have the same CVS Id, deleting"
rm "${COMPFILE}"
;;

*)
tempfoo=`basename $0`
TMPFILE1=`mktemp -t ${tempfoo}` || break
TMPFILE2=`mktemp -t ${tempfoo}` || break
sed "s/[$]${CVS_ID_TAG}:.*[$]//g" "${DESTDIR}${COMPFILE#.}" > "${TMPFILE1}"
sed "s/[$]${CVS_ID_TAG}:.*[$]//g" "${COMPFILE}" > "${TMPFILE2}"
if diff -q ${DIFF_OPTIONS} "${TMPFILE1}" "${TMPFILE2}" > \
/dev/null 2>&1; then
echo " *** Temp ${COMPFILE} and installed are the same except CVS Id, replacing"
if mm_install "${COMPFILE}"; then
echo " *** ${COMPFILE} upgraded successfully"
echo ''
else
echo " *** Problem upgrading ${COMPFILE}, it will remain to merge by hand"
fi
fi
rm -f "${TMPFILE1}" "${TMPFILE2}"
;;
esac
;;
esac
Expand Down

0 comments on commit d2560e5

Please sign in to comment.