[augeas-devel] [PATCH 1/4] Deal with continuation lines in httpd.aug
Bill Pemberton
wfp5p at virginia.edu
Fri Mar 25 12:52:42 UTC 2011
Apache allows config lines to be continued with a backslash, but the
lens couldn't deal with it. Change the value sep_spc to deal with
continuation lines as found in interfaces.aug
Enable the test for continuation lines in test_httpd.aug
---
lenses/httpd.aug | 5 ++++-
lenses/tests/test_httpd.aug | 10 ++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/lenses/httpd.aug b/lenses/httpd.aug
index 79e2312..8fbd4a3 100644
--- a/lenses/httpd.aug
+++ b/lenses/httpd.aug
@@ -43,7 +43,10 @@ autoload xfm
* Utilities lens
*****************************************************************)
let dels (s:string) = del s s
-let sep_spc = Sep.space
+
+(* deal with continuation lines *)
+let sep_spc = del /([ \t]+|[ \t]*\\\\\n[ \t]*)/ " "
+
let sep_osp = Sep.opt_space
let sep_eq = del /[ \t]*=[ \t]*/ "="
diff --git a/lenses/tests/test_httpd.aug b/lenses/tests/test_httpd.aug
index 54c462f..af6cdc1 100644
--- a/lenses/tests/test_httpd.aug
+++ b/lenses/tests/test_httpd.aug
@@ -174,15 +174,17 @@ test Httpd.directive get c8 =
* that the directive continues onto the next line. There must be no other
* characters or white space between the backslash and the end of the line.
*)
-test Httpd.directive get "Options Indexes \
-FollowSymLinks MultiViews\n" = *
-(*
+let multiline = "Options Indexes \
+FollowSymLinks MultiViews
+"
+
+test Httpd.directive get multiline =
{ "directive" = "Options"
{ "arg" = "Indexes" }
{ "arg" = "FollowSymLinks" }
{ "arg" = "MultiViews" }
}
-*)
+
let conf2 = "<VirtualHost *:80>
ServerAdmin webmaster at localhost
--
1.7.4
More information about the augeas-devel
mailing list