Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first non-working version

  • Loading branch information...
commit 2083382ef694e05a1416943eb3f3465f4bd89a39 0 parents
@domenkozar authored
Showing with 48 additions and 0 deletions.
  1. +48 −0 bacula.aug
48 bacula.aug
@@ -0,0 +1,48 @@
+(*
+Module: Bacula
+ Parses: /etc/bacula/*.conf
+
+Author: Domen Kožar <domen@dev.si>
+
+About: Reference
+ This lens tries to be ...
+
+About: License
+ This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+ See <lns>.
+
+About: Configuration files
+ This lens applies to /etc/bacula/*.conf.
+
+About: Examples
+ The <test_bacula.aug> file contains various examples and tests.
+*)
+
+
+module Bacula =
+ autoload xfm
+
+ let val = del /"?/ "\"" . store /[a-zA-Z0-9]/ . del /"?;?/ "\""
+
+ (* TODO: support whitespace in key name *)
+ let line = [ Util.del_ws_tab . key /[a-zA-Z0-9]+/ . del /[ \t]*=[ \t*]/ " = " . val . Util.comment_or_eol ]
+
+ (* TODO: support file includes *)
+ let content = del /[ \t]*\{/ " {" . Util.comment_or_eol . line . del /[ \t]*\}/ "}"
+
+ (* TODO: support nested directives *)
+ let directive = [ key /[a-zA-Z]+/ . content ]
+
+ let lns = (directive|Util.empty|Util.comment)*
+
+ let filter = incl "/etc/bacula/*.conf"
+ . Util.stdexcl
+
+ let xfm = transform lns filter
+
+ test Bacula.lns get "Storage {\n Name = kaki-sd\n}" =
+ {"Storage"
+ {"Name" = "kaki-sd"}
+ }
Please sign in to comment.
Something went wrong with that request. Please try again.