Gentoo Archives: gentoo-dev

From: Toby Dickenson <tdickenson@××××××××××××××××××××××××××××.uk>
To: Owen Gunden <ogunden@××××××××××××.edu>, gentoo-dev@g.o, Seemant Kulleen <seemant@g.o>
Subject: Re: [gentoo-dev] Interest Check: Dynamic config files for portage
Date: Wed, 02 Jul 2003 09:57:18
Message-Id: 200307021057.16601.tdickenson@devmail.geminidataloggers.co.uk
In Reply to: Re: [gentoo-dev] Interest Check: Dynamic config files for portage by Owen Gunden
1 On Tuesday 01 July 2003 23:29, Owen Gunden wrote:
2 > On Tue, Jul 01, 2003 at 05:32:56PM +0100, Toby Dickenson wrote:
3 > > On Tuesday 01 July 2003 16:49, Josep Sanjuas wrote:
4 > > > I think there could be more advantages.
5 > >
6 > > they dont seem very compelling.....
7 >
8 > There is one compelling advantage that I believe was intended by the
9 > original poster. That is this: in the current situation, when I upgrade
10 > baselayout I get a new make.conf which I have to merge by hand. In my
11 > experience this is definitely the hardest file in /etc to merge because of
12 > its size and the amount of customization I've done to it. If it were split
13 > into separate files, it would be easier to see where the new stuff is.
14 > Also, I would be familiar with the particular sections that I'd made
15 > changes to, so I could simply copy the maintainers version of any files
16 > that I know I haven't changed.
17
18 I am proposing that we can get the same advantages by creating a better merge
19 tool. That is, a merge tool specifically designed for merging configuration
20 files. (but definitely not a ufed-style file-specific tool)
21
22 I spent some time last night merging make.conf... I think the problem is that
23 sdiff (the tool used by etc-update) is using the standard diff algorithm that
24 minimises diff size. This leads to it selecting chunks of differences that
25 often dont "look right" to the etc-update user. The chunks of differences are
26 very different to what you would get if you asked a human to isolate the
27 differences between the two files.
28
29 I think the merging task would be much easier with a tool that found more
30 useful chunks of differences. Perhaps something using Python's difflib
31 module? Any feedback gratefully accepted.
32
33 difflib can be found in cvs here. Check out the comment that starts
34 "SequenceMatcher is a flexible class for comparing...."
35 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Lib/difflib.py?rev=1
36
37
38
39
40 --
41 gentoo-dev@g.o mailing list