[augeas-devel] Help regarding union.put overlap with INI-like format

Pino Toscano ptoscano at redhat.com
Tue Nov 27 14:46:40 UTC 2018


On Tuesday, 27 November 2018 14:25:24 CET Mol, Xavier (SCC) wrote:
> > The lens (attached) seems to work fine, [...]
> I don't think you attached the right file. Simplevars.aug is shipped with Augeas and your attachment looks identical to that. 
> Semanage.aug, which caused the compilation error, is not attached, right?

Oops sorry, you are right.

Attached now there is my Semanage lens.

-- 
Pino Toscano
-------------- next part --------------
(*
Module: Semanage
   Parses /etc/selinux/semanage.conf

Author:
   Pino Toscano <ptoscano at redhat.com>

About: License
   This file is licenced under the LGPL v2+, like the rest of Augeas.

About: Lens Usage
   To be documented

About: Configuration files
   This lens applies to /etc/selinux/semanage.conf. See <filter>.

About: Examples
   The <Test_Semanage> file contains various examples and tests.
*)

module Semanage =
  autoload xfm

let comment = IniFile.comment "#" "#"
let sep = IniFile.sep "=" "="
let empty = Util.empty
let eol = IniFile.eol

let entry_re = /[A-Za-z0-9_.-][A-Za-z0-9 _.-]*[A-Za-z0-9_.-]/
let entry = IniFile.entry entry_re sep comment
          | empty

let title = IniFile.title (IniFile.record_re - /^end$/)
let record = [ title . entry+ . Util.del_str "[end]" . eol ]

let lns = (entry | record)*

(* Variable: filter *)
let filter = incl "/etc/selinux/semanage.conf"

let xfm = transform lns filter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20181127/a78a9e77/attachment.sig>


More information about the augeas-devel mailing list