Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Oct 2002 16:50:53 -0800
From:      Doug Barton <DougB@FreeBSD.org>
To:        Phil Kernick <Phil@Kernick.org>
Cc:        Lucky Green <shamrock@cypherpunks.to>, freebsd-stable@FreeBSD.org
Subject:   Re: Mergemaster [was: Re: Ifconfig config of gif tunnels]
Message-ID:  <3DBC89ED.B5A1B5A9@FreeBSD.org>
References:  <004401c2742a$d6169d90$6501a8c0@VAIO650> <3DAC0045.4060201@Kernick.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Phil Kernick wrote:

> I'd also like the opposite - a list of files that mergemaster will not update
> under any circumstances. 

mergemaster does its comparison based on the presence or absence of
files in the live tree on the system, and the temproot tree created by
mergemaster. So, if you have files that you never want mm to compare,
you can simply use the MM_PRE_COMPARE_SCRIPT hook and delete those files
from the temproot tree. Similarly, if you always want to update certain
files, you could use the same hook and delete the files from the live
tree, and use the autoinstall option to mergemaster.

in ~/.mergemasterrc (or /etc/mergemaster.rc)

AUTO_INSTALL=yes
MM_PRE_COMPARE_SCRIPT=/usr/local/libexec/mergemaster_pre_compare

In /usr/local/libexec/mergemaster_pre_compare:

#!/bin/sh

# NOTE: No PATH needed, because mm's PATH is already draconian enough

# I want mm to always ignore the motd
rm -f ${TEMPROOT}/etc/motd

# I don't use inetd, so always just update this file
rm -f /etc/inetd.conf

# NOTE: No exit here, or else mm will exit too


Of course, the motd example could just as easily be accomplished by
putting 'IGNORE_MOTD=yes' in .mergemasterrc, but you get the idea.
Because of how mm sources the *_SCRIPT's, all the internal variables are
available for its use, which is quite handy. You could make the second
example somewhat safer by doing this for example:

if [ -n "${AUTO_INSTALL}" ]; then
	rm -f /etc/inetd.conf
fi

Personally, I am philosophically opposed to having mm automatically
update files, which is why there are no options to do so in the script
itself. However, enough people have requested those features that I have
added the _SCRIPT hooks so that people can load their own guns, and
point them at their feet at will. 


> At the moment I remove the CVS id from the top of
> all of the files that I modify so that I remember during mergemaster whether I
> should update them or not.

ERrr.... that's weird. :)  If the cvs ID's are the same in the live
version and the temproot version, mm will simply ignore the file. If
they are different, mm will show you the diffs, and you can choose how
to deal with them. 

I like the idea that someone else suggested of putting:

# ---- LOCAL MODIFICATIONS ---- #

near anything you changed, so that you can see it in the diffs easier. I
do something similar myself. 

HTH,

Doug

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DBC89ED.B5A1B5A9>