[augeas-devel] [PATCH] Mdadm_conf: new lens for /etc/mdadm.conf

David Lutterkort lutter at redhat.com
Mon Nov 14 03:52:18 UTC 2011


On Mon, 2011-11-07 at 16:53 +0000, Matthew Booth wrote:
> ---
>  lenses/mdadm_conf.aug            |  281 ++++++++++++++++++++++++++++++++++++++
>  lenses/tests/test_mdadm_conf.aug |   96 +++++++++++++
>  2 files changed, 377 insertions(+), 0 deletions(-)
>  create mode 100644 lenses/mdadm_conf.aug
>  create mode 100644 lenses/tests/test_mdadm_conf.aug

ACK. I was going to get all grouchy about this:


> +let dev_containers_re = /[cC][oO][nN][tT][aA][iI][nN][eE][rR][sS]/
> +let dev_partitions_re = /[pP][aA][rR][tT][iI][tT][iI][oO][nN][sS]/

since there is now syntax for case-insensitive regexps, i.e. you can
write

        let dev_containers_re = /containers/i
        let dev_partitions_re = /partitions/i
        
but then realized that a bug in the code that handles case-insensitive
regexps causes the regular expression in 

> +let dev_device = [ label "name". store ( value
> +                                         - dev_containers_re
> +                                         - dev_partitions_re ) ]

to be incorrect (it matches 'containerS' and 'partitionS') which makes
the lens fail typechecking.

I committed the lens as-is. When I fix the bug described above, I'll fix
up the lens to use the more readable regexp syntax.

David





More information about the augeas-devel mailing list