<br><br><div class="gmail_quote">2009/3/20 David Lutterkort <span dir="ltr"><<a href="mailto:lutter@redhat.com">lutter@redhat.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Fri, 2009-03-20 at 17:29 +0100, Raphaël Pinson wrote:<br>
> I'm actually guessing that even something like<br>
><br>
> Def\<br>
> aults  env_k\<br>
> eep = "COLORS DISPLAY HOSTNAME"<br>
><br>
> might work with the official parser, while Augeas has absolutely no<br>
> way (at least as it is today) to understand that "Def\\\naults"<br>
> actually stands for a multiline "Defaults" entry.<br>
<br>
</div>The problem with processing this is that we also have to be able to<br>
write the file out exactly the way it was when we read it.<br>
<br>
So if we allowed both 'Defaults' and 'Def\\\naults' to result in a tree<br>
node with label 'Defaults' we'd have no way to know which of those<br>
possibilities to write out.<br>
<div class="im"><br>
>         Is this expected behaviour, or should I file a bug report?<br>
<br>
</div>Definitely file a bug for this.<br>
<div class="im"><br>
> As it is, it is the expected behaviour of the lens because I found no<br>
> workaround for this. You could file a bug, although there is<br>
> absolutely no garantee that I can fix this. In the best situation I<br>
> can think of, I could add "\" and "\n" as authorized characters within<br>
> value fields, so they would appear as such in the value.<br>
<br>
</div>Another option would be to store such multiline strings as one line per<br>
node, i.e. we can either do something like<br>
<br>
        { "Defaults"<br>
           { "env_keep" = "line1\\\nline2\\\n" } }<br>
<br>
or<br>
<br>
    { "Defaults"<br>
       { "env_keep"<br>
         { "line" = "line1" }<br>
         { "line" = "line2" } } } <br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Any preferences for one or the other ? </blockquote><div><br>I find the second one clearer to understand (this is kind of what I had proposed for logrotate, too), but I see a problem with it, which is that having a  "line" sublevel makes field heavier, when most of the time they'll only have one line.<br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">We could also special case<br>
env_keep and parse it into something like this (completely obscuring<br>
continuation lines):<br>
<br>
   { "Defaults"<br>
     { "env_keep"<br>
       { "var" = "COLORS" }<br>
       { "var" = "DISPLAY" }<br>
       { "var" = "HOSTNAME" }<br>
       ... } }</blockquote><div><br>Afaik, I gave up parsing the contents of Defaults because it was pretty complex. It could be worth giving it another try though.<br></div></div><br><br>Raphaël<br><br><br>