[augeas-devel] [Interfaces] Draft lense
Free Ekanayaka
free at 64studio.com
Wed Aug 20 17:11:58 UTC 2008
Hi Raphaël,
|--==> Raphaël Pinson writes:
RP> Same, my last email should answer this.
RP> By the way, can we have trailing comments in interfaces, like
RP> address 192.168.1.1 # what a cool IP
RP> If this is the case, you'd have to support it also. I've settled down to map
RP> this in entries as (comment|eol) instead of eol to end up an entry.
Thanks for the tip, I'll check it out.
RP> 3) Lines splitted with the backslash character create problems, for
>>example:
>>
>>iface lo inet \
>>loopback
>>
>>I've tried to replace:
>>
>>let spc = Util.del_ws_spc
>>
>>with
>>
>>let spc = del /([ \t]+|[ \t]*\\\n[ \t]*)/ " "
>>
RP> You're missing some \. It should read
RP> let spc = del /([ \t]+|[ \t]*\\\\\n[ \t]*)/ " "
RP> Yes, that's a lot of backslashes!
Oh you're right! I had removed two backslashes because it did not work
at first, but trying again now it seems all fine. Maybe that's because
I was using the 0.3.0 release, while I compiled the hg head now.
RP> By the way, it is (imo) a good practice to make your test file as ugly as
RP> possible (!). Ideally, you'd want your lens to support not only the nice
RP> examples in the manpage, but virtually anything users could write that the
RP> official parser could read, so I find that writing horrible (see
RP> test_sudoers.aug) test files helps making sure that your lens will parse
RP> them.
Completely true, I'll definitely make it uglier as I move on solving
issues. I was just starting to play with simple cases to experiment
with lenses.
Ciao!
Free
More information about the augeas-devel
mailing list