[augeas-devel] [PATCH] Ntp: enhance lens

Raphaël Pinson raphink at gmail.com
Tue Feb 17 08:39:43 UTC 2009


On Tue, Feb 17, 2009 at 12:11 AM, David Lutterkort <lutter at redhat.com>wrote:

> These enhancements are needed to make the Ntp.lns process the default
> /etc/ntp.conf on Fedora
> ---
>  lenses/ntp.aug            |   21 ++++++++++++++-------
>  lenses/tests/test_ntp.aug |   42
> ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 56 insertions(+), 7 deletions(-)
>
> diff --git a/lenses/ntp.aug b/lenses/ntp.aug
> index 1a46ac1..7383acc 100644
> --- a/lenses/ntp.aug
> +++ b/lenses/ntp.aug
> @@ -9,14 +9,15 @@ module Ntp =
>
>     (* Define useful shortcuts *)
>
> -    let eol = Util.del_str "\n"
> +    let eol = del /[ \t]*(#.*)?\n/ "\n"
>     let sep_spc = Util.del_ws_spc
>     let word = /[^,# \n\t]+/
>     let num  = /[0-9]+/
>
>
>     (* define comments and empty lines *)
> -    let comment = [ label "comment" . del /#[ \t]*/ "#" .  store /([^
> \t\n][^\n]*)?/ . eol ]
> +    let comment = [ label "comment" . del /#[ \t]*/ "#" .
> +                    store /([^ \t\n][^\n]*)?/ . del "\n" "\n" ]
>     let empty   = [ del /[ \t]*\n/ "\n" ]
>



How about using 'label "#comment"' to make it compliant to our new comment
field policy ?


Raphaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20090217/bd4a52db/attachment.htm>


More information about the augeas-devel mailing list