[augeas-devel] Enhanced inittab lens
David Lutterkort
lutter at redhat.com
Fri Jun 12 21:53:28 UTC 2009
Hi Matt,
On Fri, 2009-06-12 at 14:49 +1000, Matt Palmer wrote:
> The existing structure of the inittab lens:
wow .. inittab was the second lens I ever wrote, and hasn't really seen
any love since then.
> 1/
> 1/id = "sa"
> 1/runlevels = "12345"
> 1/process = "whatever"
>
> Seems a bit... perverse. The id is guaranteed to be unique, and is a
> fantastic way to key your records.
>
> The following patch makes the inittab lens do this. Unfortunately, the end
> result is not backwards compatible with the current implementation, because
> you can't have the same value in two places in the tree representation. I
> do believe, however, that this new tree structure is far more workable than
> the old version.
I am really hesitant to make that change, since it will break anything
that modifies inittab as it is right now - and the difference is roughly
get /files/etc/inittab/*[id = 'si']/process
vs
get /files/etc/inittab/si/process
and
ins si after /files/etc/inittab/*[id = 'id']
vs
ins si after /files/etc/inittab/id
Does that really seem worth the breakage of every existing user of the
inittab lens[1] ? Does anybody have any good idea on how we should
handle such incompatible schema changes ?
> Oh, I also fixed up the comment stuff so that it's more standardised, and
> actually puts the contents of comments in the tree. Much betterer.
Indeed, that part of the patch is nice + uncontroversial.
David
[1] Incidentally, there was a post on puppet-users today by somebody who
is using the inittab lens - he'd have to rework his puppet manifest
after the change.
More information about the augeas-devel
mailing list