[augeas-devel] Re: [Interfaces] Draft lense

Raphaël Pinson raphink at gmail.com
Fri Aug 22 13:25:54 UTC 2008


On Fri, Aug 22, 2008 at 3:18 PM, Free Ekanayaka <free at 64studio.com> wrote:

> Hi "Raphaël,
>
> |--==> On Fri, 22 Aug 2008 14:45:23 +0200, "Raphaël Pinson" <
> raphink at gmail.com> said:
>
>  RP> On Fri, Aug 22, 2008 at 2:30 PM, Free Ekanayaka <free at 64studio.com>
> wrote:
>  >>I works, you're a wizard! The lense is now acceptable, I'm sure there
>  >>are some corner cases which are not yet covered, but it should be fine
>  >>for most real-life cases.
>
>   RP> Great, this lens is a very useful one for sure (at least for
> Debian/Ubuntu
>  RP> users ;)). Nicolas will be happy of it!
>
> :)
>
>  >>Definitely. I was thinking to the possibility of nesting nodes of
>  >>trailing comments inside a values/options nodes, so that:
>  >>
>  >>auto eth0 # Whatever
>  >>
>  >>would generate:
>  >>
>  >>{ "auto"
>  >>{ "1" = "eth0
>  >>{ "#comment" = "Whatever } } }
>  >>
>  >>while:
>  >>
>  >>auto eth0
>  >># Whatever
>  >>
>  >>would lead to:
>  >>
>  >>{ "auto"
>  >>{ "1" = "eth0 } }
>  >>{ "#comment" = "Whatever }
>  >>
>  >>I have the feeling that it would simplifiy things, but I'm not
>  >>sure.
>
>   RP> I don't think it's a good idea, because you can have several iface
> arguments
>  RP> after auto. How will you map
>
>  RP> auto lo eth0 # loopback & eth card
>
>  RP> Imo, this comment is about both "lo" and "eth0" so it would be
>
>  RP> { "auto"
>  RP>    { "1" = "lo" }
>  RP>    { "2" = "eth0" }
>  RP>    { "#comment" = "loopback & eth card" } }
>
>  RP> and it wouldn't really make sense to have
>
>  RP> { "auto"
>  RP>    { "1" = "lo" }
>  RP>    { "2" = "eth0"
>  RP>       { "#comment" = "loopback & eth card" } } }
>
> That's true. I was asking myself if that could make the lense code
> simpler.
>
>  RP> Could you send a patch (using hg email) to the list with
> interfaces.aug and
>  RP> test_interfaces.aug ? I'm sure David will be happy to apply it to the
> repo
>  RP> once he gets back :)
>
> Yes, sure I will comment it a bit more and make a uglier test case,
> then post the final version in the next days. Thanks you again for
> your assistance.



While you're refining the lens, you could improve a few little details, too:
 * Limit lines to 80 (75 if possible) characters
 * Try to align signs for readability ( align = with | and [ with . )
 * Make comment boxes for big sections (see sudoers.aug)

The style guidelines are not really set, but these are just general
standards we try to apply so far.


With all the changes that have been made, it would also be good to to put
tests. If not in the test_interfaces.aug, you can use a fakeroot for that:

mkdir fakeroot/etc/network/
cp /etc/network/interfaces fakeroot/etc/network/
augtool -I . -r fakeroot
# do all your tests here, try to insert, set, move, and so on and save


Ciao


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


More information about the augeas-devel mailing list