[augeas-devel] [PATCH] Support empty comments, like lines beginning with "; " or "#" but without any more text

Raphaël Pinson raphink at gmail.com
Wed Aug 27 10:48:08 UTC 2008


On Wed, Aug 27, 2008 at 12:18 PM, Free Ekanayaka <free at 64studio.com> wrote:

> # HG changeset patch
> # User Free Ekanayaka <free at 64studio.com>
> # Date 1219832278 -7200
> # Node ID 634a7dc64d3727a303584362341842ba28a5a340
> # Parent  33bcfcf2ae045c3f18c8d9eeddaed96746810ecd
> Support empty comments, like lines beginning with ";" or "#" but without
> any more text
>
> diff -r 33bcfcf2ae04 -r 634a7dc64d37 lenses/inifile.aug
> --- a/lenses/inifile.aug        Wed Aug 27 11:56:10 2008 +0200
> +++ b/lenses/inifile.aug        Wed Aug 27 12:17:58 2008 +0200
> @@ -32,7 +32,7 @@ let sto_to_comment     = Util.del_opt_ws
>  (* Define comment and defaults *)
>  let comment (pat:regexp) (default:string)
>                        = [ label "#comment" . sep pat default
> -                        . sto_to_eol . eol ]
> +                        . sto_to_eol? . eol ]
>  let comment_re         = /[;#]/
>  let comment_default    = ";"
>


Now that's where I was left experimenting last week, and was down to that
same state. But then, I did something like this (which I cannot do right now
because I've played so much that my inifile.aug is broken on this machine
;)).

* fire up augtool
* print an INI File with empty comments in it ('# \n' for example)
* change a value in this INI File (whatever value, really)
* save

When I tried this, augeas refused to save (since version 0.3.0, it worked
before), saying that NULL is not a proper value for the "#comment" node.
I've since tried with other stuff, like empty values in dput.aug (e.g.
'pre_upload_command =', which is fine) and get the same result.

Could you try it on your side Free?


Cheers


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


More information about the augeas-devel mailing list