[augeas-devel] Augeas Merging Configuration

Dominique Dumont domi at komarr.gre.hp.com
Tue May 10 15:22:19 UTC 2011


On Tuesday 10 May 2011 02:13:57 David Lutterkort wrote:
> After you install foo-1.0, you have in /etc/foo.conf; call that version
> of the file v1:
>         X=x1
>         Y=y1
>         
> The user then goes and edits the file; call the version v2:
>         X=x2
>         Y=y1
> 
> The update to foo-2.0 contains this /etc/foo.conf; call that version v3:
>         X=x1
>         Y=y2
> 
> All you have on an ordinary system is v2 and v3; since you don't know
> that X was changed by the user, and Y is still the value from v1, both
> changes in v3 look equally important; your only logical choices what to
> do with /etc/foo.conf therefore are to either leave v2 alone or replace
> it with v3 in its entirety.
> 
> If you knew about v1 and that the user produced v2, your update to
> foo-2.0 would most likely produce
> 
>         X=x2
>         Y=y2
> 
> which is probably closest to what the user would see as reasonable.

In this case, you assume that whichever statement is more recent is best for 
end user. This makes sense when merging code, but not necessarily then merging 
configuration data.

In the example above, keeping 'X=x2' makes sense because it reprensents a user 
customisation.

It's very hard to decide in the case of Y without knowing more about the 
semantic of Y:
- why was Y's default changed from foo-1.0 to foo-2.0?
- is Y=y1 legal for foo-2.0?

All the best

Dominique
--
http://config-model.wiki.sourceforge.net/ -o- http://search.cpan.org/~ddumont/
http://www.ohloh.net/accounts/ddumont     -o- http://ddumont.wordpress.com/




More information about the augeas-devel mailing list