From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 14 08:25:44 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BAEE16A4FB for ; Wed, 14 Jan 2004 08:25:44 -0800 (PST) Received: from bewilderbeast.blackhelicopters.org (bewilderbeast.blackhelicopters.org [198.22.63.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 926F743D1D for ; Wed, 14 Jan 2004 08:25:41 -0800 (PST) (envelope-from mwlucas@bewilderbeast.blackhelicopters.org) Received: from bewilderbeast.blackhelicopters.org (mwlucas@localhost [127.0.0.1])i0EGPdGP081753; Wed, 14 Jan 2004 11:25:39 -0500 (EST) (envelope-from mwlucas@bewilderbeast.blackhelicopters.org) Received: (from mwlucas@localhost)i0EGPdRg081752; Wed, 14 Jan 2004 11:25:39 -0500 (EST) (envelope-from mwlucas) Date: Wed, 14 Jan 2004 11:25:39 -0500 From: "Michael W. Lucas" To: "Michael R. Wayne" Message-ID: <20040114162539.GA81326@bewilderbeast.blackhelicopters.org> References: <200401130746.i0D7kNEk004375@manor.msen.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401130746.i0D7kNEk004375@manor.msen.com> User-Agent: Mutt/1.4.1i X-Spam-Status: No, hits=-5.0 required=4.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: hackers@freebsd.org Subject: Re: Mergemaster+RCS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2004 16:25:44 -0000 Woo hoo! We'll test this here the next time we upgrade. Could you send-pr this, so it doesn't get lost? Thanks! ==ml On Tue, Jan 13, 2004 at 02:46:23AM -0500, Michael R. Wayne wrote: > > Although Doug Barton has written a wonderful tool, it has always > seemed to have a major deficiency: it completely ignores the > existance of RCS files. I've exchanged some email with Doug and > he has no interest in adding RCS support to mergemaster. So I did. > > Doug has mentioned that some people solve this problem by using > the precompare script or by checking out all RCS files before > running mergemaster then checking them in afterwards. These > solutions are highly unattractive to me since they require sysadmins > to remember far too much, especially given that systems are often > upgraded at off hours to minimize user impact. > > The attached patch to the mergemaster in 4.9-RELEASE-p1 addresses > this issue. Specifically, it does the following, automatically: > > For every file that mergemaster replaces, check for the existance > of an associated RCS log file in the RCS subdirectory. (I do > NOT check for the logfile in the current directory). > If such a logfile exists > If the file is currently checked out, check it in with an automated comment. > Check the file out. > Apply the upgrade. > Check the file in with an automated comment. > If the file was originally checked out, check it back out again. > If no associated RCS log file exists, there is no change in the > operation of mergemaster. > > I take care to leave the log file in the original checked in/out > state: People have tools that "know" the state of logfiles and > these tools should not be broken. > > This seems to work for us. Comments/suggestions welcome. > > /\/\ \/\/ > > > *** /usr/sbin/mergemaster Thu Jan 8 17:03:30 2004 > --- mergemaster+rcs Fri Jan 9 08:45:19 2004 > *************** > *** 8,20 **** > # Copyright 1998-2003 Douglas Barton > # DougB@FreeBSD.org > > # $FreeBSD: src/usr.sbin/mergemaster/mergemaster.sh,v 1.6.2.18 2003/08/25 08:27:41 dougb Exp $ > > PATH=/bin:/usr/bin:/usr/sbin > > display_usage () { > VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` > ! echo "mergemaster version ${VERSION_NUMBER}" > echo 'Usage: mergemaster [-scrvahipCP] [-m /path]' > echo ' [-t /path] [-d] [-u N] [-w N] [-D /path]' > echo "Options:" > --- 8,22 ---- > # Copyright 1998-2003 Douglas Barton > # DougB@FreeBSD.org > > + # Automated support for RCS log files added 2004 by wayne@msen.com > + > # $FreeBSD: src/usr.sbin/mergemaster/mergemaster.sh,v 1.6.2.18 2003/08/25 08:27:41 dougb Exp $ > > PATH=/bin:/usr/bin:/usr/sbin > > display_usage () { > VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` > ! echo "mergemaster version ${VERSION_NUMBER} with RCS support" > echo 'Usage: mergemaster [-scrvahipCP] [-m /path]' > echo ' [-t /path] [-d] [-u N] [-w N] [-D /path]' > echo "Options:" > *************** > *** 646,653 **** > --- 648,695 ---- > ;; > esac > > + # Begin part 1 of 2 support for RCS added by wayne@msen.com > + # Deals with RCS log files in the RCS subdirectory, first checking > + # in previous changes (if any), checks in the changes made by > + # mergemaster and leaves the file in the original checked in/out state. > + # > + # Assume we will not need to check this file in. > + local MM_RCS > + MM_RCS=0 > + if [ -d ${3}/RCS ]; then > + # The RCS directory exists, check it for this logfile > + if [ -e ${3}/RCS/${2##*/},v ]; then > + # The RCS logfile exists, now we need to know it's existing state > + if [ -z `rlog -L -R ${3}/${2##*/}` ]; then > + # Target file is unlocked, check it out > + co -l ${3}/${2##*/} > + # Remember to leave file unlocked after install > + MM_RCS=1 > + else > + # File is already locked, check it in before we mess with it > + ci -l -m"Mergemaster auto checkin of locked file." ${3}/${2##*/} > + # Remember to leave file locked after install > + MM_RCS=2 > + fi > + fi > + fi > + # End part 1 of 2 support for RCS added by wayne@msen.com > + > install -m "${1}" "${2}" "${3}" && > rm -f "${2}" > + > + # Begin part 2 of 2 support for RCS added by wayne@msen.com > + if [ $MM_RCS -eq 1 ]; then > + # Checkin the file, leaving it unlocked > + ci -u -m"Mergemaster auto checkin after updates" ${3}/${2##*/} > + elif [ $MM_RCS -eq 2 ]; then > + # Checkin the file, leaving it locked > + ci -l -m"Mergemaster auto checkin after updates" ${3}/${2##*/} > + else > + # Do nothing, no RCS log file exists > + fi > + # End part 2 of 2 support for RCS added by wayne@msen.com > + > } > > find_mode () { > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- Michael Lucas mwlucas@FreeBSD.org, mwlucas@BlackHelicopters.org Today's chance of throwing it all away to start a goat farm: 41.8% http://www.BlackHelicopters.org/~mwlucas/ Absolute OpenBSD: http://www.AbsoluteOpenBSD.com/