From owner-svn-src-stable@freebsd.org Sat Oct 22 20:39:19 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3280C1D4C5; Sat, 22 Oct 2016 20:39:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90E4EE45; Sat, 22 Oct 2016 20:39:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9MKdIV6006766; Sat, 22 Oct 2016 20:39:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9MKdI1n006763; Sat, 22 Oct 2016 20:39:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610222039.u9MKdI1n006763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Oct 2016 20:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307788 - in stable/11: tools/build/mk usr.sbin usr.sbin/etcupdate X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2016 20:39:19 -0000 Author: bapt Date: Sat Oct 22 20:39:18 2016 New Revision: 307788 URL: https://svnweb.freebsd.org/changeset/base/307788 Log: MFC r303784, r303785, r305620: r303784: etcupdate: directly use diff3(1) instead of merge(1) During the last attempt to rmeove GNU rcs, 2 blockers were spotted: We need an ident(1) and etcupdate(8) uses merge(1). Now nothing should prevent to remove rcs from base Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D7401 r303785: always install etcupdate Now that etcupdate does not depend on rcs anymore there is no need to conditionnally install it r305620: (by vangyzen ) etcupdate: preserve the metadata of the destination file When using diff3 to perform a three-way merge, etcupdate lost the destination file's metadata. The metadata from the temporary file were used instead. This was unpleasant for rc.d scripts, which require execute permission. Use "cat >" to overwrite the destination file's contents while preserving its metadata. Reviewed by: bapt Sponsored by: Dell Technologies Differential Revision: https://reviews.freebsd.org/D7817 Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc stable/11/usr.sbin/Makefile stable/11/usr.sbin/etcupdate/etcupdate.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 22 20:00:39 2016 (r307787) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 22 20:39:18 2016 (r307788) @@ -6800,7 +6800,6 @@ OLD_FILES+=usr/bin/rcsdiff OLD_FILES+=usr/bin/rcsfreeze OLD_FILES+=usr/bin/rcsmerge OLD_FILES+=usr/bin/rlog -OLD_FILES+=usr/sbin/etcupdate OLD_FILES+=usr/share/man/man1/ci.1.gz OLD_FILES+=usr/share/man/man1/co.1.gz OLD_FILES+=usr/share/man/man1/merge.1.gz @@ -6812,16 +6811,6 @@ OLD_FILES+=usr/share/man/man1/rcsintro.1 OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz OLD_FILES+=usr/share/man/man1/rlog.1.gz OLD_FILES+=usr/share/man/man5/rcsfile.5.gz -OLD_FILES+=usr/share/man/man8/etcupdate.8.gz -OLD_FILES+=usr/tests/usr.sbin/etcupdate/Kyuafile -OLD_FILES+=usr/tests/usr.sbin/etcupdate/always_test -OLD_FILES+=usr/tests/usr.sbin/etcupdate/conflicts_test -OLD_FILES+=usr/tests/usr.sbin/etcupdate/fbsdid_test -OLD_FILES+=usr/tests/usr.sbin/etcupdate/ignore_test -OLD_FILES+=usr/tests/usr.sbin/etcupdate/preworld_test -OLD_FILES+=usr/tests/usr.sbin/etcupdate/tests_test -OLD_FILES+=usr/tests/usr.sbin/etcupdate/tzsetup_test -OLD_DIRS+=usr/tests/usr.sbin/etcupdate .endif #.if ${MK_RESCUE} == no Modified: stable/11/usr.sbin/Makefile ============================================================================== --- stable/11/usr.sbin/Makefile Sat Oct 22 20:00:39 2016 (r307787) +++ stable/11/usr.sbin/Makefile Sat Oct 22 20:39:18 2016 (r307788) @@ -25,6 +25,7 @@ SUBDIR= adduser \ digictl \ diskinfo \ dumpcis \ + etcupdate \ extattr \ extattrctl \ fifolog \ @@ -188,7 +189,6 @@ SUBDIR.${MK_QUOTAS}+= edquota SUBDIR.${MK_QUOTAS}+= quotaon SUBDIR.${MK_QUOTAS}+= repquota SUBDIR.${MK_RCMDS}+= rwhod -SUBDIR.${MK_RCS}+= etcupdate SUBDIR.${MK_SENDMAIL}+= editmap SUBDIR.${MK_SENDMAIL}+= mailstats SUBDIR.${MK_SENDMAIL}+= makemap Modified: stable/11/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- stable/11/usr.sbin/etcupdate/etcupdate.sh Sat Oct 22 20:00:39 2016 (r307787) +++ stable/11/usr.sbin/etcupdate/etcupdate.sh Sat Oct 22 20:39:18 2016 (r307788) @@ -814,15 +814,19 @@ 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} + # Use "cat >" to preserve metadata. + cat ${temp} > ${DESTDIR}$1 + rm -f ${temp} fi post_install_file $1 echo " M $1" @@ -832,10 +836,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" ;;