From owner-freebsd-questions@FreeBSD.ORG Sat Nov 17 18:12:46 2007 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 25F2A16A420 for ; Sat, 17 Nov 2007 18:12:46 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9897913C4D5 for ; Sat, 17 Nov 2007 18:12:44 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (dialup92.ach.sch.gr [81.186.70.92]) (authenticated bits=128) by igloo.linux.gr (8.14.1/8.14.1/Debian-9) with ESMTP id lAHIBxoi032307 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 17 Nov 2007 20:12:19 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id lAHIBwfp003041; Sat, 17 Nov 2007 20:11:58 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id lAHIBugs003040; Sat, 17 Nov 2007 20:11:56 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Sat, 17 Nov 2007 20:11:56 +0200 From: Giorgos Keramidas To: "J. Porter Clark" Message-ID: <20071117181156.GC2834@kobe.laptop> References: <20071117043426.GA71265@auricle.charter.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071117043426.GA71265@auricle.charter.net> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.939, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.46, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: Making mergemaster skip certain 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: Sat, 17 Nov 2007 18:12:46 -0000 On 2007-11-16 22:34, "J. Porter Clark" wrote: > Is there any way to keep certain files out of the reach of > mergemaster? I understand the need for carefully merging the > old and the new, but I really shouldn't ever have to for files > like these: > > /etc/aliases > /etc/hosts > /etc/hosts.allow > /etc/manpath.config > ... and many others. You can hook into mergemaster, using shell scripts. See the manpage of mergemaster for more details, but here's a short description of what I use on my laptop for some time now: 1. A `.mergemasterrc' file in the HOME directory of the `root' user, which contains: STRICT=no MM_PRE_COMPARE_SCRIPT=/root/mm-pre-compare.sh 2. The `/root/mm-pre-compare.sh' script contains the following: #!/bin/sh # NOTE: No PATH needed, because mm's PATH is already # draconian enough. # If TEMPROOT is not set, or it is set to a path which # resolves to the real root filesystem, abort early, before we # trash the config files of the installed root filesystem. if test -z "${TEMPROOT}" ; then echo >&2 "$0: error: TEMPROOT is unset or empty." exit 1 fi p=`realpath "${TEMPROOT}"` if test "${p}" = '/' ; then echo >&2 "$0: error: TEMPROOT is the real root filesystem." exit 2 fi case "${PRE_WORLD}" in '') # The following files always have local changes. # Remove them from ${TEMPROOT} to force mergemaster(8) # to ignore these files when comparing /etc directories. rm -f "${TEMPROOT}/.cshrc" rm -f "${TEMPROOT}/.profile" rm -f "${TEMPROOT}/root/.cshrc" rm -f "${TEMPROOT}/root/.profile" rm -f "${TEMPROOT}/etc/hosts" rm -f "${TEMPROOT}/etc/networks" rm -f "${TEMPROOT}/etc/motd" rm -f "${TEMPROOT}/etc/printcap" ;; esac