From owner-freebsd-questions@FreeBSD.ORG Fri May 15 14:59:39 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 705D3106566B for ; Fri, 15 May 2009 14:59:39 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 33C4E8FC16 for ; Fri, 15 May 2009 14:59:38 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from sarevok.dnr.servegame.org (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 49F6C7E837; Fri, 15 May 2009 06:59:37 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Fri, 15 May 2009 16:59:35 +0200 User-Agent: KMail/1.11.2 (FreeBSD/8.0-CURRENT; KDE/4.2.3; i386; ; ) References: <20090425101042.GA48343@hyperion.scode.org> <20090425122825.2cc0b090@gluon.draftnet> <49F4256C.6090407@isafeelin.org> In-Reply-To: <49F4256C.6090407@isafeelin.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905151659.35618.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Bruce Cran , Frederique Rijsdijk , Doug Barton , Peter Schuller Subject: Re: mergemaster -U overwriting modified files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2009 14:59:39 -0000 On Sunday 26 April 2009 11:12:12 Frederique Rijsdijk wrote: > Bruce Cran wrote: > > On Sat, 25 Apr 2009 12:10:42 +0200 > > > > Peter Schuller wrote: > >> I recently began testing mergemaster -U since the perpetual "review > >> diff of file I never touched" grows annoying real quick. > >> > >> Unfortunately I recently discovered that it does not seem to do what > >> you might expect. For example it nuked my mailer.conf on one machine, > >> and my /etc/namedb/named.conf (!!!) on another machine. > >> > >> Is this a bug or intended? What is the intended functionality of -U? > > > > I noticed this recently too: after using mergemaster -U without > > problems for a long time it suddenly went and overwrote named.conf on > > a recently upgrade of 7-STABLE. > > I've seen this happen as well with named.conf. I think I know the cause, not entirely the problem yet, as I just got hit by this too and right at the point where I upgraded source tree from cvs to svn so *all* files had different idents. Before running mergemaster -iU I checked /var/db/mergemaster.mtree and it was zero-sized. Why, is not entirely clear, (hence, I don't know the real problem) but I thought I noticed mergemaster saving mtree database on the pre-world run. Looking at the code though, this should be impossible, so the more I think about it, the more I start to doubt. At the time I was thinking why is mergemaster saving the mtree and that's when I checked it's size. Whatever the cause, this is where mergemaster fails: CHANGED= if [ -n "${AUTO_UPGRADE}" -a -f "${DESTDIR}${MTREEFILE}" ]; then for file in `mtree -eq -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then CHANGED="${CHANGED} ${DESTDIR}/$file" fi done fi Because ${MTREEFILE} is empty, the mtree command will not produce output and CHANGED will not be populated. For things like this, it would be nice if mtree supported a 'lint' mode to check syntax, but at the very least could mergemaster test for -s rather then or in addition to -f? -- Mel