From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 23 17:00:38 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 492FE106564A; Tue, 23 Mar 2010 17:00:38 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 16D5C8FC16; Tue, 23 Mar 2010 17:00:37 +0000 (UTC) Received: by pxi12 with SMTP id 12so244297pxi.14 for ; Tue, 23 Mar 2010 10:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=eI/rNd2Fx67+mS6GNDqVI7ZBXQBaxcYTwvkhNlEBOBM=; b=Segk9V1FcXwuyrdjphM8SjnBKaOsxc8+IxsTpT53kTPCgalkYX3sfw32VC83Gd2TaV iao2yCT7RCLQckQF4U+uEorwTRm/1B2YE/SJ4fDwx0Ns3algOzHctAxJRJxxCxVBH5yr DkYlSU0dhuGmNRd5vgrx3uyhXt/S2YmiOekCU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=VV//Q1FeSMBvRkcPCGivje+xdukh33/WFfAbROTx+wTEjk1GwXOFBKw4PkIpBCNAX3 LBTQmAebM+9X42N+hfQkVaM9lVkCkH0m3m95v660JR5KsQEAaqIlucGlFdaFhDL7lgxQ /XTFDJ2OfYA63Aa0P3yyELhOjy3cRXDROMmAc= MIME-Version: 1.0 Received: by 10.143.136.7 with SMTP id o7mr1876170wfn.101.1269363633341; Tue, 23 Mar 2010 10:00:33 -0700 (PDT) In-Reply-To: <201003231108.45102.jhb@freebsd.org> References: <201003231108.45102.jhb@freebsd.org> Date: Tue, 23 Mar 2010 10:00:33 -0700 Message-ID: <7d6fde3d1003231000t572a1dd2mc043a6c6ceace216@mail.gmail.com> From: Garrett Cooper To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: Another tool for updating /etc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2010 17:00:38 -0000 On Tue, Mar 23, 2010 at 8:08 AM, John Baldwin wrote: > I have tried a few approaches (and looked at another) for updating /etc a= fter > world upgrades over the past several years. =A0All of these approaches ha= ve > various tradeoffs of pros and cons. =A0However, none of them fully fit wh= at I > wanted: > > 1) Using a set of manual steps first outlined in the handbook in the pre- > mergemaster days. =A0This involved building a new etc tree after each wor= ld > install and using a script to compare this tree to the previous tree. =A0= I > would then merge changes to /etc on the main machine by hand. > > Some downsides here are that the actual merging was tedious and completel= y > manual. =A0On the upside, the the necessary data was present to do a full= 3-way > merge and to notice cases like a file becoming a directory, or a file bei= ng > removed. > > 2) Using mergemaster as described in the handbook, etc. > > Some downsides here are that the process is not automated but requires ma= nual > intervention. =A0Using '-iFU' helps some, but you can't reliably do scrip= ted > installs easily. =A0MM also does not keep as much state around. =A0The mt= ree db > will let you know if a file is "stock", but it doesn't have enough contex= t to > do a 3-way merge. > > 3) etcmerge from ports. =A0I have not actually used it, just read the > documentation, etc. =A0In general this looks like it DTRT and is fairly > automated. =A0The one caveat I see though is that it updates a separate /= etc > tree that then has to be copied back only after any conflicts are resolve= d. > > Some of the primary things I was looking for was a tool that met the > following: > > 1) Automated: is able to automate as much of the merging/etc. as possibly > using 3-way merges from the old and new versions of files, doing a best e= ffort > and only requiring manual intervention for a conflict that could not be > resolved automatically. =A0I want the ability to update 100's of machines= via > scripts without having to answer prompts on each one, then getting a summ= ary > at the end of any outstanding conflicts. > > 2) Best effort merge into /etc: I want the update to update as many files > directly in /etc as possible and only leave conflicts for manual resoluti= on. > > 3) Doing a full 3-way merge: I want something equivalent to doing an 'svn= up' > or 'cvs up'. =A0If the local changes I made do not conflict, then just me= rge the > changes automatically (e.g. enabling a serial console in /etc/ttys should= not > conflict with $FreeBSD$ changing when moving from 7.2 to 7.3). > > To that end, I wrote a new tool that I think does a decent job of solving > these goals. =A0It does not force you to read the diffs of any files upda= ted in > /etc, but there are other tools available for that. =A0However, if you ar= e ok > with reading UPDATING, commit logs, and/or release notes for that sort of > info, then this tool may work for you. > > It also has a nice feature in that you can generate a 'diff' of your curr= ent > /etc tree against the "stock" tree allowing you to easily see what local > changes you have made. =A0I have already found this feature to be far mor= e > useful than I first expected. > > The UI is (hopefully) minimalist. =A0The default output looks like the ou= tput of > 'svn up' or 'cvs up'. > > If you'd like to give it a shot, you can find the script and manpage at > http://www.FreeBSD.org/~jhb/etcupdate/ =A0There is a README file that giv= es a > brief overview and instructions on how to bootstrap the needed metadata b= efore > the first update. =A0There is also an HTML version of the manpage. Hmmm... looks pretty complete. The only [minor] concern I have is that a lot of the variables aren't quoted, so paths with spaces will fail (I'm not sure if this is a non-defacto standard way of installing things in the project, but it'd be nice if these items were fixed). I'll give it a run sometime in the near future :)... Cheers! -Garrett