[augeas-devel] augeas: master - Shellvars: allow spaces after/before opening/closing parens for array

David Lutterkort lutter at fedoraproject.org
Tue Feb 2 21:07:47 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=e5b36fcd2f8a54e68b607127de0b3e9716541ef2
Commit:        e5b36fcd2f8a54e68b607127de0b3e9716541ef2
Parent:        329abd899d64982a1ca280969a98a0f84247d0aa
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Tue Feb 2 13:03:37 2010 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Tue Feb 2 13:03:37 2010 -0800

Shellvars: allow spaces after/before opening/closing parens for array

Bug reported by Doug Warner
---
 lenses/shellvars.aug            |    4 ++--
 lenses/tests/test_shellvars.aug |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug
index b407bac..59f4709 100644
--- a/lenses/shellvars.aug
+++ b/lenses/shellvars.aug
@@ -20,10 +20,10 @@ module Shellvars =
   (* treated as a simple value                                           *)
   let array =
     let array_value = store (char+ | dquot) in
-    del "(" "(" . counter "values" .
+    del /\([ \t]*/ "(" . counter "values" .
       [ seq "values" . array_value ] .
       [ del /[ \t\n]+/ " " . seq "values" . array_value ] *
-      . del ")" ")"
+      . del /[ \t]*\)/ ")"
 
   (* Treat an empty list () as a value '()'; that's not quite correct *)
   (* but fairly close.                                                *)
diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug
index 94fb747..584fac6 100644
--- a/lenses/tests/test_shellvars.aug
+++ b/lenses/tests/test_shellvars.aug
@@ -106,6 +106,10 @@ unset ONBOOT
     { "2" = "v2" }
     { "3" = "v3" } }
 
+  (* Allow spaces after/before opening/closing parens for array *)
+  test Shellvars.lns get "config_eth1=( \"10.128.0.48/24\" )\n" =
+  { "config_eth1"  { "1" = "\"10.128.0.48/24\"" } }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)




More information about the augeas-devel mailing list