On Tue, May 18, 2010 at 1:55 PM, Frederik Wagner <[email protected]> wrote:
> Hi David,
>
> On Sat, May 8, 2010 at 1:04 AM, David Lutterkort <[email protected]> wrote:
>> On Thu, 2010-05-06 at 16:35 +0200, Frederik Wagner wrote:
>>> @David: I included all your earlier suggestions about single values
>>> w/o quotes and single as well as double quoted lists.
>>
>> Yes, I am very happy that you got that to work.
>>
>>> There are still two issues, where somebody might help:
>>> 1. escaped characters are not handled (i.e. in a double quoted list
>>> backpace escaped whitespaces or double quotes are not possible). This
>>> does not work by simply including them in the "dqchar" regexp. Why?!
>>
>> You need to build a slightly more complicated regexp. For example,
>> Shellvars.dquot is
>>
>>        let dquot = /"([^"\\\n]|\\\\.)*"/
>>
>> In English: a double quoted string is a string that starts and ends with
>> '"', and contains any individual character except for '"' and '\n' or
>> any two-character sequence '\.' - might take a little to wrap your head
>> around ;)
>
> yes... hmm, but I'm not sure why in '\\\\.' 4 backslashes are needed
> for the the ecpade chars (it only works like this, but I don't get it
> clear). Can you give me a hint?
>
>>
>> For your lens, you'd have to change list to take the full regexp for the
>> word you're parsing, e.g. /([^"\\\n]|\\\\.)*/ instead of an individual
>> character; something like (warning: not tested)
>>
>>   let list(word:regexp) =
>>      let list_value = store word in
>>      ...
>
> Done.
> I included your patch and the extended the escaped char handling.
> Find attached the two patches on top of my original patch.

I forgot the tests/Makefile.am. Last Patch attached.

Bye,
Frederik

>
>>
>>> 2. When adding new values, the 'quote' key (defining the type of
>>> quotes used) has to be added _before_ any other value. I do not
>>> understand why the tree has to be sorted?
>>
>> The Augeas tree is orderd, i.e. the order in which nodes appear in a
>> tree matters - that's a consequence of the fact that the tree reflects a
>> file, which itself is ordered.
>
> o.k., so a user has to know some structure of the lens.
>
>> It would sometimes be nice, like in this case, to say "don't worry where
>> the 'quote' node appears, always act as if it were the first
>> node" (i.e., output the quote character before outputting any 'value'
>> nodes), but there's no way to do that in Augeas currently. Would be a
>> nice addition though[1] ;)
>
> yes it would, but for the moment I'm happy if I have this running so far :-)
>
> Hope the lens is o.k. now?!
>
> Thanks for the help and bye,
> Frederik
>
>>
>> David
>>
>> [1] Boomerang (http://www.seas.upenn.edu/~harmony/) has functionality to
>> sort etc.
>>
>>
>>
>
From bf3eefbd0259df0b43a7c216219b54ffdf9aa3a1 Mon Sep 17 00:00:00 2001
From: Frederik Wagner <[email protected]>
Date: Tue, 18 May 2010 14:53:07 +0200
Subject: [PATCH 4/4] Shellvars_list: added lens to tests/Makefile.am

---
 tests/Makefile.am |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 371fe0a..1e20743 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -66,6 +66,7 @@ lens_tests =			\
   lens-securetty.sh     \
   lens-services.sh		\
   lens-shellvars.sh		\
+  lens-shellvars_list.sh	\
   lens-slapd.sh			\
   lens-soma.sh			\
   lens-spacevars.sh		\
-- 
1.7.0

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to