Date: Tue, 23 Mar 2010 10:00:33 -0700 From: Garrett Cooper <yanefbsd@gmail.com> To: John Baldwin <jhb@freebsd.org> Cc: hackers@freebsd.org Subject: Re: Another tool for updating /etc Message-ID: <7d6fde3d1003231000t572a1dd2mc043a6c6ceace216@mail.gmail.com> In-Reply-To: <201003231108.45102.jhb@freebsd.org> References: <201003231108.45102.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 23, 2010 at 8:08 AM, John Baldwin <jhb@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7d6fde3d1003231000t572a1dd2mc043a6c6ceace216>