From owner-svn-src-stable-6@FreeBSD.ORG Mon May 25 04:13:07 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 347A11065672; Mon, 25 May 2009 04:13:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 178718FC08; Mon, 25 May 2009 04:13:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4P4D6SQ010548; Mon, 25 May 2009 04:13:06 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4P4D6Kw010547; Mon, 25 May 2009 04:13:06 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200905250413.n4P4D6Kw010547@svn.freebsd.org> From: Doug Barton Date: Mon, 25 May 2009 04:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192722 - stable/6/usr.sbin/mergemaster X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2009 04:13:07 -0000 Author: dougb Date: Mon May 25 04:13:06 2009 New Revision: 192722 URL: http://svn.freebsd.org/changeset/base/192722 Log: MFC 192219: Add -L to the mtree invocation to chase symbolic links that are present in "Service jails." MFC 192230: Enhance the safety and efficiency of the -U option, fix indentation on one line. Modified: stable/6/usr.sbin/mergemaster/ (props changed) stable/6/usr.sbin/mergemaster/mergemaster.sh Modified: stable/6/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/6/usr.sbin/mergemaster/mergemaster.sh Mon May 25 04:11:30 2009 (r192721) +++ stable/6/usr.sbin/mergemaster/mergemaster.sh Mon May 25 04:13:06 2009 (r192722) @@ -115,8 +115,10 @@ diff_loop () { while [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" -o \ "${HANDLE_COMPFILE}" = "NOT V" ]; do if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" ]; then - if [ -n "${AUTO_UPGRADE}" ]; then - if echo "${CHANGED}" | grep -qsv ${DESTDIR}${COMPFILE#.}; then + if [ -n "${AUTO_UPGRADE}" -a -n "${CHANGED}" ]; then + case "${CHANGED}" in + *:${DESTDIR}${COMPFILE#.}:*) ;; # File has been modified + *) echo '' echo " *** ${COMPFILE} has not been user modified." echo '' @@ -128,10 +130,11 @@ diff_loop () { AUTO_UPGRADED_FILES="${AUTO_UPGRADED_FILES} ${DESTDIR}${COMPFILE#.} " else - echo " *** Problem upgrading ${COMPFILE}, it will remain to merge by hand" + echo " *** Problem upgrading ${COMPFILE}, it will remain to merge by hand" fi return - fi + ;; + esac fi if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then echo '' @@ -348,7 +351,7 @@ fi case "${AUTO_UPGRADE}" in '') ;; # If the option is not set no need to run the test or warn the user *) - if [ ! -f "${DESTDIR}${MTREEFILE}" ]; then + if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then echo '' echo "*** Unable to find mtree database. Skipping auto-upgrade." echo '' @@ -459,14 +462,15 @@ MM_MAKE="make ${ARCHSTRING} -m ${SOURCED # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. # -CHANGED= -if [ -n "${AUTO_UPGRADE}" -a -f "${DESTDIR}${MTREEFILE}" ]; then - for file in `mtree -eq -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ +if [ -n "${AUTO_UPGRADE}" -a -s "${DESTDIR}${MTREEFILE}" ]; then + CHANGED=: + for file in `mtree -eqL -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then - CHANGED="${CHANGED} ${DESTDIR}/$file" + CHANGED="${CHANGED}${DESTDIR}/${file}:" fi done + [ "$CHANGED" = ':' ] && unset CHANGED fi # Check the width of the user's terminal @@ -1049,7 +1053,7 @@ done # This is for the for way up there echo '' echo "*** Comparison complete" -if [ -f "${MTREENEW}" ]; then +if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} mv ${MTREENEW} ${DESTDIR}${MTREEFILE}