[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [augeas-devel] OS variations of lenses (was: Lens compatibility (ticket #295))



On 14/08/12 19:11, David Lutterkort wrote:
> One idea would be to maintain specific variations of lenses using a
> conditional:
> 
>         let lns = match shellvars_variant with
>            "split_exports" -> lens_with_export_splitting
>          | _               -> old_lens

Taking this in a new direction, an issue I've seen a bit recently is the
need for different operating systems to need different lenses or changes
to filters.

One problem that Steven Wills just pointed out was the lens for
/etc/sysctl.conf, which on FreeBSD follows a slightly different format
to the same file on Linux (no spaces around equals signs on BSD).  There
were a few others we hit during #255 but would mostly be solved with
more flexible filters.

Would it be sensible to use the same construct with some sort of basic
OS detection (uname for starters) to make Augeas lenses more portable?

> I am not entirely happy with the impact this will have on testing, since
> we'll have a lot more variations of lenses that need to be tested.

Clearly this would need solving too.

> BTW, I have a very old patch floating around that adds a match construct
> to the lens language.

-- 
Dominic Cleal
Red Hat Consulting
m: +44 (0)7817 878113


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]