{"commit":"c8ace2978114bd643ef3b2e827709f756617dada","subject":"postfix_transport.aug also applies to virtual (5)","message":"postfix_transport.aug also applies to virtual (5)\n","repos":"ptoscano\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,jjlin\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,kunkku\/augeas,jjlin\/augeas,kumy\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,manandbytes\/augeas,pevalme\/augeas,jtopjian\/augeas,raphink\/augeas,mlichvar\/augeas,kumy\/augeas,lutter\/augeas,domcleal\/augeas,mchf\/augeas,kumy\/augeas,dafugg\/augeas,pevalme\/augeas,kumy\/augeas,ptoscano\/augeas,jtopjian\/augeas,jasperla\/augeas,dafugg\/augeas,mlichvar\/augeas,jasperla\/augeas,kunkku\/augeas,mlichvar\/augeas,domcleal\/augeas,pevalme\/augeas,raphink\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,kunkku\/augeas,lutter\/augeas","old_file":"lenses\/postfix_transport.aug","new_file":"lenses\/postfix_transport.aug","new_contents":"(*\nModule: Postfix_Transport\n Parses \/etc\/postfix\/transport\n\nAuthor: Raphael Pinson \n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 transport` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/postfix\/transport. See .\n\nAbout: Examples\n The file contains various examples and tests.\n*)\n\nmodule Postfix_Transport =\n\nautoload xfm\n\n(* View: space_or_eol *)\nlet space_or_eol = del \/([ \\t]*\\n)?[ \\t]+\/ \" \"\n\n(* View: colon *)\nlet colon = Sep.colon\n\n(* View: transport *)\nlet transport = [ label \"transport\" . (store Rx.word)? ]\n\n(* View: nexthop *)\nlet nexthop = [ label \"nexthop\" . (store Rx.space_in)? ]\n\n(* View: record *)\nlet record = [ label \"pattern\" . store \/[A-Za-z0-9@\\*.-]+\/\n . space_or_eol . transport\n . colon . nexthop\n . Util.eol ]\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | record)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/postfix\/transport\"\n . incl \"\/etc\/postfix\/virtual\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Postfix_Transport\n Parses \/etc\/postfix\/transport\n\nAuthor: Raphael Pinson \n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 transport` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/postfix\/transport. See .\n\nAbout: Examples\n The file contains various examples and tests.\n*)\n\nmodule Postfix_Transport =\n\nautoload xfm\n\n(* View: space_or_eol *)\nlet space_or_eol = del \/([ \\t]*\\n)?[ \\t]+\/ \" \"\n\n(* View: colon *)\nlet colon = Sep.colon\n\n(* View: transport *)\nlet transport = [ label \"transport\" . (store Rx.word)? ]\n\n(* View: nexthop *)\nlet nexthop = [ label \"nexthop\" . (store Rx.space_in)? ]\n\n(* View: record *)\nlet record = [ label \"pattern\" . store \/[A-Za-z0-9@\\*.-]+\/\n . space_or_eol . transport\n . colon . nexthop\n . Util.eol ]\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | record)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/postfix\/transport\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"acb6181298f9a23c643c82a8d6f282e595ba91a1","subject":"Allow Creation of Hostname When File is Missing","message":"Allow Creation of Hostname When File is Missing\n\nWithin augtool, the current `hostname` lens does not allow you to create a hostname entry under the following circumstances:\r\n* \/etc\/hostname file is empty\r\n* \/etc\/hostname file does not exist\r\n\r\n:: \/etc\/hostname file is empty\r\n\r\nThere is no augtool command(s) that will allow you to add a hostname entry to an existing, but empty, file. Example:\r\n```\r\n$ sudo rm \/etc\/hostname\r\n$ sudo touch \/etc\/hostname\r\n$ sudo augtool\r\n\r\naugtool> set \/files\/etc\/hostname\/hostname myhostname\r\naugtool> save\r\nerror: Failed to execute command\r\nsaving failed (run 'errors' for details)\r\n\r\naugtool> errors\r\n\r\nError in \/etc\/hostname:1.0 (parse_skel_failed)\r\n Input string does not match at all\r\n Lens: \/usr\/share\/augeas\/lenses\/dist\/hostname.aug:16.10-.57:\r\n```\r\n\r\nAdditionally, you cannot remove the empty file using augtool:\r\n```\r\n$ sudo rm \/etc\/hostname\r\n$ sudo touch \/etc\/hostname\r\n$ sudo augtool rm \/files\/etc\/hostname\r\n$ ls -l \/etc\/hostname\r\n-rw-r--r-- 1 root root 0 Feb 19 12:39 \/etc\/hostname\r\n```\r\n\r\n:: \/etc\/hostname does not exist\r\n\r\nSimilar to the empty file case, you cannot create a hostname entry if the file does not already exist.\r\n\r\nYou can, however, create an empty file:\r\n```\r\n$ sudo rm \/etc\/hostname\r\n# You can create an empty file with clear or touch\r\n$ sudo augtool touch \/files\/etc\/hostname\r\n$ ls -l \/etc\/hostname\r\n-rw-r--r-- 1 root root 0 Feb 19 12:34 \/etc\/hostname\r\n```\r\n\r\nOf course, now that you have an empty file, you cannot create a hostname entry for it :( \r\n\r\nThis proposed change will allow you to at least create a hostname entry when the file does not already exist.\r\n\r\nIt also enables you to remove file, allowing for a deterministic approach:\r\n```\r\n$ sudo rm \/etc\/hostname\r\n$ sudo touch \/etc\/hostname\r\n$ sudo augtool rm \/files\/etc\/hostname\r\n$ ls -l \/etc\/hostname\r\nls: cannot access '\/etc\/hostname': No such file or directory\r\n$ sudo augtool set \/files\/etc\/hostname\/hostname myhostname\r\n$ ls -l \/etc\/hostname\r\n-rw-r--r-- 1 root root 11 Feb 19 12:44 \/etc\/hostname\r\n$ cat \/etc\/hostname\r\nmyhostname\r\n```\r\n\r\nNOTE: Its probably very possible to fix the lens to deal more of the edge cases, but this quick fix at least gives deterministic behavior if a rm\/set each time I want to configure the hostname.\r\n\r\nThank you for your consideration.\r\n\r\n-David Farrell","repos":"mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas","old_file":"lenses\/hostname.aug","new_file":"lenses\/hostname.aug","new_contents":"(*\nModule: Hostname\n Parses \/etc\/hostname and \/etc\/mailname\n\nAuthor: Raphael Pinson \n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n*)\n\n\nmodule Hostname =\nautoload xfm\n\n(* View: lns *)\nlet lns = [ label \"hostname\" . store Rx.word . Util.eol ] | Util.empty\n\n(* View: filter *)\nlet filter = incl \"\/etc\/hostname\"\n . incl \"\/etc\/mailname\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Hostname\n Parses \/etc\/hostname and \/etc\/mailname\n\nAuthor: Raphael Pinson \n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n*)\n\n\nmodule Hostname =\nautoload xfm\n\n(* View: lns *)\nlet lns = [ label \"hostname\" . store Rx.word . Util.eol ]\n\n(* View: filter *)\nlet filter = incl \"\/etc\/hostname\"\n . incl \"\/etc\/mailname\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"402635ac784591b4c6adb879d71520daf8a4d247","subject":"Add FreeBSD path for rc.conf.d","message":"Add FreeBSD path for rc.conf.d\n","repos":"ptoscano\/augeas,kunkku\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,mlichvar\/augeas,lutter\/augeas,kunkku\/augeas,mlichvar\/augeas,pevalme\/augeas,pevalme\/augeas,hercules-team\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,lutter\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lbu\/lbu.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.d\/*\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lbu\/lbu.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d454d7dceb2613b861db6d2a8724bf47360466f7","subject":"Reflect Ubuntu 16.04 location of php.ini (#399)","message":"Reflect Ubuntu 16.04 location of php.ini (#399)\n\nphp.ini has moved with upgrade from PHP5 to PHP7 (included in Ubuntu 16.04).","repos":"lutter\/augeas,kunkku\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,pevalme\/augeas,kunkku\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,mchf\/augeas,kunkku\/augeas,mchf\/augeas,mlichvar\/augeas,manandbytes\/augeas,pevalme\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry =\n let word = IniFile.entry_re\n in let entry_re = word . ( \"[\" . word . \"]\" )? \n in IniFile.indented_entry entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php\/*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n (* PHPFPM Support *)\n . (incl \"\/etc\/php*\/fpm\/pool.d\/*.conf\")\n (* Zend Community edition *)\n . (incl \"\/usr\/local\/zend\/etc\/php.ini\")\n . (incl \"\/usr\/local\/zend\/etc\/conf.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry =\n let word = IniFile.entry_re\n in let entry_re = word . ( \"[\" . word . \"]\" )? \n in IniFile.indented_entry entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n (* PHPFPM Support *)\n . (incl \"\/etc\/php*\/fpm\/pool.d\/*.conf\")\n (* Zend Community edition *)\n . (incl \"\/usr\/local\/zend\/etc\/php.ini\")\n . (incl \"\/usr\/local\/zend\/etc\/conf.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"02a420d6967a95de1aaf2cfd896d2bc846ca90f5","subject":"Rx: remove \\b and \\d escapes","message":"Rx: remove \\b and \\d escapes\n","repos":"raphink\/augeas,hercules-team\/augeas,jjlin\/augeas,jtopjian\/augeas,pevalme\/augeas,hercules-team\/augeas,pevalme\/augeas,kunkku\/augeas,dafugg\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,camptocamp\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,domcleal\/augeas,kumy\/augeas,manandbytes\/augeas,ptoscano\/augeas,kunkku\/augeas,camptocamp\/augeas,jasperla\/augeas,dafugg\/augeas,kumy\/augeas,mlichvar\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,bkearney\/augeas,mchf\/augeas,domcleal\/augeas,kumy\/augeas,domcleal\/augeas,jasperla\/augeas,camptocamp\/augeas,lutter\/augeas,bkearney\/augeas,ptoscano\/augeas,raphink\/augeas,jjlin\/augeas,camptocamp\/augeas,bkearney\/augeas,pevalme\/augeas,bkearney\/augeas,manandbytes\/augeas,lutter\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,kumy\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,jjlin\/augeas,mlichvar\/augeas,MikaelSmith\/augeas","old_file":"lenses\/rx.aug","new_file":"lenses\/rx.aug","new_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson \n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Spaces *)\nlet space = \/[ \\t]+\/\nlet opt_space = \/[ \\t]*\/\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\nlet no_spaces = \/[^ \\t\\n]+\/\n\n(* Generic fields *)\nlet word = \/[A-Za-z0-9_.-]+\/\nlet integer = \/[0-9]+\/\nlet decimal = \/[0-9]+[.,][0-9]+\/\n\n(* All but... *)\n(* Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n\n(*\n * IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\nlet ipv4 =\n let dot = \".\" in\n let digits = \/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/ in\n digits . dot . digits . dot . digits . dot . digits\n\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\nlet ip = ipv4 | ipv6\n","old_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson \n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Spaces *)\nlet space = \/[ \\t]+\/\nlet opt_space = \/[ \\t]*\/\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\nlet no_spaces = \/[^ \\t\\n]+\/\n\n(* Generic fields *)\nlet word = \/[A-Za-z0-9_.-]+\/\nlet integer = \/[0-9]+\/\nlet decimal = \/[0-9]+[.,][0-9]+\/\n\n(* All but... *)\n(* Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n\n(*\n * IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\nlet ipv4 =\n let dot = \".\" in\n let digits = \/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/ in\n digits . dot . digits . dot . digits . dot . digits\n\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}\/\n . \/(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}\/\n . \/(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}\/\n . \/(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\nlet ip = ipv4 | ipv6\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3a5cb7727d47ab90791350789bf954e34af371fb","subject":"Remove leading whitespace inside Match directives","message":"Remove leading whitespace inside Match directives\n","repos":"manandbytes\/augeas,jjlin\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,lutter\/augeas,jtopjian\/augeas,mlichvar\/augeas,camptocamp\/augeas,pevalme\/augeas,bkearney\/augeas,kunkku\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,kumy\/augeas,kumy\/augeas,MikaelSmith\/augeas,dafugg\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,kumy\/augeas,mlichvar\/augeas,raphink\/augeas,lutter\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,ptoscano\/augeas,jjlin\/augeas,dafugg\/augeas,jtopjian\/augeas,domcleal\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,bkearney\/augeas,kumy\/augeas,mchf\/augeas,raphink\/augeas,pevalme\/augeas,kunkku\/augeas,jasperla\/augeas,bkearney\/augeas,mchf\/augeas,jjlin\/augeas,jasperla\/augeas,hercules-team\/augeas,bkearney\/augeas,mlichvar\/augeas,camptocamp\/augeas,manandbytes\/augeas","old_file":"spec\/sshd.aug","new_file":"spec\/sshd.aug","new_contents":"# \/etc\/sshd\/sshd_config\n\nmap\n grammar sshd\n include '\/etc\/ssh\/sshd_config' '\/system\/config\/sshd'\nend\n\ngrammar sshd\n token EOL \/[ \\t]*\\n\/ = '\\n'\n token SEP \/[ \\t]+(?!\\n)\/ = ' '\n token COMMENT \/(#.*|[ \\t]*)\\n\/ = '\\n'\n\n start: (comment | accept_env | allow_groups | allow_users \n | deny_groups | macs | match | other_entry ) *\n\n comment: [ COMMENT ]\n\n other_entry: [ key ... . SEP . store ... . EOL ]\n\n accept_env: [ key 'AcceptEnv' .\n ([ SEP . seq 'accept_env' . store ...])* .\n EOL]\n\n allow_groups: [ key 'AllowGroups' .\n ([ SEP . seq 'allow_groups' . store ...])* .\n EOL]\n \n allow_users: [ key 'AllowUsers' .\n ([ SEP . seq 'allow_users' . store ...])* .\n EOL]\n \n deny_groups: [ key 'DenyGroups' .\n ([ SEP . seq 'deny_groups' . store ...])* .\n EOL]\n \n deny_users: [ key 'DenyUsers' .\n ([ SEP . seq 'deny_users' . store ...])* .\n EOL]\n\n macs: [ key 'MACs' . SEP .\n [ seq 'macs' . store ... ] .\n ([ seq 'macs' . ',' . store ...])* .\n EOL ]\n\n match: [ key 'Match' .\n [ seq 'match' .\n [ label 'cond' . store ... . EOL ] .\n (SEP . other_entry) * ] ]\n\nend\n","old_contents":"# \/etc\/sshd\/sshd_config\n\nmap\n grammar sshd\n include '\/etc\/ssh\/sshd_config' '\/system\/config\/sshd'\nend\n\ngrammar sshd\n token EOL \/[ \\t]*\\n\/ = '\\n'\n token SEP \/[ \\t]+(?!\\n)\/ = ' '\n token COMMENT \/(#.*|[ \\t]*)\\n\/ = '\\n'\n\n start: (comment | accept_env | allow_groups | allow_users \n | deny_groups | macs | match | other_entry ) *\n\n comment: [ COMMENT ]\n\n other_entry: [ key ... . SEP . store ... . EOL ]\n\n accept_env: [ key 'AcceptEnv' .\n ([ SEP . seq 'accept_env' . store ...])* .\n EOL]\n\n allow_groups: [ key 'AllowGroups' .\n ([ SEP . seq 'allow_groups' . store ...])* .\n EOL]\n \n allow_users: [ key 'AllowUsers' .\n ([ SEP . seq 'allow_users' . store ...])* .\n EOL]\n \n deny_groups: [ key 'DenyGroups' .\n ([ SEP . seq 'deny_groups' . store ...])* .\n EOL]\n \n deny_users: [ key 'DenyUsers' .\n ([ SEP . seq 'deny_users' . store ...])* .\n EOL]\n\n macs: [ key 'MACs' . SEP .\n [ seq 'macs' . store ... ] .\n ([ seq 'macs' . ',' . store ...])* .\n EOL ]\n\n match: [ key 'Match' .\n [ seq 'match' .\n [ label 'cond' . store ... . EOL ] .\n (other_entry) * ] ]\n\nend","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"96b3580120b447e22803442c314c1a44e1aed0cd","subject":"Slapd: Add unit test for by\/control","message":"Slapd: Add unit test for by\/control\n","repos":"jasperla\/augeas,jasperla\/augeas,pevalme\/augeas,mlichvar\/augeas,mlichvar\/augeas,raphink\/augeas,lutter\/augeas,pevalme\/augeas,manandbytes\/augeas,kunkku\/augeas,manandbytes\/augeas,ptoscano\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,raphink\/augeas,dafugg\/augeas,jjlin\/augeas,kunkku\/augeas,jtopjian\/augeas,hercules-team\/augeas,lutter\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,lutter\/augeas,kunkku\/augeas,mchf\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,ptoscano\/augeas,jtopjian\/augeas,jjlin\/augeas,pevalme\/augeas,dafugg\/augeas,mchf\/augeas,mlichvar\/augeas,jjlin\/augeas","old_file":"lenses\/tests\/test_slapd.aug","new_file":"lenses\/tests\/test_slapd.aug","new_contents":"module Test_slapd =\n\nlet conf = \"# This is the main slapd configuration file. See slapd.conf(5) for more\n# info on the configuration options.\n\n#######################################################################\n# Global Directives:\n\n# Features to permit\n#allow bind_v2\n\n# Schema and objectClass definitions\ninclude \/etc\/ldap\/schema\/core.schema\n\n#######################################################################\n# Specific Directives for database #1, of type hdb:\n# Database specific directives apply to this databasse until another\n# 'database' directive occurs\ndatabase hdb\n\n# The base of your directory in database #1\nsuffix \\\"dc=nodomain\\\"\n\naccess to attrs=userPassword,shadowLastChange\n by dn=\\\"cn=admin,dc=nodomain\\\" write\n by anonymous auth\n by self write\n by * none\n\"\n\ntest Slapd.lns get conf =\n { \"#comment\" = \"This is the main slapd configuration file. See slapd.conf(5) for more\" }\n { \"#comment\" = \"info on the configuration options.\" }\n {}\n { \"#comment\" = \"######################################################################\" }\n { \"#comment\" = \"Global Directives:\"}\n {}\n { \"#comment\" = \"Features to permit\" }\n { \"#comment\" = \"allow bind_v2\" }\n {}\n { \"#comment\" = \"Schema and objectClass definitions\" }\n { \"include\" = \"\/etc\/ldap\/schema\/core.schema\" }\n {}\n { \"#comment\" = \"######################################################################\" }\n { \"#comment\" = \"Specific Directives for database #1, of type hdb:\" }\n { \"#comment\" = \"Database specific directives apply to this databasse until another\" }\n { \"#comment\" = \"'database' directive occurs\" }\n { \"database\" = \"hdb\"\n {}\n { \"#comment\" = \"The base of your directory in database #1\" }\n { \"suffix\" = \"\\\"dc=nodomain\\\"\" }\n {}\n { \"access to\" = \"attrs=userPassword,shadowLastChange\"\n { \"by\"\n { \"who\" = \"dn=\\\"cn=admin,dc=nodomain\\\"\" }\n { \"what\" = \"write\" } }\n { \"by\"\n { \"who\" = \"anonymous\" }\n { \"what\" = \"auth\" } }\n { \"by\"\n { \"who\" = \"self\" }\n { \"what\" = \"write\" } }\n { \"by\"\n { \"who\" = \"*\" }\n { \"what\" = \"none\" } } } }\n\ntest Slapd.lns get \"access to dn.subtree=\\\"dc=example,dc=com\\\"\n by self write stop\\n\" =\n { \"access to\" = \"dn.subtree=\\\"dc=example,dc=com\\\"\"\n { \"by\"\n { \"who\" = \"self\" }\n { \"what\" = \"write\" }\n { \"control\" = \"stop\" } } }\n\n","old_contents":"module Test_slapd =\n\nlet conf = \"# This is the main slapd configuration file. See slapd.conf(5) for more\n# info on the configuration options.\n\n#######################################################################\n# Global Directives:\n\n# Features to permit\n#allow bind_v2\n\n# Schema and objectClass definitions\ninclude \/etc\/ldap\/schema\/core.schema\n\n#######################################################################\n# Specific Directives for database #1, of type hdb:\n# Database specific directives apply to this databasse until another\n# 'database' directive occurs\ndatabase hdb\n\n# The base of your directory in database #1\nsuffix \\\"dc=nodomain\\\"\n\naccess to attrs=userPassword,shadowLastChange\n by dn=\\\"cn=admin,dc=nodomain\\\" write\n by anonymous auth\n by self write\n by * none\n\"\n\ntest Slapd.lns get conf =\n { \"#comment\" = \"This is the main slapd configuration file. See slapd.conf(5) for more\" }\n { \"#comment\" = \"info on the configuration options.\" }\n {}\n { \"#comment\" = \"######################################################################\" }\n { \"#comment\" = \"Global Directives:\"}\n {}\n { \"#comment\" = \"Features to permit\" }\n { \"#comment\" = \"allow bind_v2\" }\n {}\n { \"#comment\" = \"Schema and objectClass definitions\" }\n { \"include\" = \"\/etc\/ldap\/schema\/core.schema\" }\n {}\n { \"#comment\" = \"######################################################################\" }\n { \"#comment\" = \"Specific Directives for database #1, of type hdb:\" }\n { \"#comment\" = \"Database specific directives apply to this databasse until another\" }\n { \"#comment\" = \"'database' directive occurs\" }\n { \"database\" = \"hdb\"\n {}\n { \"#comment\" = \"The base of your directory in database #1\" }\n { \"suffix\" = \"\\\"dc=nodomain\\\"\" }\n {}\n { \"access to\" = \"attrs=userPassword,shadowLastChange\"\n { \"by\"\n { \"who\" = \"dn=\\\"cn=admin,dc=nodomain\\\"\" }\n { \"what\" = \"write\" } }\n { \"by\"\n { \"who\" = \"anonymous\" }\n { \"what\" = \"auth\" } }\n { \"by\"\n { \"who\" = \"self\" }\n { \"what\" = \"write\" } }\n { \"by\"\n { \"who\" = \"*\" }\n { \"what\" = \"none\" } } } }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"af5ab05a58b69b935c68d489dfd9cfabeab6ce39","subject":"Revert \"switched the httpd.aug to the version from 1.2\"","message":"Revert \"switched the httpd.aug to the version from 1.2\"\n\nThis reverts commit 60fce0b22e422bbfd1bb700740c9648d209c0228.\n","repos":"thanatos\/lets-encrypt-preview,kuba\/letsencrypt,twstrike\/le_for_patching,xgin\/letsencrypt,lbeltrame\/letsencrypt,piru\/letsencrypt,piru\/letsencrypt,letsencrypt\/letsencrypt,letsencrypt\/letsencrypt,goofwear\/letsencrypt,Sveder\/letsencrypt,jtl999\/certbot,kuba\/letsencrypt,DavidGarciaCat\/letsencrypt,sjerdo\/letsencrypt,wteiken\/letsencrypt,TheBoegl\/letsencrypt,bsmr-misc-forks\/letsencrypt,jtl999\/certbot,goofwear\/letsencrypt,VladimirTyrin\/letsencrypt,stweil\/letsencrypt,dietsche\/letsencrypt,mrb\/letsencrypt,jsha\/letsencrypt,martindale\/letsencrypt,dietsche\/letsencrypt,brentdax\/letsencrypt,wteiken\/letsencrypt,mrb\/letsencrypt,mitnk\/letsencrypt,lmcro\/letsencrypt,twstrike\/le_for_patching,mitnk\/letsencrypt,lbeltrame\/letsencrypt,jsha\/letsencrypt,DavidGarciaCat\/letsencrypt,VladimirTyrin\/letsencrypt,stweil\/letsencrypt,sjerdo\/letsencrypt,xgin\/letsencrypt,thanatos\/lets-encrypt-preview,TheBoegl\/letsencrypt,martindale\/letsencrypt,bsmr-misc-forks\/letsencrypt,lmcro\/letsencrypt,Sveder\/letsencrypt,brentdax\/letsencrypt","old_file":"letsencrypt-apache\/letsencrypt_apache\/augeas_lens\/httpd.aug","new_file":"letsencrypt-apache\/letsencrypt_apache\/augeas_lens\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort \n Francis Giraldeau \n Raphael Pinson \n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See .\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^\\\\ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort \n Francis Giraldeau \n Raphael Pinson \n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See .\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\r\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\r\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"1181f13a49396183419b254db891b65bbf7e1fbf","subject":"test_php.aug: make a nice test for PHP","message":"test_php.aug: make a nice test for PHP\n","repos":"ptoscano\/augeas,camptocamp\/augeas,pevalme\/augeas,bkearney\/augeas,hercules-team\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,kumy\/augeas,lutter\/augeas,lutter\/augeas,lutter\/augeas,kunkku\/augeas,MikaelSmith\/augeas,jasperla\/augeas,pevalme\/augeas,camptocamp\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,camptocamp\/augeas,kumy\/augeas,jasperla\/augeas,dafugg\/augeas,pevalme\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,jjlin\/augeas,jtopjian\/augeas,hercules-team\/augeas,domcleal\/augeas,dafugg\/augeas,kunkku\/augeas,dafugg\/augeas,jjlin\/augeas,jjlin\/augeas,mchf\/augeas,camptocamp\/augeas,mlichvar\/augeas,raphink\/augeas,manandbytes\/augeas,bkearney\/augeas,bkearney\/augeas,raphink\/augeas,manandbytes\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_php.aug","new_file":"lenses\/tests\/test_php.aug","new_contents":"module Test_php =\n\n let conf = \"[PHP]\n; Enable the PHP scripting language engine under Apache.\nengine = On\n\n; Enable compatibility mode with Zend Engine 1 (PHP 4.x)\nzend.ze1_compatibility_mode = Off\nunserialize_callback_func=\ndate.default_latitude = 31.7667\n\n[sqlite]\nsqlite.assoc_case = 0\n\"\n\n\n test PHP.lns get conf = \n { \"section\" = \"PHP\"\n { \"#comment\" = \"Enable the PHP scripting language engine under Apache.\" }\n\t { \"engine\" = \"On\" }\n\t {}\n\t { \"#comment\" = \"Enable compatibility mode with Zend Engine 1 (PHP 4.x)\" }\n\t { \"zend.ze1_compatibility_mode\" = \"Off\" }\n\t { \"unserialize_callback_func\" }\n\t { \"date.default_latitude\" = \"31.7667\" }\n\t {} }\n { \"section\" = \"sqlite\"\n { \"sqlite.assoc_case\" = \"0\" } }\n","old_contents":"module Test_php =\n\n let conf = \"[PHP]\n\n;;;;;;;;;;;;;;;;;;;;\n; Language Options ;\n;;;;;;;;;;;;;;;;;;;;\n\n; Enable the PHP scripting language engine under Apache.\nengine = On\n\n; Enable compatibility mode with Zend Engine 1 (PHP 4.x)\nzend.ze1_compatibility_mode = Off\n\n; Allow the tags are recognized.\n; NOTE: Using short tags should be avoided when developing applications or\n; libraries that are meant for redistribution, or deployment on PHP\n; servers which are not under your control, because short tags may not\n; be supported on the target server. For portable, redistributable code,\n; be sure not to use short tags.\nshort_open_tag = On\n\n; Allow ASP-style <% %> tags.\nasp_tags = Off\n\n; The number of significant digits displayed in floating point numbers.\nprecision = 12\n\n; Enforce year 2000 compliance (will cause problems with non-compliant browsers)\ny2k_compliance = On\n\n; Output buffering allows you to send header lines (including cookies) even\n; after you send body content, at the price of slowing PHP's output layer a\n; bit. You can enable output buffering during runtime by calling the output\n; buffering functions. You can also enable output buffering for all files by\n; setting this directive to On. If you wish to limit the size of the buffer\n; to a certain size - you can use a maximum number of bytes instead of 'On', as\n; a value for this directive (e.g., output_buffering=4096).\noutput_buffering = Off\n; You can redirect all of the output of your scripts to a function. For\n; example, if you set output_handler to \\\"mb_output_handler\\\", character\n; encoding will be transparently converted to the specified encoding.\n; Setting any output handler automatically turns on output buffering.\n; Note: People who wrote portable scripts should not depend on this ini\n; directive. Instead, explicitly set the output handler using ob_start().\n; Using this ini directive may cause problems unless you know what script\n; is doing.\n; Note: You cannot use both \\\"mb_output_handler\\\" with \\\"ob_iconv_handler\\\"\n; and you cannot use both \\\"ob_gzhandler\\\" and \\\"zlib.output_compression\\\".\n; Note: output_handler must be empty if this is set 'On' !!!!\n; Instead you must use zlib.output_handler.\n;output_handler =\n\n; Transparent output compression using the zlib library\n; Valid values for this option are 'off', 'on', or a specific buffer size\n; to be used for compression (default is 4KB)\n; Note: Resulting chunk size may vary due to nature of compression. PHP\n; outputs chunks that are few hundreds bytes each as a result of\n; compression. If you prefer a larger chunk size for better\n; performance, enable output_buffering in addition.\n; Note: You need to use zlib.output_handler instead of the standard\n; output_handler, or otherwise the output will be corrupted.\nzlib.output_compression = Off\n;zlib.output_compression_level = -1\n\n; You cannot specify additional output handlers if zlib.output_compression\n; is activated here. This setting does the same as output_handler but in\n; a different order.\n;zlib.output_handler =\n\n; Implicit flush tells PHP to tell the output layer to flush itself\n; automatically after every output block. This is equivalent to calling the\n; PHP function flush() after each and every call to print() or echo() and each\n; and every HTML block. Turning this option on has serious performance\n; implications and is generally recommended for debugging purposes only.\nimplicit_flush = Off\n\n; The unserialize callback function will be called (with the undefined class'\n; name as parameter), if the unserializer finds an undefined class\n; which should be instantiated.\n; A warning appears if the specified function is not defined, or if the\n; function doesn't include\/implement the missing class.\n; So only set this entry, if you really want to implement such a\n; callback-function.\nunserialize_callback_func=\n\n;extension=mysql.so\n;extension=gd.so\n\n;;;;;;;;;;;;;;;;;;;\n; Module Settings ;\n;;;;;;;;;;;;;;;;;;;\n\n[Date]\n; Defines the default timezone used by the date functions\n;date.timezone =\n\n;date.default_latitude = 31.7667\n;date.default_longitude = 35.2333\n\n;date.sunrise_zenith = 90.583333\n;date.sunset_zenith = 90.583333\n\n[filter]\n;filter.default = unsafe_raw\n;filter.default_flags =\n\n[iconv]\n;iconv.input_encoding = ISO-8859-1\n;iconv.internal_encoding = ISO-8859-1\n;iconv.output_encoding = ISO-8859-1\n\n[sqlite]\n;sqlite.assoc_case = 0\n\n\n\"\n\n\n test PHP.lns get conf = ?\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cdd762e425a5b8b076d36d63c742f25cd4f87c85","subject":"qemu augeas: Add spice_tls\/spice_tls_x509_cert_dir","message":"qemu augeas: Add spice_tls\/spice_tls_x509_cert_dir\n\nIf vdsm is installed and configured in Fedora 17, we add the following\nitems into qemu.conf:\n\nspice_tls=1\nspice_tls_x509_cert_dir=\"\/etc\/pki\/vdsm\/libvirt-spice\"\n\nHowever, after this changes, augtool cannot identify qemu.conf anymore.\n","repos":"taget\/libvirt,iam-TJ\/libvirt,siboulet\/libvirt-openvz,warewolf\/libvirt,bjzhang\/libvirt,olafhering\/libvirt,rlaager\/libvirt,taget\/libvirt,wiedi\/libvirt,libvirt\/libvirt,wiedi\/libvirt,VenkatDatta\/libvirt,jardasgit\/libvirt,VenkatDatta\/libvirt,bjzhang\/libvirt,emaste\/libvirt,novel\/fbsd-libvirt,fabianfreyer\/libvirt,bjzhang\/libvirt,agx\/libvirt,nertpinx\/libvirt,jeckersb\/libvirt,olafhering\/libvirt,zippy2\/libvirt,libvirt\/libvirt,iam-TJ\/libvirt,libvirt\/libvirt,VenkatDatta\/libvirt,trainstack\/libvirt,trainstack\/libvirt,dumbbell\/libvirt,novel\/fbsd-libvirt,novel\/fbsd-libvirt,novel\/fbsd-libvirt,jardasgit\/libvirt,dumbbell\/libvirt,jfehlig\/libvirt,novel\/fbsd-libvirt,eskultety\/libvirt,cbosdo\/libvirt,zhlcindy\/libvirt-1.1.4-maintain,taget\/libvirt,taget\/libvirt,trainstack\/libvirt,emaste\/libvirt,rmarwaha\/libvirt1,crobinso\/libvirt,dumbbell\/libvirt,jeckersb\/libvirt,dumbbell\/libvirt,bjzhang\/libvirt,jardasgit\/libvirt,emaste\/libvirt,zippy2\/libvirt,rmarwaha\/libvirt1,rlaager\/libvirt,nertpinx\/libvirt,rlaager\/libvirt,zippy2\/libvirt,rmarwaha\/libvirt1,elmarco\/libvirt,wiedi\/libvirt,datto\/libvirt,shugaoye\/libvirt,elmarco\/libvirt,shugaoye\/libvirt,trainstack\/libvirt,datto\/libvirt,fabianfreyer\/libvirt,trainstack\/libvirt,jardasgit\/libvirt,warewolf\/libvirt,crobinso\/libvirt,rmarwaha\/libvirt,siboulet\/libvirt-openvz,novel\/fbsd-libvirt,emaste\/libvirt,rmarwaha\/libvirt1,nertpinx\/libvirt,jeckersb\/libvirt,datto\/libvirt,rlaager\/libvirt,agx\/libvirt,VenkatDatta\/libvirt,cbosdo\/libvirt,agx\/libvirt,jfehlig\/libvirt,zhlcindy\/libvirt-1.1.4-maintain,fabianfreyer\/libvirt,olafhering\/libvirt,elmarco\/libvirt,warewolf\/libvirt,datto\/libvirt,iam-TJ\/libvirt,cbosdo\/libvirt,wiedi\/libvirt,olafhering\/libvirt,agx\/libvirt,elmarco\/libvirt,nertpinx\/libvirt,cbosdo\/libvirt,iam-TJ\/libvirt,andreabolognani\/libvirt,taget\/libvirt,andreabolognani\/libvirt,novel\/fbsd-libvirt,wiedi\/libvirt,elmarco\/libvirt,agx\/libvirt,wiedi\/libvirt,warewolf\/libvirt,novel\/fbsd-libvirt,rmarwaha\/libvirt,warewolf\/libvirt,rmarwaha\/libvirt,emaste\/libvirt,eskultety\/libvirt,iam-TJ\/libvirt,warewolf\/libvirt,jfehlig\/libvirt,crobinso\/libvirt,andreabolognani\/libvirt,novel\/fbsd-libvirt,crobinso\/libvirt,trainstack\/libvirt,emaste\/libvirt,rmarwaha\/libvirt1,trainstack\/libvirt,libvirt\/libvirt,rmarwaha\/libvirt,dumbbell\/libvirt,andreabolognani\/libvirt,jfehlig\/libvirt,jeckersb\/libvirt,shugaoye\/libvirt,zippy2\/libvirt,jardasgit\/libvirt,nertpinx\/libvirt,zhlcindy\/libvirt-1.1.4-maintain,rmarwaha\/libvirt1,zhlcindy\/libvirt-1.1.4-maintain,eskultety\/libvirt,shugaoye\/libvirt,wiedi\/libvirt,datto\/libvirt,cbosdo\/libvirt,rmarwaha\/libvirt,iam-TJ\/libvirt,eskultety\/libvirt,eskultety\/libvirt,bjzhang\/libvirt,siboulet\/libvirt-openvz,VenkatDatta\/libvirt,siboulet\/libvirt-openvz,zhlcindy\/libvirt-1.1.4-maintain,jeckersb\/libvirt,rlaager\/libvirt,fabianfreyer\/libvirt,jeckersb\/libvirt,iam-TJ\/libvirt,rmarwaha\/libvirt,warewolf\/libvirt,emaste\/libvirt,andreabolognani\/libvirt,jeckersb\/libvirt,fabianfreyer\/libvirt,siboulet\/libvirt-openvz,dumbbell\/libvirt,shugaoye\/libvirt","old_file":"src\/qemu\/libvirtd_qemu.aug","new_file":"src\/qemu\/libvirtd_qemu.aug","new_contents":"(* \/etc\/libvirt\/qemu.conf *)\n\nmodule Libvirtd_qemu =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let vnc_entry = str_entry \"vnc_listen\"\n | bool_entry \"vnc_auto_unix_socket\"\n | bool_entry \"vnc_tls\"\n | str_entry \"vnc_tls_x509_cert_dir\"\n | bool_entry \"vnc_tls_x509_verify\"\n | str_entry \"vnc_password\"\n | bool_entry \"vnc_sasl\"\n | str_entry \"vnc_sasl_dir\"\n | str_entry \"spice_listen\"\n | bool_entry \"spice_tls\"\n | str_entry \"spice_tls_x509_cert_dir\"\n | str_entry \"spice_passwd\"\n | str_entry \"security_driver\"\n | bool_entry \"security_default_confined\"\n | bool_entry \"security_require_confined\"\n | str_entry \"user\"\n | str_entry \"group\"\n | bool_entry \"dynamic_ownership\"\n | str_array_entry \"cgroup_controllers\"\n | str_array_entry \"cgroup_device_acl\"\n | str_entry \"save_image_format\"\n | str_entry \"dump_image_format\"\n | str_entry \"auto_dump_path\"\n | bool_entry \"auto_dump_bypass_cache\"\n | bool_entry \"auto_start_bypass_cache\"\n | str_entry \"hugetlbfs_mount\"\n | bool_entry \"mac_filter\"\n | bool_entry \"relaxed_acs_check\"\n | bool_entry \"vnc_allow_host_audio\"\n | bool_entry \"clear_emulator_capabilities\"\n | bool_entry \"allow_disk_format_probing\"\n | bool_entry \"set_process_name\"\n | int_entry \"max_processes\"\n | int_entry \"max_files\"\n | str_entry \"lock_manager\"\n | int_entry \"max_queued\"\n | int_entry \"keepalive_interval\"\n | int_entry \"keepalive_count\"\n\n (* Each enty in the config is one of the following three ... *)\n let entry = vnc_entry\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/qemu.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* \/etc\/libvirt\/qemu.conf *)\n\nmodule Libvirtd_qemu =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let vnc_entry = str_entry \"vnc_listen\"\n | bool_entry \"vnc_auto_unix_socket\"\n | bool_entry \"vnc_tls\"\n | str_entry \"vnc_tls_x509_cert_dir\"\n | bool_entry \"vnc_tls_x509_verify\"\n | str_entry \"vnc_password\"\n | bool_entry \"vnc_sasl\"\n | str_entry \"vnc_sasl_dir\"\n | str_entry \"security_driver\"\n | bool_entry \"security_default_confined\"\n | bool_entry \"security_require_confined\"\n | str_entry \"user\"\n | str_entry \"group\"\n | bool_entry \"dynamic_ownership\"\n | str_array_entry \"cgroup_controllers\"\n | str_array_entry \"cgroup_device_acl\"\n | str_entry \"save_image_format\"\n | str_entry \"dump_image_format\"\n | str_entry \"auto_dump_path\"\n | bool_entry \"auto_dump_bypass_cache\"\n | bool_entry \"auto_start_bypass_cache\"\n | str_entry \"hugetlbfs_mount\"\n | bool_entry \"relaxed_acs_check\"\n | bool_entry \"vnc_allow_host_audio\"\n | bool_entry \"clear_emulator_capabilities\"\n | bool_entry \"allow_disk_format_probing\"\n | bool_entry \"set_process_name\"\n | int_entry \"max_processes\"\n | int_entry \"max_files\"\n | str_entry \"lock_manager\"\n | int_entry \"max_queued\"\n | int_entry \"keepalive_interval\"\n | int_entry \"keepalive_count\"\n\n (* Each enty in the config is one of the following three ... *)\n let entry = vnc_entry\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/qemu.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"987b2d89007c8918d314f5b5262f1558ae6e5d54","subject":"Changes in nrpe.aug Remove wrong ^ in comment regex Use Util.comment_generic Use generic modules Improve NaturalDocs documentation","message":"Changes in nrpe.aug\nRemove wrong ^ in comment regex\nUse Util.comment_generic\nUse generic modules\nImprove NaturalDocs documentation\n","repos":"manandbytes\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,kumy\/augeas,dafugg\/augeas,ptoscano\/augeas,hercules-team\/augeas,mchf\/augeas,jtopjian\/augeas,dafugg\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jjlin\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,lutter\/augeas,domcleal\/augeas,jasperla\/augeas,dafugg\/augeas,raphink\/augeas,jjlin\/augeas,kunkku\/augeas,domcleal\/augeas,pevalme\/augeas,kumy\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,jasperla\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mlichvar\/augeas,lutter\/augeas,jjlin\/augeas,kumy\/augeas,MikaelSmith\/augeas,raphink\/augeas","old_file":"lenses\/nrpe.aug","new_file":"lenses\/nrpe.aug","new_contents":"(*\nModule: Nrpe\n Parses nagios-nrpe configuration files.\n\nAuthor: Marc Fournier \n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\nmodule Nrpe =\n autoload xfm\n\n\nlet eol = Util.eol\nlet eq = Sep.equal\n\n(* View: word *)\nlet word = \/[^=\\n\\t ]+\/\n\n\n(* View: command\n nrpe.cfg usually has many entries defining commands to run\n\n > command[check_foo]=\/path\/to\/nagios\/plugin -w 123 -c 456\n > command[check_bar]=\/path\/to\/another\/nagios\/plugin --option\n*)\nlet command =\n let obrkt = del \/\\[\/ \"[\" in\n let cbrkt = del \/\\]\/ \"]\" in\n [ key \"command\" .\n [ obrkt . key \/[^]\\\/\\n]+\/ . cbrkt . eq\n . store \/[^=\\n]+\/ . del \/\\n\/ \"\\n\" ]\n ]\n\n\n(* View: item_re\n regular entries re *)\nlet item_re = \"server_port\"\n | \"command_prefix\"\n | \"server_address\"\n | \"allowed_hosts\"\n | \"debug\"\n | \"nrpe_user\"\n | \"nrpe_group\"\n | \"dont_blame_nrpe\"\n | \"command_timeout\"\n | \"connection_timeout\"\n | \"allow_weak_random_seed\"\n | \"pid_file\"\n | \"log_facility\"\n\n(* View: item\n regular entries *)\nlet item = [ key item_re . eq . store word . eol ]\n\n\n(* View: include\n An include entry.\n\n nrpe.cfg can include more than one file or directory of files\n\n > include=\/path\/to\/file1.cfg\n > include=\/path\/to\/file2.cfg\n*)\nlet include = [ key \"include\" .\n [ label \"file\" . eq . store word . eol ]\n]\n\n(* View: include_dir\n > include_dir=\/path\/to\/dir\/\n*)\nlet include_dir = [ key \"include_dir\" .\n [ label \"dir\" . eq . store word . eol ]\n]\n\n\n(* View: comment\n Nrpe comments must start at beginning of line *)\nlet comment = Util.comment_generic \/#[ \\t]*\/ \"# \"\n\n(* blank lines and empty comments *)\nlet empty = Util.empty\n\n(* View: lns\n The Nrpe lens *)\nlet lns = ( command | item | include | include_dir | comment | empty ) *\n\n(* View: filter\n File filter *)\nlet filter = Util.stdexcl .\n incl \"\/etc\/nrpe.cfg\" .\n incl \"\/etc\/nagios\/nrpe.cfg\"\n\nlet xfm = transform lns (filter)\n\n","old_contents":"(*\nModule: Nrpe\n Parses nagios-nrpe configuration files.\n\nAuthor: Marc Fournier \n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\nmodule Nrpe =\n autoload xfm\n\nlet nl = del \/[ \\t]*\\n\/ \"\\n\"\nlet eq = del \/=\/ \"=\"\n\n\n(* command entries\n\nnrpe.cfg usually has many entries defining commands to run\n\ncommand[check_foo]=\/path\/to\/nagios\/plugin -w 123 -c 456\ncommand[check_bar]=\/path\/to\/another\/nagios\/plugin --option\n\n*)\nlet obrkt = del \/\\[\/ \"[\"\nlet cbrkt = del \/\\]\/ \"]\"\n\nlet command = [ key \"command\" .\n [ obrkt . key \/[^]\\\/\\n]+\/ . cbrkt . eq . store \/[^=\\n]+\/ . del \/\\n\/ \"\\n\" ]\n]\n\n\n(* regular entries *)\nlet item_re = \"server_port\"\n | \"command_prefix\"\n | \"server_address\"\n | \"allowed_hosts\"\n | \"debug\"\n | \"nrpe_user\"\n | \"nrpe_group\"\n | \"dont_blame_nrpe\"\n | \"command_timeout\"\n | \"connection_timeout\"\n | \"allow_weak_random_seed\"\n | \"pid_file\"\n | \"log_facility\"\n\nlet item = [ key item_re . eq . store \/[^=\\n\\t ]+\/ . nl ]\n\n\n(* include entries\n\nnrpe.cfg can include more than one file or directory of files\n\ninclude=\/path\/to\/file1.cfg\ninclude=\/path\/to\/file2.cfg\ninclude_dir=\/path\/to\/dir\/\n\n*)\nlet include = [ key \"include\" .\n [ label \"file\" . eq . store \/[^=\\n\\t ]+\/ . nl ]\n]\nlet include_dir = [ key \"include_dir\" .\n [ label \"dir\" . eq . store \/[^=\\n\\t ]+\/ . nl ]\n]\n\n\n(* comments\n\nWe can't use Util.comment because nrpe only allows comments starting at\nbeginning of line.\n\n*)\nlet comment = [ label \"#comment\" . del \/^#[ \\t]*\/ \"# \" . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . nl ]\n\n\n(* blank lines and empty comments *)\nlet empty = Util.empty\n\n\n(* final lens definition *)\nlet lns = ( command | item | include | include_dir | comment | empty ) *\n\nlet filter = Util.stdexcl .\n incl \"\/etc\/nrpe.cfg\" .\n incl \"\/etc\/nagios\/nrpe.cfg\"\n\nlet xfm = transform lns (filter)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a59562f4b5f4305824193ddfe7a9b00a61739899","subject":"Simplify Cron.key_re to improve typechecking of cron.aug","message":"Simplify Cron.key_re to improve typechecking of cron.aug\n","repos":"kunkku\/augeas,mchf\/augeas,lutter\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,ptoscano\/augeas,raphink\/augeas,domcleal\/augeas,pevalme\/augeas,pevalme\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,dafugg\/augeas,jtopjian\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,raphink\/augeas,kumy\/augeas,domcleal\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,kumy\/augeas,domcleal\/augeas,MikaelSmith\/augeas,kunkku\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jjlin\/augeas,pevalme\/augeas,kumy\/augeas,lutter\/augeas,jasperla\/augeas,kunkku\/augeas,hercules-team\/augeas,mlichvar\/augeas,lutter\/augeas,mchf\/augeas,ptoscano\/augeas,dafugg\/augeas,jjlin\/augeas,jtopjian\/augeas,kumy\/augeas,hercules-team\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/cron.aug","new_file":"lenses\/cron.aug","new_contents":"(*\nModule: Cron\n Parses \/etc\/cron.d\/*, \/etc\/crontab\n\nAuthor: Raphael Pinson \n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 crontab` where\n possible.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the entry that launches '\/usr\/bin\/ls'\n > match '\/files\/etc\/crontab\/entry[. = \"\/usr\/bin\/ls\"]'\n\nAbout: Configuration files\n This lens applies to \/etc\/cron.d\/* and \/etc\/crontab. See .\n*)\n\nmodule Cron =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: num *)\nlet num = \/[0-9*][0-9\\\/,*-]*\/\n\n(* Variable: alpha *)\nlet alpha = \/[A-Za-z]{3}\/\n\n(* Variable: alphanum *)\nlet alphanum = (num|alpha) . (\"-\" . (num|alpha))?\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_eq *)\nlet sep_eq = Util.del_str \"=\"\n\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = \/[A-Za-z-1-9_]+(\\[[0-9]+\\])?\/ - \"entry\" in\n let sto_to_eol = store \/[^\\n]*[^ \\t\\n]\/ in\n [ key key_re . sep_eq . sto_to_eol . eol ]\n\n\n(* View: minute *)\nlet minute = [ label \"minute\" . store num ]\n\n(* View: hour *)\nlet hour = [ label \"hour\" . store num ]\n\n(* View: dayofmonth *)\nlet dayofmonth = [ label \"dayofmonth\" . store num ]\n\n(* View: month *)\nlet month = [ label \"month\" . store alphanum ]\n\n(* View: dayofweek *)\nlet dayofweek = [ label \"dayofweek\" . store alphanum ]\n\n\n(* View: user *)\nlet user = [ label \"user\" . store Rx.word ]\n\n\n(************************************************************************\n * View: time\n * Time in the format \"minute hour dayofmonth month dayofweek\"\n *************************************************************************)\nlet time = [ label \"time\" .\n minute . sep_spc . hour . sep_spc . dayofmonth\n . sep_spc . month . sep_spc . dayofweek ]\n\n(* Variable: the valid values for schedules *)\nlet schedule_re = \"reboot\" | \"yearly\" | \"annually\" | \"monthly\"\n | \"weekly\" | \"daily\" | \"midnight\" | \"hourly\"\n\n(************************************************************************\n * View: schedule\n * Time in the format \"@keyword\"\n *************************************************************************)\nlet schedule = [ label \"schedule\" . Util.del_str \"@\"\n . store schedule_re ]\n\n\n(************************************************************************\n * View: entry\n * A crontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . indent\n . ( time | schedule )\n . sep_spc . user\n . sep_spc . store Rx.space_in . eol ]\n\n\n(*\n * View: lns\n * The cron lens\n *)\nlet lns = ( empty | comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/cron.d\/*\" .\n incl \"\/etc\/crontab\" .\n excl \"\/etc\/cron.d\/at.allow\" .\n excl \"\/etc\/cron.d\/at.deny\" .\n excl \"\/etc\/cron.d\/cron.allow\" .\n excl \"\/etc\/cron.d\/cron.deny\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Cron\n Parses \/etc\/cron.d\/*, \/etc\/crontab\n\nAuthor: Raphael Pinson \n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 crontab` where\n possible.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the entry that launches '\/usr\/bin\/ls'\n > match '\/files\/etc\/crontab\/entry[. = \"\/usr\/bin\/ls\"]'\n\nAbout: Configuration files\n This lens applies to \/etc\/cron.d\/* and \/etc\/crontab. See .\n*)\n\nmodule Cron =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: num *)\nlet num = \/[0-9*][0-9\\\/,*-]*\/\n\n(* Variable: alpha *)\nlet alpha = \/[A-Za-z]{3}\/\n\n(* Variable: alphanum *)\nlet alphanum = (num|alpha) . (\"-\" . (num|alpha))?\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_eq *)\nlet sep_eq = Util.del_str \"=\"\n\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = Shellvars.key_re - \"entry\" in\n let sto_to_eol = store \/[^\\n]*[^ \\t\\n]\/ in\n [ key key_re . sep_eq . sto_to_eol . eol ]\n\n\n(* View: minute *)\nlet minute = [ label \"minute\" . store num ]\n\n(* View: hour *)\nlet hour = [ label \"hour\" . store num ]\n\n(* View: dayofmonth *)\nlet dayofmonth = [ label \"dayofmonth\" . store num ]\n\n(* View: month *)\nlet month = [ label \"month\" . store alphanum ]\n\n(* View: dayofweek *)\nlet dayofweek = [ label \"dayofweek\" . store alphanum ]\n\n\n(* View: user *)\nlet user = [ label \"user\" . store Rx.word ]\n\n\n(************************************************************************\n * View: time\n * Time in the format \"minute hour dayofmonth month dayofweek\"\n *************************************************************************)\nlet time = [ label \"time\" .\n minute . sep_spc . hour . sep_spc . dayofmonth\n . sep_spc . month . sep_spc . dayofweek ]\n\n(* Variable: the valid values for schedules *)\nlet schedule_re = \"reboot\" | \"yearly\" | \"annually\" | \"monthly\"\n | \"weekly\" | \"daily\" | \"midnight\" | \"hourly\"\n\n(************************************************************************\n * View: schedule\n * Time in the format \"@keyword\"\n *************************************************************************)\nlet schedule = [ label \"schedule\" . Util.del_str \"@\"\n . store schedule_re ]\n\n\n(************************************************************************\n * View: entry\n * A crontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . indent\n . ( time | schedule )\n . sep_spc . user\n . sep_spc . store Rx.space_in . eol ]\n\n\n(*\n * View: lns\n * The cron lens\n *)\nlet lns = ( empty | comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/cron.d\/*\" .\n incl \"\/etc\/crontab\" .\n excl \"\/etc\/cron.d\/at.allow\" .\n excl \"\/etc\/cron.d\/at.deny\" .\n excl \"\/etc\/cron.d\/cron.allow\" .\n excl \"\/etc\/cron.d\/cron.deny\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4b2039a2ae7acf0def71c0f0df1b5f3507686994","subject":"Samba: Change default indentation and separation","message":"Samba: Change default indentation and separation\n\nMatch indentation of the example configuration file shipped by the upstream\nauthors\n","repos":"bkearney\/augeas,MikaelSmith\/augeas,pevalme\/augeas,bkearney\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,mlichvar\/augeas,dafugg\/augeas,jjlin\/augeas,jasperla\/augeas,raphink\/augeas,manandbytes\/augeas,dafugg\/augeas,camptocamp\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,raphink\/augeas,kumy\/augeas,ptoscano\/augeas,lutter\/augeas,kunkku\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,pevalme\/augeas,jasperla\/augeas,bkearney\/augeas,kumy\/augeas,camptocamp\/augeas,mchf\/augeas,domcleal\/augeas,lutter\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,mchf\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,kunkku\/augeas,jjlin\/augeas,dafugg\/augeas,mlichvar\/augeas,ptoscano\/augeas,domcleal\/augeas,domcleal\/augeas,jtopjian\/augeas,pevalme\/augeas,ptoscano\/augeas,bkearney\/augeas,jjlin\/augeas","old_file":"lenses\/samba.aug","new_file":"lenses\/samba.aug","new_contents":"(* Samba module for Augeas \n Author: Free Ekanayaka \n\n Reference: man smb.conf(5)\n\n*)\n\n\nmodule Samba =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = del \/[ \\t]*[=:]\/ \" =\"\nlet indent = del \/[ \\t]*\/ \" \"\n\n(* Import useful INI File primitives *)\nlet eol = IniFile.eol\nlet empty = IniFile.empty\nlet sto_to_comment \n = Util.del_opt_ws \" \"\n . store \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n(************************************************************************\n * ENTRY\n * smb.conf allows indented entries\n *************************************************************************)\n\nlet entry_re = \/[A-Za-z0-9_.-][A-Za-z0-9 _.-]*[A-Za-z0-9_.-]\/\nlet entry = let kw = entry_re in\n [ indent\n . key kw\n . sep\n . sto_to_comment?\n . (comment|eol) ]\n | comment\n\n(************************************************************************\n * TITLE\n *************************************************************************)\n\nlet title = IniFile.title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry \n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/samba\/smb.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Samba module for Augeas \n Author: Free Ekanayaka \n\n Reference: man smb.conf(5)\n\n*)\n\n\nmodule Samba =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\n\n(* Import useful INI File primitives *)\nlet eol = IniFile.eol\nlet empty = IniFile.empty\nlet sto_to_comment\n = IniFile.sto_to_comment\n\n(************************************************************************\n * ENTRY\n * smb.conf allows indented entries\n *************************************************************************)\n\nlet entry_re = \/[A-Za-z0-9_.-][A-Za-z0-9 _.-]*[A-Za-z0-9_.-]\/\nlet entry = let kw = entry_re in\n [ Util.indent\n . key kw\n . sep\n . sto_to_comment?\n . (comment|eol) ]\n | comment\n\n(************************************************************************\n * TITLE\n *************************************************************************)\n\nlet title = IniFile.title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry \n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/samba\/smb.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c55e6647654e0a8e5ca11d196f905227f7311b23","subject":"Remove bogus reset of 'record' counter","message":"Remove bogus reset of 'record' counter\n","repos":"hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,manandbytes\/augeas,raphink\/augeas,dafugg\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,raphink\/augeas,jtopjian\/augeas,kunkku\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,lutter\/augeas,jtopjian\/augeas,kumy\/augeas,bkearney\/augeas,domcleal\/augeas,mchf\/augeas,kumy\/augeas,kunkku\/augeas,camptocamp\/augeas,mlichvar\/augeas,camptocamp\/augeas,jjlin\/augeas,pevalme\/augeas,bkearney\/augeas,ptoscano\/augeas,lutter\/augeas,kunkku\/augeas,jasperla\/augeas,mlichvar\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,pevalme\/augeas,domcleal\/augeas,mlichvar\/augeas,dafugg\/augeas,camptocamp\/augeas,kumy\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,jjlin\/augeas,kumy\/augeas,hercules-team\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,dafugg\/augeas,jasperla\/augeas,bkearney\/augeas,ptoscano\/augeas,mchf\/augeas","old_file":"spec\/inittab.aug","new_file":"spec\/inittab.aug","new_contents":"# Parsing \/etc\/inittab\n\nmap\n grammar inittab\n include '\/etc\/inittab' '\/system\/config\/inittab'\nend\n\ngrammar inittab\n\n token SEP ':'\n token EOL '\\n'\n\n file: ( comment | record ) *\n\n comment: ( \/#.*?\\n\/ | \/[ \\t]*\\n\/ )\n\n record: [ seq 'record' . \n [ label 'id' . store ..? ] .\n SEP .\n [ label 'runlevels' . store ..? ] .\n SEP .\n [ label 'action' . store ..? ] .\n SEP .\n [ label 'process' . store ..? ] .\n EOL\n ]\nend\n","old_contents":"# Parsing \/etc\/inittab\n\n#map\n# grammar inittab\n# include '\/etc\/inittab' '\/system\/config\/inittab'\n#end\n\ngrammar inittab\n\n token SEP ':'\n token EOL '\\n'\n\n file: ( comment | record ) *\n\n comment: ( \/#.*?\\n\/ | \/[ \\t]*\\n\/ )\n\n record: counter 'record' . \n [ seq 'record' . \n [ label 'id' . store ..? ] .\n SEP .\n [ label 'runlevels' . store ..? ] .\n SEP .\n [ label 'action' . store ..? ] .\n SEP .\n [ label 'process' . store ..? ] .\n EOL\n ]\nend\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"12a5fb19aa10f559ee2e53bbf9211ae68108cc93","subject":"OpenShift_Quickstarts: Fix tests after Json update","message":"OpenShift_Quickstarts: Fix tests after Json update\n","repos":"mchf\/augeas,lutter\/augeas,hercules-team\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,dafugg\/augeas,kunkku\/augeas,jjlin\/augeas,lutter\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,manandbytes\/augeas,pevalme\/augeas,ptoscano\/augeas,jjlin\/augeas,mchf\/augeas,pevalme\/augeas,manandbytes\/augeas,dafugg\/augeas,mlichvar\/augeas,hercules-team\/augeas,mlichvar\/augeas,pevalme\/augeas","old_file":"lenses\/tests\/test_openshift_quickstarts.aug","new_file":"lenses\/tests\/test_openshift_quickstarts.aug","new_contents":"(*\nModule: Test_OpenShift_Quickstarts\n Provides unit tests and examples for the lens.\n*)\n\nmodule Test_OpenShift_Quickstarts =\n\n(* Variable: conf *)\nlet conf = \"[\n {\\\"quickstart\\\": {\n \\\"id\\\": \\\"1\\\",\n \\\"name\\\":\\\"CakePHP\\\",\n \\\"website\\\":\\\"http:\/\/cakephp.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/cakephp-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"cakephp\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\": {\n \\\"id\\\": \\\"2\\\",\n \\\"name\\\":\\\"Django\\\",\n \\\"website\\\":\\\"https:\/\/www.djangoproject.com\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/django-example.git\\\",\n \\\"cartridges\\\":[\\\"python-2.7\\\"],\n \\\"summary\\\":\\\"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"python\\\",\\\"django\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"4\\\",\n \\\"name\\\":\\\"Drupal\\\",\n \\\"website\\\":\\\"http:\/\/drupal.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/drupal-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"drupal\\\",\\\"wiki\\\",\\\"framework\\\",\\\"instant_app\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"6\\\",\n \\\"name\\\":\\\"Ruby on Rails\\\",\n \\\"website\\\":\\\"http:\/\/rubyonrails.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/rails-example.git\\\",\n \\\"cartridges\\\":[\\\"ruby-1.9\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\\\",\n \\\"tags\\\":[\\\"ruby\\\",\\\"rails\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"8\\\",\n \\\"name\\\":\\\"WordPress\\\",\n \\\"website\\\":\\\"http:\/\/wordpress.org\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/wordpress-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"wordpress\\\",\\\"blog\\\",\\\"framework\\\",\\\"instant_app\\\"],\n \\\"admin_tags\\\":[]\n }}\n]\"\n\n(* Variable: new_conf *) \nlet new_conf = \"[\n {\\\"quickstart\\\": {\n \\\"id\\\": \\\"1\\\",\n \\\"name\\\":\\\"CakePHP\\\",\n \\\"website\\\":\\\"http:\/\/cakephp.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/cakephp-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"cakephp\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\": {\n \\\"id\\\": \\\"2\\\",\n \\\"name\\\":\\\"Django\\\",\n \\\"website\\\":\\\"https:\/\/www.djangoproject.com\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/django-example.git\\\",\n \\\"cartridges\\\":[\\\"python-2.7\\\"],\n \\\"summary\\\":\\\"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"python\\\",\\\"django\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"4\\\",\n \\\"name\\\":\\\"Drupal\\\",\n \\\"website\\\":\\\"http:\/\/drupal.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/drupal-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"drupal\\\",\\\"wiki\\\",\\\"framework\\\",\\\"instant_app\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"6\\\",\n \\\"name\\\":\\\"Ruby on Rails\\\",\n \\\"website\\\":\\\"http:\/\/rubyonrails.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/rails-example.git\\\",\n \\\"cartridges\\\":[\\\"ruby-1.9\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\\\",\n \\\"tags\\\":[\\\"ruby\\\",\\\"rails\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"8\\\",\n \\\"name\\\":\\\"WordPress\\\",\n \\\"website\\\":\\\"https:\/\/wordpress.org\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/wordpress-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"wordpress\\\",\\\"blog\\\",\\\"framework\\\",\\\"instant_app\\\"],\n \\\"admin_tags\\\":[]\n }}\n]\"\n\n(* Test: OpenShift_Quickstarts.lns *)\ntest OpenShift_Quickstarts.lns get conf =\n { \"array\"\n { }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { }\n { \"entry\" = \"id\"\n { \"string\" = \"1\" }\n }\n { }\n { \"entry\" = \"name\"\n { \"string\" = \"CakePHP\" }\n }\n { }\n { \"entry\" = \"website\"\n { \"string\" = \"http:\/\/cakephp.org\/\" }\n }\n { }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/cakephp-example.git\" }\n }\n { }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"php-5.4\" }\n { \"string\" = \"mysql-5.1\" }\n }\n }\n { }\n { \"entry\" = \"summary\"\n { \"string\" = \"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\" }\n }\n { }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"php\" }\n { \"string\" = \"cakephp\" }\n { \"string\" = \"framework\" }\n }\n }\n { }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n { }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { }\n { \"entry\" = \"id\"\n { \"string\" = \"2\" }\n }\n { }\n { \"entry\" = \"name\"\n { \"string\" = \"Django\" }\n }\n { }\n { \"entry\" = \"website\"\n { \"string\" = \"https:\/\/www.djangoproject.com\/\" }\n }\n { }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/django-example.git\" }\n }\n { }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"python-2.7\" }\n }\n }\n { }\n { \"entry\" = \"summary\"\n { \"string\" = \"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\" }\n }\n { }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"python\" }\n { \"string\" = \"django\" }\n { \"string\" = \"framework\" }\n }\n }\n { }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n { }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { }\n { \"entry\" = \"id\"\n { \"string\" = \"4\" }\n }\n { }\n { \"entry\" = \"name\"\n { \"string\" = \"Drupal\" }\n }\n { }\n { \"entry\" = \"website\"\n { \"string\" = \"http:\/\/drupal.org\/\" }\n }\n { }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/drupal-example.git\" }\n }\n { }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"php-5.4\" }\n { \"string\" = \"mysql-5.1\" }\n }\n }\n { }\n { \"entry\" = \"summary\"\n { \"string\" = \"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\" }\n }\n { }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"php\" }\n { \"string\" = \"drupal\" }\n { \"string\" = \"wiki\" }\n { \"string\" = \"framework\" }\n { \"string\" = \"instant_app\" }\n }\n }\n { }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n { }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { }\n { \"entry\" = \"id\"\n { \"string\" = \"6\" }\n }\n { }\n { \"entry\" = \"name\"\n { \"string\" = \"Ruby on Rails\" }\n }\n { }\n { \"entry\" = \"website\"\n { \"string\" = \"http:\/\/rubyonrails.org\/\" }\n }\n { }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/rails-example.git\" }\n }\n { }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"ruby-1.9\" }\n { \"string\" = \"mysql-5.1\" }\n }\n }\n { }\n { \"entry\" = \"summary\"\n { \"string\" = \"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\" }\n }\n { }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"ruby\" }\n { \"string\" = \"rails\" }\n { \"string\" = \"framework\" }\n }\n }\n { }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n { }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { }\n { \"entry\" = \"id\"\n { \"string\" = \"8\" }\n }\n { }\n { \"entry\" = \"name\"\n { \"string\" = \"WordPress\" }\n }\n { }\n { \"entry\" = \"website\"\n { \"string\" = \"http:\/\/wordpress.org\" }\n }\n { }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/wordpress-example.git\" }\n }\n { }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"php-5.4\" }\n { \"string\" = \"mysql-5.1\" }\n }\n }\n { }\n { \"entry\" = \"summary\"\n { \"string\" = \"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\" }\n }\n { }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"php\" }\n { \"string\" = \"wordpress\" }\n { \"string\" = \"blog\" }\n { \"string\" = \"framework\" }\n { \"string\" = \"instant_app\" }\n }\n }\n { }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n { }\n }\n}\n\n\n(* FIXME: not yet supported:\n * The manner in which the JSON utility lens currently works does not maintain\n * whitepsace as per the Augeas specification in the put direction.\n\ntest OpenShift_Quickstarts.lns put conf after set \"\/array\/dict[5]\/entry\/dict\/entry[3]\/string\" \"https:\/\/wordpress.org\"\n = new_conf *)\n\n(* vim: set ts=4 expandtab sw=4: *)\n","old_contents":"(*\nModule: Test_OpenShift_Quickstarts\n Provides unit tests and examples for the lens.\n*)\n\nmodule Test_OpenShift_Quickstarts =\n\n(* Variable: conf *)\nlet conf = \"[\n {\\\"quickstart\\\": {\n \\\"id\\\": \\\"1\\\",\n \\\"name\\\":\\\"CakePHP\\\",\n \\\"website\\\":\\\"http:\/\/cakephp.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/cakephp-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"cakephp\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\": {\n \\\"id\\\": \\\"2\\\",\n \\\"name\\\":\\\"Django\\\",\n \\\"website\\\":\\\"https:\/\/www.djangoproject.com\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/django-example.git\\\",\n \\\"cartridges\\\":[\\\"python-2.7\\\"],\n \\\"summary\\\":\\\"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"python\\\",\\\"django\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"4\\\",\n \\\"name\\\":\\\"Drupal\\\",\n \\\"website\\\":\\\"http:\/\/drupal.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/drupal-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"drupal\\\",\\\"wiki\\\",\\\"framework\\\",\\\"instant_app\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"6\\\",\n \\\"name\\\":\\\"Ruby on Rails\\\",\n \\\"website\\\":\\\"http:\/\/rubyonrails.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/rails-example.git\\\",\n \\\"cartridges\\\":[\\\"ruby-1.9\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\\\",\n \\\"tags\\\":[\\\"ruby\\\",\\\"rails\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"8\\\",\n \\\"name\\\":\\\"WordPress\\\",\n \\\"website\\\":\\\"http:\/\/wordpress.org\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/wordpress-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"wordpress\\\",\\\"blog\\\",\\\"framework\\\",\\\"instant_app\\\"],\n \\\"admin_tags\\\":[]\n }}\n]\"\n\n(* Variable: new_conf *) \nlet new_conf = \"[\n {\\\"quickstart\\\": {\n \\\"id\\\": \\\"1\\\",\n \\\"name\\\":\\\"CakePHP\\\",\n \\\"website\\\":\\\"http:\/\/cakephp.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/cakephp-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"cakephp\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\": {\n \\\"id\\\": \\\"2\\\",\n \\\"name\\\":\\\"Django\\\",\n \\\"website\\\":\\\"https:\/\/www.djangoproject.com\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/django-example.git\\\",\n \\\"cartridges\\\":[\\\"python-2.7\\\"],\n \\\"summary\\\":\\\"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"python\\\",\\\"django\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"4\\\",\n \\\"name\\\":\\\"Drupal\\\",\n \\\"website\\\":\\\"http:\/\/drupal.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/drupal-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"drupal\\\",\\\"wiki\\\",\\\"framework\\\",\\\"instant_app\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"6\\\",\n \\\"name\\\":\\\"Ruby on Rails\\\",\n \\\"website\\\":\\\"http:\/\/rubyonrails.org\/\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/rails-example.git\\\",\n \\\"cartridges\\\":[\\\"ruby-1.9\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\\\",\n \\\"tags\\\":[\\\"ruby\\\",\\\"rails\\\",\\\"framework\\\"],\n \\\"admin_tags\\\":[]\n }},\n {\\\"quickstart\\\":{\n \\\"id\\\": \\\"8\\\",\n \\\"name\\\":\\\"WordPress\\\",\n \\\"website\\\":\\\"https:\/\/wordpress.org\\\",\n \\\"initial_git_url\\\":\\\"git:\/\/github.com\/openshift\/wordpress-example.git\\\",\n \\\"cartridges\\\":[\\\"php-5.4\\\",\\\"mysql-5.1\\\"],\n \\\"summary\\\":\\\"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\\\",\n \\\"tags\\\":[\\\"php\\\",\\\"wordpress\\\",\\\"blog\\\",\\\"framework\\\",\\\"instant_app\\\"],\n \\\"admin_tags\\\":[]\n }}\n]\"\n\n(* Test: OpenShift_Quickstarts.lns *)\ntest OpenShift_Quickstarts.lns get conf =\n { \"array\"\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { \"entry\" = \"id\"\n { \"string\" = \"1\" }\n }\n { \"entry\" = \"name\"\n { \"string\" = \"CakePHP\" }\n }\n { \"entry\" = \"website\"\n { \"string\" = \"http:\/\/cakephp.org\/\" }\n }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/cakephp-example.git\" }\n }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"php-5.4\" }\n { \"string\" = \"mysql-5.1\" }\n }\n }\n { \"entry\" = \"summary\"\n { \"string\" = \"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\" }\n }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"php\" }\n { \"string\" = \"cakephp\" }\n { \"string\" = \"framework\" }\n }\n }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { \"entry\" = \"id\"\n { \"string\" = \"2\" }\n }\n { \"entry\" = \"name\"\n { \"string\" = \"Django\" }\n }\n { \"entry\" = \"website\"\n { \"string\" = \"https:\/\/www.djangoproject.com\/\" }\n }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/django-example.git\" }\n }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"python-2.7\" }\n }\n }\n { \"entry\" = \"summary\"\n { \"string\" = \"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\" }\n }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"python\" }\n { \"string\" = \"django\" }\n { \"string\" = \"framework\" }\n }\n }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { \"entry\" = \"id\"\n { \"string\" = \"4\" }\n }\n { \"entry\" = \"name\"\n { \"string\" = \"Drupal\" }\n }\n { \"entry\" = \"website\"\n { \"string\" = \"http:\/\/drupal.org\/\" }\n }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/drupal-example.git\" }\n }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"php-5.4\" }\n { \"string\" = \"mysql-5.1\" }\n }\n }\n { \"entry\" = \"summary\"\n { \"string\" = \"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\" }\n }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"php\" }\n { \"string\" = \"drupal\" }\n { \"string\" = \"wiki\" }\n { \"string\" = \"framework\" }\n { \"string\" = \"instant_app\" }\n }\n }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { \"entry\" = \"id\"\n { \"string\" = \"6\" }\n }\n { \"entry\" = \"name\"\n { \"string\" = \"Ruby on Rails\" }\n }\n { \"entry\" = \"website\"\n { \"string\" = \"http:\/\/rubyonrails.org\/\" }\n }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/rails-example.git\" }\n }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"ruby-1.9\" }\n { \"string\" = \"mysql-5.1\" }\n }\n }\n { \"entry\" = \"summary\"\n { \"string\" = \"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\" }\n }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"ruby\" }\n { \"string\" = \"rails\" }\n { \"string\" = \"framework\" }\n }\n }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n { \"dict\"\n { \"entry\" = \"quickstart\"\n { \"dict\"\n { \"entry\" = \"id\"\n { \"string\" = \"8\" }\n }\n { \"entry\" = \"name\"\n { \"string\" = \"WordPress\" }\n }\n { \"entry\" = \"website\"\n { \"string\" = \"http:\/\/wordpress.org\" }\n }\n { \"entry\" = \"initial_git_url\"\n { \"string\" = \"git:\/\/github.com\/openshift\/wordpress-example.git\" }\n }\n { \"entry\" = \"cartridges\"\n { \"array\"\n { \"string\" = \"php-5.4\" }\n { \"string\" = \"mysql-5.1\" }\n }\n }\n { \"entry\" = \"summary\"\n { \"string\" = \"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR\/CREDENTIALS.\" }\n }\n { \"entry\" = \"tags\"\n { \"array\"\n { \"string\" = \"php\" }\n { \"string\" = \"wordpress\" }\n { \"string\" = \"blog\" }\n { \"string\" = \"framework\" }\n { \"string\" = \"instant_app\" }\n }\n }\n { \"entry\" = \"admin_tags\"\n { \"array\" }\n }\n }\n }\n }\n}\n\n\n(* FIXME: not yet supported:\n * The manner in which the JSON utility lens currently works does not maintain\n * whitepsace as per the Augeas specification in the put direction.\n\ntest OpenShift_Quickstarts.lns put conf after set \"\/array\/dict[5]\/entry\/dict\/entry[3]\/string\" \"https:\/\/wordpress.org\"\n = new_conf *)\n\n(* vim: set ts=4 expandtab sw=4: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"dc9f4363941616183015990a3cb3503f71e41fa1","subject":"Inifile: allow single-character keys","message":"Inifile: allow single-character keys\n","repos":"hercules-team\/augeas,pevalme\/augeas,jjlin\/augeas,mchf\/augeas,mlichvar\/augeas,raphink\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,pevalme\/augeas,dafugg\/augeas,MikaelSmith\/augeas,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,jtopjian\/augeas,lutter\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,manandbytes\/augeas,ptoscano\/augeas,jasperla\/augeas,jjlin\/augeas,ptoscano\/augeas,raphink\/augeas,lutter\/augeas,pevalme\/augeas,dafugg\/augeas,kunkku\/augeas,jasperla\/augeas,kunkku\/augeas,manandbytes\/augeas,hercules-team\/augeas,kunkku\/augeas,mchf\/augeas","old_file":"lenses\/inifile.aug","new_file":"lenses\/inifile.aug","new_contents":"(*\nModule: IniFile\n Generic module to create INI files lenses\n\nAuthor: Raphael Pinson \n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: TODO\n Things to add in the future\n - Support double quotes in value\n\nAbout: Lens usage\n This lens is made to provide generic primitives to construct INI File lenses.\n See , , or for examples of real life lenses using it.\n\nAbout: Examples\n The file contains various examples and tests.\n*)\n\nmodule IniFile =\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Internal primitives *)\n\n(*\nVariable: eol\n End of line, inherited from \n*)\nlet eol = Util.doseol\n\n\n(* Group: Separators *)\n\n\n\n(*\nVariable: sep\n Generic separator\n\n Parameters:\n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep (pat:regexp) (default:string)\n = Sep.opt_space . del pat default\n\n(*\nVariable: sep_noindent\n Generic separator, no indentation\n\n Parameters:\n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep_noindent (pat:regexp) (default:string)\n = del pat default\n\n(*\nVariable: sep_re\n The default regexp for a separator\n*)\n\nlet sep_re = \/[=:]\/\n\n(*\nVariable: sep_default\n The default separator value\n*)\nlet sep_default = \"=\"\n\n\n(* Group: Stores *)\n\n\n(*\nVariable: sto_to_eol\n Store until end of line\n*)\nlet sto_to_eol = Sep.opt_space . store Rx.space_in\n\n(*\nVariable: to_comment_re\n Regex until comment\n*)\nlet to_comment_re = \/[^\";# \\t\\n][^\";#\\n]*[^\";# \\t\\n]|[^\";# \\t\\n]\/\n\n(*\nVariable: sto_to_comment\n Store until comment\n*)\nlet sto_to_comment = Sep.opt_space . store to_comment_re\n\n(*\nVariable: sto_multiline\n Store multiline values\n*)\nlet sto_multiline = Sep.opt_space\n . store (to_comment_re\n . (\/[ \\t]*\\n\/ . Rx.space . to_comment_re)*)\n\n(*\nVariable: sto_multiline_nocomment\n Store multiline values without an end-of-line comment\n*)\nlet sto_multiline_nocomment = Sep.opt_space\n . store (Rx.space_in . (\/[ \\t]*\\n\/ . Rx.space . Rx.space_in)*)\n\n\n(* Group: Define comment and defaults *)\n\n(*\nView: comment_noindent\n Map comments into \"#comment\" nodes,\n no indentation allowed\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment_noindent \"#\" \"#\"\n let comment = IniFile.comment_noindent IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment_noindent (pat:regexp) (default:string) =\n Util.comment_generic_seteol (pat . Rx.opt_space) default eol\n\n(*\nView: comment\n Map comments into \"#comment\" nodes\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment \"#\" \"#\"\n let comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment (pat:regexp) (default:string) =\n Util.comment_generic_seteol (Rx.opt_space . pat . Rx.opt_space) default eol\n\n(*\nVariable: comment_re\n Default regexp for pattern\n*)\n\nlet comment_re = \/[;#]\/\n\n(*\nVariable: comment_default\n Default value for pattern\n*)\nlet comment_default = \";\"\n\n(*\nView: empty_generic\n Empty line, including empty comments\n\n Parameters:\n indent:regexp - the indentation regexp\n comment_re:regexp - the comment separator regexp\n*)\nlet empty_generic (indent:regexp) (comment_re:regexp) =\n Util.empty_generic_dos (indent . comment_re? . Rx.opt_space)\n\n(*\nView: empty\n Empty line\n*)\nlet empty = empty_generic Rx.opt_space comment_re\n\n(*\nView: empty_noindent\n Empty line, without indentation\n*)\nlet empty_noindent = empty_generic \"\" comment_re\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Group: entry includes comments *)\n\n(*\nView: entry_generic_nocomment\n A very generic INI File entry, not including comments\n It allows to set the key lens (to set indentation\n or subnodes linked to the key) as well as the comment\n separator regexp, used to tune the store regexps.\n\n Parameters:\n kw:lens - lens to match the key, including optional indentation\n sep:lens - lens to use as key\/value separator\n comment_re:regexp - comment separator regexp\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry_generic (key \"setting\") sep IniFile.comment_re comment\n*)\nlet entry_generic_nocomment (kw:lens) (sep:lens)\n (comment_re:regexp) (comment:lens) =\n let bare_re_noquot = (\/[^\" \\t\\r\\n]\/ - comment_re)\n in let bare_re = (\/[^\\r\\n]\/ - comment_re)+\n in let no_quot = \/[^\"\\r\\n]*\/\n in let bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?))\n in let quoted = Quote.do_dquote (store (no_quot . comment_re+ . no_quot))\n in [ kw . sep . (Sep.opt_space . bare)? . (comment|eol) ]\n | [ kw . sep . Sep.opt_space . quoted . (comment|eol) ]\n\n(*\nView: entry_generic\n A very generic INI File entry\n It allows to set the key lens (to set indentation\n or subnodes linked to the key) as well as the comment\n separator regexp, used to tune the store regexps.\n\n Parameters:\n kw:lens - lens to match the key, including optional indentation\n sep:lens - lens to use as key\/value separator\n comment_re:regexp - comment separator regexp\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry_generic (key \"setting\") sep IniFile.comment_re comment\n*)\nlet entry_generic (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) =\n entry_generic_nocomment kw sep comment_re comment | comment\n\n(*\nView: entry\n Generic INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry setting sep comment\n*)\nlet entry (kw:regexp) (sep:lens) (comment:lens) =\n entry_generic (key kw) sep comment_re comment\n\n(*\nView: indented_entry\n Generic INI File entry that might be indented with an arbitrary\n amount of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.indented_entry setting sep comment\n*)\nlet indented_entry (kw:regexp) (sep:lens) (comment:lens) =\n entry_generic (Util.indent . key kw) sep comment_re comment\n\n(*\nView: entry_multiline_generic\n A very generic multiline INI File entry\n It allows to set the key lens (to set indentation\n or subnodes linked to the key) as well as the comment\n separator regexp, used to tune the store regexps.\n\n Parameters:\n kw:lens - lens to match the key, including optional indentation\n sep:lens - lens to use as key\/value separator\n comment_re:regexp - comment separator regexp\n comment:lens - lens to use as comment\n eol:lens - lens for end of line\n\n Sample Usage:\n > let entry = IniFile.entry_generic (key \"setting\") sep IniFile.comment_re comment comment_or_eol\n*)\nlet entry_multiline_generic (kw:lens) (sep:lens) (comment_re:regexp)\n (comment:lens) (eol:lens) =\n let newline = \/\\r?\\n[ \\t]+\/\n in let bare =\n let word_re_noquot = (\/[^\" \\t\\r\\n]\/ - comment_re)+\n in let word_re = (\/[^\\r\\n]\/ - comment_re)+\n in let base_re = (word_re_noquot . (word_re* . word_re_noquot)?)\n in let sto_re = base_re . (newline . base_re)*\n | (newline . base_re)+\n in Quote.do_dquote_opt_nil (store sto_re)\n in let quoted =\n let no_quot = \/[^\"\\r\\n]*\/\n in let base_re = (no_quot . comment_re+ . no_quot)\n in let sto_re = base_re . (newline . base_re)*\n | (newline . base_re)+\n in Quote.do_dquote (store sto_re)\n in [ kw . sep . (Sep.opt_space . bare)? . eol ]\n | [ kw . sep . Sep.opt_space . quoted . eol ]\n | comment\n \n\n(*\nView: entry_multiline\n Generic multiline INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n*)\nlet entry_multiline (kw:regexp) (sep:lens) (comment:lens) =\n entry_multiline_generic (key kw) sep comment_re comment (comment|eol)\n\n(*\nView: entry_multiline_nocomment\n Generic multiline INI File entry without an end-of-line comment\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n*)\nlet entry_multiline_nocomment (kw:regexp) (sep:lens) (comment:lens) =\n entry_multiline_generic (key kw) sep comment_re comment eol\n\n(*\nView: entry_list\n Generic INI File list entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n sto:regexp - store regexp for the values\n list_sep:lens - lens to use as list separator\n comment:lens - lens to use as comment\n*)\nlet entry_list (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) (comment:lens) =\n let list = counter \"elem\"\n . Build.opt_list [ seq \"elem\" . store sto ] list_sep\n in Build.key_value_line_comment kw sep (Sep.opt_space . list) comment\n\n(*\nView: entry_list_nocomment\n Generic INI File list entry without an end-of-line comment\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n sto:regexp - store regexp for the values\n list_sep:lens - lens to use as list separator\n*)\nlet entry_list_nocomment (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) =\n let list = counter \"elem\"\n . Build.opt_list [ seq \"elem\" . store sto ] list_sep\n in Build.key_value_line kw sep (Sep.opt_space . list)\n\n(*\nVariable: entry_re\n Default regexp for keyword\n*)\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9._-]*\/ )\n\n\n(************************************************************************\n * Group: RECORD\n *************************************************************************)\n\n(* Group: Title definition *)\n\n(*\nView: title\n Title for . This maps the title of a record as a node in the abstract tree.\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title\n Title for . This maps the title of a record as a node in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet indented_title (kw:regexp)\n = Util.indent . title kw\n\n(*\nView: title_label\n Title for . This maps the title of a record as a value in the abstract tree.\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title_label\n Title for . This maps the title of a record as a value in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet indented_title_label (name:string) (kw:regexp)\n = Util.indent . title_label name kw\n\n\n(*\nVariable: record_re\n Default regexp for keyword pattern\n*)\nlet record_re = ( \/[^]\\r\\n\\\/]+\/ - \/#comment\/ )\n\n(*\nVariable: record_label_re\n Default regexp for <title_label> keyword pattern\n*)\nlet record_label_re = \/[^]\\r\\n]+\/\n\n\n(* Group: Record definition *)\n\n(*\nView: record_noempty\n INI File Record with no empty lines allowed.\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n*)\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\n\n(*\nView: record\n Generic INI File record\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n\n Sample Usage:\n > let record = IniFile.record title entry\n*)\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\n\n\n(************************************************************************\n * Group: GENERIC LENSES\n *************************************************************************)\n\n\n(*\n\nGroup: Lens definition\n\nView: lns_noempty\n Generic INI File lens with no empty lines\n\n Parameters:\n record:lens - record lens to use. See <record_noempty>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns_noempty record comment\n*)\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\n\n(*\nView: lns\n Generic INI File lens\n\n Parameters:\n record:lens - record lens to use. See <record>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns record comment\n*)\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n(************************************************************************\n * Group: READY-TO-USE LENSES\n *************************************************************************)\n\nlet record_anon (entry:lens) = [ label \"section\" . value \".anon\" . ( entry | empty )+ ]\n\n(*\nView: lns_loose\n A loose, ready-to-use lens, featuring:\n - sections as values (to allow '\/' in names)\n - support empty lines and comments\n - support for [#;] as comment, defaulting to \";\"\n - .anon sections\n - don't allow multiline values\n - allow indented titles\n - allow indented entries\n*)\nlet lns_loose = \n let l_comment = comment comment_re comment_default\n in let l_sep = sep sep_re sep_default\n in let l_entry = indented_entry entry_re l_sep l_comment\n in let l_title = indented_title_label \"section\" (record_label_re - \".anon\")\n in let l_record = record l_title l_entry\n in (record_anon l_entry)? . l_record*\n\n(*\nView: lns_loose_multiline\n A loose, ready-to-use lens, featuring:\n - sections as values (to allow '\/' in names)\n - support empty lines and comments\n - support for [#;] as comment, defaulting to \";\"\n - .anon sections\n - allow multiline values\n*)\nlet lns_loose_multiline = \n let l_comment = comment comment_re comment_default\n in let l_sep = sep sep_re sep_default\n in let l_entry = entry_multiline entry_re l_sep l_comment\n in let l_title = title_label \"section\" (record_label_re - \".anon\")\n in let l_record = record l_title l_entry\n in (record_anon l_entry)? . l_record*\n\n","old_contents":"(*\nModule: IniFile\n Generic module to create INI files lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: TODO\n Things to add in the future\n - Support double quotes in value\n\nAbout: Lens usage\n This lens is made to provide generic primitives to construct INI File lenses.\n See <Puppet>, <PHP>, <MySQL> or <Dput> for examples of real life lenses using it.\n\nAbout: Examples\n The <Test_IniFile> file contains various examples and tests.\n*)\n\nmodule IniFile =\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Internal primitives *)\n\n(*\nVariable: eol\n End of line, inherited from <Util.eol>\n*)\nlet eol = Util.doseol\n\n\n(* Group: Separators *)\n\n\n\n(*\nVariable: sep\n Generic separator\n\n Parameters:\n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep (pat:regexp) (default:string)\n = Sep.opt_space . del pat default\n\n(*\nVariable: sep_noindent\n Generic separator, no indentation\n\n Parameters:\n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep_noindent (pat:regexp) (default:string)\n = del pat default\n\n(*\nVariable: sep_re\n The default regexp for a separator\n*)\n\nlet sep_re = \/[=:]\/\n\n(*\nVariable: sep_default\n The default separator value\n*)\nlet sep_default = \"=\"\n\n\n(* Group: Stores *)\n\n\n(*\nVariable: sto_to_eol\n Store until end of line\n*)\nlet sto_to_eol = Sep.opt_space . store Rx.space_in\n\n(*\nVariable: to_comment_re\n Regex until comment\n*)\nlet to_comment_re = \/[^\";# \\t\\n][^\";#\\n]*[^\";# \\t\\n]|[^\";# \\t\\n]\/\n\n(*\nVariable: sto_to_comment\n Store until comment\n*)\nlet sto_to_comment = Sep.opt_space . store to_comment_re\n\n(*\nVariable: sto_multiline\n Store multiline values\n*)\nlet sto_multiline = Sep.opt_space\n . store (to_comment_re\n . (\/[ \\t]*\\n\/ . Rx.space . to_comment_re)*)\n\n(*\nVariable: sto_multiline_nocomment\n Store multiline values without an end-of-line comment\n*)\nlet sto_multiline_nocomment = Sep.opt_space\n . store (Rx.space_in . (\/[ \\t]*\\n\/ . Rx.space . Rx.space_in)*)\n\n\n(* Group: Define comment and defaults *)\n\n(*\nView: comment_noindent\n Map comments into \"#comment\" nodes,\n no indentation allowed\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment_noindent \"#\" \"#\"\n let comment = IniFile.comment_noindent IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment_noindent (pat:regexp) (default:string) =\n Util.comment_generic_seteol (pat . Rx.opt_space) default eol\n\n(*\nView: comment\n Map comments into \"#comment\" nodes\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment \"#\" \"#\"\n let comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment (pat:regexp) (default:string) =\n Util.comment_generic_seteol (Rx.opt_space . pat . Rx.opt_space) default eol\n\n(*\nVariable: comment_re\n Default regexp for <comment> pattern\n*)\n\nlet comment_re = \/[;#]\/\n\n(*\nVariable: comment_default\n Default value for <comment> pattern\n*)\nlet comment_default = \";\"\n\n(*\nView: empty_generic\n Empty line, including empty comments\n\n Parameters:\n indent:regexp - the indentation regexp\n comment_re:regexp - the comment separator regexp\n*)\nlet empty_generic (indent:regexp) (comment_re:regexp) =\n Util.empty_generic_dos (indent . comment_re? . Rx.opt_space)\n\n(*\nView: empty\n Empty line\n*)\nlet empty = empty_generic Rx.opt_space comment_re\n\n(*\nView: empty_noindent\n Empty line, without indentation\n*)\nlet empty_noindent = empty_generic \"\" comment_re\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Group: entry includes comments *)\n\n(*\nView: entry_generic_nocomment\n A very generic INI File entry, not including comments\n It allows to set the key lens (to set indentation\n or subnodes linked to the key) as well as the comment\n separator regexp, used to tune the store regexps.\n\n Parameters:\n kw:lens - lens to match the key, including optional indentation\n sep:lens - lens to use as key\/value separator\n comment_re:regexp - comment separator regexp\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry_generic (key \"setting\") sep IniFile.comment_re comment\n*)\nlet entry_generic_nocomment (kw:lens) (sep:lens)\n (comment_re:regexp) (comment:lens) =\n let bare_re_noquot = (\/[^\" \\t\\r\\n]\/ - comment_re)\n in let bare_re = (\/[^\\r\\n]\/ - comment_re)+\n in let no_quot = \/[^\"\\r\\n]*\/\n in let bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?))\n in let quoted = Quote.do_dquote (store (no_quot . comment_re+ . no_quot))\n in [ kw . sep . (Sep.opt_space . bare)? . (comment|eol) ]\n | [ kw . sep . Sep.opt_space . quoted . (comment|eol) ]\n\n(*\nView: entry_generic\n A very generic INI File entry\n It allows to set the key lens (to set indentation\n or subnodes linked to the key) as well as the comment\n separator regexp, used to tune the store regexps.\n\n Parameters:\n kw:lens - lens to match the key, including optional indentation\n sep:lens - lens to use as key\/value separator\n comment_re:regexp - comment separator regexp\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry_generic (key \"setting\") sep IniFile.comment_re comment\n*)\nlet entry_generic (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) =\n entry_generic_nocomment kw sep comment_re comment | comment\n\n(*\nView: entry\n Generic INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry setting sep comment\n*)\nlet entry (kw:regexp) (sep:lens) (comment:lens) =\n entry_generic (key kw) sep comment_re comment\n\n(*\nView: indented_entry\n Generic INI File entry that might be indented with an arbitrary\n amount of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.indented_entry setting sep comment\n*)\nlet indented_entry (kw:regexp) (sep:lens) (comment:lens) =\n entry_generic (Util.indent . key kw) sep comment_re comment\n\n(*\nView: entry_multiline_generic\n A very generic multiline INI File entry\n It allows to set the key lens (to set indentation\n or subnodes linked to the key) as well as the comment\n separator regexp, used to tune the store regexps.\n\n Parameters:\n kw:lens - lens to match the key, including optional indentation\n sep:lens - lens to use as key\/value separator\n comment_re:regexp - comment separator regexp\n comment:lens - lens to use as comment\n eol:lens - lens for end of line\n\n Sample Usage:\n > let entry = IniFile.entry_generic (key \"setting\") sep IniFile.comment_re comment comment_or_eol\n*)\nlet entry_multiline_generic (kw:lens) (sep:lens) (comment_re:regexp)\n (comment:lens) (eol:lens) =\n let newline = \/\\r?\\n[ \\t]+\/\n in let bare =\n let word_re_noquot = (\/[^\" \\t\\r\\n]\/ - comment_re)+\n in let word_re = (\/[^\\r\\n]\/ - comment_re)+\n in let base_re = (word_re_noquot . (word_re* . word_re_noquot)?)\n in let sto_re = base_re . (newline . base_re)*\n | (newline . base_re)+\n in Quote.do_dquote_opt_nil (store sto_re)\n in let quoted =\n let no_quot = \/[^\"\\r\\n]*\/\n in let base_re = (no_quot . comment_re+ . no_quot)\n in let sto_re = base_re . (newline . base_re)*\n | (newline . base_re)+\n in Quote.do_dquote (store sto_re)\n in [ kw . sep . (Sep.opt_space . bare)? . eol ]\n | [ kw . sep . Sep.opt_space . quoted . eol ]\n | comment\n \n\n(*\nView: entry_multiline\n Generic multiline INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n*)\nlet entry_multiline (kw:regexp) (sep:lens) (comment:lens) =\n entry_multiline_generic (key kw) sep comment_re comment (comment|eol)\n\n(*\nView: entry_multiline_nocomment\n Generic multiline INI File entry without an end-of-line comment\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n*)\nlet entry_multiline_nocomment (kw:regexp) (sep:lens) (comment:lens) =\n entry_multiline_generic (key kw) sep comment_re comment eol\n\n(*\nView: entry_list\n Generic INI File list entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n sto:regexp - store regexp for the values\n list_sep:lens - lens to use as list separator\n comment:lens - lens to use as comment\n*)\nlet entry_list (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) (comment:lens) =\n let list = counter \"elem\"\n . Build.opt_list [ seq \"elem\" . store sto ] list_sep\n in Build.key_value_line_comment kw sep (Sep.opt_space . list) comment\n\n(*\nView: entry_list_nocomment\n Generic INI File list entry without an end-of-line comment\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n sto:regexp - store regexp for the values\n list_sep:lens - lens to use as list separator\n*)\nlet entry_list_nocomment (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) =\n let list = counter \"elem\"\n . Build.opt_list [ seq \"elem\" . store sto ] list_sep\n in Build.key_value_line kw sep (Sep.opt_space . list)\n\n(*\nVariable: entry_re\n Default regexp for <entry> keyword\n*)\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9._-]+\/ )\n\n\n(************************************************************************\n * Group: RECORD\n *************************************************************************)\n\n(* Group: Title definition *)\n\n(*\nView: title\n Title for <record>. This maps the title of a record as a node in the abstract tree.\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title\n Title for <record>. This maps the title of a record as a node in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet indented_title (kw:regexp)\n = Util.indent . title kw\n\n(*\nView: title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree.\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet indented_title_label (name:string) (kw:regexp)\n = Util.indent . title_label name kw\n\n\n(*\nVariable: record_re\n Default regexp for <title> keyword pattern\n*)\nlet record_re = ( \/[^]\\r\\n\\\/]+\/ - \/#comment\/ )\n\n(*\nVariable: record_label_re\n Default regexp for <title_label> keyword pattern\n*)\nlet record_label_re = \/[^]\\r\\n]+\/\n\n\n(* Group: Record definition *)\n\n(*\nView: record_noempty\n INI File Record with no empty lines allowed.\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n*)\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\n\n(*\nView: record\n Generic INI File record\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n\n Sample Usage:\n > let record = IniFile.record title entry\n*)\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\n\n\n(************************************************************************\n * Group: GENERIC LENSES\n *************************************************************************)\n\n\n(*\n\nGroup: Lens definition\n\nView: lns_noempty\n Generic INI File lens with no empty lines\n\n Parameters:\n record:lens - record lens to use. See <record_noempty>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns_noempty record comment\n*)\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\n\n(*\nView: lns\n Generic INI File lens\n\n Parameters:\n record:lens - record lens to use. See <record>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns record comment\n*)\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n(************************************************************************\n * Group: READY-TO-USE LENSES\n *************************************************************************)\n\nlet record_anon (entry:lens) = [ label \"section\" . value \".anon\" . ( entry | empty )+ ]\n\n(*\nView: lns_loose\n A loose, ready-to-use lens, featuring:\n - sections as values (to allow '\/' in names)\n - support empty lines and comments\n - support for [#;] as comment, defaulting to \";\"\n - .anon sections\n - don't allow multiline values\n - allow indented titles\n - allow indented entries\n*)\nlet lns_loose = \n let l_comment = comment comment_re comment_default\n in let l_sep = sep sep_re sep_default\n in let l_entry = indented_entry entry_re l_sep l_comment\n in let l_title = indented_title_label \"section\" (record_label_re - \".anon\")\n in let l_record = record l_title l_entry\n in (record_anon l_entry)? . l_record*\n\n(*\nView: lns_loose_multiline\n A loose, ready-to-use lens, featuring:\n - sections as values (to allow '\/' in names)\n - support empty lines and comments\n - support for [#;] as comment, defaulting to \";\"\n - .anon sections\n - allow multiline values\n*)\nlet lns_loose_multiline = \n let l_comment = comment comment_re comment_default\n in let l_sep = sep sep_re sep_default\n in let l_entry = entry_multiline entry_re l_sep l_comment\n in let l_title = title_label \"section\" (record_label_re - \".anon\")\n in let l_record = record l_title l_entry\n in (record_anon l_entry)? . l_record*\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"413b69eb4de6e25b07bb412a6093d629f9891c4f","subject":"Add \/etc\/profile and \/etc\/byobu to Shellvars.lns","message":"Add \/etc\/profile and \/etc\/byobu to Shellvars.lns\n","repos":"ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,mchf\/augeas,kunkku\/augeas,pevalme\/augeas,mchf\/augeas,mlichvar\/augeas,mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas,manandbytes\/augeas,ptoscano\/augeas,lutter\/augeas,lutter\/augeas,lutter\/augeas,manandbytes\/augeas,pevalme\/augeas,pevalme\/augeas,kunkku\/augeas,hercules-team\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"877a8b91b0c1bb1818fd8d7843610a83123ade48","subject":"On FreeBSD (at least) the sudoers file is in \/usr\/local\/etc\/.","message":"On FreeBSD (at least) the sudoers file is in \/usr\/local\/etc\/.\n","repos":"hercules-team\/augeas-do-not-use,dafugg\/augeas,dafugg\/augeas,hercules-team\/augeas,ptoscano\/augeas,jtopjian\/augeas,jasperla\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,pevalme\/augeas,jjlin\/augeas,ptoscano\/augeas,mchf\/augeas,kumy\/augeas,lutter\/augeas,manandbytes\/augeas,lutter\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,raphink\/augeas,lutter\/augeas,mlichvar\/augeas,jjlin\/augeas,jjlin\/augeas,domcleal\/augeas,hercules-team\/augeas,mchf\/augeas,manandbytes\/augeas,kumy\/augeas,domcleal\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,jasperla\/augeas,raphink\/augeas,mlichvar\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kunkku\/augeas,pevalme\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"038bfbf58976be238702a230f463f3814827560a","subject":"Add comment_c_style and comment_multiline Add empty_generic and make empty a call to it Add empty_c_style to complement comment_c_style","message":"Add comment_c_style and comment_multiline\nAdd empty_generic and make empty a call to it\nAdd empty_c_style to complement comment_c_style\n","repos":"jtopjian\/augeas,domcleal\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,lutter\/augeas,mchf\/augeas,raphink\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas,mlichvar\/augeas,dafugg\/augeas,dafugg\/augeas,jasperla\/augeas,kunkku\/augeas,mchf\/augeas,MikaelSmith\/augeas,lutter\/augeas,pevalme\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jjlin\/augeas,pevalme\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,domcleal\/augeas,manandbytes\/augeas,kumy\/augeas,raphink\/augeas,kunkku\/augeas,pevalme\/augeas,kumy\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,ptoscano\/augeas,kumy\/augeas,kunkku\/augeas,jjlin\/augeas,domcleal\/augeas,ptoscano\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol> *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*#?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline = \n let mline_re = (\/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\" \n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*[ \\t\\n]*\/ \"\/*\\n\"\n . counter \"mline\"\n . (mline . (eol . mline)*)\n . del \/[ \\t\\n]*\\*\\\/[ \\t]*\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style = \n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) = \n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style = \n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment and empty\n This is a general definition of comment and empty.\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol> *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*#?\\n\/ \"\\n\")\n\n(*\nView: empty\n Map empty lines, including empty comments\n*)\n let empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d6806d2883f6f114359720542e1f0874391b21db","subject":"Shellvars: use Util.eol for eol","message":"Shellvars: use Util.eol for eol\n","repos":"kunkku\/augeas,ptoscano\/augeas,camptocamp\/augeas,jtopjian\/augeas,pevalme\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,hercules-team\/augeas,mchf\/augeas,bkearney\/augeas,bkearney\/augeas,dafugg\/augeas,kunkku\/augeas,dafugg\/augeas,kumy\/augeas,lutter\/augeas,lutter\/augeas,kumy\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,dafugg\/augeas,camptocamp\/augeas,mlichvar\/augeas,mchf\/augeas,jasperla\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,raphink\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,jjlin\/augeas,manandbytes\/augeas,jasperla\/augeas,pevalme\/augeas,kumy\/augeas,bkearney\/augeas,mlichvar\/augeas,bkearney\/augeas,camptocamp\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,raphink\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,jtopjian\/augeas,domcleal\/augeas,ptoscano\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n let eq = Util.del_str \"=\"\n let comment = [ del \/(#.*)?[ \\t]*\\n\/ \"# \\n\" ]\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/ \n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \"(\" \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t]+\/ \" \" . seq \"values\" . array_value ] *\n . del \")\" \")\"\n \n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value = \n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | empty_array)\n\n let kv = [ key key_re . eq . (simple_value | array) . eol ]\n\n let source = \n [ \n del \/\\.|source\/ \".\" . label \".source\" . \n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol \n ]\n\n let lns = (comment | source | kv) *\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n let eq = Util.del_str \"=\"\n let comment = [ del \/(#.*)?[ \\t]*\\n\/ \"# \\n\" ]\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/ \n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \"(\" \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t]+\/ \" \" . seq \"values\" . array_value ] *\n . del \")\" \")\"\n \n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value = \n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | empty_array)\n\n let kv = [ key key_re . eq . (simple_value | array) . eol ]\n\n let source = \n [ \n del \/\\.|source\/ \".\" . label \".source\" . \n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol \n ]\n\n let lns = (comment | source | kv) *\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c0beaf3e48c2a06823a8f88e9bc321fa47be4f96","subject":"Add automount, netmasks and sendmailvars keywords for databases in nsswitch.aug","message":"Add automount, netmasks and sendmailvars keywords for databases in nsswitch.aug\n","repos":"mlichvar\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jtopjian\/augeas,mlichvar\/augeas,hercules-team\/augeas,lutter\/augeas,domcleal\/augeas,jtopjian\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,mchf\/augeas,hercules-team\/augeas,kumy\/augeas,manandbytes\/augeas,jjlin\/augeas,kumy\/augeas,MikaelSmith\/augeas,pevalme\/augeas,ptoscano\/augeas,dafugg\/augeas,lutter\/augeas,kunkku\/augeas,raphink\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,ptoscano\/augeas,domcleal\/augeas,dafugg\/augeas,mchf\/augeas,pevalme\/augeas,ptoscano\/augeas,jasperla\/augeas,domcleal\/augeas,lutter\/augeas,jasperla\/augeas,raphink\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jjlin\/augeas,kunkku\/augeas","old_file":"lenses\/nsswitch.aug","new_file":"lenses\/nsswitch.aug","new_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n let database_kw = \"aliases\"\n | \"automount\"\n | \"bootparams\"\n | \"ethers\"\n | \"group\"\n | \"hosts\"\n | \"netgroup\"\n | \"netmasks\"\n | \"networks\"\n | \"passwd\"\n | \"protocols\"\n | \"publickey\"\n | \"rpc\"\n | \"sendmailvars\"\n | \"services\"\n | \"shadow\"\n in [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n let database_kw = \"aliases\"\n | \"ethers\"\n | \"group\"\n | \"hosts\"\n | \"netgroup\"\n | \"networks\"\n | \"passwd\"\n | \"protocols\"\n | \"publickey\"\n | \"rpc\"\n | \"services\"\n | \"shadow\"\n | \"bootparams\"\n in [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"590f654ef2f965269a75cd53c98cc8824976f317","subject":"Debctrl (multi_line_entry): fix bad regexp","message":"Debctrl (multi_line_entry): fix bad regexp\n\nThe lens 'del \/^ \/ \" \"' is not valid, since we do not allow '^' as a meta\ncharacter. Changing that to 'del \/ \/ \" \"' exposed a typecheck problem in\nlns: both multi_line_entry and eol match blank lines. Fixed this by\nrequiring that a multi_line_entry has to have at least one non-blank\ncharacter.\n","repos":"jasperla\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,lutter\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,kunkku\/augeas,ptoscano\/augeas,jasperla\/augeas,mlichvar\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,domcleal\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jtopjian\/augeas,kumy\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,mchf\/augeas,dafugg\/augeas,pevalme\/augeas,dafugg\/augeas,mlichvar\/augeas,pevalme\/augeas,jjlin\/augeas,domcleal\/augeas,dafugg\/augeas,kumy\/augeas,lutter\/augeas,kumy\/augeas,jjlin\/augeas,manandbytes\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,domcleal\/augeas,manandbytes\/augeas,kunkku\/augeas,raphink\/augeas,kumy\/augeas,lutter\/augeas","old_file":"lenses\/debctrl.aug","new_file":"lenses\/debctrl.aug","new_contents":"(*\nModule: debctrl\n Parses .\/debian\/control\n\nAuthor:\n Dominique Dumont domi.dumont@free.fr or dominique.dumont@hp.com\n\nAbout: Reference\n http:\/\/augeas.net\/page\/Create_a_lens_from_bottom_to_top\n http:\/\/www.debian.org\/doc\/debian-policy\/ch-controlfields.html\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Since control file is not a system configuration file, you will have\n to use augtool -r option to point to 'debian' directory.\n\n Run augtool:\n $ augtool -r debian\n\n Sample usage of this lens in augtool:\n\n * Get the value stored in control file\n > print \/files\/control\n ...\n\n Saving your file:\n\n > save\n\n\n*)\n\nmodule Debctrl =\n autoload xfm\n\nlet eol = Util.eol\nlet del_ws_spc = del \/[\\t ]*\/ \" \"\nlet hardeol = del \/\\n\/ \"\\n\"\nlet del_opt_ws = del \/[\\t ]*\/ \"\"\nlet colon = del \/:[ \\t]*\/ \": \"\n\nlet simple_entry (k:regexp) =\n let value = store \/[^ \\t][^\\n]+\/ in\n [ key k . colon . value . hardeol ]\n\nlet cont_line = del \/\\n[ \\t]+\/ \"\\n \"\nlet comma = del \/,[ \\t]*\/ \", \"\n\nlet sep_comma_with_nl = del \/[ \\t\\n]*,[ \\t\\n]*\/ \",\\n \"\n (*= del_opt_ws . cont_line* . comma . cont_line**)\n\nlet email = store ( \/([A-Za-z]+ )+<[^\\n>]+>\/ | \/[^\\n,\\t<> ]+\/ )\n\nlet multi_line_array_entry (k:regexp) (v:lens) =\n [ key k . colon . [ counter \"array\" . seq \"array\" . v ] .\n [ seq \"array\" . sep_comma_with_nl . v ]* . hardeol ]\n\n(* dependency stuff *)\n\nlet version_depends =\n [ label \"version\"\n . [ del \/ *\\( *\/ \" ( \" . label \"relation\" . store \/[<>=]+\/ ]\n . [ del_ws_spc . label \"number\" . store \/[a-zA-Z0-9_\\.\\-]+\/\n . del \/ *\\)\/ \" )\" ]\n ]\n\nlet arch_depends =\n [ label \"arch\"\n . [ del \/ *\\[ *\/ \" [ \" . label \"prefix\" . store \/!?\/ ]\n . [ label \"name\" . store \/[a-zA-Z0-9_\\.\\-]+\/ . del \/ *\\]\/ \" ]\" ] ]\n\n\nlet package_depends\n = [ key ( \/[a-zA-Z0-9_\\-]+\/ | \/\\$\\{[a-zA-Z0-9:]+\\}\/ )\n . ( version_depends | arch_depends ) * ]\n\n\nlet dependency = [ label \"or\" . package_depends ]\n . [ label \"or\" . del \/ *\\| *\/ \" | \"\n . package_depends ] *\n\nlet dependency_list (field:regexp) =\n [ key field . colon . [ label \"and\" . dependency ]\n . [ label \"and\" . sep_comma_with_nl . dependency ]*\n . eol ]\n\n(* source package *)\nlet uploaders =\n multi_line_array_entry \/Uploaders\/ email\n\nlet simple_src_keyword = \"Source\" | \"Section\" | \"Priority\"\n | \"Standards\\-Version\" | \"Homepage\" | \/Vcs\\-Svn\/ | \/Vcs\\-Browser\/\n | \"Maintainer\"\nlet depend_src_keywords = \/Build\\-Depends\/ | \/Build\\-Depends\\-Indep\/\n\nlet src_entries = ( simple_entry simple_src_keyword\n | uploaders\n | dependency_list depend_src_keywords ) *\n\n\n(* package paragraph *)\n\nlet simple_bin_keyword = \"Package\" | \"Architecture\" | \"Section\"\n | \"Priority\" | \"Essential\" | \"Homepage\"\n\nlet simple_bin_entry = simple_entry simple_bin_keyword\n\nlet multi_line_entry (k:string) =\n let line = \/.*[^ \\t\\n].*\/ in\n [ label k . del \/ \/ \" \" . store line . hardeol ] *\n\n\nlet description\n = [ key \"Description\" . colon\n . [ label \"summary\" . store \/[a-zA-Z][^\\n]+\/ . hardeol ]\n . multi_line_entry \"text\" ]\n\n\n(* binary package *)\nlet simple_bin_keywords = \"Package\" | \"Architecture\"\nlet depend_bin_keywords = \"Depends\" | \"Recommends\" | \"Suggests\"\n\nlet bin_entries = ( simple_entry simple_bin_keywords\n | dependency_list depend_bin_keywords\n ) + . description\n\n(* The whole stuff *)\nlet lns = [ label \"srcpkg\" . src_entries ]\n . [ label \"binpkg\" . hardeol+ . bin_entries ]+\n . eol*\n\n(* lens must be used with AUG_ROOT set to debian package source directory *)\nlet xfm = transform lns (incl \"\/control\")\n","old_contents":"(*\nModule: debctrl\n Parses .\/debian\/control\n\nAuthor:\n Dominique Dumont domi.dumont@free.fr or dominique.dumont@hp.com\n\nAbout: Reference\n http:\/\/augeas.net\/page\/Create_a_lens_from_bottom_to_top\n http:\/\/www.debian.org\/doc\/debian-policy\/ch-controlfields.html\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Since control file is not a system configuration file, you will have\n to use augtool -r option to point to 'debian' directory.\n\n Run augtool:\n $ augtool -r debian\n\n Sample usage of this lens in augtool:\n\n * Get the value stored in control file\n > print \/files\/control\n ...\n\n Saving your file:\n\n > save\n\n\n*)\n\nmodule Debctrl =\n autoload xfm\n\nlet eol = Util.eol\nlet del_ws_spc = del \/[\\t ]*\/ \" \"\nlet hardeol = del \/\\n\/ \"\\n\"\nlet del_opt_ws = del \/[\\t ]*\/ \"\"\nlet colon = del \/:[ \\t]*\/ \": \"\n\nlet simple_entry (k:regexp) =\n let value = store \/[^ \\t][^\\n]+\/ in\n [ key k . colon . value . hardeol ]\n\nlet cont_line = del \/\\n[ \\t]+\/ \"\\n \"\nlet comma = del \/,[ \\t]*\/ \", \"\n\nlet sep_comma_with_nl = del \/[ \\t\\n]*,[ \\t\\n]*\/ \",\\n \"\n (*= del_opt_ws . cont_line* . comma . cont_line**)\n\nlet email = store ( \/([A-Za-z]+ )+<[^\\n>]+>\/ | \/[^\\n,\\t<> ]+\/ )\n\nlet multi_line_array_entry (k:regexp) (v:lens) =\n [ key k . colon . [ counter \"array\" . seq \"array\" . v ] .\n [ seq \"array\" . sep_comma_with_nl . v ]* . hardeol ]\n\n(* dependency stuff *)\n\nlet version_depends =\n [ label \"version\"\n . [ del \/ *\\( *\/ \" ( \" . label \"relation\" . store \/[<>=]+\/ ]\n . [ del_ws_spc . label \"number\" . store \/[a-zA-Z0-9_\\.\\-]+\/\n . del \/ *\\)\/ \" )\" ]\n ]\n\nlet arch_depends =\n [ label \"arch\"\n . [ del \/ *\\[ *\/ \" [ \" . label \"prefix\" . store \/!?\/ ]\n . [ label \"name\" . store \/[a-zA-Z0-9_\\.\\-]+\/ . del \/ *\\]\/ \" ]\" ] ]\n\n\nlet package_depends\n = [ key ( \/[a-zA-Z0-9_\\-]+\/ | \/\\$\\{[a-zA-Z0-9:]+\\}\/ )\n . ( version_depends | arch_depends ) * ]\n\n\nlet dependency = [ label \"or\" . package_depends ]\n . [ label \"or\" . del \/ *\\| *\/ \" | \"\n . package_depends ] *\n\nlet dependency_list (field:regexp) =\n [ key field . colon . [ label \"and\" . dependency ]\n . [ label \"and\" . sep_comma_with_nl . dependency ]*\n . eol ]\n\n(* source package *)\nlet uploaders =\n multi_line_array_entry \/Uploaders\/ email\n\nlet simple_src_keyword = \"Source\" | \"Section\" | \"Priority\"\n | \"Standards\\-Version\" | \"Homepage\" | \/Vcs\\-Svn\/ | \/Vcs\\-Browser\/\n | \"Maintainer\"\nlet depend_src_keywords = \/Build\\-Depends\/ | \/Build\\-Depends\\-Indep\/\n\nlet src_entries = ( simple_entry simple_src_keyword\n | uploaders\n | dependency_list depend_src_keywords ) *\n\n\n(* package paragraph *)\n\nlet simple_bin_keyword = \"Package\" | \"Architecture\" | \"Section\"\n | \"Priority\" | \"Essential\" | \"Homepage\"\n\nlet simple_bin_entry = simple_entry simple_bin_keyword\n\nlet multi_line_entry (k:string) =\n let line = \/[^\\n]+\/ in\n [ label k . del \/^ \/ \" \" . store line . hardeol ] *\n\n\nlet description\n = [ key \"Description\" . colon\n . [ label \"summary\" . store \/[a-zA-Z][^\\n]+\/ . hardeol ]\n . multi_line_entry \"text\" ]\n\n\n(* binary package *)\nlet simple_bin_keywords = \"Package\" | \"Architecture\"\nlet depend_bin_keywords = \"Depends\" | \"Recommends\" | \"Suggests\"\n\nlet bin_entries = ( simple_entry simple_bin_keywords\n | dependency_list depend_bin_keywords\n ) + . description\n\n(* The whole stuff *)\nlet lns = [ label \"srcpkg\" . src_entries ]\n . [ label \"binpkg\" . hardeol+ . bin_entries ]+\n . eol*\n\n(* lens must be used with AUG_ROOT set to debian package source directory *)\nlet xfm = transform lns (incl \"\/control\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e0bb98d7583aae163f4bf2d15728bc2e2da75845","subject":"\/etc\/sudoers.d is now supported (at least in Debian and Ubuntu)","message":"\/etc\/sudoers.d is now supported (at least in Debian and Ubuntu)\n","repos":"hercules-team\/augeas,ptoscano\/augeas,domcleal\/augeas,mchf\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,mlichvar\/augeas,jasperla\/augeas,hercules-team\/augeas,domcleal\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jtopjian\/augeas,jtopjian\/augeas,pevalme\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,raphink\/augeas,pevalme\/augeas,kumy\/augeas,ptoscano\/augeas,kumy\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,jjlin\/augeas,kunkku\/augeas,ptoscano\/augeas,jasperla\/augeas,kunkku\/augeas,manandbytes\/augeas,pevalme\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,lutter\/augeas,lutter\/augeas,mchf\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: paramater_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: paramater_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5b3e5dc691f7b7e894825c26a06296bf2bea5d01","subject":"* lenses\/tests\/test_iptables.aug: fix syntax error","message":"* lenses\/tests\/test_iptables.aug: fix syntax error\n","repos":"ptoscano\/augeas,raphink\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,jtopjian\/augeas,jjlin\/augeas,pevalme\/augeas,domcleal\/augeas,dafugg\/augeas,jjlin\/augeas,hercules-team\/augeas,kumy\/augeas,ptoscano\/augeas,manandbytes\/augeas,dafugg\/augeas,jasperla\/augeas,MikaelSmith\/augeas,jasperla\/augeas,kunkku\/augeas,jjlin\/augeas,jtopjian\/augeas,dafugg\/augeas,raphink\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,kumy\/augeas,kumy\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mchf\/augeas,domcleal\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,kunkku\/augeas,lutter\/augeas,mchf\/augeas,pevalme\/augeas,kumy\/augeas","old_file":"lenses\/tests\/test_iptables.aug","new_file":"lenses\/tests\/test_iptables.aug","new_contents":"module Test_iptables =\n\nlet add_rule = Iptables.table_rule\nlet ipt_match = Iptables.ipt_match\n\ntest add_rule get\n\"-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT\\n\" =\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"ESTABLISHED,RELATED\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n\"-A INPUT -p icmp -j \\tACCEPT \\n\" =\n { \"append\" = \"INPUT\"\n { \"protocol\" = \"icmp\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n\"-A INPUT -i lo -j ACCEPT\\n\" =\n { \"append\" = \"INPUT\"\n { \"in-interface\" = \"lo\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest ipt_match get \" -m tcp -p tcp --dport 53\" =\n { \"match\" = \"tcp\" } { \"protocol\" = \"tcp\" } { \"dport\" = \"53\" }\n\nlet arule = \" -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT\"\n\ntest add_rule get (\"--append INPUT\" . arule . \"\\n\") =\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"NEW\" }\n { \"match\" = \"tcp\" }\n { \"protocol\" = \"tcp\" }\n { \"dport\" = \"53\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest ipt_match get arule =\n { \"match\" = \"state\" } { \"state\" = \"NEW\" } { \"match\" = \"tcp\" }\n { \"protocol\" = \"tcp\" } { \"dport\" = \"53\" } { \"jump\" = \"ACCEPT\" }\n\ntest ipt_match get (\"-A INPUT\" . arule) = *\n\ntest ipt_match get \" -p esp -j ACCEPT\" =\n { \"protocol\" = \"esp\" } { \"jump\" = \"ACCEPT\" }\n\ntest ipt_match get\n \" -m state --state NEW -m udp -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT\"\n =\n { \"match\" = \"state\" } { \"state\" = \"NEW\" } { \"match\" = \"udp\" }\n { \"protocol\" = \"udp\" } { \"dport\" = \"5353\" }\n { \"destination\" = \"224.0.0.251\" } { \"jump\" = \"ACCEPT\" }\n\ntest add_rule get\n \"-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT\\n\" =\n { \"insert\" = \"FORWARD\"\n { \"match\" = \"physdev\" } { \"physdev-is-bridged\" } { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n \"-A INPUT -j REJECT --reject-with icmp-host-prohibited\\n\" =\n { \"append\" = \"INPUT\"\n { \"jump\" = \"REJECT\" } { \"reject-with\" = \"icmp-host-prohibited\" } }\n\ntest add_rule get\n \"-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT\\n\" =\n { \"append\" = \"RH-Firewall-1-INPUT\"\n { \"protocol\" = \"icmp\" }\n { \"icmp-type\" = \"any\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest Iptables.table get \"*filter\n:RH-Firewall-1-INPUT - [0:0]\n-A FORWARD -j RH-Firewall-1-INPUT\n-A RH-Firewall-1-INPUT -i lo -j ACCEPT\nCOMMIT\\n\" =\n { \"table\" = \"filter\"\n { \"chain\" = \"RH-Firewall-1-INPUT\"\n { \"policy\" = \"-\" } }\n { \"append\" = \"FORWARD\"\n { \"jump\" = \"RH-Firewall-1-INPUT\" } }\n { \"append\" = \"RH-Firewall-1-INPUT\"\n { \"in-interface\" = \"lo\" }\n { \"jump\" = \"ACCEPT\" } } }\n\nlet conf = \"# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*filter\n:INPUT DROP [1:229]\n:FORWARD DROP [0:0]\n:OUTPUT DROP [0:0]\n-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n-I FORWARD -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n# comments and blank lines are allow between rules\n\n-A FORWARD -i eth1 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT\n--append OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\n# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*mangle\n:PREROUTING ACCEPT [658:32445]\n\n:INPUT ACCEPT [658:32445]\n:FORWARD ACCEPT [0:0]\n:OUTPUT ACCEPT [891:68234]\n:POSTROUTING ACCEPT [891:68234]\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\n# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*nat\n:PREROUTING ACCEPT [1:229]\n:POSTROUTING ACCEPT [3:450]\n# The output chain\n:OUTPUT ACCEPT [3:450]\n# insert something\n--insert POSTROUTING -o eth0 -j SNAT --to-source 195.233.192.1 \\t\n# and now commit\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\\n\"\n\ntest Iptables.lns get conf =\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"filter\"\n { \"chain\" = \"INPUT\" { \"policy\" = \"DROP\" } }\n { \"chain\" = \"FORWARD\" { \"policy\" = \"DROP\" } }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"DROP\" } }\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n {}\n { \"insert\" = \"FORWARD\"\n { \"in-interface\" = \"eth0\" }\n { \"match\" = \"state\" }\n { \"state\" = \"RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n {}\n { \"#comment\" = \"comments and blank lines are allow between rules\" }\n {}\n { \"append\" = \"FORWARD\"\n { \"in-interface\" = \"eth1\" }\n { \"match\" = \"state\" }\n { \"state\" = \"NEW,RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n { \"append\" = \"OUTPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"NEW,RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"mangle\"\n { \"chain\" = \"PREROUTING\" { \"policy\" = \"ACCEPT\" } }\n {}\n { \"chain\" = \"INPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"FORWARD\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"POSTROUTING\" { \"policy\" = \"ACCEPT\" } } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"nat\"\n { \"chain\" = \"PREROUTING\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"POSTROUTING\" { \"policy\" = \"ACCEPT\" } }\n { \"#comment\" = \"The output chain\" }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"#comment\" = \"insert something\" }\n { \"insert\" = \"POSTROUTING\"\n { \"out-interface\" = \"eth0\" }\n { \"jump\" = \"SNAT\" }\n { \"to-source\" = \"195.233.192.1\" } }\n { \"#comment\" = \"and now commit\" } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n\ntest ipt_match get \" -m comment --comment \\\"A comment\\\"\" =\n { \"match\" = \"comment\" }\n { \"comment\" = \"\\\"A comment\\\"\" }\n\n(*\n * Test the various schemes for negation that iptables supports\n *\n * Note that the two ways in which a parameter can be negated lead to\n * two different trees that mean the same.\n *)\ntest add_rule get \"-I POSTROUTING ! -d 192.168.122.0\/24 -j MASQUERADE\\n\" =\n { \"insert\" = \"POSTROUTING\"\n { \"destination\" = \"192.168.122.0\/24\"\n { \"not\" } }\n { \"jump\" = \"MASQUERADE\" } }\n\ntest add_rule get \"-I POSTROUTING -d ! 192.168.122.0\/24 -j MASQUERADE\\n\" =\n { \"insert\" = \"POSTROUTING\"\n { \"destination\" = \"! 192.168.122.0\/24\" }\n { \"jump\" = \"MASQUERADE\" } }\n\ntest add_rule put \"-I POSTROUTING ! -d 192.168.122.0\/24 -j MASQUERADE\\n\"\n after rm \"\/insert\/destination\/not\" =\n \"-I POSTROUTING -d 192.168.122.0\/24 -j MASQUERADE\\n\"\n\n(* I have no idea if iptables will accept double negations, but we\n * allow it syntactically *)\ntest add_rule put \"-I POSTROUTING -d ! 192.168.122.0\/24 -j MASQUERADE\\n\"\n after clear \"\/insert\/destination\/not\" =\n \"-I POSTROUTING ! -d ! 192.168.122.0\/24 -j MASQUERADE\\n\"\n\ntest Iptables.chain get \":tcp_packets - [0:0]\n\" =\n { \"chain\" = \"tcp_packets\" { \"policy\" = \"-\" } }\n\n(* Bug #157 *)\ntest ipt_match get \" --tcp-flags SYN,RST,ACK,FIN SYN\" =\n { \"tcp-flags\"\n { \"mask\" = \"SYN\" }\n { \"mask\" = \"RST\" }\n { \"mask\" = \"ACK\" }\n { \"mask\" = \"FIN\" }\n { \"set\" = \"SYN\" } }\n\n(* Bug #224 *)\ntest ipt_match get \" --icmpv6-type neighbor-solicitation\" =\n { \"icmpv6-type\" = \"neighbor-solicitation\" }\n","old_contents":"module Test_iptables =\n\nlet add_rule = Iptables.table_rule\nlet ipt_match = Iptables.ipt_match\n\ntest add_rule get\n\"-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT\\n\" =\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"ESTABLISHED,RELATED\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n\"-A INPUT -p icmp -j \\tACCEPT \\n\" =\n { \"append\" = \"INPUT\"\n { \"protocol\" = \"icmp\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n\"-A INPUT -i lo -j ACCEPT\\n\" =\n { \"append\" = \"INPUT\"\n { \"in-interface\" = \"lo\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest ipt_match get \" -m tcp -p tcp --dport 53\" =\n { \"match\" = \"tcp\" } { \"protocol\" = \"tcp\" } { \"dport\" = \"53\" }\n\nlet arule = \" -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT\"\n\ntest add_rule get (\"--append INPUT\" . arule . \"\\n\") =\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"NEW\" }\n { \"match\" = \"tcp\" }\n { \"protocol\" = \"tcp\" }\n { \"dport\" = \"53\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest ipt_match get arule =\n { \"match\" = \"state\" } { \"state\" = \"NEW\" } { \"match\" = \"tcp\" }\n { \"protocol\" = \"tcp\" } { \"dport\" = \"53\" } { \"jump\" = \"ACCEPT\" }\n\ntest ipt_match get (\"-A INPUT\" . arule) = *\n\ntest ipt_match get \" -p esp -j ACCEPT\" =\n { \"protocol\" = \"esp\" } { \"jump\" = \"ACCEPT\" }\n\ntest ipt_match get\n \" -m state --state NEW -m udp -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT\"\n =\n { \"match\" = \"state\" } { \"state\" = \"NEW\" } { \"match\" = \"udp\" }\n { \"protocol\" = \"udp\" } { \"dport\" = \"5353\" }\n { \"destination\" = \"224.0.0.251\" } { \"jump\" = \"ACCEPT\" }\n\ntest add_rule get\n \"-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT\\n\" =\n { \"insert\" = \"FORWARD\"\n { \"match\" = \"physdev\" } { \"physdev-is-bridged\" } { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n \"-A INPUT -j REJECT --reject-with icmp-host-prohibited\\n\" =\n { \"append\" = \"INPUT\"\n { \"jump\" = \"REJECT\" } { \"reject-with\" = \"icmp-host-prohibited\" } }\n\ntest add_rule get\n \"-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT\\n\" =\n { \"append\" = \"RH-Firewall-1-INPUT\"\n { \"protocol\" = \"icmp\" }\n { \"icmp-type\" = \"any\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest Iptables.table get \"*filter\n:RH-Firewall-1-INPUT - [0:0]\n-A FORWARD -j RH-Firewall-1-INPUT\n-A RH-Firewall-1-INPUT -i lo -j ACCEPT\nCOMMIT\\n\" =\n { \"table\" = \"filter\"\n { \"chain\" = \"RH-Firewall-1-INPUT\"\n { \"policy\" = \"-\" } }\n { \"append\" = \"FORWARD\"\n { \"jump\" = \"RH-Firewall-1-INPUT\" } }\n { \"append\" = \"RH-Firewall-1-INPUT\"\n { \"in-interface\" = \"lo\" }\n { \"jump\" = \"ACCEPT\" } } }\n\nlet conf = \"# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*filter\n:INPUT DROP [1:229]\n:FORWARD DROP [0:0]\n:OUTPUT DROP [0:0]\n-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n-I FORWARD -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n# comments and blank lines are allow between rules\n\n-A FORWARD -i eth1 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT\n--append OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\n# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*mangle\n:PREROUTING ACCEPT [658:32445]\n\n:INPUT ACCEPT [658:32445]\n:FORWARD ACCEPT [0:0]\n:OUTPUT ACCEPT [891:68234]\n:POSTROUTING ACCEPT [891:68234]\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\n# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*nat\n:PREROUTING ACCEPT [1:229]\n:POSTROUTING ACCEPT [3:450]\n# The output chain\n:OUTPUT ACCEPT [3:450]\n# insert something\n--insert POSTROUTING -o eth0 -j SNAT --to-source 195.233.192.1 \\t\n# and now commit\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\\n\"\n\ntest Iptables.lns get conf =\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"filter\"\n { \"chain\" = \"INPUT\" { \"policy\" = \"DROP\" } }\n { \"chain\" = \"FORWARD\" { \"policy\" = \"DROP\" } }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"DROP\" } }\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n {}\n { \"insert\" = \"FORWARD\"\n { \"in-interface\" = \"eth0\" }\n { \"match\" = \"state\" }\n { \"state\" = \"RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n {}\n { \"#comment\" = \"comments and blank lines are allow between rules\" }\n {}\n { \"append\" = \"FORWARD\"\n { \"in-interface\" = \"eth1\" }\n { \"match\" = \"state\" }\n { \"state\" = \"NEW,RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n { \"append\" = \"OUTPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"NEW,RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"mangle\"\n { \"chain\" = \"PREROUTING\" { \"policy\" = \"ACCEPT\" } }\n {}\n { \"chain\" = \"INPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"FORWARD\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"POSTROUTING\" { \"policy\" = \"ACCEPT\" } } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"nat\"\n { \"chain\" = \"PREROUTING\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"POSTROUTING\" { \"policy\" = \"ACCEPT\" } }\n { \"#comment\" = \"The output chain\" }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"#comment\" = \"insert something\" }\n { \"insert\" = \"POSTROUTING\"\n { \"out-interface\" = \"eth0\" }\n { \"jump\" = \"SNAT\" }\n { \"to-source\" = \"195.233.192.1\" } }\n { \"#comment\" = \"and now commit\" } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n\ntest ipt_match get \" -m comment --comment \\\"A comment\\\"\" =\n { \"match\" = \"comment\" }\n { \"comment\" = \"\\\"A comment\\\"\" }\n\n(*\n * Test the various schemes for negation that iptables supports\n *\n * Note that the two ways in which a parameter can be negated lead to\n * two different trees that mean the same.\n *)\ntest add_rule get \"-I POSTROUTING ! -d 192.168.122.0\/24 -j MASQUERADE\\n\" =\n { \"insert\" = \"POSTROUTING\"\n { \"destination\" = \"192.168.122.0\/24\"\n { \"not\" } }\n { \"jump\" = \"MASQUERADE\" } }\n\ntest add_rule get \"-I POSTROUTING -d ! 192.168.122.0\/24 -j MASQUERADE\\n\" =\n { \"insert\" = \"POSTROUTING\"\n { \"destination\" = \"! 192.168.122.0\/24\" }\n { \"jump\" = \"MASQUERADE\" } }\n\ntest add_rule put \"-I POSTROUTING ! -d 192.168.122.0\/24 -j MASQUERADE\\n\"\n after rm \"\/insert\/destination\/not\" =\n \"-I POSTROUTING -d 192.168.122.0\/24 -j MASQUERADE\\n\"\n\n(* I have no idea if iptables will accept double negations, but we\n * allow it syntactically *)\ntest add_rule put \"-I POSTROUTING -d ! 192.168.122.0\/24 -j MASQUERADE\\n\"\n after clear \"\/insert\/destination\/not\" =\n \"-I POSTROUTING ! -d ! 192.168.122.0\/24 -j MASQUERADE\\n\"\n\ntest Iptables.chain get \":tcp_packets - [0:0]\n\" = \n { \"chain\" = \"tcp_packets\" { \"policy\" = \"-\" } }\n\n(* Bug #157 *)\ntest ipt_match get \" --tcp-flags SYN,RST,ACK,FIN SYN\" =\n { \"tcp-flags\"\n { \"mask\" = \"SYN\" }\n { \"mask\" = \"RST\" }\n { \"mask\" = \"ACK\" }\n { \"mask\" = \"FIN\" }\n { \"set\" = \"SYN\" } }\n\n(* Bug #224 *)\ntest ipt_match get \" --icmpv6-type neighbor-solicitation\" = ?\n { \"icmpv6-type\" = \"neighbor-solicitation\" }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6fffd52fc5163a67072186b39cba3c89d9bfaf98","subject":"adding network configuration paths according to 'systemd.network(5)' (#683)","message":"adding network configuration paths according to 'systemd.network(5)' (#683)\n\nCo-authored-by: Mario R\u00fctti <436bc265f5db72f3ed4bff03b8806de2ed381384@kraemerag.ch>\r\nCo-authored-by: Rapha\u00ebl Pinson <0909132c360f4744d45149034acd6a9d36df8f8f@camptocamp.com>","repos":"hercules-team\/augeas,mlichvar\/augeas,hercules-team\/augeas,mlichvar\/augeas,mlichvar\/augeas","old_file":"lenses\/systemd.aug","new_file":"lenses\/systemd.aug","new_contents":"(*\nModule: Systemd\n Parses systemd unit files.\n\nAuthor: Dominic Cleal <dcleal@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to systemd.unit(5) and\n systemd.service(5) etc where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/lib\/systemd\/system\/* and \/etc\/systemd\/system\/*.\n See <filter>.\n*)\n\nmodule Systemd =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: eol_comment\n An <IniFile.comment> entry for standalone comment lines (; or #) *)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\n(* View: eol_comment\n An <IniFile.comment> entry for end of line comments (# only) *)\nlet eol_comment = IniFile.comment \"#\" \"#\"\n\n(* View: sep\n An <IniFile.sep> entry *)\nlet sep = IniFile.sep \"=\" \"=\"\n\n(* Variable: entry_single_kw *)\nlet entry_single_kw = \"Description\"\n\n(* Variable: entry_command_kw *)\nlet entry_command_kw = \/Exec[A-Za-z][A-Za-z0-9._-]+\/\n\n(* Variable: entry_env_kw *)\nlet entry_env_kw = \"Environment\"\n\n(* Variable: entry_multi_kw *)\nlet entry_multi_kw =\n let forbidden = entry_single_kw | entry_command_kw | entry_env_kw\n in \/[A-Za-z][A-Za-z0-9._-]+\/ - forbidden\n\n(* Variable: value_single_re *)\nlet value_single_re = \/[^# \\t\\n\\\\][^#\\n\\\\]*[^# \\t\\n\\\\]|[^# \\t\\n\\\\]\/\n\n(* View: sto_value_single\n Support multiline values with a backslash *)\nlet sto_value_single = Util.del_opt_ws \"\"\n . store (value_single_re\n . (\/\\\\\\\\\\n\/ . value_single_re)*)\n\n(* View: sto_value *)\nlet sto_value = store \/[^# \\t\\n]*[^# \\t\\n\\\\]\/\n\n(* Variable: value_sep\n Multi-value entries separated by whitespace or backslash and newline *)\nlet value_sep = del \/[ \\t]+|[ \\t]*\\\\\\\\[ \\t]*\\n[ \\t]*\/ \" \"\n\n(* Variable: value_cmd_re\n Don't parse @ and - prefix flags *)\nlet value_cmd_re = \/[^#@ \\t\\n\\\\-][^#@ \\t\\n\\\\-][^# \\t\\n\\\\]*\/\n\n(* Variable: env_key *)\nlet env_key = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n(*\nSupported entry features, selected by key names:\n * multi-value space separated attrs (the default)\n * single-value attrs (Description)\n * systemd.service: Exec* attrs with flags, command and arguments\n * systemd.service: Environment NAME=arg\n*)\n\n(* View: entry_fn\n Prototype for our various key=value lines, with optional comment *)\nlet entry_fn (kw:regexp) (val:lens) =\n [ key kw . sep . val . (eol_comment|eol) ]\n\n(* View: entry_value\n Store a value that doesn't contain spaces *)\nlet entry_value = [ label \"value\" . sto_value ]\n\n(* View: entry_single\n Entry that takes a single value containing spaces *)\nlet entry_single = entry_fn entry_single_kw\n [ label \"value\" . sto_value_single ]?\n\n(* View: entry_command\n Entry that takes a space separated set of values (the default) *)\nlet entry_multi = entry_fn entry_multi_kw\n ( Util.del_opt_ws \"\"\n . Build.opt_list entry_value value_sep )?\n\n(* View: entry_command_flags\n Exec* flags \"@\" and \"-\". Order is important, see systemd.service(8) *)\nlet entry_command_flags =\n let exit = [ label \"ignoreexit\" . Util.del_str \"-\" ]\n in let arg0 = [ label \"arg0\" . Util.del_str \"@\" ]\n in exit? . arg0?\n\n(* View: entry_command\n Entry that takes a command, arguments and the optional prefix flags *)\nlet entry_command =\n let cmd = [ label \"command\" . store value_cmd_re ]\n in let arg = [ seq \"args\" . sto_value ]\n in let args = [ counter \"args\" . label \"arguments\"\n . (value_sep . arg)+ ]\n in entry_fn entry_command_kw ( entry_command_flags . cmd . args? )?\n\n(* View: entry_env\n Entry that takes a space separated set of ENV=value key\/value pairs *)\nlet entry_env =\n let envkv (env_val:lens) = key env_key . Util.del_str \"=\" . env_val\n (* bare has no spaces, and is optionally quoted *)\n in let bare = Quote.do_quote_opt (envkv (store \/[^#'\" \\t\\n]*[^#'\" \\t\\n\\\\]\/)?)\n in let bare_dqval = envkv (store \/\"[^#\"\\t\\n]*[^#\"\\t\\n\\\\]\"\/)\n in let bare_sqval = envkv (store \/'[^#'\\t\\n]*[^#'\\t\\n\\\\]'\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_quote (envkv (store \/[^#\"'\\n]*[ \\t]+[^#\"'\\n]*\/))\n in let envkv_quoted = [ bare ] | [ bare_dqval ] | [ bare_sqval ] | [ quoted ]\n in entry_fn entry_env_kw ( Build.opt_list envkv_quoted value_sep )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n(* View: entry\n An <IniFile.entry> *)\nlet entry = entry_single | entry_multi | entry_command | entry_env | comment\n\n(* View: include\n Includes another file at this position *)\nlet include = [ key \".include\" . Util.del_ws_spc . sto_value\n . (eol_comment|eol) ]\n\n(* View: title\n An <IniFile.title> *)\nlet title = IniFile.title IniFile.record_re\n\n(* View: record\n An <IniFile.record> *)\nlet record = IniFile.record title (entry|include)\n\n(* View: lns\n An <IniFile.lns> *)\nlet lns = IniFile.lns record (comment|include)\n\n(* View: filter *)\nlet filter = incl \"\/lib\/systemd\/system\/*\"\n . incl \"\/lib\/systemd\/system\/*\/*\"\n . incl \"\/etc\/systemd\/system\/*\"\n . incl \"\/etc\/systemd\/system\/*\/*\"\n . incl \"\/etc\/systemd\/logind.conf\"\n . incl \"\/etc\/sysconfig\/*.systemd\"\n . incl \"\/lib\/systemd\/network\/*\"\n . incl \"\/usr\/local\/lib\/systemd\/network\/*\"\n . incl \"\/etc\/systemd\/network\/*\"\n . excl \"\/lib\/systemd\/system\/*.d\"\n . excl \"\/etc\/systemd\/system\/*.d\"\n . excl \"\/lib\/systemd\/system\/*.wants\"\n . excl \"\/etc\/systemd\/system\/*.wants\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Systemd\n Parses systemd unit files.\n\nAuthor: Dominic Cleal <dcleal@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to systemd.unit(5) and\n systemd.service(5) etc where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/lib\/systemd\/system\/* and \/etc\/systemd\/system\/*.\n See <filter>.\n*)\n\nmodule Systemd =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: eol_comment\n An <IniFile.comment> entry for standalone comment lines (; or #) *)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\n(* View: eol_comment\n An <IniFile.comment> entry for end of line comments (# only) *)\nlet eol_comment = IniFile.comment \"#\" \"#\"\n\n(* View: sep\n An <IniFile.sep> entry *)\nlet sep = IniFile.sep \"=\" \"=\"\n\n(* Variable: entry_single_kw *)\nlet entry_single_kw = \"Description\"\n\n(* Variable: entry_command_kw *)\nlet entry_command_kw = \/Exec[A-Za-z][A-Za-z0-9._-]+\/\n\n(* Variable: entry_env_kw *)\nlet entry_env_kw = \"Environment\"\n\n(* Variable: entry_multi_kw *)\nlet entry_multi_kw =\n let forbidden = entry_single_kw | entry_command_kw | entry_env_kw\n in \/[A-Za-z][A-Za-z0-9._-]+\/ - forbidden\n\n(* Variable: value_single_re *)\nlet value_single_re = \/[^# \\t\\n\\\\][^#\\n\\\\]*[^# \\t\\n\\\\]|[^# \\t\\n\\\\]\/\n\n(* View: sto_value_single\n Support multiline values with a backslash *)\nlet sto_value_single = Util.del_opt_ws \"\"\n . store (value_single_re\n . (\/\\\\\\\\\\n\/ . value_single_re)*)\n\n(* View: sto_value *)\nlet sto_value = store \/[^# \\t\\n]*[^# \\t\\n\\\\]\/\n\n(* Variable: value_sep\n Multi-value entries separated by whitespace or backslash and newline *)\nlet value_sep = del \/[ \\t]+|[ \\t]*\\\\\\\\[ \\t]*\\n[ \\t]*\/ \" \"\n\n(* Variable: value_cmd_re\n Don't parse @ and - prefix flags *)\nlet value_cmd_re = \/[^#@ \\t\\n\\\\-][^#@ \\t\\n\\\\-][^# \\t\\n\\\\]*\/\n\n(* Variable: env_key *)\nlet env_key = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n(*\nSupported entry features, selected by key names:\n * multi-value space separated attrs (the default)\n * single-value attrs (Description)\n * systemd.service: Exec* attrs with flags, command and arguments\n * systemd.service: Environment NAME=arg\n*)\n\n(* View: entry_fn\n Prototype for our various key=value lines, with optional comment *)\nlet entry_fn (kw:regexp) (val:lens) =\n [ key kw . sep . val . (eol_comment|eol) ]\n\n(* View: entry_value\n Store a value that doesn't contain spaces *)\nlet entry_value = [ label \"value\" . sto_value ]\n\n(* View: entry_single\n Entry that takes a single value containing spaces *)\nlet entry_single = entry_fn entry_single_kw\n [ label \"value\" . sto_value_single ]?\n\n(* View: entry_command\n Entry that takes a space separated set of values (the default) *)\nlet entry_multi = entry_fn entry_multi_kw\n ( Util.del_opt_ws \"\"\n . Build.opt_list entry_value value_sep )?\n\n(* View: entry_command_flags\n Exec* flags \"@\" and \"-\". Order is important, see systemd.service(8) *)\nlet entry_command_flags =\n let exit = [ label \"ignoreexit\" . Util.del_str \"-\" ]\n in let arg0 = [ label \"arg0\" . Util.del_str \"@\" ]\n in exit? . arg0?\n\n(* View: entry_command\n Entry that takes a command, arguments and the optional prefix flags *)\nlet entry_command =\n let cmd = [ label \"command\" . store value_cmd_re ]\n in let arg = [ seq \"args\" . sto_value ]\n in let args = [ counter \"args\" . label \"arguments\"\n . (value_sep . arg)+ ]\n in entry_fn entry_command_kw ( entry_command_flags . cmd . args? )?\n\n(* View: entry_env\n Entry that takes a space separated set of ENV=value key\/value pairs *)\nlet entry_env =\n let envkv (env_val:lens) = key env_key . Util.del_str \"=\" . env_val\n (* bare has no spaces, and is optionally quoted *)\n in let bare = Quote.do_quote_opt (envkv (store \/[^#'\" \\t\\n]*[^#'\" \\t\\n\\\\]\/)?)\n in let bare_dqval = envkv (store \/\"[^#\"\\t\\n]*[^#\"\\t\\n\\\\]\"\/)\n in let bare_sqval = envkv (store \/'[^#'\\t\\n]*[^#'\\t\\n\\\\]'\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_quote (envkv (store \/[^#\"'\\n]*[ \\t]+[^#\"'\\n]*\/))\n in let envkv_quoted = [ bare ] | [ bare_dqval ] | [ bare_sqval ] | [ quoted ]\n in entry_fn entry_env_kw ( Build.opt_list envkv_quoted value_sep )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n(* View: entry\n An <IniFile.entry> *)\nlet entry = entry_single | entry_multi | entry_command | entry_env | comment\n\n(* View: include\n Includes another file at this position *)\nlet include = [ key \".include\" . Util.del_ws_spc . sto_value\n . (eol_comment|eol) ]\n\n(* View: title\n An <IniFile.title> *)\nlet title = IniFile.title IniFile.record_re\n\n(* View: record\n An <IniFile.record> *)\nlet record = IniFile.record title (entry|include)\n\n(* View: lns\n An <IniFile.lns> *)\nlet lns = IniFile.lns record (comment|include)\n\n(* View: filter *)\nlet filter = incl \"\/lib\/systemd\/system\/*\"\n . incl \"\/lib\/systemd\/system\/*\/*\"\n . incl \"\/etc\/systemd\/system\/*\"\n . incl \"\/etc\/systemd\/system\/*\/*\"\n . incl \"\/etc\/systemd\/logind.conf\"\n . incl \"\/etc\/sysconfig\/*.systemd\"\n . excl \"\/lib\/systemd\/system\/*.d\"\n . excl \"\/etc\/systemd\/system\/*.d\"\n . excl \"\/lib\/systemd\/system\/*.wants\"\n . excl \"\/etc\/systemd\/system\/*.wants\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b1d835b47b02370aa97ba83e17b466f89db01143","subject":"Pam: Use eol, indent, comment and empty from Util","message":"Pam: Use eol, indent, comment and empty from Util\n","repos":"hercules-team\/augeas-do-not-use,domcleal\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,mchf\/augeas,mlichvar\/augeas,jtopjian\/augeas,ptoscano\/augeas,ptoscano\/augeas,bkearney\/augeas,jasperla\/augeas,camptocamp\/augeas,kunkku\/augeas,jjlin\/augeas,lutter\/augeas,raphink\/augeas,manandbytes\/augeas,pevalme\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,dafugg\/augeas,manandbytes\/augeas,lutter\/augeas,pevalme\/augeas,raphink\/augeas,ptoscano\/augeas,bkearney\/augeas,camptocamp\/augeas,kumy\/augeas,jjlin\/augeas,bkearney\/augeas,mlichvar\/augeas,camptocamp\/augeas,hercules-team\/augeas,mchf\/augeas,MikaelSmith\/augeas,jasperla\/augeas,jtopjian\/augeas,bkearney\/augeas,kumy\/augeas,dafugg\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,kumy\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,domcleal\/augeas,camptocamp\/augeas,kunkku\/augeas,kumy\/augeas,domcleal\/augeas","old_file":"lenses\/pam.aug","new_file":"lenses\/pam.aug","new_contents":"(* Proces \/etc\/pam.d *)\nmodule Pam =\n autoload xfm\n\n let eol = Util.eol\n let indent = Util.indent\n\n (* For the control syntax of [key=value ..] we could split the key value *)\n (* pairs into an array and generate a subtree control\/N\/KEY = VALUE *)\n let control = \/(\\[[^]#\\n]*\\]|[^[ \\t][^ \\t]*)\/\n let word = \/[^# \\t\\n]+\/\n (* Allowed types. FIXME: Should be case insensitive *)\n let types = \/(auth|session|account|password)\/\n\n (* This isn't entirely right: arguments enclosed in [ .. ] are allowed *)\n (* and should be parsed as one *)\n let argument = \/[^#\\n \\t]+\/\n\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Not mentioned in the man page, but Debian uses the syntax *)\n (* @include module *)\n (* quite a bit *)\n let include = [ indent . Util.del_str \"@\" . key \"include\" . \n Util.del_ws_spc . store word . eol ]\n\n let record = [ seq \"record\" . indent .\n [ label \"type\" . store types ] .\n Util.del_ws_tab .\n [ label \"control\" . store control] .\n Util.del_ws_tab .\n [ label \"module\" . store word ] .\n [ Util.del_ws_tab . label \"argument\" . store argument ]* .\n\t\t (comment|eol)\n ]\n let lns = ( empty | comment | include | record ) *\n\n let xfm = transform lns ((incl \"\/etc\/pam.d\/*\") . Util.stdexcl)\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Proces \/etc\/pam.d *)\nmodule Pam =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let indent = del \/[ \\t]*\/ \"\"\n\n (* For the control syntax of [key=value ..] we could split the key value *)\n (* pairs into an array and generate a subtree control\/N\/KEY = VALUE *)\n let control = \/(\\[[^]#\\n]*\\]|[^[ \\t][^ \\t]*)\/\n let word = \/[^# \\t\\n]+\/\n (* Allowed types. FIXME: Should be case insensitive *)\n let types = \/(auth|session|account|password)\/\n\n (* This isn't entirely right: arguments enclosed in [ .. ] are allowed *)\n (* and should be parsed as one *)\n let argument = \/[^#\\n \\t]+\/\n\n let comment = [ indent . label \"comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n let empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\" ]\n\n\n (* Not mentioned in the man page, but Debian uses the syntax *)\n (* @include module *)\n (* quite a bit *)\n let include = [ indent . Util.del_str \"@\" . key \"include\" . \n Util.del_ws_spc . store word . eol ]\n\n let record = [ seq \"record\" . indent .\n [ label \"type\" . store types ] .\n Util.del_ws_tab .\n [ label \"control\" . store control] .\n Util.del_ws_tab .\n [ label \"module\" . store word ] .\n [ Util.del_ws_tab . label \"argument\" . store argument ]* .\n\t\t (comment|eol)\n ]\n let lns = ( empty | comment | include | record ) *\n\n let xfm = transform lns ((incl \"\/etc\/pam.d\/*\") . Util.stdexcl)\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c3c70504dd4499f90128a48338ec5cdcadbb6ce9","subject":"Known_Hosts: fix description","message":"Known_Hosts: fix description\n","repos":"jjlin\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,lutter\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas,mlichvar\/augeas,mlichvar\/augeas,dafugg\/augeas,lutter\/augeas,jtopjian\/augeas,hercules-team\/augeas,jtopjian\/augeas,mchf\/augeas,kunkku\/augeas,jjlin\/augeas,hercules-team\/augeas,pevalme\/augeas,ptoscano\/augeas,mchf\/augeas,dafugg\/augeas,dafugg\/augeas,pevalme\/augeas,kunkku\/augeas,manandbytes\/augeas,jjlin\/augeas,ptoscano\/augeas,kunkku\/augeas,manandbytes\/augeas","old_file":"lenses\/known_hosts.aug","new_file":"lenses\/known_hosts.aug","new_contents":"(*\nModule: Known_Hosts\n Parses SSH known_hosts files\n\nAuthor: Rapha\u00ebl Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens manages OpenSSH's known_hosts files. See `man 8 sshd` for reference.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get a key by name from ssh_known_hosts\n > print \/files\/etc\/ssh_known_hosts\/*[.=\"foo.example.com\"]\n ...\n\n * Change a host's key\n > set \/files\/etc\/ssh_known_hosts\/*[.=\"foo.example.com\"]\/key \"newkey\"\n\nAbout: Configuration files\n This lens applies to SSH known_hosts files. See <filter>.\n\n*)\n\nmodule Known_Hosts =\n\nautoload xfm\n\n(* View: entry\n A known_hosts entry *)\nlet entry =\n let alias = [ label \"alias\" . store Rx.neg1 ]\n in [ Util.indent . seq \"entry\" . store Rx.neg1\n . (Sep.comma . Build.opt_list alias Sep.comma)?\n . Sep.space\n . [ label \"type\" . store Rx.no_spaces ]\n . Sep.space\n . [ label \"key\" . store Rx.no_spaces ]\n . Util.eol ]\n\n(* View: lns\n The known_hosts lens *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/ssh\/ssh_known_hosts\"\n . incl (Sys.getenv(\"HOME\") . \"\/.ssh\/known_hosts\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Known_Hosts\n Parses SSH known_hosts files\n\nAuthor: Rapha\u00ebl Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens ensures that conf files included in ActiveMQ \/FuseMQ are properly\n handled by Augeas.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get a key by name from ssh_known_hosts\n > print \/files\/etc\/ssh_known_hosts\/*[.=\"foo.example.com\"]\n ...\n\n * Change a host's key\n > set \/files\/etc\/ssh_known_hosts\/*[.=\"foo.example.com\"]\/key \"newkey\"\n\nAbout: Configuration files\n This lens applies to SSH known_hosts files. See <filter>.\n\n*)\n\nmodule Known_Hosts =\n\nautoload xfm\n\n(* View: entry\n A known_hosts entry *)\nlet entry =\n let alias = [ label \"alias\" . store Rx.neg1 ]\n in [ Util.indent . seq \"entry\" . store Rx.neg1\n . (Sep.comma . Build.opt_list alias Sep.comma)?\n . Sep.space\n . [ label \"type\" . store Rx.no_spaces ]\n . Sep.space\n . [ label \"key\" . store Rx.no_spaces ]\n . Util.eol ]\n\n(* View: lns\n The known_hosts lens *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/ssh\/ssh_known_hosts\"\n . incl (Sys.getenv(\"HOME\") . \"\/.ssh\/known_hosts\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"69eb611785da41d540b75b37ca92fecd5406d67e","subject":"Shellvars: fix syntax error in filter","message":"Shellvars: fix syntax error in filter\n","repos":"manandbytes\/augeas,raphink\/augeas,dafugg\/augeas,raphink\/augeas,jjlin\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas,hercules-team\/augeas,mchf\/augeas,ptoscano\/augeas,pevalme\/augeas,dafugg\/augeas,kunkku\/augeas,jtopjian\/augeas,kunkku\/augeas,MikaelSmith\/augeas,dafugg\/augeas,jjlin\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,mchf\/augeas,jjlin\/augeas,mlichvar\/augeas,jasperla\/augeas,mlichvar\/augeas,lutter\/augeas,lutter\/augeas,jasperla\/augeas,hercules-team\/augeas,manandbytes\/augeas,ptoscano\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | (dquot | squot)+ | bquot | dbquot | dollar_assign) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | (dquot | squot)+ | bquot | dbquot | dollar_assign) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\",\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"59d5c537fe4ada10c0f1806716656ee6392f651c","subject":"mdadm.aug: dev_device cannot match dev_partitions_re","message":"mdadm.aug: dev_device cannot match dev_partitions_re\n","repos":"ptoscano\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,jasperla\/augeas,kunkku\/augeas,hercules-team\/augeas,jtopjian\/augeas,mlichvar\/augeas,mlichvar\/augeas,jtopjian\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,ptoscano\/augeas,kumy\/augeas,mchf\/augeas,raphink\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas,kunkku\/augeas,kunkku\/augeas,mchf\/augeas,MikaelSmith\/augeas,dafugg\/augeas,pevalme\/augeas,ptoscano\/augeas,domcleal\/augeas,manandbytes\/augeas,kumy\/augeas,pevalme\/augeas,kumy\/augeas,kumy\/augeas,dafugg\/augeas,lutter\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jasperla\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,jjlin\/augeas","old_file":"lenses\/mdadm_conf.aug","new_file":"lenses\/mdadm_conf.aug","new_contents":"(******************************************************************************\nMdadm_conf module for Augeas\n\nAuthor: Matthew Booth <mbooth@redhat.com>\n\nCopyright (C):\n 2011 Red Hat Inc.\n\nReference:\n mdadm(5)\n config.c and policy.c from mdadm-3.2.2\n\nLicense:\n This file is licensed under the LGPLv2+.\n\nThis is a lens for \/etc\/mdadm.conf. It aims to parse every valid configuration\nfile as of version 3.2.2, and many invalid ones too. This last point is a\nfeature, not a bug! madm will generate warnings for invalid configuration which\ndo not prevent correct operation of the tool. Wherever possible, we try to\nallow for this behaviour.\n\nKeywords in mdadm.conf are matched with a case-insensitive prefix match of at\nleast 3 characters. Keys in key\/value pairs are also matched case-insensitively,\nbut require a full match. The exception is POLICY and PART-POLICY, where keys\nare matched case-sensitively.\n\nN.B. We can't use case-insensitive regular expressions in most places due to bug\n#147.\n*******************************************************************************)\n\nmodule Mdadm_conf =\n\n autoload xfm\n\n\n(******************************************************************************\n * PRIMITIVES\n ******************************************************************************)\n\nlet eol = Util.comment_or_eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet value = \/[^ \\t\\n#]+\/\nlet value_no_eq = \/[^ \\t\\n#=]+\/\nlet value_no_eq_sl = \/[^ \\t\\n#=\\\/]+\/\n\nlet continuation = \/\\n[ \\t]+\/\nlet space = \/[ \\t]+\/\nlet value_sep = ( del ( continuation | space . continuation? ) \" \"\n | comment . del space \" \" )\n\n(* We parse specific keys rather than having a catch-all owing to the varying\ncase of the syntax. This means the user can rely on 'array\/uuid' rather than\nadditionally testing for 'array\/UUID'.\n\nIt would be good to have an additional catchall, but I haven't been able to make\nthat work.\n*)\nlet keyvalue (r:regexp) (lc:string) (uc:string) =\n [ del ( r . \/=\/ ) ( uc . \"=\" ) . label lc . store value ]\n\nlet simplevalue (r:regexp) (lc:string) (uc:string) =\n [ del r uc . label lc\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * DEVICES\n ******************************************************************************)\n\nlet dev_re = \/dev(i(ce?)?)?\/i\n\nlet dev_containers_re = \/containers\/i\nlet dev_partitions_re = \/partitions\/i\n\nlet dev_containers = [ del dev_containers_re \"containers\" . label \"containers\" ]\nlet dev_partitions = [ del dev_partitions_re \"partitions\" . label \"partitions\" ]\nlet dev_device = [ label \"name\". store ( value - dev_containers_re - dev_partitions_re) ]\n\n(* Strictly there must be at least 1 device, but we err on the side of parsing\n*)\nlet dev_devices = ( value_sep . ( dev_containers\n | dev_partitions\n | dev_device ) )*\n\nlet device = [ del dev_re \"DEVICE\" . label \"device\" . dev_devices . eol ]\n\n\n(******************************************************************************\n * ARRAY\n ******************************************************************************)\n\nlet array_re = \/arr(ay?)?\/i\n\nlet arr_auto_re = \/auto\/i\nlet arr_bitmap_re = \/bitmap\/i\nlet arr_container_re = \/container\/i\nlet arr_devices_re = \/devices\/i\nlet arr_disks_re = \/disks\/i (* Undocumented *)\nlet arr_level_re = \/level\/i\nlet arr_member_re = \/member\/i\nlet arr_metadata_re = \/metadata\/i\nlet arr_name_re = \/name\/i\nlet arr_num_devices_re = \/num-devices\/i\nlet arr_spare_group_re = \/spare-group\/i\nlet arr_spares_re = \/spares\/i\nlet arr_super_minor_re = \/super-minor\/i\nlet arr_uuid_re = \/uuid\/i\n\nlet arr_devicename = [ store value_no_eq . label \"devicename\" ]\n\nlet arr_auto = keyvalue arr_auto_re \"auto\" \"AUTO\"\nlet arr_bitmap = keyvalue arr_bitmap_re \"bitmap\" \"BITMAP\"\nlet arr_container = keyvalue arr_container_re \"container\" \"CONTAINER\"\nlet arr_devices = keyvalue arr_devices_re \"devices\" \"DEVICES\"\nlet arr_disks = keyvalue arr_disks_re \"disks\" \"DISKS\"\nlet arr_level = keyvalue arr_level_re \"level\" \"LEVEL\"\nlet arr_member = keyvalue arr_member_re \"member\" \"MEMBER\"\nlet arr_metadata = keyvalue arr_metadata_re \"metadata\" \"METADATA\"\nlet arr_name = keyvalue arr_name_re \"name\" \"NAME\"\nlet arr_num_devices = keyvalue arr_num_devices_re \"num-devices\" \"NUM-DEVICES\"\nlet arr_spare_group = keyvalue arr_spare_group_re \"spare-group\" \"SPARE-GROUP\"\nlet arr_spares = keyvalue arr_spares_re \"spares\" \"SPARES\"\nlet arr_super_minor = keyvalue arr_super_minor_re \"super-minor\" \"SUPER-MINOR\"\nlet arr_uuid = keyvalue arr_uuid_re \"uuid\" \"UUID\"\n\nlet arr_options = ( value_sep . ( arr_devicename\n | arr_auto\n | arr_bitmap\n | arr_container\n | arr_devices\n | arr_disks\n | arr_level\n | arr_member\n | arr_metadata\n | arr_name\n | arr_num_devices\n | arr_spare_group\n | arr_spares\n | arr_super_minor\n | arr_uuid ) )*\n\nlet array = [ del array_re \"ARRAY\" . label \"array\" . arr_options . eol ]\n\n\n(******************************************************************************\n * MAILADDR\n ******************************************************************************)\n\nlet mailaddr_re = \/mai(l(a(d(dr?)?)?)?)?\/i\n\n(* We intentially allow multiple mailaddr values here, even though this is\ninvalid and would produce a warning. This is better than not parsing the file.\n*)\nlet mailaddr = simplevalue mailaddr_re \"mailaddr\" \"MAILADDR\"\n\n\n(******************************************************************************\n * MAILFROM\n ******************************************************************************)\n\n(* N.B. MAILFROM can only be abbreviated to 5 characters *)\nlet mailfrom_re = \/mailf(r(om?)?)?\/i\n\nlet mailfrom = [ del mailfrom_re \"MAILFROM\" . label \"mailfrom\"\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * PROGRAM\n ******************************************************************************)\n\nlet program_re = \/pro(g(r(am?)?)?)?\/i\n\nlet program = simplevalue program_re \"program\" \"PROGRAM\"\n\n\n(******************************************************************************\n * CREATE\n ******************************************************************************)\n\nlet create_re = \/cre(a(te?)?)?\/i\n\nlet cre_auto_re = \/auto\/i\nlet cre_owner_re = \/owner\/i\nlet cre_group_re = \/group\/i\nlet cre_mode_re = \/mode\/i\nlet cre_metadata_re = \/metadata\/i\nlet cre_symlinks_re = \/symlinks\/i\n\nlet cre_auto = keyvalue cre_auto_re \"auto\" \"AUTO\"\nlet cre_group = keyvalue cre_group_re \"group\" \"GROUP\"\nlet cre_metadata = keyvalue cre_metadata_re \"metadata\" \"METADATA\"\nlet cre_mode = keyvalue cre_mode_re \"mode\" \"MODE\"\nlet cre_owner = keyvalue cre_owner_re \"owner\" \"OWNER\"\nlet cre_symlinks = keyvalue cre_symlinks_re \"symlinks\" \"SYMLINKS\"\n\nlet cre_options = ( value_sep . ( arr_auto\n | cre_owner\n | cre_group\n | cre_mode\n | cre_metadata\n | cre_symlinks) )*\n\nlet create = [ del create_re \"CREATE\" . label \"create\" . cre_options . eol ]\n\n\n(******************************************************************************\n * HOMEHOST\n ******************************************************************************)\n\nlet homehost_re = \/hom(e(h(o(st?)?)?)?)?\/i\n\nlet homehost = simplevalue homehost_re \"homehost\" \"HOMEHOST\"\n\n\n(******************************************************************************\n * AUTO\n ******************************************************************************)\n\nlet auto_re = \/auto?\/i\n\nlet aut_plus = [ key \"+\" . store value ]\nlet aut_minus = [ key \"-\" . store value ]\nlet aut_homehost = [ del \/homehost\/i \"homehost\" . label \"homehost\" ]\n\nlet aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )*\n\nlet auto = [ del auto_re \"AUTO\" . label \"auto\" . aut_list . eol ]\n\n\n(******************************************************************************\n * POLICY and PART-POLICY\n ******************************************************************************)\n\n(* PART-POLICY is undocumented. A cursory inspection of the parsing code\nsuggests it's parsed the same way as POLICY, but treated slightly differently\nthereafter. *)\n\nlet policy_re = \/pol(i(cy?)?)?\/i\nlet part_policy_re = \/par(t(-(p(o(l(i(cy?)?)?)?)?)?)?)?\/i\n\n(* Unlike everything else, policy keys are matched case sensitive. This means we\ndon't have to mess around with explicit option matching, as the match string is\nfixed for a working configuration. *)\n\nlet pol_option (act:string) =\n [ del ( act . \"=\" ) ( act . \"=\" ) . label act . store value ]\n\nlet pol_options = ( value_sep . [ key value_no_eq_sl . del \"=\" \"=\"\n . store value ] )*\n\nlet policy = [ del policy_re \"POLICY\" . label \"policy\"\n . pol_options . eol ]\nlet part_policy = [ del part_policy_re \"PART-POLICY\" . label \"part-policy\"\n . pol_options . eol ]\n\n\n(******************************************************************************\n * LENS\n ******************************************************************************)\n\nlet lns = (comment\n | empty\n | device\n | array\n | mailaddr\n | mailfrom\n | program\n | create\n | homehost\n | auto\n | policy\n | part_policy )*\n\nlet filter = incl \"\/etc\/mdadm.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(******************************************************************************\nMdadm_conf module for Augeas\n\nAuthor: Matthew Booth <mbooth@redhat.com>\n\nCopyright (C):\n 2011 Red Hat Inc.\n\nReference:\n mdadm(5)\n config.c and policy.c from mdadm-3.2.2\n\nLicense:\n This file is licensed under the LGPLv2+.\n\nThis is a lens for \/etc\/mdadm.conf. It aims to parse every valid configuration\nfile as of version 3.2.2, and many invalid ones too. This last point is a\nfeature, not a bug! madm will generate warnings for invalid configuration which\ndo not prevent correct operation of the tool. Wherever possible, we try to\nallow for this behaviour.\n\nKeywords in mdadm.conf are matched with a case-insensitive prefix match of at\nleast 3 characters. Keys in key\/value pairs are also matched case-insensitively,\nbut require a full match. The exception is POLICY and PART-POLICY, where keys\nare matched case-sensitively.\n\nN.B. We can't use case-insensitive regular expressions in most places due to bug\n#147.\n*******************************************************************************)\n\nmodule Mdadm_conf =\n\n autoload xfm\n\n\n(******************************************************************************\n * PRIMITIVES\n ******************************************************************************)\n\nlet eol = Util.comment_or_eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet value = \/[^ \\t\\n#]+\/\nlet value_no_eq = \/[^ \\t\\n#=]+\/\nlet value_no_eq_sl = \/[^ \\t\\n#=\\\/]+\/\n\nlet continuation = \/\\n[ \\t]+\/\nlet space = \/[ \\t]+\/\nlet value_sep = ( del ( continuation | space . continuation? ) \" \"\n | comment . del space \" \" )\n\n(* We parse specific keys rather than having a catch-all owing to the varying\ncase of the syntax. This means the user can rely on 'array\/uuid' rather than\nadditionally testing for 'array\/UUID'.\n\nIt would be good to have an additional catchall, but I haven't been able to make\nthat work.\n*)\nlet keyvalue (r:regexp) (lc:string) (uc:string) =\n [ del ( r . \/=\/ ) ( uc . \"=\" ) . label lc . store value ]\n\nlet simplevalue (r:regexp) (lc:string) (uc:string) =\n [ del r uc . label lc\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * DEVICES\n ******************************************************************************)\n\nlet dev_re = \/dev(i(ce?)?)?\/i\n\nlet dev_containers_re = \/containers\/i\nlet dev_partitions_re = \/partitions\/i\n\nlet dev_containers = [ del dev_containers_re \"containers\" . label \"containers\" ]\nlet dev_partitions = [ del dev_partitions_re \"partitions\" . label \"partitions\" ]\nlet dev_device = [ label \"name\". store ( value - dev_containers_re) ]\n\n(* Strictly there must be at least 1 device, but we err on the side of parsing\n*)\nlet dev_devices = ( value_sep . ( dev_containers\n | dev_partitions\n | dev_device ) )*\n\nlet device = [ del dev_re \"DEVICE\" . label \"device\" . dev_devices . eol ]\n\n\n(******************************************************************************\n * ARRAY\n ******************************************************************************)\n\nlet array_re = \/arr(ay?)?\/i\n\nlet arr_auto_re = \/auto\/i\nlet arr_bitmap_re = \/bitmap\/i\nlet arr_container_re = \/container\/i\nlet arr_devices_re = \/devices\/i\nlet arr_disks_re = \/disks\/i (* Undocumented *)\nlet arr_level_re = \/level\/i\nlet arr_member_re = \/member\/i\nlet arr_metadata_re = \/metadata\/i\nlet arr_name_re = \/name\/i\nlet arr_num_devices_re = \/num-devices\/i\nlet arr_spare_group_re = \/spare-group\/i\nlet arr_spares_re = \/spares\/i\nlet arr_super_minor_re = \/super-minor\/i\nlet arr_uuid_re = \/uuid\/i\n\nlet arr_devicename = [ store value_no_eq . label \"devicename\" ]\n\nlet arr_auto = keyvalue arr_auto_re \"auto\" \"AUTO\"\nlet arr_bitmap = keyvalue arr_bitmap_re \"bitmap\" \"BITMAP\"\nlet arr_container = keyvalue arr_container_re \"container\" \"CONTAINER\"\nlet arr_devices = keyvalue arr_devices_re \"devices\" \"DEVICES\"\nlet arr_disks = keyvalue arr_disks_re \"disks\" \"DISKS\"\nlet arr_level = keyvalue arr_level_re \"level\" \"LEVEL\"\nlet arr_member = keyvalue arr_member_re \"member\" \"MEMBER\"\nlet arr_metadata = keyvalue arr_metadata_re \"metadata\" \"METADATA\"\nlet arr_name = keyvalue arr_name_re \"name\" \"NAME\"\nlet arr_num_devices = keyvalue arr_num_devices_re \"num-devices\" \"NUM-DEVICES\"\nlet arr_spare_group = keyvalue arr_spare_group_re \"spare-group\" \"SPARE-GROUP\"\nlet arr_spares = keyvalue arr_spares_re \"spares\" \"SPARES\"\nlet arr_super_minor = keyvalue arr_super_minor_re \"super-minor\" \"SUPER-MINOR\"\nlet arr_uuid = keyvalue arr_uuid_re \"uuid\" \"UUID\"\n\nlet arr_options = ( value_sep . ( arr_devicename\n | arr_auto\n | arr_bitmap\n | arr_container\n | arr_devices\n | arr_disks\n | arr_level\n | arr_member\n | arr_metadata\n | arr_name\n | arr_num_devices\n | arr_spare_group\n | arr_spares\n | arr_super_minor\n | arr_uuid ) )*\n\nlet array = [ del array_re \"ARRAY\" . label \"array\" . arr_options . eol ]\n\n\n(******************************************************************************\n * MAILADDR\n ******************************************************************************)\n\nlet mailaddr_re = \/mai(l(a(d(dr?)?)?)?)?\/i\n\n(* We intentially allow multiple mailaddr values here, even though this is\ninvalid and would produce a warning. This is better than not parsing the file.\n*)\nlet mailaddr = simplevalue mailaddr_re \"mailaddr\" \"MAILADDR\"\n\n\n(******************************************************************************\n * MAILFROM\n ******************************************************************************)\n\n(* N.B. MAILFROM can only be abbreviated to 5 characters *)\nlet mailfrom_re = \/mailf(r(om?)?)?\/i\n\nlet mailfrom = [ del mailfrom_re \"MAILFROM\" . label \"mailfrom\"\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * PROGRAM\n ******************************************************************************)\n\nlet program_re = \/pro(g(r(am?)?)?)?\/i\n\nlet program = simplevalue program_re \"program\" \"PROGRAM\"\n\n\n(******************************************************************************\n * CREATE\n ******************************************************************************)\n\nlet create_re = \/cre(a(te?)?)?\/i\n\nlet cre_auto_re = \/auto\/i\nlet cre_owner_re = \/owner\/i\nlet cre_group_re = \/group\/i\nlet cre_mode_re = \/mode\/i\nlet cre_metadata_re = \/metadata\/i\nlet cre_symlinks_re = \/symlinks\/i\n\nlet cre_auto = keyvalue cre_auto_re \"auto\" \"AUTO\"\nlet cre_group = keyvalue cre_group_re \"group\" \"GROUP\"\nlet cre_metadata = keyvalue cre_metadata_re \"metadata\" \"METADATA\"\nlet cre_mode = keyvalue cre_mode_re \"mode\" \"MODE\"\nlet cre_owner = keyvalue cre_owner_re \"owner\" \"OWNER\"\nlet cre_symlinks = keyvalue cre_symlinks_re \"symlinks\" \"SYMLINKS\"\n\nlet cre_options = ( value_sep . ( arr_auto\n | cre_owner\n | cre_group\n | cre_mode\n | cre_metadata\n | cre_symlinks) )*\n\nlet create = [ del create_re \"CREATE\" . label \"create\" . cre_options . eol ]\n\n\n(******************************************************************************\n * HOMEHOST\n ******************************************************************************)\n\nlet homehost_re = \/hom(e(h(o(st?)?)?)?)?\/i\n\nlet homehost = simplevalue homehost_re \"homehost\" \"HOMEHOST\"\n\n\n(******************************************************************************\n * AUTO\n ******************************************************************************)\n\nlet auto_re = \/auto?\/i\n\nlet aut_plus = [ key \"+\" . store value ]\nlet aut_minus = [ key \"-\" . store value ]\nlet aut_homehost = [ del \/homehost\/i \"homehost\" . label \"homehost\" ]\n\nlet aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )*\n\nlet auto = [ del auto_re \"AUTO\" . label \"auto\" . aut_list . eol ]\n\n\n(******************************************************************************\n * POLICY and PART-POLICY\n ******************************************************************************)\n\n(* PART-POLICY is undocumented. A cursory inspection of the parsing code\nsuggests it's parsed the same way as POLICY, but treated slightly differently\nthereafter. *)\n\nlet policy_re = \/pol(i(cy?)?)?\/i\nlet part_policy_re = \/par(t(-(p(o(l(i(cy?)?)?)?)?)?)?)?\/i\n\n(* Unlike everything else, policy keys are matched case sensitive. This means we\ndon't have to mess around with explicit option matching, as the match string is\nfixed for a working configuration. *)\n\nlet pol_option (act:string) =\n [ del ( act . \"=\" ) ( act . \"=\" ) . label act . store value ]\n\nlet pol_options = ( value_sep . [ key value_no_eq_sl . del \"=\" \"=\"\n . store value ] )*\n\nlet policy = [ del policy_re \"POLICY\" . label \"policy\"\n . pol_options . eol ]\nlet part_policy = [ del part_policy_re \"PART-POLICY\" . label \"part-policy\"\n . pol_options . eol ]\n\n\n(******************************************************************************\n * LENS\n ******************************************************************************)\n\nlet lns = (comment\n | empty\n | device\n | array\n | mailaddr\n | mailfrom\n | program\n | create\n | homehost\n | auto\n | policy\n | part_policy )*\n\nlet filter = incl \"\/etc\/mdadm.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3eff650fcceb250d7c07c3d4e5bdaca8f0883d75","subject":"Fix empty comments in INI file","message":"Fix empty comments in INI file\n","repos":"GeoffWilliams\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,bkearney\/augeas,jjlin\/augeas,jjlin\/augeas,kunkku\/augeas,camptocamp\/augeas,domcleal\/augeas,mchf\/augeas,ptoscano\/augeas,jtopjian\/augeas,camptocamp\/augeas,jasperla\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,kunkku\/augeas,MikaelSmith\/augeas,bkearney\/augeas,mlichvar\/augeas,jasperla\/augeas,mlichvar\/augeas,pevalme\/augeas,domcleal\/augeas,manandbytes\/augeas,kumy\/augeas,manandbytes\/augeas,kumy\/augeas,pevalme\/augeas,jjlin\/augeas,domcleal\/augeas,ptoscano\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,dafugg\/augeas,raphink\/augeas,jtopjian\/augeas,camptocamp\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,mchf\/augeas,bkearney\/augeas,kunkku\/augeas,lutter\/augeas,GeoffWilliams\/augeas,bkearney\/augeas,raphink\/augeas,dafugg\/augeas","old_file":"lenses\/inifile.aug","new_file":"lenses\/inifile.aug","new_contents":"(* IniFile generic module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* TODO: Support double quotes in value *)\n\nmodule IniFile =\n\n (* Define useful shortcuts *)\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=\/ \" = \"\n let value_sepwithcolon = del \/[ \\t]*(=|:)\/ \" = \"\n let value_to_eol = del \/[ \\t]*\/ \" \" . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_comment = del \/[ \\t]*\/ \"\" . store \/[^;# \\t\\n]+\/\n\n\n (* Define comment and empty strings *)\n (* Some implementations of INI file allow \"#\" as a comment sign *)\n let comment_generic (pattern:regexp) = [ label \"comment\" . del pattern \"; \" . value_to_eol? . eol ]\n let comment = comment_generic \/[ \\t]*(#|;)\/\n let comment_nosharp = comment_generic \/[ \\t]*;\/\n\n let empty = [ del \/[ \\t]*\\n\/ \"\" ]\n\n\n (* Define entry function *)\n (* Some implementations of INI file allow \";\" as separator *)\n let entry_generic (kw:regexp) (sep:lens) (comment:lens) = [ key kw . sep . value_to_comment? . (comment|eol) ]\n let entry (kw:regexp) = entry_generic kw value_sepwithcolon comment\n let entry_setcomment (kw:regexp) (comment:lens) = entry_generic kw value_sepwithcolon comment\n let entry_nocolon (kw:regexp) = entry_generic kw value_sep comment\n let entry_nocolon_setcomment (kw:regexp) (comment:lens) = entry_generic kw value_sep comment\n\n\n (* Define record *)\n\n let title = Util.del_str \"[\" . store \/[^] ]+\/ . Util.del_str \"]\". eol\n let record (label_name:string) (entry:lens) = [ label label_name . title . (entry | comment | empty)* ] \n let record_setcomment (label_name:string) (entry:lens) (comment:lens) = [ label label_name . title . (entry | comment | empty)* ] \n (* Some implementations of INI File do not allow empty lines *)\n let record_noempty (label_name:string) (entry:lens) = [ label label_name . title . (entry | comment)* ] \n let record_noempty_setcomment (label_name:string) (entry:lens) (comment:lens) = [ label label_name . title . (entry | comment)* ] \n\n (* Generic INI file lens *)\n let lns (record:lens) = ( comment | empty )* . record*\n (* Let the user choose the type of comment they want *)\n let lns_setcomment (record:lens) (comment:lens) = ( comment | empty )* . record*\n\n (* Some implementations of INI File do not allow empty lines *)\n let lns_noempty (record:lens) = comment* . record*\n (* Let the user choose the type of comment they want *)\n let lns_noempty_setcomment (record:lens) (comment:lens) = comment* . record*\n","old_contents":"(* IniFile generic module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* TODO: Support double quotes in value *)\n\nmodule IniFile =\n\n (* Define useful shortcuts *)\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=\/ \" = \"\n let value_sepwithcolon = del \/[ \\t]*(=|:)\/ \" = \"\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_comment = del \/[ \\t]*\/ \"\" . store \/[^;# \\t\\n]+\/\n\n\n (* Define comment and empty strings *)\n (* Some implementations of INI file allow \"#\" as a comment sign *)\n let comment_generic (pattern:regexp) = [ label \"comment\" . del pattern \"; \" . value_to_eol . eol ]\n let comment = comment_generic \/[ \\t]*(#|;)[ \\t]*\/\n let comment_nosharp = comment_generic \/[ \\t]*;[ \\t]*\/\n\n let empty = [ del \/[ \\t]*\\n\/ \"\" ]\n\n\n (* Define entry function *)\n (* Some implementations of INI file allow \";\" as separator *)\n let entry_generic (kw:regexp) (sep:lens) (comment:lens) = [ key kw . sep . value_to_comment? . (comment|eol) ]\n let entry (kw:regexp) = entry_generic kw value_sepwithcolon comment\n let entry_setcomment (kw:regexp) (comment:lens) = entry_generic kw value_sepwithcolon comment\n let entry_nocolon (kw:regexp) = entry_generic kw value_sep comment\n let entry_nocolon_setcomment (kw:regexp) (comment:lens) = entry_generic kw value_sep comment\n\n\n (* Define record *)\n\n let title = Util.del_str \"[\" . store \/[^] ]+\/ . Util.del_str \"]\". eol\n let record (label_name:string) (entry:lens) = [ label label_name . title . (entry | comment | empty)* ] \n let record_setcomment (label_name:string) (entry:lens) (comment:lens) = [ label label_name . title . (entry | comment | empty)* ] \n (* Some implementations of INI File do not allow empty lines *)\n let record_noempty (label_name:string) (entry:lens) = [ label label_name . title . (entry | comment)* ] \n let record_noempty_setcomment (label_name:string) (entry:lens) (comment:lens) = [ label label_name . title . (entry | comment)* ] \n\n (* Generic INI file lens *)\n let lns (record:lens) = ( comment | empty )* . record*\n (* Let the user choose the type of comment they want *)\n let lns_setcomment (record:lens) (comment:lens) = ( comment | empty )* . record*\n\n (* Some implementations of INI File do not allow empty lines *)\n let lns_noempty (record:lens) = comment* . record*\n (* Let the user choose the type of comment they want *)\n let lns_noempty_setcomment (record:lens) (comment:lens) = comment* . record*\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7557425762b4a5869987818c1d49389acff73ca9","subject":"Add \/etc\/wgetrc to simplevars.aug","message":"Add \/etc\/wgetrc to simplevars.aug\n","repos":"kumy\/augeas,dafugg\/augeas,dafugg\/augeas,kunkku\/augeas,domcleal\/augeas,kumy\/augeas,domcleal\/augeas,pevalme\/augeas,manandbytes\/augeas,raphink\/augeas,lutter\/augeas,mchf\/augeas,mchf\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,ptoscano\/augeas,manandbytes\/augeas,jtopjian\/augeas,kumy\/augeas,mlichvar\/augeas,jjlin\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas,mlichvar\/augeas,hercules-team\/augeas,jasperla\/augeas,MikaelSmith\/augeas,jjlin\/augeas,domcleal\/augeas,kunkku\/augeas,raphink\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,hercules-team\/augeas","old_file":"lenses\/simplevars.aug","new_file":"lenses\/simplevars.aug","new_contents":"(*\nModule: Simplevars\n Parses simple key = value conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Simplevars> file contains various examples and tests.\n*)\n\nmodule Simplevars =\n\nautoload xfm\n\n(* View: entry *)\nlet entry = Build.key_value_line Rx.word Sep.space_equal\n (store Rx.space_in)\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/kernel-img.conf\"\n . incl \"\/etc\/kerneloops.conf\"\n . incl \"\/etc\/wgetrc\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Simplevars\n Parses simple key = value conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Simplevars> file contains various examples and tests.\n*)\n\nmodule Simplevars =\n\nautoload xfm\n\n(* View: entry *)\nlet entry = Build.key_value_line Rx.word Sep.space_equal\n (store Rx.space_in)\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/kernel-img.conf\"\n . incl \"\/etc\/kerneloops.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8b7692ecc308c2940f98118f923a6a72cfd72a8f","subject":"Shellvars: test case for wrapping command arguments","message":"Shellvars: test case for wrapping command arguments\n","repos":"mlichvar\/augeas,hercules-team\/augeas,kunkku\/augeas,pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,lutter\/augeas,manandbytes\/augeas,manandbytes\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,pevalme\/augeas,mchf\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas,mchf\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\"\n { \"1\" = \"ONBOOT\" }\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\"\n { \"1\" = \"FOO\" } }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Allow wrapping builtin arguments to multiple lines *)\n test Shellvars.lns get \"ulimit -c \\\\\\nunlimited\\nulimit \\\\\\n -x 123\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c \\\\\\nunlimited\" } }\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-x 123\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file1\" }\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file2\" }\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"@unset\"\n { \"1\" = \"f\" } } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"b\" }\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\"\n { \"@pattern\" = \"eth0\" }\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\"\n { \"1\" = \"f\" } } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" { \"@pattern\" = \"*\" } } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\"\n { \"@pattern\" = \"*debug*\" }\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* Partial quoting is allowed *)\n test Shellvars.lns get \"FOO=\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\\n\" =\n { \"FOO\" = \"\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\"\n { \"1\" = \"${!LC_*}\" } }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n # \n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\ntest \\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\ntest \\\\\\ntest2\\\"\" }\n\n (* Export of multiple variables, RHBZ#1033795 *)\n test lns get \"export TestVar1 TestVar2\\n\" =\n { \"@export\"\n { \"1\" = \"TestVar1\" }\n { \"2\" = \"TestVar2\" } }\n\n (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)\n test lns get \"case $ARG in\n 0) TestVar=\\\"test0\\\" ;;\n 1) TestVar=\\\"test1\\\" ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"TestVar\" = \"\\\"test0\\\"\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"TestVar\" = \"\\\"test1\\\"\" } } }\n\n (* case: support ;; on the same line with multiple commands *)\n test lns get \"case $ARG in\n 0) Foo=0; Bar=1;;\n 1)\n\t Foo=2\n\t Bar=3; Baz=4;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"Foo\" = \"0\" }\n { \"Bar\" = \"1\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"Foo\" = \"2\" }\n { \"Bar\" = \"3\" }\n { \"Baz\" = \"4\" }\n }\n }\n\n(* Test: Shellvars.lns\n Support `##` bashism in conditions (GH issue #118) *)\ntest Shellvars.lns get \"if [ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ] ; then\n SUFFIX=\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\nelse\n SUFFIX=\nfi\\n\" =\n { \"@if\" = \"[ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ]\"\n { \"SUFFIX\" = \"\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\" }\n { \"@else\"\n { \"SUFFIX\" = \"\" }\n }\n }\n\n (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)\n test lns get \"export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\\n\" =\n { \"MALLOC_PERTURB_\" = \"$(($RANDOM % 255 + 1))\"\n { \"export\" } }\n\n (*\n * Github issue 202\n *)\n let starts_with_blank = \"\\n \\nVAR=value\\n\"\n\n test lns get starts_with_blank = { \"VAR\" = \"value\" }\n\n (* It is now possible to insert at the beginning of a file\n * that starts with blank lines *)\n test lns put starts_with_blank after\n insb \"#comment\" \"\/*[1]\";\n set \"\/#comment[1]\" \"a comment\" =\n \" # a comment\\nVAR=value\\n\"\n\n (* Modifications of the file lose the blank lines though *)\n test lns put starts_with_blank after\n set \"\/VAR2\" \"abc\" = \"VAR=value\\nVAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\";\n set \"\/VAR2\" \"abc\" = \"VAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\" = \"\"\n\n (* Support associative arrays *)\n test lns get \"var[alpha_beta,gamma]=something\\n\" =\n { \"var[alpha_beta,gamma]\" = \"something\" }\n\n (* GH #188: support more conditions *)\n test Shellvars.lns get \"[ -f $FILENAME ]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" } }\n\n test Shellvars.lns get \"[[ -f $FILENAME ]]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[[\" } }\n\n (* Allow wrapping loop condition to multiple lines *)\n test Shellvars.lns get \"for x in foo \\\\\\nbar\\\\\\nbaz; do y=$x; done\\n\" =\n { \"@for\" = \"x in foo \\\\\\nbar\\\\\\nbaz\" { \"y\" = \"$x\" } }\n\n (* Allow quotes in loop conditions *)\n test Shellvars.lns get \"for x in \\\"$@\\\"; do y=$x; done\\n\" =\n { \"@for\" = \"x in \\\"$@\\\"\" { \"y\" = \"$x\" } }\n\n (* case: support quotes and spaces in pattern lists *)\n test lns get \"case $ARG in\n \\\"foo bar\\\")\n Foo=0\n ;;\n baz | quux)\n Foo=1\n ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"\\\"foo bar\\\"\" }\n { \"Foo\" = \"0\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"baz\" }\n { \"@pattern\" = \"quux\" }\n { \"Foo\" = \"1\" }\n }\n }\n\n (* eval *)\n test lns get \"eval `dircolors`\\n\" =\n { \"@eval\" = \"`dircolors`\" }\n\n (* alias *)\n test lns get \"alias ls='ls $LS_OPTIONS'\\n\" =\n { \"@alias\" = \"ls\" { \"value\" = \"'ls $LS_OPTIONS'\" } }\n\n (* Allow && and || constructs after condition *)\n test Shellvars.lns get \"[ -f $FILENAME ] && do this || or that\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" }\n { \"@and\" = \"do this\" }\n { \"@or\" = \"or that\" } }\n\n(* Test: Shellvars.lns\n Parse (almost) any command *)\ntest Shellvars.lns get \"echo foobar 'and this is baz'\n\/usr\/local\/bin\/myscript.sh with args\necho foo \\\nbar\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foobar 'and this is baz'\" }\n }\n { \"@command\" = \"\/usr\/local\/bin\/myscript.sh\"\n { \"@arg\" = \"with args\" }\n }\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foo \\\\\\nbar\" }\n }\n\n(* Test: Shellvars.lns\n Support pipes in commands *)\ntest Shellvars.lns get \"echo \\\"$STRING\\\" | grep foo\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"\\\"$STRING\\\"\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"foo\" } } } }\n\n(* Test: Shellvars.lns\n Support && and || after command\n GH #215 *)\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && echo moo\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue || echo baa\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && DEBIAN=1\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"DEBIAN\" = \"1\" } } }\n\ntest Shellvars.lns get \"cat \/etc\/issue | grep -q \\\"Debian\\\" && echo moo || echo baa\\n\" =\n { \"@command\" = \"cat\"\n { \"@arg\" = \"\/etc\/issue\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\"\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } } } } } }\n\n\n(* Wrapped command sequences *)\n\ntest Shellvars.lns get \"foo && \\\\\\nbar baz \\\\\\n|| qux \\\\\\n quux\\\\\\ncorge grault\\n\" =\n { \"@command\" = \"foo\"\n { \"@and\"\n { \"@command\" = \"bar\"\n { \"@arg\" = \"baz\" }\n\t{ \"@or\" { \"@command\" = \"qux\" { \"@arg\" = \"quux\\\\\\ncorge grault\" } } }\n }\n }\n }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\"\n { \"1\" = \"ONBOOT\" }\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\"\n { \"1\" = \"FOO\" } }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Allow wrapping builtin arguments to multiple lines *)\n test Shellvars.lns get \"ulimit -c \\\\\\nunlimited\\nulimit \\\\\\n -x 123\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c \\\\\\nunlimited\" } }\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-x 123\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file1\" }\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file2\" }\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"@unset\"\n { \"1\" = \"f\" } } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"b\" }\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\"\n { \"@pattern\" = \"eth0\" }\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\"\n { \"1\" = \"f\" } } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" { \"@pattern\" = \"*\" } } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\"\n { \"@pattern\" = \"*debug*\" }\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* Partial quoting is allowed *)\n test Shellvars.lns get \"FOO=\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\\n\" =\n { \"FOO\" = \"\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\"\n { \"1\" = \"${!LC_*}\" } }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n # \n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\ntest \\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\ntest \\\\\\ntest2\\\"\" }\n\n (* Export of multiple variables, RHBZ#1033795 *)\n test lns get \"export TestVar1 TestVar2\\n\" =\n { \"@export\"\n { \"1\" = \"TestVar1\" }\n { \"2\" = \"TestVar2\" } }\n\n (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)\n test lns get \"case $ARG in\n 0) TestVar=\\\"test0\\\" ;;\n 1) TestVar=\\\"test1\\\" ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"TestVar\" = \"\\\"test0\\\"\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"TestVar\" = \"\\\"test1\\\"\" } } }\n\n (* case: support ;; on the same line with multiple commands *)\n test lns get \"case $ARG in\n 0) Foo=0; Bar=1;;\n 1)\n\t Foo=2\n\t Bar=3; Baz=4;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"Foo\" = \"0\" }\n { \"Bar\" = \"1\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"Foo\" = \"2\" }\n { \"Bar\" = \"3\" }\n { \"Baz\" = \"4\" }\n }\n }\n\n(* Test: Shellvars.lns\n Support `##` bashism in conditions (GH issue #118) *)\ntest Shellvars.lns get \"if [ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ] ; then\n SUFFIX=\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\nelse\n SUFFIX=\nfi\\n\" =\n { \"@if\" = \"[ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ]\"\n { \"SUFFIX\" = \"\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\" }\n { \"@else\"\n { \"SUFFIX\" = \"\" }\n }\n }\n\n (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)\n test lns get \"export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\\n\" =\n { \"MALLOC_PERTURB_\" = \"$(($RANDOM % 255 + 1))\"\n { \"export\" } }\n\n (*\n * Github issue 202\n *)\n let starts_with_blank = \"\\n \\nVAR=value\\n\"\n\n test lns get starts_with_blank = { \"VAR\" = \"value\" }\n\n (* It is now possible to insert at the beginning of a file\n * that starts with blank lines *)\n test lns put starts_with_blank after\n insb \"#comment\" \"\/*[1]\";\n set \"\/#comment[1]\" \"a comment\" =\n \" # a comment\\nVAR=value\\n\"\n\n (* Modifications of the file lose the blank lines though *)\n test lns put starts_with_blank after\n set \"\/VAR2\" \"abc\" = \"VAR=value\\nVAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\";\n set \"\/VAR2\" \"abc\" = \"VAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\" = \"\"\n\n (* Support associative arrays *)\n test lns get \"var[alpha_beta,gamma]=something\\n\" =\n { \"var[alpha_beta,gamma]\" = \"something\" }\n\n (* GH #188: support more conditions *)\n test Shellvars.lns get \"[ -f $FILENAME ]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" } }\n\n test Shellvars.lns get \"[[ -f $FILENAME ]]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[[\" } }\n\n (* Allow wrapping loop condition to multiple lines *)\n test Shellvars.lns get \"for x in foo \\\\\\nbar\\\\\\nbaz; do y=$x; done\\n\" =\n { \"@for\" = \"x in foo \\\\\\nbar\\\\\\nbaz\" { \"y\" = \"$x\" } }\n\n (* Allow quotes in loop conditions *)\n test Shellvars.lns get \"for x in \\\"$@\\\"; do y=$x; done\\n\" =\n { \"@for\" = \"x in \\\"$@\\\"\" { \"y\" = \"$x\" } }\n\n (* case: support quotes and spaces in pattern lists *)\n test lns get \"case $ARG in\n \\\"foo bar\\\")\n Foo=0\n ;;\n baz | quux)\n Foo=1\n ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"\\\"foo bar\\\"\" }\n { \"Foo\" = \"0\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"baz\" }\n { \"@pattern\" = \"quux\" }\n { \"Foo\" = \"1\" }\n }\n }\n\n (* eval *)\n test lns get \"eval `dircolors`\\n\" =\n { \"@eval\" = \"`dircolors`\" }\n\n (* alias *)\n test lns get \"alias ls='ls $LS_OPTIONS'\\n\" =\n { \"@alias\" = \"ls\" { \"value\" = \"'ls $LS_OPTIONS'\" } }\n\n (* Allow && and || constructs after condition *)\n test Shellvars.lns get \"[ -f $FILENAME ] && do this || or that\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" }\n { \"@and\" = \"do this\" }\n { \"@or\" = \"or that\" } }\n\n(* Test: Shellvars.lns\n Parse (almost) any command *)\ntest Shellvars.lns get \"echo foobar 'and this is baz'\n\/usr\/local\/bin\/myscript.sh with args\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foobar 'and this is baz'\" }\n }\n { \"@command\" = \"\/usr\/local\/bin\/myscript.sh\"\n { \"@arg\" = \"with args\" }\n }\n\n(* Test: Shellvars.lns\n Support pipes in commands *)\ntest Shellvars.lns get \"echo \\\"$STRING\\\" | grep foo\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"\\\"$STRING\\\"\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"foo\" } } } }\n\n(* Test: Shellvars.lns\n Support && and || after command\n GH #215 *)\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && echo moo\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue || echo baa\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && DEBIAN=1\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"DEBIAN\" = \"1\" } } }\n\ntest Shellvars.lns get \"cat \/etc\/issue | grep -q \\\"Debian\\\" && echo moo || echo baa\\n\" =\n { \"@command\" = \"cat\"\n { \"@arg\" = \"\/etc\/issue\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\"\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } } } } } }\n\n\n(* Wrapped command sequences *)\n\ntest Shellvars.lns get \"foo && \\\\\\nbar baz \\\\\\n|| qux \\\\\\n quux\\\\\\ncorge grault\\n\" =\n { \"@command\" = \"foo\"\n { \"@and\"\n { \"@command\" = \"bar\"\n { \"@arg\" = \"baz\" }\n\t{ \"@or\" { \"@command\" = \"qux\" { \"@arg\" = \"quux\\\\\\ncorge grault\" } } }\n }\n }\n }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2f4dda3834fdfcffc620337c649750d9c6545b31","subject":"Add more possible SUSE extensions to read from multipath config.","message":"Add more possible SUSE extensions to read from multipath config.\n","repos":"jjlin\/augeas,hercules-team\/augeas,jasperla\/augeas,kunkku\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,pevalme\/augeas,pevalme\/augeas,mchf\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,mchf\/augeas,ptoscano\/augeas,jjlin\/augeas,mlichvar\/augeas,manandbytes\/augeas,lutter\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,jtopjian\/augeas,kunkku\/augeas,MikaelSmith\/augeas,pevalme\/augeas,manandbytes\/augeas,ptoscano\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,mlichvar\/augeas,kunkku\/augeas,jtopjian\/augeas,raphink\/augeas,lutter\/augeas,jjlin\/augeas,raphink\/augeas,dafugg\/augeas,jasperla\/augeas","old_file":"lenses\/multipath.aug","new_file":"lenses\/multipath.aug","new_contents":"(* Process \/etc\/multipath.conf *)\n(* The lens is based on the multipath.conf(5) man page *)\nmodule Multipath =\n\nautoload xfm\n\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\nlet eol = Util.eol\n\nlet ws = del \/[ \\t]+\/ \" \"\nlet indent = del \/[ \\t]*\/ \"\"\n(* We require that braces are always followed by a newline *)\nlet obr = del \/\\{([ \\t]*)\\n\/ \"{\\n\"\nlet cbr = del \/[ \\t]*}[ \\t]*\\n\/ \"}\\n\"\n\nlet ikey (k:regexp) = indent . key k\n\nlet section (n:regexp) (b:lens) =\n [ ikey n . ws . obr . (b|empty|comment)* . cbr ]\n\nlet kv (k:regexp) (v:regexp) =\n [ ikey k . ws . store v . eol ]\n\n(* FIXME: it would be much more concise to write *)\n(* [ key k . ws . (bare | quoted) ] *)\n(* but the typechecker trips over that *)\nlet qstr (k:regexp) =\n let delq = del \/['\"]\/ \"\\\"\" in\n let bare = del \/[\"']?\/ \"\" . store \/[^\"' \\t\\n]+\/ . del \/[\"']?\/ \"\" in\n let quoted = delq . store \/.*[ \\t].*\/ . delq in\n [ ikey k . ws . bare . eol ]\n |[ ikey k . ws . quoted . eol ]\n\nlet wwid = kv \"wwid\" (Rx.word|\"*\")\n\n(* Settings that can be changed in various places *)\nlet common_setting =\n kv \"path_grouping_policy\"\n \/failover|multibus|group_by_(serial|prio|node_name)\/\n |qstr \/(getuid|prio)_callout\/\n |qstr \/path_(selector|checker)|features\/\n |kv \"failback\" (Rx.integer | \/immediate|manual\/)\n |kv \"rr_weight\" \/priorities|uniform\/\n |kv \"no_path_retry\" (Rx.integer | \/fail|queue\/)\n |kv \/rr_min_io(_rq)?\/ Rx.integer\n\nlet default_setting =\n kv \"polling_interval\" Rx.integer\n |kv \"udev_dir\" Rx.fspath\n |qstr \"selector\"\n |kv \"user_friendly_names\" \/yes|no\/\n |kv \"dev_loss_tmo\" Rx.integer\n |kv \"fast_io_fail_tmo\" Rx.integer\n |kv \"verbosity\" \/[0-6]\/\n |kv \"reassign_maps\" \/yes|no\/\n (* These are not in the manpage but in the example multipath.conf *)\n |kv \"prio\" Rx.word\n |kv \"max_fds\" Rx.integer\n (* SUSE extensions *)\n |kv \"async_timeout\" Rx.integer\n |kv \"max_polling_interval\" Rx.integer\n |kv \"pg_timeout\" Rx.word\n |kv \"bindings_file\" Rx.fspath\n |kv \"multipath_dir\" Rx.fspath\n |kv \"alias_prefix\" Rx.word\n |kv \"queue_without_daemon\" \/yes|no\/\n |kv \"h_on_last_deleassign_maps\" \/yes|no\/\n |qstr \"prio_args\"\n (* SUSE extensions SP3 *)\n |qstr \"uid_attribute\"\n |kv \"wwids_file\" Rx.fspath\n |kv \"log_checker_err\" Rx.word\n |kv \"retain_attached_hw_handler\" \/yes|no\/\n |kv \"detect_prio\" \/yes|no\/\n |kv \"flush_on_last_del\" \/yes|no\/\n\n(* A device subsection *)\nlet device =\n let setting =\n qstr \/vendor|product|product_blacklist|hardware_handler\/\n |common_setting\n |default_setting in\n section \"device\" setting\n\n(* The defaults section *)\nlet defaults =\n let setting =\n common_setting\n |default_setting\n in section \"defaults\" setting\n\n(* The blacklist and blacklist_exceptions sections *)\nlet blacklist =\n let setting =\n wwid\n |qstr \"devnode\"\n |device in\n section \/blacklist(_exceptions)?\/ setting\n\n(* A multipath subsection *)\nlet multipath =\n let setting =\n wwid\n |qstr \"alias\"\n |common_setting in\n section \"multipath\" setting\n\n(* The multipaths section *)\nlet multipaths =\n section \"multipaths\" multipath\n\n(* The devices section *)\nlet devices =\n section \"devices\" device\n\nlet lns = (comment|empty|defaults|blacklist|devices|multipaths)*\n\nlet xfm = transform lns (incl \"\/etc\/multipath.conf\")\n","old_contents":"(* Process \/etc\/multipath.conf *)\n(* The lens is based on the multipath.conf(5) man page *)\nmodule Multipath =\n\nautoload xfm\n\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\nlet eol = Util.eol\n\nlet ws = del \/[ \\t]+\/ \" \"\nlet indent = del \/[ \\t]*\/ \"\"\n(* We require that braces are always followed by a newline *)\nlet obr = del \/\\{([ \\t]*)\\n\/ \"{\\n\"\nlet cbr = del \/[ \\t]*}[ \\t]*\\n\/ \"}\\n\"\n\nlet ikey (k:regexp) = indent . key k\n\nlet section (n:regexp) (b:lens) =\n [ ikey n . ws . obr . (b|empty|comment)* . cbr ]\n\nlet kv (k:regexp) (v:regexp) =\n [ ikey k . ws . store v . eol ]\n\n(* FIXME: it would be much more concise to write *)\n(* [ key k . ws . (bare | quoted) ] *)\n(* but the typechecker trips over that *)\nlet qstr (k:regexp) =\n let delq = del \/['\"]\/ \"\\\"\" in\n let bare = del \/[\"']?\/ \"\" . store \/[^\"' \\t\\n]+\/ . del \/[\"']?\/ \"\" in\n let quoted = delq . store \/.*[ \\t].*\/ . delq in\n [ ikey k . ws . bare . eol ]\n |[ ikey k . ws . quoted . eol ]\n\nlet wwid = kv \"wwid\" (Rx.word|\"*\")\n\n(* Settings that can be changed in various places *)\nlet common_setting =\n kv \"path_grouping_policy\"\n \/failover|multibus|group_by_(serial|prio|node_name)\/\n |qstr \/(getuid|prio)_callout\/\n |qstr \/path_(selector|checker)|features\/\n |kv \"failback\" (Rx.integer | \/immediate|manual\/)\n |kv \"rr_weight\" \/priorities|uniform\/\n |kv \"no_path_retry\" (Rx.integer | \/fail|queue\/)\n |kv \/rr_min_io(_rq)?\/ Rx.integer\n\nlet default_setting =\n kv \"polling_interval\" Rx.integer\n |kv \"udev_dir\" Rx.fspath\n |qstr \"selector\"\n |kv \"user_friendly_names\" \/yes|no\/\n |kv \"dev_loss_tmo\" Rx.integer\n |kv \"fast_io_fail_tmo\" Rx.integer\n |kv \"verbosity\" \/[0-6]\/\n |kv \"reassign_maps\" \/yes|no\/\n (* These are not in the manpage but in the example multipath.conf *)\n |kv \"prio\" Rx.word\n |kv \"max_fds\" Rx.integer\n (* SUSE extensions *)\n |kv \"async_timeout\" Rx.integer\n |kv \"max_polling_interval\" Rx.integer\n\n(* A device subsection *)\nlet device =\n let setting =\n qstr \/vendor|product|product_blacklist|hardware_handler\/\n |common_setting\n |default_setting in\n section \"device\" setting\n\n(* The defaults section *)\nlet defaults =\n let setting =\n common_setting\n |default_setting\n in section \"defaults\" setting\n\n(* The blacklist and blacklist_exceptions sections *)\nlet blacklist =\n let setting =\n wwid\n |qstr \"devnode\"\n |device in\n section \/blacklist(_exceptions)?\/ setting\n\n(* A multipath subsection *)\nlet multipath =\n let setting =\n wwid\n |qstr \"alias\"\n |common_setting in\n section \"multipath\" setting\n\n(* The multipaths section *)\nlet multipaths =\n section \"multipaths\" multipath\n\n(* The devices section *)\nlet devices =\n section \"devices\" device\n\nlet lns = (comment|empty|defaults|blacklist|devices|multipaths)*\n\nlet xfm = transform lns (incl \"\/etc\/multipath.conf\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ccc1f259734dabee79858ec2932036507f343c80","subject":"Shellvars: read various snmpd config files","message":"Shellvars: read various snmpd config files\n\nPatch by erinn\n\nFixes ticket #170\n","repos":"raphink\/augeas,lutter\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,mchf\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,dafugg\/augeas,dafugg\/augeas,domcleal\/augeas,jjlin\/augeas,jasperla\/augeas,raphink\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,pevalme\/augeas,kumy\/augeas,ptoscano\/augeas,mchf\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,domcleal\/augeas,pevalme\/augeas,ptoscano\/augeas,hercules-team\/augeas,pevalme\/augeas,mlichvar\/augeas,manandbytes\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,kumy\/augeas,kumy\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,jasperla\/augeas,mlichvar\/augeas,kunkku\/augeas,domcleal\/augeas,kunkku\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . store \/[^ \\t\\n][^;\\n]+[^ \\t\\n]|[^ \\t;\\n]+\/ ]\n . eol ]\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . store \/[^ \\t\\n][^;\\n]+[^ \\t\\n]|[^ \\t;\\n]+\/ ]\n . eol ]\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cf061a1e749c32243bf43f7ba4895929ee513a3f","subject":"Debctrl: whitespace cleanup, no functional change","message":"Debctrl: whitespace cleanup, no functional change\n","repos":"kumy\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,pevalme\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,manandbytes\/augeas,kumy\/augeas,kunkku\/augeas,jasperla\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,domcleal\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,pevalme\/augeas,pevalme\/augeas,jjlin\/augeas,jasperla\/augeas,dafugg\/augeas,mlichvar\/augeas,jtopjian\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas,raphink\/augeas,ptoscano\/augeas,kumy\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,jtopjian\/augeas,dafugg\/augeas,kumy\/augeas,raphink\/augeas,manandbytes\/augeas,hercules-team\/augeas,mlichvar\/augeas,mchf\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jjlin\/augeas","old_file":"lenses\/debctrl.aug","new_file":"lenses\/debctrl.aug","new_contents":"(*\nModule: debctrl\n Parses .\/debian\/control\n\nAuthor:\n Dominique Dumont domi.dumont@free.fr or dominique.dumont@hp.com\n\nAbout: Reference\n http:\/\/augeas.net\/page\/Create_a_lens_from_bottom_to_top\n http:\/\/www.debian.org\/doc\/debian-policy\/ch-controlfields.html\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Since control file is not a system configuration file, you will have\n to use augtool -r option to point to 'debian' directory.\n\n Run augtool:\n $ augtool -r debian\n\n Sample usage of this lens in augtool:\n\n * Get the value stored in control file\n > print \/files\/control\n ...\n\n Saving your file:\n\n > save\n\n\n*)\n\nmodule Debctrl =\n autoload xfm\n\nlet eol = Util.eol\nlet del_ws_spc = del \/[\\t ]*\/ \" \"\nlet hardeol = del \/\\n\/ \"\\n\"\nlet del_opt_ws = del \/[\\t ]*\/ \"\"\nlet colon = del \/:[ \\t]*\/ \": \"\n\nlet simple_entry (k:regexp) =\n let value = store \/[^ \\t][^\\n]+\/ in\n [ key k . colon . value . hardeol ]\n\nlet cont_line = del \/\\n[ \\t]+\/ \"\\n \"\nlet comma = del \/,[ \\t]*\/ \", \"\n\nlet sep_comma_with_nl = del \/[ \\t\\n]*,[ \\t\\n]*\/ \",\\n \"\n (*= del_opt_ws . cont_line* . comma . cont_line**)\n\nlet email = store ( \/([A-Za-z]+ )+<[^\\n>]+>\/ | \/[^\\n,\\t<> ]+\/ )\n\nlet multi_line_array_entry (k:regexp) (v:lens) =\n [ key k . colon . [ counter \"array\" . seq \"array\" . v ] .\n [ seq \"array\" . sep_comma_with_nl . v ]* . hardeol ]\n\n(* dependency stuff *)\n\nlet version_depends =\n [ label \"version\"\n . [ del \/ *\\( *\/ \" ( \" . label \"relation\" . store \/[<>=]+\/ ]\n . [ del_ws_spc . label \"number\" . store \/[a-zA-Z0-9_\\.\\-]+\/\n . del \/ *\\)\/ \" )\" ]\n ]\n\nlet arch_depends =\n [ label \"arch\"\n . [ del \/ *\\[ *\/ \" [ \" . label \"prefix\" . store \/!?\/ ]\n . [ label \"name\" . store \/[a-zA-Z0-9_\\.\\-]+\/ . del \/ *\\]\/ \" ]\" ] ]\n\n\nlet package_depends\n = [ key ( \/[a-zA-Z0-9_\\-]+\/ | \/\\$\\{[a-zA-Z0-9:]+\\}\/ )\n . ( version_depends | arch_depends ) * ]\n\n\nlet dependency = [ label \"or\" . package_depends ]\n . [ label \"or\" . del \/ *\\| *\/ \" | \"\n . package_depends ] *\n\nlet dependency_list (field:regexp) =\n [ key field . colon . [ label \"and\" . dependency ]\n . [ label \"and\" . sep_comma_with_nl . dependency ]*\n . eol ]\n\n(* source package *)\nlet uploaders =\n multi_line_array_entry \/Uploaders\/ email\n\nlet simple_src_keyword = \"Source\" | \"Section\" | \"Priority\"\n | \"Standards\\-Version\" | \"Homepage\" | \/Vcs\\-Svn\/ | \/Vcs\\-Browser\/\n | \"Maintainer\"\nlet depend_src_keywords = \/Build\\-Depends\/ | \/Build\\-Depends\\-Indep\/\n\nlet src_entries = ( simple_entry simple_src_keyword\n | uploaders\n | dependency_list depend_src_keywords ) *\n\n\n(* package paragraph *)\n\nlet simple_bin_keyword = \"Package\" | \"Architecture\" | \"Section\"\n | \"Priority\" | \"Essential\" | \"Homepage\"\n\nlet simple_bin_entry = simple_entry simple_bin_keyword\n\nlet multi_line_entry (k:string) =\n let line = \/[^\\n]+\/ in\n [ label k . del \/^ \/ \" \" . store line . hardeol ] *\n\n\nlet description\n = [ key \"Description\" . colon\n . [ label \"summary\" . store \/[a-zA-Z][^\\n]+\/ . hardeol ]\n . multi_line_entry \"text\" ]\n\n\n(* binary package *)\nlet simple_bin_keywords = \"Package\" | \"Architecture\"\nlet depend_bin_keywords = \"Depends\" | \"Recommends\" | \"Suggests\"\n\nlet bin_entries = ( simple_entry simple_bin_keywords\n | dependency_list depend_bin_keywords\n ) + . description\n\n(* The whole stuff *)\nlet lns = [ label \"srcpkg\" . src_entries ]\n . [ label \"binpkg\" . hardeol+ . bin_entries ]+\n . eol*\n\n(* lens must be used with AUG_ROOT set to debian package source directory *)\nlet xfm = transform lns (incl \"\/control\")\n","old_contents":"(*\nModule: debctrl\n Parses .\/debian\/control\n\nAuthor: \n Dominique Dumont domi.dumont@free.fr or dominique.dumont@hp.com\n\nAbout: Reference\n http:\/\/augeas.net\/page\/Create_a_lens_from_bottom_to_top\n http:\/\/www.debian.org\/doc\/debian-policy\/ch-controlfields.html\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Since control file is not a system configuration file, you will have\n to use augtool -r option to point to 'debian' directory.\n\n Run augtool:\n $ augtool -r debian\n\n Sample usage of this lens in augtool:\n\n * Get the value stored in control file\n > print \/files\/control\n ...\n\n Saving your file:\n\n > save\n\n\n*)\n\nmodule Debctrl =\n autoload xfm\n\nlet eol = Util.eol\nlet del_ws_spc = del \/[\\t ]*\/ \" \"\nlet hardeol = del \/\\n\/ \"\\n\"\nlet del_opt_ws = del \/[\\t ]*\/ \"\"\nlet colon = del \/:[ \\t]*\/ \": \"\n\nlet simple_entry (k:regexp) =\n let value = store \/[^ \\t][^\\n]+\/ in\n [ key k . colon . value . hardeol ]\n\nlet cont_line = del \/\\n[ \\t]+\/ \"\\n \"\nlet comma = del \/,[ \\t]*\/ \", \"\n\nlet sep_comma_with_nl = del \/[ \\t\\n]*,[ \\t\\n]*\/ \",\\n \"\n (*= del_opt_ws . cont_line* . comma . cont_line**)\n\nlet email = store ( \/([A-Za-z]+ )+<[^\\n>]+>\/ | \/[^\\n,\\t<> ]+\/ )\n\nlet multi_line_array_entry (k:regexp) (v:lens) =\n [ key k . colon . [ counter \"array\" . seq \"array\" . v ] . \n [ seq \"array\" . sep_comma_with_nl . v ]* . hardeol ]\n\n(* dependency stuff *)\n\nlet version_depends = \n [ label \"version\" \n . [ del \/ *\\( *\/ \" ( \" . label \"relation\" . store \/[<>=]+\/ ]\n . [ del_ws_spc . label \"number\" . store \/[a-zA-Z0-9_\\.\\-]+\/ \n . del \/ *\\)\/ \" )\" ] \n ]\n \nlet arch_depends = \n [ label \"arch\" \n . [ del \/ *\\[ *\/ \" [ \" . label \"prefix\" . store \/!?\/ ]\n . [ label \"name\" . store \/[a-zA-Z0-9_\\.\\-]+\/ . del \/ *\\]\/ \" ]\" ] ]\n \n\nlet package_depends \n = [ key ( \/[a-zA-Z0-9_\\-]+\/ | \/\\$\\{[a-zA-Z0-9:]+\\}\/ ) \n . ( version_depends | arch_depends ) * ]\n \n\nlet dependency = [ label \"or\" . package_depends ]\n . [ label \"or\" . del \/ *\\| *\/ \" | \"\n . package_depends ] *\n\nlet dependency_list (field:regexp) = \n [ key field . colon . [ label \"and\" . dependency ]\n . [ label \"and\" . sep_comma_with_nl . dependency ]*\n . eol ]\n\n(* source package *)\nlet uploaders =\n multi_line_array_entry \/Uploaders\/ email\n\nlet simple_src_keyword = \"Source\" | \"Section\" | \"Priority\" \n | \"Standards\\-Version\" | \"Homepage\" | \/Vcs\\-Svn\/ | \/Vcs\\-Browser\/\n | \"Maintainer\"\nlet depend_src_keywords = \/Build\\-Depends\/ | \/Build\\-Depends\\-Indep\/\n\nlet src_entries = ( simple_entry simple_src_keyword \n | uploaders \n | dependency_list depend_src_keywords ) *\n\n\n(* package paragraph *)\n\nlet simple_bin_keyword = \"Package\" | \"Architecture\" | \"Section\"\n | \"Priority\" | \"Essential\" | \"Homepage\" \n\nlet simple_bin_entry = simple_entry simple_bin_keyword \n\nlet multi_line_entry (k:string) =\n let line = \/[^\\n]+\/ in\n [ label k . del \/^ \/ \" \" . store line . hardeol ] * \n\n\nlet description \n = [ key \"Description\" . colon \n . [ label \"summary\" . store \/[a-zA-Z][^\\n]+\/ . hardeol ]\n . multi_line_entry \"text\" ]\n\n\n(* binary package *)\nlet simple_bin_keywords = \"Package\" | \"Architecture\" \nlet depend_bin_keywords = \"Depends\" | \"Recommends\" | \"Suggests\"\n\nlet bin_entries = ( simple_entry simple_bin_keywords\n | dependency_list depend_bin_keywords\n ) + . description\n\n(* The whole stuff *)\nlet lns = [ label \"srcpkg\" . src_entries ] \n . [ label \"binpkg\" . hardeol+ . bin_entries ]+\n . eol*\n\n(* lens must be used with AUG_ROOT set to debian package source directory *)\nlet xfm = transform lns (incl \"\/control\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cff19bdb979887faaf0cd340f70cc300b17f7709","subject":"Vsftpd: add isolate and isolate_network options","message":"Vsftpd: add isolate and isolate_network options\n","repos":"pevalme\/augeas,kunkku\/augeas,mlichvar\/augeas,mchf\/augeas,ptoscano\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,kunkku\/augeas,lutter\/augeas,manandbytes\/augeas,mlichvar\/augeas,hercules-team\/augeas,pevalme\/augeas,manandbytes\/augeas,mchf\/augeas,kunkku\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas","old_file":"lenses\/vsftpd.aug","new_file":"lenses\/vsftpd.aug","new_contents":"(* Parse vsftpd.conf *)\nmodule Vsftpd =\n autoload xfm\n\n(* The code in parseconf.c does not seem to allow for trailing whitespace *)\n(* in the config file *)\nlet eol = Util.del_str \"\\n\"\nlet empty = Util.empty\nlet comment = Util.comment\n\nlet bool_option_re = \/anonymous_enable|isolate|isolate_network|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert|require_ssl_reuse\/\n\nlet uint_option_re = \/accept_timeout|connect_timeout|local_umask|anon_umask|ftp_data_port|idle_session_timeout|data_connection_timeout|pasv_min_port|pasv_max_port|anon_max_rate|local_max_rate|listen_port|max_clients|file_open_mode|max_per_ip|trans_chunk_size|delay_failed_login|delay_successful_login|max_login_fails|chown_upload_mode\/\n\nlet str_option_re = \/secure_chroot_dir|ftp_username|chown_username|xferlog_file|vsftpd_log_file|message_file|nopriv_user|ftpd_banner|banned_email_file|chroot_list_file|pam_service_name|guest_username|userlist_file|anon_root|local_root|banner_file|pasv_address|listen_address|user_config_dir|listen_address6|cmds_allowed|hide_file|deny_file|user_sub_token|email_password_file|rsa_cert_file|dsa_cert_file|ssl_ciphers|rsa_private_key_file|dsa_private_key_file|ca_certs_file\/\n\nlet bool_value_re = \/[yY][eE][sS]|[tT][rR][uU][eE]|1|[nN][oO]|[fF][aA][lL][sS][eE]|0\/\n\nlet option (k:regexp) (v:regexp) = [ key k . Util.del_str \"=\" . store v . eol ]\n\nlet bool_option = option bool_option_re bool_value_re\n\nlet str_option = option str_option_re \/[^\\n]+\/\n\nlet uint_option = option uint_option_re \/[0-9]+\/\n\nlet lns = (bool_option|str_option|uint_option|comment|empty)*\n\nlet filter = (incl \"\/etc\/vsftpd.conf\") . (incl \"\/etc\/vsftpd\/vsftpd.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(* Parse vsftpd.conf *)\nmodule Vsftpd =\n autoload xfm\n\n(* The code in parseconf.c does not seem to allow for trailing whitespace *)\n(* in the config file *)\nlet eol = Util.del_str \"\\n\"\nlet empty = Util.empty\nlet comment = Util.comment\n\nlet bool_option_re = \/anonymous_enable|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert|require_ssl_reuse\/\n\nlet uint_option_re = \/accept_timeout|connect_timeout|local_umask|anon_umask|ftp_data_port|idle_session_timeout|data_connection_timeout|pasv_min_port|pasv_max_port|anon_max_rate|local_max_rate|listen_port|max_clients|file_open_mode|max_per_ip|trans_chunk_size|delay_failed_login|delay_successful_login|max_login_fails|chown_upload_mode\/\n\nlet str_option_re = \/secure_chroot_dir|ftp_username|chown_username|xferlog_file|vsftpd_log_file|message_file|nopriv_user|ftpd_banner|banned_email_file|chroot_list_file|pam_service_name|guest_username|userlist_file|anon_root|local_root|banner_file|pasv_address|listen_address|user_config_dir|listen_address6|cmds_allowed|hide_file|deny_file|user_sub_token|email_password_file|rsa_cert_file|dsa_cert_file|ssl_ciphers|rsa_private_key_file|dsa_private_key_file|ca_certs_file\/\n\nlet bool_value_re = \/[yY][eE][sS]|[tT][rR][uU][eE]|1|[nN][oO]|[fF][aA][lL][sS][eE]|0\/\n\nlet option (k:regexp) (v:regexp) = [ key k . Util.del_str \"=\" . store v . eol ]\n\nlet bool_option = option bool_option_re bool_value_re\n\nlet str_option = option str_option_re \/[^\\n]+\/\n\nlet uint_option = option uint_option_re \/[0-9]+\/\n\nlet lns = (bool_option|str_option|uint_option|comment|empty)*\n\nlet filter = (incl \"\/etc\/vsftpd.conf\") . (incl \"\/etc\/vsftpd\/vsftpd.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c1ad19f7cf90852a649ce57ff7cc0bd20beb852a","subject":"yum.aug: added pluginconf.d\/ to search path","message":"yum.aug: added pluginconf.d\/ to search path\n","repos":"leapcode\/puppet_augeas,apa-it\/puppet-augeas,SUNET\/puppet-augeas,jordiclariana\/puppet-augeas,camptocamp\/puppet-augeas","old_file":"files\/yum.aug","new_file":"files\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n let key_re = \/[^#;:= \\t\\n[\\\/]+\/ - \"baseurl\"\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/[ \\t]*(,[ \\t]*|\\n[ \\t]+)\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section = [ sechead . (entry* | entry* . (kv_list \"baseurl\") . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n let key_re = \/[^#;:= \\t\\n[\\\/]+\/ - \"baseurl\"\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/[ \\t]*(,[ \\t]*|\\n[ \\t]+)\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section = [ sechead . (entry* | entry* . (kv_list \"baseurl\") . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\") . (incl \"\/etc\/yum.repos.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"7e2fdee6387ae91e31990b027a92752c1e4b07ae","subject":"FAI_DiskConfig: Fix invalid escape sequence \\s","message":"FAI_DiskConfig: Fix invalid escape sequence \\s\n\nIt should be expanded to [ \\n\\t].\n\nSigned-off-by: Michael Chapman <a17fed27eaa842282862ff7c1b9c8395a26ac320@very.puzzling.org>\n","repos":"pevalme\/augeas,manandbytes\/augeas,jtopjian\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,manandbytes\/augeas,kumy\/augeas,jjlin\/augeas,mlichvar\/augeas,jasperla\/augeas,domcleal\/augeas,kumy\/augeas,GeoffWilliams\/augeas,lutter\/augeas,kumy\/augeas,jasperla\/augeas,ptoscano\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jjlin\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,pevalme\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,mchf\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,ptoscano\/augeas,mchf\/augeas,pevalme\/augeas,raphink\/augeas,kumy\/augeas,jtopjian\/augeas,lutter\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,kunkku\/augeas,dafugg\/augeas,jjlin\/augeas,domcleal\/augeas","old_file":"lenses\/fai_diskconfig.aug","new_file":"lenses\/fai_diskconfig.aug","new_contents":"(*\nModule: FAI_DiskConfig\n Parses disk_config files for FAI\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to the FAI wiki where possible:\n http:\/\/wiki.fai-project.org\/wiki\/Setup-storage#New_configuration_file_syntax\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n*)\n\nmodule FAI_DiskConfig =\n\n(* autoload xfm *)\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: space *)\nlet space = Sep.space\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: tag\n A generic tag beginning with a colon *)\nlet tag (re:regexp) = [ Util.del_str \":\" . key re ]\n\n(* Variable: generic_opt\n A generic key\/value option *)\nlet generic_opt (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . store kw ]\n\n(* Variable: generic_opt_list\n A generic key\/list option *)\nlet generic_opt_list (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . counter \"locallist\"\n . Build.opt_list [seq \"locallist\" . store kw] Sep.comma ]\n\n\n(************************************************************************\n * Group: RECORDS\n *************************************************************************)\n\n\n(* Group: volume *)\n\n(* Variable: mountpoint_kw *)\nlet mountpoint_kw = \"-\" (* do not mount *)\n | \"swap\" (* swap space *)\n (* fully qualified path; if :encrypt is given, the partition\n * will be encrypted, the key is generated automatically *)\n | \/\\\/[^: \\t\\n]*\/\n\n(* Variable: encrypt\n encrypt tag *)\nlet encrypt = tag \"encrypt\"\n\n(* Variable: mountpoint *)\nlet mountpoint = [ label \"mountpoint\" . store mountpoint_kw\n (* encrypt is only for the fspath, but we parse it anyway *)\n . encrypt?]\n\n(* Variable: resize\n resize tag *)\nlet resize = tag \"resize\"\n\n(* Variable: size_kw\n Regexps for size *)\nlet size_kw = \/[0-9]+[kMGTP%]?(-([0-9]+[kMGTP%]?)?)?\/\n | \/-[0-9]+[kMGTP%]?\/\n\n(* Variable: size *)\nlet size = [ label \"size\" . store size_kw . resize? ]\n\n(* Variable: filesystem_kw\n Regexps for filesystem *)\nlet filesystem_kw = \"-\"\n | \"swap\"\n (* NOTE: Restraining this regexp would improve perfs *)\n | (Rx.no_spaces - \"-\" - \"swap\") (* mkfs.xxx must exist *)\n\n(* Variable: filesystem *)\nlet filesystem = [ label \"filesystem\" . store filesystem_kw ]\n\n\n(* Variable: mount_option_value *)\nlet mount_option_value = [ label \"value\" . Util.del_str \"=\"\n . store \/[^,= \\t\\n]+\/ ]\n\n(* Variable: mount_option\n Counting options *)\nlet mount_option = [ seq \"mount_option\"\n . store \/[^,= \\t\\n]+\/\n . mount_option_value? ]\n\n(* Variable: mount_options\n An array of <mount_option>s *)\nlet mount_options = [ label \"mount_options\"\n . counter \"mount_option\"\n . Build.opt_list mount_option Sep.comma ]\n\n(* Variable: fs_option *)\nlet fs_option =\n [ key \/createopts|tuneopts\/\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: fs_options\n An array of <fs_option>s *)\nlet fs_options =\n (* options to append to mkfs.xxx and to the filesystem-specific\n * tuning tool *)\n [ label \"fs_options\" . Build.opt_list fs_option Sep.space ]\n\n(* Variable: volume_full *)\nlet volume_full (type:lens) (third_field:lens) =\n [ type . space\n . mountpoint .space\n (* The third field changes depending on types *)\n . third_field . space\n . filesystem . space\n . mount_options\n . (space . fs_options)?\n . eol ]\n\n(* Variable: name\n LVM volume group name *)\nlet name = [ label \"name\" . store \/[^\\\/ \\t\\n]+\/ ]\n\n(* Variable: partition\n An optional partition number for <disk> *)\nlet partition = [ label \"partition\" . Util.del_str \".\" . store \/[0-9]+\/ ]\n\n(* Variable: disk *)\nlet disk = [ label \"disk\" . store \/[^\\., \\t\\n]+\/ . partition? ]\n\n(* Variable: vg_option\n An option for <volume_vg> *)\nlet vg_option =\n [ key \"pvcreateopts\"\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: volume_vg *)\nlet volume_vg = [ key \"vg\"\n . space . name\n . space . disk\n . (space . vg_option)?\n . eol ]\n\n(* Variable: spare_missing *)\nlet spare_missing = tag \/spare|missing\/\n\n(* Variable: disk_with_opt\n A <disk> with a spare\/missing option for raids *)\nlet disk_with_opt = [ label \"disk\" . store \/[^:\\., \\t\\n]+\/ . partition?\n . spare_missing* ]\n\n(* Variable: disk_list\n A list of <disk_with_opt>s *)\nlet disk_list = Build.opt_list disk_with_opt Sep.comma\n\n(* Variable: type_label_lv *)\nlet type_label_lv = label \"lv\"\n . [ label \"vg\" . store (\/[^# \\t\\n-]+\/ - \"raw\") ]\n . Util.del_str \"-\"\n . [ label \"name\" . store \/[^ \\t\\n]+\/ ]\n\n(* Variable: volume_tmpfs *)\nlet volume_tmpfs =\n [ key \"tmpfs\" . space\n . mountpoint .space\n . size . space\n . mount_options\n . (space . fs_options)?\n . eol ]\n\n(* Variable: volume_lvm *)\nlet volume_lvm = volume_full type_label_lv size (* lvm logical volume: vg name and lv name *)\n | volume_vg\n\n(* Variable: volume_raid *)\nlet volume_raid = volume_full (key \/raid[0156]\/) disk_list (* raid level *)\n\n(* Variable: device *)\nlet device = [ label \"device\" . store Rx.fspath ]\n\n(* Variable: volume_cryptsetup *)\nlet volume_cryptsetup = volume_full (key (\"swap\"|\"tmp\"|\"luks\")) device\n\n(* Variable: volume *)\nlet volume = volume_full (key \"primary\") size (* for physical disks only *)\n | volume_full (key \"logical\") size (* for physical disks only *)\n | volume_full (key \"raw-disk\") size\n\n(* Variable: volume_or_comment\n A succesion of <volume>s and <comment>s *)\nlet volume_or_comment (vol:lens) =\n (vol|empty|comment)* . vol\n\n(* Variable: disk_config_entry *)\nlet disk_config_entry (kw:regexp) (opt:lens) (vol:lens) =\n [ key \"disk_config\" . space . store kw\n . (space . opt)* . eol\n . (volume_or_comment vol)? ]\n\n(* Variable: lvmoption *)\nlet lvmoption =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt \"preserve_reinstall\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* attempt to resize partitions *)\n | generic_opt \"resize\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: raidoption *)\nlet raidoption =\n (* preserve partitions -- always *)\n generic_opt_list \"preserve_always\" (Rx.integer | \"all\")\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt_list \"preserve_reinstall\" Rx.integer\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: option *)\nlet option =\n (* preserve partitions -- always *)\n generic_opt_list \"preserve_always\" (Rx.integer | \"all\")\n (* preserve partitions -- unless the system is installed\n for the first time *)\n | generic_opt_list \"preserve_reinstall\" Rx.integer\n (* attempt to resize partitions *)\n | generic_opt_list \"resize\" Rx.integer\n (* write a disklabel - default is msdos *)\n | generic_opt \"disklabel\" \/msdos|gpt\/\n (* mark a partition bootable, default is \/ *)\n | generic_opt \"bootable\" Rx.integer\n (* do not assume the disk to be a physical device, use with xen *)\n | [ key \"virtual\" ]\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n | generic_opt_list \"always_format\" Rx.integer\n | generic_opt \"sameas\" Rx.fspath\n\nlet cryptoption =\n [ key \"randinit\" ]\n\n(* Variable: disk_config *)\nlet disk_config =\n let other_label = Rx.fspath - \"lvm\" - \"raid\" - \"end\" - \/disk[0-9]+\/\n - \"cryptsetup\" - \"tmpfs\" in\n disk_config_entry \"lvm\" lvmoption volume_lvm\n | disk_config_entry \"raid\" raidoption volume_raid\n | disk_config_entry \"tmpfs\" option volume_tmpfs\n | disk_config_entry \"end\" option volume (* there shouldn't be an option here *)\n | disk_config_entry \/disk[0-9]+\/ option volume\n | disk_config_entry \"cryptsetup\" cryptoption volume_cryptsetup\n | disk_config_entry other_label option volume\n\n(* Variable: lns\n The disk_config lens *)\nlet lns = (disk_config|comment|empty)*\n\n\n(* let xfm = transform lns Util.stdexcl *)\n","old_contents":"(*\nModule: FAI_DiskConfig\n Parses disk_config files for FAI\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to the FAI wiki where possible:\n http:\/\/wiki.fai-project.org\/wiki\/Setup-storage#New_configuration_file_syntax\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n*)\n\nmodule FAI_DiskConfig =\n\n(* autoload xfm *)\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: space *)\nlet space = Sep.space\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: tag\n A generic tag beginning with a colon *)\nlet tag (re:regexp) = [ Util.del_str \":\" . key re ]\n\n(* Variable: generic_opt\n A generic key\/value option *)\nlet generic_opt (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . store kw ]\n\n(* Variable: generic_opt_list\n A generic key\/list option *)\nlet generic_opt_list (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . counter \"locallist\"\n . Build.opt_list [seq \"locallist\" . store kw] Sep.comma ]\n\n\n(************************************************************************\n * Group: RECORDS\n *************************************************************************)\n\n\n(* Group: volume *)\n\n(* Variable: mountpoint_kw *)\nlet mountpoint_kw = \"-\" (* do not mount *)\n | \"swap\" (* swap space *)\n (* fully qualified path; if :encrypt is given, the partition\n * will be encrypted, the key is generated automatically *)\n | \/\\\/[^: \\t\\n]*\/\n\n(* Variable: encrypt\n encrypt tag *)\nlet encrypt = tag \"encrypt\"\n\n(* Variable: mountpoint *)\nlet mountpoint = [ label \"mountpoint\" . store mountpoint_kw\n (* encrypt is only for the fspath, but we parse it anyway *)\n . encrypt?]\n\n(* Variable: resize\n resize tag *)\nlet resize = tag \"resize\"\n\n(* Variable: size_kw\n Regexps for size *)\nlet size_kw = \/[0-9]+[kMGTP%]?(-([0-9]+[kMGTP%]?)?)?\/\n | \/-[0-9]+[kMGTP%]?\/\n\n(* Variable: size *)\nlet size = [ label \"size\" . store size_kw . resize? ]\n\n(* Variable: filesystem_kw\n Regexps for filesystem *)\nlet filesystem_kw = \"-\"\n | \"swap\"\n (* NOTE: Restraining this regexp would improve perfs *)\n | (Rx.no_spaces - \"-\" - \"swap\") (* mkfs.xxx must exist *)\n\n(* Variable: filesystem *)\nlet filesystem = [ label \"filesystem\" . store filesystem_kw ]\n\n\n(* Variable: mount_option_value *)\nlet mount_option_value = [ label \"value\" . Util.del_str \"=\"\n . store \/[^,= \\t\\n]+\/ ]\n\n(* Variable: mount_option\n Counting options *)\nlet mount_option = [ seq \"mount_option\"\n . store \/[^,= \\t\\n]+\/\n . mount_option_value? ]\n\n(* Variable: mount_options\n An array of <mount_option>s *)\nlet mount_options = [ label \"mount_options\"\n . counter \"mount_option\"\n . Build.opt_list mount_option Sep.comma ]\n\n(* Variable: fs_option *)\nlet fs_option =\n [ key \/createopts|tuneopts\/\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: fs_options\n An array of <fs_option>s *)\nlet fs_options =\n (* options to append to mkfs.xxx and to the filesystem-specific\n * tuning tool *)\n [ label \"fs_options\" . Build.opt_list fs_option Sep.space ]\n\n(* Variable: volume_full *)\nlet volume_full (type:lens) (third_field:lens) =\n [ type . space\n . mountpoint .space\n (* The third field changes depending on types *)\n . third_field . space\n . filesystem . space\n . mount_options\n . (space . fs_options)?\n . eol ]\n\n(* Variable: name\n LVM volume group name *)\nlet name = [ label \"name\" . store \/[^\\\/ \\t\\n]+\/ ]\n\n(* Variable: partition\n An optional partition number for <disk> *)\nlet partition = [ label \"partition\" . Util.del_str \".\" . store \/[0-9]+\/ ]\n\n(* Variable: disk *)\nlet disk = [ label \"disk\" . store \/[^\\., \\t\\n]+\/ . partition? ]\n\n(* Variable: vg_option\n An option for <volume_vg> *)\nlet vg_option =\n [ key \"pvcreateopts\"\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: volume_vg *)\nlet volume_vg = [ key \"vg\"\n . space . name\n . space . disk\n . (space . vg_option)?\n . eol ]\n\n(* Variable: spare_missing *)\nlet spare_missing = tag \/spare|missing\/\n\n(* Variable: disk_with_opt\n A <disk> with a spare\/missing option for raids *)\nlet disk_with_opt = [ label \"disk\" . store \/[^:\\., \\t\\n]+\/ . partition?\n . spare_missing* ]\n\n(* Variable: disk_list\n A list of <disk_with_opt>s *)\nlet disk_list = Build.opt_list disk_with_opt Sep.comma\n\n(* Variable: type_label_lv *)\nlet type_label_lv = label \"lv\"\n . [ label \"vg\" . store (\/[^# \\t\\n-]+\/ - \"raw\") ]\n . Util.del_str \"-\"\n . [ label \"name\" . store \/[^ \\t\\n]+\/ ]\n\n(* Variable: volume_tmpfs *)\nlet volume_tmpfs =\n [ key \"tmpfs\" . space\n . mountpoint .space\n . size . space\n . mount_options\n . (space . fs_options)?\n . eol ]\n\n(* Variable: volume_lvm *)\nlet volume_lvm = volume_full type_label_lv size (* lvm logical volume: vg name and lv name *)\n | volume_vg\n\n(* Variable: volume_raid *)\nlet volume_raid = volume_full (key \/raid[0156]\/) disk_list (* raid level *)\n\n(* Variable: device *)\nlet device = [ label \"device\" . store Rx.fspath ]\n\n(* Variable: volume_cryptsetup *)\nlet volume_cryptsetup = volume_full (key (\"swap\"|\"tmp\"|\"luks\")) device\n\n(* Variable: volume *)\nlet volume = volume_full (key \"primary\") size (* for physical disks only *)\n | volume_full (key \"logical\") size (* for physical disks only *)\n | volume_full (key \"raw-disk\") size\n\n(* Variable: volume_or_comment\n A succesion of <volume>s and <comment>s *)\nlet volume_or_comment (vol:lens) =\n (vol|empty|comment)* . vol\n\n(* Variable: disk_config_entry *)\nlet disk_config_entry (kw:regexp) (opt:lens) (vol:lens) =\n [ key \"disk_config\" . space . store kw\n . (space . opt)* . eol\n . (volume_or_comment vol)? ]\n\n(* Variable: lvmoption *)\nlet lvmoption =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/,\\s\\-]+-[^\\\/, \\t\\n-]+)*\/\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt \"preserve_reinstall\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* attempt to resize partitions *)\n | generic_opt \"resize\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: raidoption *)\nlet raidoption =\n (* preserve partitions -- always *)\n generic_opt_list \"preserve_always\" (Rx.integer | \"all\")\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt_list \"preserve_reinstall\" Rx.integer\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: option *)\nlet option =\n (* preserve partitions -- always *)\n generic_opt_list \"preserve_always\" (Rx.integer | \"all\")\n (* preserve partitions -- unless the system is installed\n for the first time *)\n | generic_opt_list \"preserve_reinstall\" Rx.integer\n (* attempt to resize partitions *)\n | generic_opt_list \"resize\" Rx.integer\n (* write a disklabel - default is msdos *)\n | generic_opt \"disklabel\" \/msdos|gpt\/\n (* mark a partition bootable, default is \/ *)\n | generic_opt \"bootable\" Rx.integer\n (* do not assume the disk to be a physical device, use with xen *)\n | [ key \"virtual\" ]\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n | generic_opt_list \"always_format\" Rx.integer\n | generic_opt \"sameas\" Rx.fspath\n\nlet cryptoption =\n [ key \"randinit\" ]\n\n(* Variable: disk_config *)\nlet disk_config =\n let other_label = Rx.fspath - \"lvm\" - \"raid\" - \"end\" - \/disk[0-9]+\/\n - \"cryptsetup\" - \"tmpfs\" in\n disk_config_entry \"lvm\" lvmoption volume_lvm\n | disk_config_entry \"raid\" raidoption volume_raid\n | disk_config_entry \"tmpfs\" option volume_tmpfs\n | disk_config_entry \"end\" option volume (* there shouldn't be an option here *)\n | disk_config_entry \/disk[0-9]+\/ option volume\n | disk_config_entry \"cryptsetup\" cryptoption volume_cryptsetup\n | disk_config_entry other_label option volume\n\n(* Variable: lns\n The disk_config lens *)\nlet lns = (disk_config|comment|empty)*\n\n\n(* let xfm = transform lns Util.stdexcl *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b96dbdd70f5779abb3645c5708d64a5c84304b40","subject":"Allow spaces after 'endscript' in logrotate.aug","message":"Allow spaces after 'endscript' in logrotate.aug\n","repos":"ptoscano\/augeas,MikaelSmith\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,kunkku\/augeas,kunkku\/augeas,mchf\/augeas,ptoscano\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kumy\/augeas,hercules-team\/augeas,kumy\/augeas,jjlin\/augeas,mlichvar\/augeas,jtopjian\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,raphink\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,domcleal\/augeas,kunkku\/augeas,kumy\/augeas,kumy\/augeas,mlichvar\/augeas,jasperla\/augeas,dafugg\/augeas,ptoscano\/augeas,lutter\/augeas,raphink\/augeas,lutter\/augeas,manandbytes\/augeas,jtopjian\/augeas,dafugg\/augeas,pevalme\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,jjlin\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,manandbytes\/augeas,domcleal\/augeas,jjlin\/augeas","old_file":"lenses\/logrotate.aug","new_file":"lenses\/logrotate.aug","new_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = \/[0-9]+\/\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = \/\\\/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n (* define comments and empty lines *)\n let comment (indent:string) =\n let nl = Util.del_str \"\\n\" in\n [ label \"#comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n].*)?\/ . nl ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_val . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ del \/[ \\t]*\/ indent . key \"create\" .\n ( mode | mode . owner | mode . owner . group )?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" size indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" size indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . del \"\\n\" \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ del \/[ \\t]*\/ \"\\t\" . key hook_names . eol .\n hook_lines .\n del \/[ \\t]*endscript[ \\t]*\\n\/ \"\\tendscript\\n\" ]\n\n (* Define rule *)\n\n let body = del \/\\{[ \\t]*\\n\/ \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n let rule =\n [ label \"rule\" . Util.indent .\n [ label \"file\" . store filename ] .\n\t [ del \/[ \\t\\n]+\/ \" \" . label \"file\" . store filename ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = \/[0-9]+\/\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = \/\\\/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n (* define comments and empty lines *)\n let comment (indent:string) =\n let nl = Util.del_str \"\\n\" in\n [ label \"#comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n].*)?\/ . nl ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_val . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ del \/[ \\t]*\/ indent . key \"create\" .\n ( mode | mode . owner | mode . owner . group )?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" size indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" size indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . del \"\\n\" \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ del \/[ \\t]*\/ \"\\t\" . key hook_names . eol .\n hook_lines .\n del \/[ \\t]*endscript\\n\/ \"\\tendscript\\n\" ]\n\n (* Define rule *)\n\n let body = del \/\\{[ \\t]*\\n\/ \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n let rule =\n [ label \"rule\" . Util.indent .\n [ label \"file\" . store filename ] .\n\t [ del \/[ \\t\\n]+\/ \" \" . label \"file\" . store filename ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a370d9ccfbd0b6b6f927880014b29569c58b03c0","subject":"Grub: handle \"foreground\" option","message":"Grub: handle \"foreground\" option\n\nFixes RHBZ#1059383\n","repos":"mchf\/augeas,dafugg\/augeas,raphink\/augeas,mlichvar\/augeas,jtopjian\/augeas,jtopjian\/augeas,lutter\/augeas,raphink\/augeas,lutter\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,MikaelSmith\/augeas,jasperla\/augeas,kunkku\/augeas,jjlin\/augeas,dafugg\/augeas,ptoscano\/augeas,ptoscano\/augeas,ptoscano\/augeas,jjlin\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,hercules-team\/augeas,pevalme\/augeas,mlichvar\/augeas,manandbytes\/augeas,dafugg\/augeas,hercules-team\/augeas,jasperla\/augeas,kunkku\/augeas,mchf\/augeas,lutter\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,pevalme\/augeas","old_file":"lenses\/grub.aug","new_file":"lenses\/grub.aug","new_contents":"(*\nModule: Grub\n Parses grub configuration\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* View: value_to_eol *)\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n\n (* View: eol *)\n let eol = Util.eol\n\n (* View: del_to_eol *)\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n\n (* View: spc *)\n let spc = Util.del_ws_spc\n\n (* View: opt_ws *)\n let opt_ws = Util.del_opt_ws \"\"\n\n (* View: dels *)\n let dels (s:string) = Util.del_str s\n\n (* View: eq *)\n let eq = dels \"=\"\n\n (* View: switch *)\n let switch (n:regexp) = dels \"--\" . key n\n\n (* View: switch_arg *)\n let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces\n\n (* View: value_sep *)\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n (* View: comment_re *)\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n (* View: comment *)\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n\n (* View: empty *)\n let empty = Util.empty\n\n(************************************************************************\n * Group: USEFUL FUNCTIONS\n *************************************************************************)\n\n (* View: command *)\n let command (kw:regexp) (indent:string) =\n Util.del_opt_ws indent . key kw\n\n (* View: kw_arg *)\n let kw_arg (kw:regexp) (indent:string) (dflt_sep:string) =\n [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]\n\n (* View: kw_boot_arg *)\n let kw_boot_arg (kw:regexp) = kw_arg kw \"\\t\" \" \"\n\n (* View: kw_menu_arg *)\n let kw_menu_arg (kw:regexp) = kw_arg kw \"\" \" \"\n\n (* View: password_arg *)\n let password_arg = [ key \"password\" .\n (spc . [ switch \"md5\" ])? .\n (spc . [ switch \"encrypted\" ])? .\n spc . store (\/[^ \\t\\n]+\/ - \/--[^ \\t\\n]+\/) .\n (spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n (* View: kw_pres *)\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n(************************************************************************\n * Group: BOOT ENTRIES\n *************************************************************************)\n\n (* View: device\n * This is a shell-only directive in upstream grub; the grub versions\n * in at least Fedora\/RHEL use this to find devices for UEFI boot *)\n let device =\n [ command \"device\" \"\" . Sep.space . store \/\\([A-Za-z0-9_.-]+\\)\/ . spc .\n [ label \"file\" . value_to_eol ] . Util.eol ]\n\n (* View: color *)\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n dels \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n spc . [ label \"normal\" . color_spec ] .\n (spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n (* View: serial *)\n let serial =\n [ command \"serial\" \"\" .\n [ spc . switch_arg \/unit|port|speed|word|parity|stop|device\/ ]* .\n eol ]\n\n (* View: terminal *)\n let terminal =\n [ command \"terminal\" \"\" .\n ([ spc . switch \/dumb|no-echo|no-edit|silent\/ ]\n |[ spc . switch_arg \/timeout|lines\/ ])* .\n [ spc . key \/console|serial|hercules\/ ]* . eol ]\n\n (* View: setkey *)\n let setkey = [ command \"setkey\" \"\" .\n ( spc . [ label \"to\" . store Rx.no_spaces ] .\n spc . [ label \"from\" . store Rx.no_spaces ] )? .\n eol ]\n\n (* View: menu_setting *)\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"gfxmenu\"\n | kw_menu_arg \"foreground\"\n | kw_menu_arg \"background\"\n | kw_menu_arg \"verbose\"\n | serial\n | terminal\n | password_arg\n | color\n | device\n | setkey\n\n (* View: title *)\n let title = del \/title[ \\t=]+\/ \"title \" . value_to_eol . eol\n\n (* View: multiboot_arg\n * Permits a second form for Solaris multiboot kernels that\n * take a path (with a slash) as their first arg, e.g.\n * \/boot\/multiboot kernel\/unix another=arg *)\n let multiboot_arg = [ label \"@path\" .\n store (Rx.word . \"\/\" . Rx.no_spaces) ]\n\n (* View: kernel_args\n Parse the file name and args on a kernel or module line. *)\n let kernel_args =\n let arg = \/[A-Za-z0-9_.$-]+\/ - \/type|no-mem-option\/ in\n store \/(\\([a-z0-9,]+\\))?\\\/[^ \\t\\n]*\/ .\n (spc . multiboot_arg)? .\n (spc . [ key arg . (eq. store \/([^ \\t\\n])*\/)?])* . eol\n\n (* View: module_line\n Solaris extension adds module$ and kernel$ for variable interpolation *)\n let module_line =\n [ command \/module\\$?\/ \"\\t\" . spc . kernel_args ]\n\n (* View: map_line *)\n let map_line =\n [ command \"map\" \"\\t\" . spc .\n [ label \"from\" . store \/[()A-za-z0-9]+\/ ] . spc .\n [ label \"to\" . store \/[()A-za-z0-9]+\/ ] . eol ]\n\n (* View: kernel *)\n let kernel =\n [ command \/kernel\\$?\/ \"\\t\" .\n (spc .\n ([switch \"type\" . eq . store \/[a-z]+\/]\n |[switch \"no-mem-option\"]))* .\n spc . kernel_args ]\n\n (* View: chainloader *)\n let chainloader =\n [ command \"chainloader\" \"\\t\" .\n [ spc . switch \"force\" ]? . spc . store Rx.no_spaces . eol ]\n\n (* View: savedefault *)\n let savedefault =\n [ command \"savedefault\" \"\\t\" . (spc . store Rx.integer)? . eol ]\n\n (* View: configfile *)\n let configfile =\n [ command \"configfile\" \"\\t\" . spc . store Rx.no_spaces . eol ]\n\n (* View: boot_setting\n <boot> entries *)\n let boot_setting =\n let boot_arg_re = \"root\" | \"initrd\" | \"rootnoverify\" | \"uuid\"\n | \"findroot\" | \"bootfs\" (* Solaris extensions *)\n in kw_boot_arg boot_arg_re\n | kernel\n | chainloader\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | savedefault\n | configfile\n | module_line\n | map_line\n | kw_pres \"lock\"\n | kw_pres \"makeactive\"\n\n (* View: boot *)\n let boot =\n let line = ((boot_setting|comment)* . boot_setting)? in\n [ label \"title\" . title . line ]\n\n(************************************************************************\n * Group: DEBIAN-SPECIFIC SECTIONS\n *************************************************************************)\n\n (* View: debian_header\n Header for a <debian>-specific section *)\n let debian_header = \"## ## Start Default Options ##\\n\"\n\n (* View: debian_footer\n Footer for a <debian>-specific section *)\n let debian_footer = \"## ## End Default Options ##\\n\"\n\n (* View: debian_comment_re *)\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n\n (* View: debian_comment\n A comment entry inside a <debian>-specific section *)\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n\n (* View: debian_setting_re *)\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n | \"indomU\"\n\n (* View: debian_entry *)\n let debian_entry = [ Util.del_str \"#\" . Util.indent\n . key debian_setting_re . del \/[ \\t]*=\/ \"=\"\n . value_to_eol? . eol ]\n\n (* View: debian\n A debian-specific section, made of <debian_entry> lines *)\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n (* View: lns *)\n let lns = (comment | empty | menu_setting | boot | debian)*\n\n (* View: filter *)\n let filter = incl \"\/boot\/grub\/grub.conf\"\n . incl \"\/boot\/grub\/menu.lst\"\n . incl \"\/etc\/grub.conf\"\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Grub\n Parses grub configuration\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* View: value_to_eol *)\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n\n (* View: eol *)\n let eol = Util.eol\n\n (* View: del_to_eol *)\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n\n (* View: spc *)\n let spc = Util.del_ws_spc\n\n (* View: opt_ws *)\n let opt_ws = Util.del_opt_ws \"\"\n\n (* View: dels *)\n let dels (s:string) = Util.del_str s\n\n (* View: eq *)\n let eq = dels \"=\"\n\n (* View: switch *)\n let switch (n:regexp) = dels \"--\" . key n\n\n (* View: switch_arg *)\n let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces\n\n (* View: value_sep *)\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n (* View: comment_re *)\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n (* View: comment *)\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n\n (* View: empty *)\n let empty = Util.empty\n\n(************************************************************************\n * Group: USEFUL FUNCTIONS\n *************************************************************************)\n\n (* View: command *)\n let command (kw:regexp) (indent:string) =\n Util.del_opt_ws indent . key kw\n\n (* View: kw_arg *)\n let kw_arg (kw:regexp) (indent:string) (dflt_sep:string) =\n [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]\n\n (* View: kw_boot_arg *)\n let kw_boot_arg (kw:regexp) = kw_arg kw \"\\t\" \" \"\n\n (* View: kw_menu_arg *)\n let kw_menu_arg (kw:regexp) = kw_arg kw \"\" \" \"\n\n (* View: password_arg *)\n let password_arg = [ key \"password\" .\n (spc . [ switch \"md5\" ])? .\n (spc . [ switch \"encrypted\" ])? .\n spc . store (\/[^ \\t\\n]+\/ - \/--[^ \\t\\n]+\/) .\n (spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n (* View: kw_pres *)\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n(************************************************************************\n * Group: BOOT ENTRIES\n *************************************************************************)\n\n (* View: device\n * This is a shell-only directive in upstream grub; the grub versions\n * in at least Fedora\/RHEL use this to find devices for UEFI boot *)\n let device =\n [ command \"device\" \"\" . Sep.space . store \/\\([A-Za-z0-9_.-]+\\)\/ . spc .\n [ label \"file\" . value_to_eol ] . Util.eol ]\n\n (* View: color *)\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n dels \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n spc . [ label \"normal\" . color_spec ] .\n (spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n (* View: serial *)\n let serial =\n [ command \"serial\" \"\" .\n [ spc . switch_arg \/unit|port|speed|word|parity|stop|device\/ ]* .\n eol ]\n\n (* View: terminal *)\n let terminal =\n [ command \"terminal\" \"\" .\n ([ spc . switch \/dumb|no-echo|no-edit|silent\/ ]\n |[ spc . switch_arg \/timeout|lines\/ ])* .\n [ spc . key \/console|serial|hercules\/ ]* . eol ]\n\n (* View: setkey *)\n let setkey = [ command \"setkey\" \"\" .\n ( spc . [ label \"to\" . store Rx.no_spaces ] .\n spc . [ label \"from\" . store Rx.no_spaces ] )? .\n eol ]\n\n (* View: menu_setting *)\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"gfxmenu\"\n | kw_menu_arg \"background\"\n | kw_menu_arg \"verbose\"\n | serial\n | terminal\n | password_arg\n | color\n | device\n | setkey\n\n (* View: title *)\n let title = del \/title[ \\t=]+\/ \"title \" . value_to_eol . eol\n\n (* View: multiboot_arg\n * Permits a second form for Solaris multiboot kernels that\n * take a path (with a slash) as their first arg, e.g.\n * \/boot\/multiboot kernel\/unix another=arg *)\n let multiboot_arg = [ label \"@path\" .\n store (Rx.word . \"\/\" . Rx.no_spaces) ]\n\n (* View: kernel_args\n Parse the file name and args on a kernel or module line. *)\n let kernel_args =\n let arg = \/[A-Za-z0-9_.$-]+\/ - \/type|no-mem-option\/ in\n store \/(\\([a-z0-9,]+\\))?\\\/[^ \\t\\n]*\/ .\n (spc . multiboot_arg)? .\n (spc . [ key arg . (eq. store \/([^ \\t\\n])*\/)?])* . eol\n\n (* View: module_line\n Solaris extension adds module$ and kernel$ for variable interpolation *)\n let module_line =\n [ command \/module\\$?\/ \"\\t\" . spc . kernel_args ]\n\n (* View: map_line *)\n let map_line =\n [ command \"map\" \"\\t\" . spc .\n [ label \"from\" . store \/[()A-za-z0-9]+\/ ] . spc .\n [ label \"to\" . store \/[()A-za-z0-9]+\/ ] . eol ]\n\n (* View: kernel *)\n let kernel =\n [ command \/kernel\\$?\/ \"\\t\" .\n (spc .\n ([switch \"type\" . eq . store \/[a-z]+\/]\n |[switch \"no-mem-option\"]))* .\n spc . kernel_args ]\n\n (* View: chainloader *)\n let chainloader =\n [ command \"chainloader\" \"\\t\" .\n [ spc . switch \"force\" ]? . spc . store Rx.no_spaces . eol ]\n\n (* View: savedefault *)\n let savedefault =\n [ command \"savedefault\" \"\\t\" . (spc . store Rx.integer)? . eol ]\n\n (* View: configfile *)\n let configfile =\n [ command \"configfile\" \"\\t\" . spc . store Rx.no_spaces . eol ]\n\n (* View: boot_setting\n <boot> entries *)\n let boot_setting =\n let boot_arg_re = \"root\" | \"initrd\" | \"rootnoverify\" | \"uuid\"\n | \"findroot\" | \"bootfs\" (* Solaris extensions *)\n in kw_boot_arg boot_arg_re\n | kernel\n | chainloader\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | savedefault\n | configfile\n | module_line\n | map_line\n | kw_pres \"lock\"\n | kw_pres \"makeactive\"\n\n (* View: boot *)\n let boot =\n let line = ((boot_setting|comment)* . boot_setting)? in\n [ label \"title\" . title . line ]\n\n(************************************************************************\n * Group: DEBIAN-SPECIFIC SECTIONS\n *************************************************************************)\n\n (* View: debian_header\n Header for a <debian>-specific section *)\n let debian_header = \"## ## Start Default Options ##\\n\"\n\n (* View: debian_footer\n Footer for a <debian>-specific section *)\n let debian_footer = \"## ## End Default Options ##\\n\"\n\n (* View: debian_comment_re *)\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n\n (* View: debian_comment\n A comment entry inside a <debian>-specific section *)\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n\n (* View: debian_setting_re *)\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n | \"indomU\"\n\n (* View: debian_entry *)\n let debian_entry = [ Util.del_str \"#\" . Util.indent\n . key debian_setting_re . del \/[ \\t]*=\/ \"=\"\n . value_to_eol? . eol ]\n\n (* View: debian\n A debian-specific section, made of <debian_entry> lines *)\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n (* View: lns *)\n let lns = (comment | empty | menu_setting | boot | debian)*\n\n (* View: filter *)\n let filter = incl \"\/boot\/grub\/grub.conf\"\n . incl \"\/boot\/grub\/menu.lst\"\n . incl \"\/etc\/grub.conf\"\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"66c0aa7434c7ce478d1231f733a36db4449f3e42","subject":"Suppress .rpmnew\/save files","message":"Suppress .rpmnew\/save files\n","repos":"lutter\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,dafugg\/augeas,kumy\/augeas,pevalme\/augeas,mlichvar\/augeas,camptocamp\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,jjlin\/augeas,bkearney\/augeas,pevalme\/augeas,raphink\/augeas,camptocamp\/augeas,kunkku\/augeas,mchf\/augeas,lutter\/augeas,hercules-team\/augeas,jasperla\/augeas,kunkku\/augeas,lutter\/augeas,dafugg\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,hercules-team\/augeas,mlichvar\/augeas,camptocamp\/augeas,pevalme\/augeas,bkearney\/augeas,MikaelSmith\/augeas,bkearney\/augeas,jjlin\/augeas,jasperla\/augeas,bkearney\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,kumy\/augeas,ptoscano\/augeas,jtopjian\/augeas,ptoscano\/augeas,jjlin\/augeas,manandbytes\/augeas,manandbytes\/augeas,kumy\/augeas,camptocamp\/augeas,domcleal\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,mchf\/augeas,ptoscano\/augeas,raphink\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(* Simple utilities used in several places *)\nmodule Util =\n let del_str (s:string) = del s s\n\n let del_ws = del \/[ \\t]+\/\n let del_ws_spc = del_ws \" \"\n let del_ws_tab = del_ws \"\\t\"\n\n (* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n (* appears in a separate subtree. The labels for the subtrees are *)\n (* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n (* Exclusion for files that are commonly not wanted\/needed *)\n let stdexcl = (excl \"*~\") . (excl \"*.rpmnew\") . (excl \"*.rpmsave\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Simple utilities used in several places *)\nmodule Util =\n let del_str (s:string) = del s s\n\n let del_ws = del \/[ \\t]+\/\n let del_ws_spc = del_ws \" \"\n let del_ws_tab = del_ws \"\\t\"\n\n (* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n (* appears in a separate subtree. The labels for the subtrees are *)\n (* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n (* Exclusion for files that are commonly not wanted\/needed *)\n let stdexcl = excl \"*~\"\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3ce70f278fc34fca07b373137f7a193c7b3ebfdf","subject":"Sshd: add test showing how to add a Subsystem","message":"Sshd: add test showing how to add a Subsystem\n","repos":"mchf\/augeas,kumy\/augeas,raphink\/augeas,domcleal\/augeas,raphink\/augeas,jjlin\/augeas,bkearney\/augeas,ptoscano\/augeas,pevalme\/augeas,kumy\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,pevalme\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,hercules-team\/augeas,mlichvar\/augeas,jjlin\/augeas,bkearney\/augeas,mlichvar\/augeas,domcleal\/augeas,bkearney\/augeas,camptocamp\/augeas,camptocamp\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,dafugg\/augeas,camptocamp\/augeas,camptocamp\/augeas,bkearney\/augeas,jtopjian\/augeas,kunkku\/augeas,mchf\/augeas,lutter\/augeas,kumy\/augeas,lutter\/augeas,domcleal\/augeas,ptoscano\/augeas,jjlin\/augeas,dafugg\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/tests\/test_sshd.aug","new_file":"lenses\/tests\/test_sshd.aug","new_contents":"module Test_sshd =\n\n let accept_env = \"Protocol 2\nAcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT\nAcceptEnv LC_IDENTIFICATION LC_ALL\\n\"\n\n test Sshd.lns get accept_env =\n { \"Protocol\" = \"2\" }\n { \"AcceptEnv\"\n { \"1\" = \"LC_PAPER\" }\n { \"2\" = \"LC_NAME\" }\n { \"3\" = \"LC_ADDRESS\" }\n { \"4\" = \"LC_TELEPHONE\" }\n { \"5\" = \"LC_MEASUREMENT\" } }\n { \"AcceptEnv\"\n { \"6\" = \"LC_IDENTIFICATION\" }\n { \"7\" = \"LC_ALL\" } }\n\n\n test Sshd.lns get \"HostKey \/etc\/ssh\/ssh_host_rsa_key\nHostKey \/etc\/ssh\/ssh_host_dsa_key\\n\" =\n { \"HostKey\" = \"\/etc\/ssh\/ssh_host_rsa_key\" }\n { \"HostKey\" = \"\/etc\/ssh\/ssh_host_dsa_key\" }\n\n\n test Sshd.lns put accept_env after\n rm \"AcceptEnv\";\n rm \"AcceptEnv\";\n set \"Protocol\" \"1.5\";\n set \"X11Forwarding\" \"yes\"\n = \"Protocol 1.5\\nX11Forwarding yes\\n\"\n\n test Sshd.lns get \"AuthorizedKeysFile %h\/.ssh\/authorized_keys\\n\" =\n { \"AuthorizedKeysFile\" = \"%h\/.ssh\/authorized_keys\" }\n\n test Sshd.lns get \"Subsystem sftp \/usr\/lib\/openssh\/sftp-server\\n\" =\n { \"Subsystem\" \n\t{ \"sftp\" = \"\/usr\/lib\/openssh\/sftp-server\" } }\n\n\n\n let match_blocks = \"X11Forwarding yes\nMatch User sarko Group pres.*\n Banner \/etc\/bienvenue.txt\n X11Forwarding no\nMatch User bush Group pres.* Host white.house.*\nBanner \/etc\/welcome.txt\n\"\n test Sshd.lns get match_blocks =\n { \"X11Forwarding\" = \"yes\"}\n { \"Match\"\n\t { \"Condition\" { \"User\" = \"sarko\" }\n\t { \"Group\" = \"pres.*\" } }\n\t { \"Settings\" { \"Banner\" = \"\/etc\/bienvenue.txt\" }\n \t { \"X11Forwarding\" = \"no\" } } }\n { \"Match\"\n\t { \"Condition\" { \"User\" = \"bush\" }\n\t { \"Group\" = \"pres.*\" }\n\t { \"Host\" = \"white.house.*\" } }\n\t { \"Settings\" { \"Banner\" = \"\/etc\/welcome.txt\" } } }\n\n test Sshd.lns put match_blocks after\n insb \"Subsystem\" \"\/Match[1]\";\n set \"\/Subsystem\/sftp\" \"\/usr\/libexec\/openssh\/sftp-server\"\n = \"X11Forwarding yes\nSubsystem sftp \/usr\/libexec\/openssh\/sftp-server\nMatch User sarko Group pres.*\n Banner \/etc\/bienvenue.txt\n X11Forwarding no\nMatch User bush Group pres.* Host white.house.*\nBanner \/etc\/welcome.txt\\n\"\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"module Test_sshd =\n\n let accept_env = \"Protocol 2\nAcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT\nAcceptEnv LC_IDENTIFICATION LC_ALL\\n\"\n\n test Sshd.lns get accept_env =\n { \"Protocol\" = \"2\" }\n { \"AcceptEnv\"\n { \"1\" = \"LC_PAPER\" }\n { \"2\" = \"LC_NAME\" }\n { \"3\" = \"LC_ADDRESS\" }\n { \"4\" = \"LC_TELEPHONE\" }\n { \"5\" = \"LC_MEASUREMENT\" } }\n { \"AcceptEnv\"\n { \"6\" = \"LC_IDENTIFICATION\" }\n { \"7\" = \"LC_ALL\" } }\n\n\n test Sshd.lns get \"HostKey \/etc\/ssh\/ssh_host_rsa_key\nHostKey \/etc\/ssh\/ssh_host_dsa_key\\n\" =\n { \"HostKey\" = \"\/etc\/ssh\/ssh_host_rsa_key\" }\n { \"HostKey\" = \"\/etc\/ssh\/ssh_host_dsa_key\" }\n\n\n test Sshd.lns put accept_env after\n rm \"AcceptEnv\";\n rm \"AcceptEnv\";\n set \"Protocol\" \"1.5\";\n set \"X11Forwarding\" \"yes\"\n = \"Protocol 1.5\\nX11Forwarding yes\\n\"\n\n test Sshd.lns get \"AuthorizedKeysFile %h\/.ssh\/authorized_keys\\n\" =\n { \"AuthorizedKeysFile\" = \"%h\/.ssh\/authorized_keys\" }\n\n test Sshd.lns get \"Subsystem sftp \/usr\/lib\/openssh\/sftp-server\\n\" =\n { \"Subsystem\" \n\t{ \"sftp\" = \"\/usr\/lib\/openssh\/sftp-server\" } }\n\n\n\n let match_blocks = \"X11Forwarding yes\nMatch User sarko Group pres.*\n Banner \/etc\/bienvenue.txt\n X11Forwarding no\nMatch User bush Group pres.* Host white.house.*\nBanner \/etc\/welcome.txt\n\"\n test Sshd.lns get match_blocks =\n { \"X11Forwarding\" = \"yes\"}\n { \"Match\"\n\t { \"Condition\" { \"User\" = \"sarko\" }\n\t { \"Group\" = \"pres.*\" } }\n\t { \"Settings\" { \"Banner\" = \"\/etc\/bienvenue.txt\" }\n \t { \"X11Forwarding\" = \"no\" } } }\n { \"Match\"\n\t { \"Condition\" { \"User\" = \"bush\" }\n\t { \"Group\" = \"pres.*\" }\n\t { \"Host\" = \"white.house.*\" } }\n\t { \"Settings\" { \"Banner\" = \"\/etc\/welcome.txt\" } } }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0d68bbe44e3dba3dc754d6113d584014872ec761","subject":"Support for SLES ","message":"Support for SLES \n\nAdded SLES vhosts path","repos":"mchf\/augeas,ptoscano\/augeas,pevalme\/augeas,jjlin\/augeas,jjlin\/augeas,mchf\/augeas,lutter\/augeas,kunkku\/augeas,manandbytes\/augeas,kunkku\/augeas,dafugg\/augeas,dafugg\/augeas,mlichvar\/augeas,hercules-team\/augeas,jjlin\/augeas,kunkku\/augeas,hercules-team\/augeas,mlichvar\/augeas,pevalme\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,mlichvar\/augeas,manandbytes\/augeas","old_file":"lenses\/httpd.aug","new_file":"lenses\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^\\\\ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/apache2\/vhosts.d\/*.conf\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^\\\\ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"bbd690ab581617607656c110947f10d3cfa984bc","subject":"Mysql: include \/etc\/my.cnf used on Fedora\/RHEL","message":"Mysql: include \/etc\/my.cnf used on Fedora\/RHEL\n\nFixes https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=688053\n","repos":"jtopjian\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,jasperla\/augeas,raphink\/augeas,mchf\/augeas,kumy\/augeas,kunkku\/augeas,lutter\/augeas,domcleal\/augeas,ptoscano\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,domcleal\/augeas,jtopjian\/augeas,manandbytes\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,kunkku\/augeas,jasperla\/augeas,lutter\/augeas,pevalme\/augeas,kumy\/augeas,kumy\/augeas,kunkku\/augeas,hercules-team\/augeas,mlichvar\/augeas,mchf\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas,manandbytes\/augeas,dafugg\/augeas,kumy\/augeas,mlichvar\/augeas,ptoscano\/augeas,pevalme\/augeas,mlichvar\/augeas,jjlin\/augeas,raphink\/augeas,lutter\/augeas","old_file":"lenses\/mysql.aug","new_file":"lenses\/mysql.aug","new_contents":"(* MySQL module for Augeas *)\n(* Author: Tim Stoop <tim@kumina.nl> *)\n(* Heavily based on php.aug by Raphael Pinson *)\n(* <raphink@gmail.com> *)\n(* *)\n\nmodule MySQL =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\nlet entry = [ key IniFile.entry_re . sep . IniFile.sto_to_comment . (comment|IniFile.eol) ] | \n [ key IniFile.entry_re . store \/\/ . (comment|IniFile.eol) ] | \n [ key \/\\![A-Za-z][A-Za-z0-9\\._-]+\/ . del \/ \/ \" \" . store \/\\\/[A-Za-z0-9\\.\\\/_-]+\/ . (comment|IniFile.eol) ] |\n comment\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.indented_title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/mysql\/my.cnf\")\n . (incl \"\/etc\/mysql\/conf.d\/*.cnf\")\n . (incl \"\/etc\/my.cnf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(* MySQL module for Augeas *)\n(* Author: Tim Stoop <tim@kumina.nl> *)\n(* Heavily based on php.aug by Raphael Pinson *)\n(* <raphink@gmail.com> *)\n(* *)\n\nmodule MySQL =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\nlet entry = [ key IniFile.entry_re . sep . IniFile.sto_to_comment . (comment|IniFile.eol) ] | \n [ key IniFile.entry_re . store \/\/ . (comment|IniFile.eol) ] | \n [ key \/\\![A-Za-z][A-Za-z0-9\\._-]+\/ . del \/ \/ \" \" . store \/\\\/[A-Za-z0-9\\.\\\/_-]+\/ . (comment|IniFile.eol) ] |\n comment\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.indented_title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/mysql\/my.cnf\")\n . (incl \"\/etc\/mysql\/conf.d\/*.cnf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b0a30ce091dd1d6302f6eb10d2a9bccaf2914a11","subject":"Cron: Fix parsing of numeric fields","message":"Cron: Fix parsing of numeric fields\n\nIn:\n\n let num = \/[0-9\\*][0-9\\\/,-\\*]*\/\n\nthe hyphen was treated as a range, not a literal character. This\nerroneously allowed a whole bunch of characters (including all uppercase\nletters) in numeric fields.\n\nSigned-off-by: Michael Chapman <a17fed27eaa842282862ff7c1b9c8395a26ac320@very.puzzling.org>\n","repos":"jjlin\/augeas,kunkku\/augeas,hercules-team\/augeas,jjlin\/augeas,mchf\/augeas,lutter\/augeas,raphink\/augeas,hercules-team\/augeas,manandbytes\/augeas,dafugg\/augeas,domcleal\/augeas,lutter\/augeas,raphink\/augeas,MikaelSmith\/augeas,domcleal\/augeas,kumy\/augeas,kumy\/augeas,mlichvar\/augeas,pevalme\/augeas,mlichvar\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,jasperla\/augeas,kunkku\/augeas,jasperla\/augeas,ptoscano\/augeas,manandbytes\/augeas,domcleal\/augeas,ptoscano\/augeas,jtopjian\/augeas,kumy\/augeas,dafugg\/augeas,jtopjian\/augeas,lutter\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kumy\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/cron.aug","new_file":"lenses\/cron.aug","new_contents":"(*\nModule: Cron\n Parses \/etc\/cron.d\/*, \/etc\/crontab\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 crontab` where\n possible.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the entry that launches '\/usr\/bin\/ls'\n > match '\/files\/etc\/crontab\/entry[. = \"\/usr\/bin\/ls\"]'\n\nAbout: Configuration files\n This lens applies to \/etc\/cron.d\/* and \/etc\/crontab. See <filter>.\n*)\n\nmodule Cron =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: num *)\nlet num = \/[0-9*][0-9\\\/,*-]*\/\n\n(* Variable: alpha *)\nlet alpha = \/[A-Za-z]{3}\/\n\n(* Variable: alphanum *)\nlet alphanum = (num|alpha) . (\"-\" . (num|alpha))?\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_eq *)\nlet sep_eq = Util.del_str \"=\"\n\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = Shellvars.key_re - \"entry\" in\n [ key key_re . sep_eq . Shellvars.simple_value . eol ]\n\n\n(* View: minute *)\nlet minute = [ label \"minute\" . store num ]\n\n(* View: hour *)\nlet hour = [ label \"hour\" . store num ]\n\n(* View: dayofmonth *)\nlet dayofmonth = [ label \"dayofmonth\" . store num ]\n\n(* View: month *)\nlet month = [ label \"month\" . store alphanum ]\n\n(* View: dayofweek *)\nlet dayofweek = [ label \"dayofweek\" . store alphanum ]\n\n\n(* View: user *)\nlet user = [ label \"user\" . store Rx.word ]\n\n\n(************************************************************************\n * View: time\n * Time in the format \"minute hour dayofmonth month dayofweek\"\n *************************************************************************)\nlet time = [ label \"time\" .\n minute . sep_spc . hour . sep_spc . dayofmonth\n . sep_spc . month . sep_spc . dayofweek ]\n\n(* Variable: the valid values for schedules *)\nlet schedule_re = \"reboot\" | \"yearly\" | \"annually\" | \"monthly\"\n | \"weekly\" | \"daily\" | \"midnight\" | \"hourly\"\n\n(************************************************************************\n * View: schedule\n * Time in the format \"@keyword\"\n *************************************************************************)\nlet schedule = [ label \"schedule\" . Util.del_str \"@\"\n . store schedule_re ]\n\n\n(************************************************************************\n * View: entry\n * A crontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . indent\n . ( time | schedule )\n . sep_spc . user\n . sep_spc . store Rx.space_in . eol ]\n\n\n(*\n * View: lns\n * The cron lens\n *)\nlet lns = ( empty | comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/cron.d\/*\" .\n incl \"\/etc\/crontab\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Cron\n Parses \/etc\/cron.d\/*, \/etc\/crontab\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 crontab` where\n possible.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the entry that launches '\/usr\/bin\/ls'\n > match '\/files\/etc\/crontab\/entry[. = \"\/usr\/bin\/ls\"]'\n\nAbout: Configuration files\n This lens applies to \/etc\/cron.d\/* and \/etc\/crontab. See <filter>.\n*)\n\nmodule Cron =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: num *)\nlet num = \/[0-9\\*][0-9\\\/,-\\*]*\/\n\n(* Variable: alpha *)\nlet alpha = \/[A-Za-z]{3}\/\n\n(* Variable: alphanum *)\nlet alphanum = (num|alpha) . (\"-\" . (num|alpha))?\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_eq *)\nlet sep_eq = Util.del_str \"=\"\n\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = Shellvars.key_re - \"entry\" in\n [ key key_re . sep_eq . Shellvars.simple_value . eol ]\n\n\n(* View: minute *)\nlet minute = [ label \"minute\" . store num ]\n\n(* View: hour *)\nlet hour = [ label \"hour\" . store num ]\n\n(* View: dayofmonth *)\nlet dayofmonth = [ label \"dayofmonth\" . store num ]\n\n(* View: month *)\nlet month = [ label \"month\" . store alphanum ]\n\n(* View: dayofweek *)\nlet dayofweek = [ label \"dayofweek\" . store alphanum ]\n\n\n(* View: user *)\nlet user = [ label \"user\" . store Rx.word ]\n\n\n(************************************************************************\n * View: time\n * Time in the format \"minute hour dayofmonth month dayofweek\"\n *************************************************************************)\nlet time = [ label \"time\" .\n minute . sep_spc . hour . sep_spc . dayofmonth\n . sep_spc . month . sep_spc . dayofweek ]\n\n(* Variable: the valid values for schedules *)\nlet schedule_re = \"reboot\" | \"yearly\" | \"annually\" | \"monthly\"\n | \"weekly\" | \"daily\" | \"midnight\" | \"hourly\"\n\n(************************************************************************\n * View: schedule\n * Time in the format \"@keyword\"\n *************************************************************************)\nlet schedule = [ label \"schedule\" . Util.del_str \"@\"\n . store schedule_re ]\n\n\n(************************************************************************\n * View: entry\n * A crontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . indent\n . ( time | schedule )\n . sep_spc . user\n . sep_spc . store Rx.space_in . eol ]\n\n\n(*\n * View: lns\n * The cron lens\n *)\nlet lns = ( empty | comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/cron.d\/*\" .\n incl \"\/etc\/crontab\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c2d9b274e02291e75bac4793ecfca2ed4f972263","subject":"OpenShift_Quickstarts: Use Json.lns lens","message":"OpenShift_Quickstarts: Use Json.lns lens\n","repos":"manandbytes\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas,kunkku\/augeas,mchf\/augeas,manandbytes\/augeas,jjlin\/augeas,ptoscano\/augeas,pevalme\/augeas,mlichvar\/augeas,jjlin\/augeas,dafugg\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,dafugg\/augeas,pevalme\/augeas,jjlin\/augeas,mchf\/augeas,kunkku\/augeas,mlichvar\/augeas,hercules-team\/augeas,lutter\/augeas,dafugg\/augeas","old_file":"lenses\/openshift_quickstarts.aug","new_file":"lenses\/openshift_quickstarts.aug","new_contents":"(*\nModule: OpenShift_Quickstarts\n Parses\n - \/etc\/openshift\/quickstarts.json\n\nAuthor: Brian Redbeard <redbeard@dead-city.org>\n\nAbout: License\n This file is licenced under the LGPL v2+, conforming to the other components\n of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get your current setup\n > print \/files\/etc\/openshift\/quickstarts.json\n ...\n\n * Delete the quickstart named WordPress\n > rm \/files\/etc\/openshift\/quickstarts.json\/array\/dict[*]\/entry\/dict\/entry[*][string = 'WordPress']\/..\/..\/..\/\n\n Saving your file:\n\n > save\n\nAbout: Configuration files\n \/etc\/openshift\/quickstarts.json - Quickstarts available via the\n OpenShift Console.\n\nAbout: Examples\n The <Test_OpenShift_Quickstarts> file contains various examples and tests.\n*)\nmodule OpenShift_Quickstarts =\n autoload xfm\n\n(* View: lns *)\nlet lns = Json.lns\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/openshift\/quickstarts.json\"\n\nlet xfm = transform lns filter\n(* vim: set ts=4 expandtab sw=4: *)\n","old_contents":"(*\nModule: OpenShift_Quickstarts\n Parses\n - \/etc\/openshift\/quickstarts.json\n\nAuthor: Brian Redbeard <redbeard@dead-city.org>\n\nAbout: License\n This file is licenced under the LGPL v2+, conforming to the other components\n of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get your current setup\n > print \/files\/etc\/openshift\/quickstarts.json\n ...\n\n * Delete the quickstart named WordPress\n > rm \/files\/etc\/openshift\/quickstarts.json\/array\/dict[*]\/entry\/dict\/entry[*][string = 'WordPress']\/..\/..\/..\/\n\n Saving your file:\n\n > save\n\nAbout: Configuration files\n \/etc\/openshift\/quickstarts.json - Quickstarts available via the\n OpenShift Console.\n\nAbout: Examples\n The <Test_OpenShift_Quickstarts> file contains various examples and tests.\n*)\nmodule OpenShift_Quickstarts =\n autoload xfm\n\n(* View: json *)\nlet json = Json.lns\n\n(* View: lns *)\nlet lns = (Util.empty | json )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/openshift\/quickstarts.json\"\n\nlet xfm = transform lns filter\n(* vim: set ts=4 expandtab sw=4: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cbe7b2a430e90f3e0d812fc841cbbfdedbe78d03","subject":"Httpd: add test to verify that issue #140 is fixed","message":"Httpd: add test to verify that issue #140 is fixed\n\nIssue: https:\/\/github.com\/hercules-team\/augeas\/issues\/140\n","repos":"jjlin\/augeas,kunkku\/augeas,dafugg\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,lutter\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,jtopjian\/augeas,pevalme\/augeas,mchf\/augeas,kunkku\/augeas,lutter\/augeas,jtopjian\/augeas,manandbytes\/augeas,jjlin\/augeas,mlichvar\/augeas,dafugg\/augeas,mchf\/augeas,mlichvar\/augeas,pevalme\/augeas,dafugg\/augeas,kunkku\/augeas,manandbytes\/augeas,hercules-team\/augeas,jjlin\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_httpd.aug","new_file":"lenses\/tests\/test_httpd.aug","new_contents":"module Test_httpd =\n\n(* Check that we can iterate on directive *)\nlet _ = Httpd.directive+\n\n(* Check that we can do a non iterative section *)\nlet _ = Httpd.section Httpd.directive\n\n(* directives testing *)\nlet d1 = \"ServerRoot \\\"\/etc\/apache2\\\"\\n\"\ntest Httpd.directive get d1 =\n { \"directive\" = \"ServerRoot\"\n { \"arg\" = \"\\\"\/etc\/apache2\\\"\" }\n }\n\n(* simple quotes *)\nlet d1s = \"ServerRoot '\/etc\/apache2'\\n\"\ntest Httpd.directive get d1s =\n { \"directive\" = \"ServerRoot\"\n { \"arg\" = \"'\/etc\/apache2'\" }\n }\n\nlet d2 = \"ScriptAlias \/cgi-bin\/ \/usr\/lib\/cgi-bin\/\\n\"\ntest Httpd.directive get d2 =\n { \"directive\" = \"ScriptAlias\"\n { \"arg\" = \"\/cgi-bin\/\" }\n { \"arg\" = \"\/usr\/lib\/cgi-bin\/\" }\n }\n\nlet d3 = \"LockFile \/var\/lock\/apache2\/accept.lock\\n\"\ntest Httpd.directive get d3 =\n { \"directive\" = \"LockFile\"\n { \"arg\" = \"\/var\/lock\/apache2\/accept.lock\" }\n }\n\nlet c1 = \"\n<IfModule>\n<\/IfModule>\n\"\nlet c1_put =\n\"\n<IfModule foo bar>\n<\/IfModule>\n\"\n\n\ntest Httpd.lns get c1 = { }{ \"IfModule\" }\n\ntest Httpd.lns put c1 after set \"\/IfModule\/arg[1]\" \"foo\";\n set \"\/IfModule\/arg[2]\" \"bar\" = c1_put\n\nlet c2 = \"\n<IfModule !mpm_winnt.c>\n <IfModule !mpm_netware.c>\n LockFile \/var\/lock\/apache2\/accept.lock\n <\/IfModule>\n<\/IfModule>\n\"\n\ntest Httpd.lns get c2 =\n { }\n { \"IfModule\"\n { \"arg\" = \"!mpm_winnt.c\" }\n { \"IfModule\"\n { \"arg\" = \"!mpm_netware.c\" }\n { \"directive\" = \"LockFile\"\n { \"arg\" = \"\/var\/lock\/apache2\/accept.lock\" }\n }\n }\n }\n\n(* arguments must be the first child of the section *)\ntest Httpd.lns put c2 after rm \"\/IfModule\/arg\";\n insb \"arg\" \"\/IfModule\/*[1]\";\n set \"\/IfModule\/arg\" \"foo\" =\n\"\n<IfModule foo>\n <IfModule !mpm_netware.c>\n LockFile \/var\/lock\/apache2\/accept.lock\n <\/IfModule>\n<\/IfModule>\n\"\n\nlet c3 = \"\n<IfModule mpm_event_module>\n StartServers 2\n MaxClients 150\n MinSpareThreads 25\n MaxSpareThreads 75\n ThreadLimit 64\n ThreadsPerChild 25\n MaxRequestsPerChild 0\n<\/IfModule>\n\"\n\ntest Httpd.lns get c3 =\n { }\n { \"IfModule\"\n { \"arg\" = \"mpm_event_module\" }\n { \"directive\" = \"StartServers\"\n { \"arg\" = \"2\" }\n }\n { \"directive\" = \"MaxClients\"\n { \"arg\" = \"150\" }\n }\n { \"directive\" = \"MinSpareThreads\"\n { \"arg\" = \"25\" }\n }\n { \"directive\" = \"MaxSpareThreads\"\n { \"arg\" = \"75\" }\n }\n { \"directive\" = \"ThreadLimit\"\n { \"arg\" = \"64\" }\n }\n { \"directive\" = \"ThreadsPerChild\"\n { \"arg\" = \"25\" }\n }\n { \"directive\" = \"MaxRequestsPerChild\"\n { \"arg\" = \"0\" }\n }\n }\n\n\n\nlet c4 = \"\n<Files ~ \\\"^\\.ht\\\">\n Order allow,deny\n Deny from all\n Satisfy all\n<\/Files>\n\"\n\ntest Httpd.lns get c4 =\n { }\n { \"Files\"\n { \"arg\" = \"~\" }\n { \"arg\" = \"\\\"^\\.ht\\\"\" }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"Deny\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n { \"directive\" = \"Satisfy\"\n { \"arg\" = \"all\" }\n }\n }\n\n\n\nlet c5 = \"LogFormat \\\"%{User-agent}i\\\" agent\\n\"\ntest Httpd.lns get c5 =\n { \"directive\" = \"LogFormat\"\n { \"arg\" = \"\\\"%{User-agent}i\\\"\" }\n { \"arg\" = \"agent\" }\n }\n\nlet c7 = \"LogFormat \\\"%v:%p %h %l %u %t \\\\\"%r\\\\\" %>s %O \\\\\"%{Referer}i\\\\\" \\\\\"%{User-Agent}i\\\\\"\\\" vhost_combined\\n\"\ntest Httpd.lns get c7 =\n { \"directive\" = \"LogFormat\"\n { \"arg\" = \"\\\"%v:%p %h %l %u %t \\\\\"%r\\\\\" %>s %O \\\\\"%{Referer}i\\\\\" \\\\\"%{User-Agent}i\\\\\"\\\"\" }\n { \"arg\" = \"vhost_combined\" }\n }\n\nlet c8 = \"IndexIgnore .??* *~ *# RCS CVS *,v *,t \\n\"\ntest Httpd.directive get c8 =\n { \"directive\" = \"IndexIgnore\"\n { \"arg\" = \".??*\" }\n { \"arg\" = \"*~\" }\n { \"arg\" = \"*#\" }\n { \"arg\" = \"RCS\" }\n { \"arg\" = \"CVS\" }\n { \"arg\" = \"*,v\" }\n { \"arg\" = \"*,t\" }\n }\n\n(* FIXME: not yet supported:\n * The backslash \"\\\" may be used as the last character on a line to indicate\n * that the directive continues onto the next line. There must be no other\n * characters or white space between the backslash and the end of the line.\n *)\nlet multiline = \"Options Indexes \\\nFollowSymLinks MultiViews\n\"\n\ntest Httpd.directive get multiline =\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"FollowSymLinks\" }\n { \"arg\" = \"MultiViews\" }\n }\n\n\nlet conf2 = \"<VirtualHost *:80>\n ServerAdmin webmaster@localhost\n\n DocumentRoot \/var\/www\n <Directory \/>\n Options FollowSymLinks\n AllowOverride None\n <\/Directory>\n <Directory \/var\/www\/>\n Options Indexes FollowSymLinks MultiViews\n AllowOverride None\n Order allow,deny\n allow from all\n <\/Directory>\n\n ScriptAlias \/cgi-bin\/ \/usr\/lib\/cgi-bin\/\n <Directory \\\"\/usr\/lib\/cgi-bin\\\">\n AllowOverride None\n Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch\n Order allow,deny\n Allow from all\n <\/Directory>\n\n ErrorLog \/var\/log\/apache2\/error.log\n\n # Possible values include: debug, info, notice, warn, error, crit,\n # alert, emerg.\n LogLevel warn\n\n CustomLog \/var\/log\/apache2\/access.log combined\n\n SSLRequireSSL\n\n Alias \/doc\/ \\\"\/usr\/share\/doc\/\\\"\n <Directory \\\"\/usr\/share\/doc\/\\\">\n Options Indexes MultiViews FollowSymLinks\n AllowOverride None\n Order deny,allow\n Deny from all\n Allow from 127.0.0.0\/255.0.0.0 ::1\/128\n <\/Directory>\n\n<\/VirtualHost>\n\"\n\ntest Httpd.lns get conf2 =\n { \"VirtualHost\"\n { \"arg\" = \"*:80\" }\n { \"directive\" = \"ServerAdmin\"\n { \"arg\" = \"webmaster@localhost\" }\n }\n { }\n { \"directive\" = \"DocumentRoot\"\n { \"arg\" = \"\/var\/www\" }\n }\n { \"Directory\"\n { \"arg\" = \"\/\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"FollowSymLinks\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n }\n { \"Directory\"\n { \"arg\" = \"\/var\/www\/\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"FollowSymLinks\" }\n { \"arg\" = \"MultiViews\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n }\n { }\n { \"directive\" = \"ScriptAlias\"\n { \"arg\" = \"\/cgi-bin\/\" }\n { \"arg\" = \"\/usr\/lib\/cgi-bin\/\" }\n }\n { \"Directory\"\n { \"arg\" = \"\\\"\/usr\/lib\/cgi-bin\\\"\" }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Options\"\n { \"arg\" = \"+ExecCGI\" }\n { \"arg\" = \"-MultiViews\" }\n { \"arg\" = \"+SymLinksIfOwnerMatch\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"Allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n }\n { }\n { \"directive\" = \"ErrorLog\"\n { \"arg\" = \"\/var\/log\/apache2\/error.log\" }\n }\n { }\n { \"#comment\" = \"Possible values include: debug, info, notice, warn, error, crit,\" }\n { \"#comment\" = \"alert, emerg.\" }\n { \"directive\" = \"LogLevel\"\n { \"arg\" = \"warn\" }\n }\n { }\n { \"directive\" = \"CustomLog\"\n { \"arg\" = \"\/var\/log\/apache2\/access.log\" }\n { \"arg\" = \"combined\" }\n }\n { }\n { \"directive\" = \"SSLRequireSSL\" }\n { }\n { \"directive\" = \"Alias\"\n { \"arg\" = \"\/doc\/\" }\n { \"arg\" = \"\\\"\/usr\/share\/doc\/\\\"\" }\n }\n { \"Directory\"\n { \"arg\" = \"\\\"\/usr\/share\/doc\/\\\"\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"MultiViews\" }\n { \"arg\" = \"FollowSymLinks\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"deny,allow\" }\n }\n { \"directive\" = \"Deny\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n { \"directive\" = \"Allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"127.0.0.0\/255.0.0.0\" }\n { \"arg\" = \"::1\/128\" }\n }\n }\n { }\n }\n\n(* Eol comment *)\ntest Httpd.lns get \"<a> # a comment\nMyDirective Foo\n<\/a>\\n\" =\n { \"a\"\n { \"#comment\" = \"a comment\" }\n { \"directive\" = \"MyDirective\" { \"arg\" = \"Foo\" } } }\n\ntest Httpd.lns get \"<a>\n# a comment\n<\/a>\\n\" =\n { \"a\" { \"#comment\" = \"a comment\" } }\n\n(* Test: Httpd.lns\n Newlines inside quoted value (GH issue #104) *)\ntest Httpd.lns get \"Single 'Foo\\\\\nbar'\nDouble \\\"Foo\\\\\nbar\\\"\\n\" =\n { \"directive\" = \"Single\"\n { \"arg\" = \"'Foo\\\\\\nbar'\" } }\n { \"directive\" = \"Double\"\n { \"arg\" = \"\\\"Foo\\\\\\nbar\\\"\" } }\n\n(* Test: Httpd.lns\n Support >= in tags (GH #154) *)\nlet versioncheck = \"\n<IfVersion = 2.1>\n<IfModule !proxy_ajp_module>\nLoadModule proxy_ajp_module modules\/mod_proxy_ajp.so\n<\/IfModule>\n<\/IfVersion>\n\n<IfVersion >= 2.4>\n<IfModule !proxy_ajp_module>\nLoadModule proxy_ajp_module modules\/mod_proxy_ajp.so\n<\/IfModule>\n<\/IfVersion>\n\"\n\ntest Httpd.lns get versioncheck =\n { }\n { \"IfVersion\"\n { \"arg\" = \"=\" }\n { \"arg\" = \"2.1\" }\n { \"IfModule\"\n { \"arg\" = \"!proxy_ajp_module\" }\n { \"directive\" = \"LoadModule\"\n { \"arg\" = \"proxy_ajp_module\" }\n { \"arg\" = \"modules\/mod_proxy_ajp.so\" }\n }\n }\n }\n {}\n { \"IfVersion\"\n { \"arg\" = \">=\" }\n { \"arg\" = \"2.4\" }\n { \"IfModule\"\n { \"arg\" = \"!proxy_ajp_module\" }\n { \"directive\" = \"LoadModule\"\n { \"arg\" = \"proxy_ajp_module\" }\n { \"arg\" = \"modules\/mod_proxy_ajp.so\" }\n }\n }\n }\n\n\n(* GH #220 *)\nlet double_comment = \"<IfDefine Foo>\n##\n## Comment\n##\n<\/IfDefine>\\n\"\n\ntest Httpd.lns get double_comment =\n { \"IfDefine\"\n { \"arg\" = \"Foo\" }\n { \"#comment\" = \"#\" }\n { \"#comment\" = \"# Comment\" }\n { \"#comment\" = \"#\" }\n }\n\nlet single_comment = \"<IfDefine Foo>\n#\n## Comment\n##\n<\/IfDefine>\\n\"\n\ntest Httpd.lns get single_comment =\n { \"IfDefine\"\n { \"arg\" = \"Foo\" }\n { \"#comment\" = \"# Comment\" }\n { \"#comment\" = \"#\" }\n }\n\nlet single_empty = \"<IfDefine Foo>\n#\n\n<\/IfDefine>\\n\"\ntest Httpd.lns get single_empty =\n { \"IfDefine\"\n { \"arg\" = \"Foo\" }\n }\n\nlet eol_empty = \"<IfDefine Foo> #\n<\/IfDefine>\\n\"\ntest Httpd.lns get eol_empty =\n { \"IfDefine\"\n { \"arg\" = \"Foo\" }\n }\n\n(* Issue #140 *)\ntest Httpd.lns get \"<IfModule mod_ssl.c>\n # one comment\n # another comment\n<\/IfModule>\\n\" =\n { \"IfModule\"\n { \"arg\" = \"mod_ssl.c\" }\n { \"#comment\" = \"one comment\" }\n { \"#comment\" = \"another comment\" }\n }\n","old_contents":"module Test_httpd =\n\n(* Check that we can iterate on directive *)\nlet _ = Httpd.directive+\n\n(* Check that we can do a non iterative section *)\nlet _ = Httpd.section Httpd.directive\n\n(* directives testing *)\nlet d1 = \"ServerRoot \\\"\/etc\/apache2\\\"\\n\"\ntest Httpd.directive get d1 =\n { \"directive\" = \"ServerRoot\"\n { \"arg\" = \"\\\"\/etc\/apache2\\\"\" }\n }\n\n(* simple quotes *)\nlet d1s = \"ServerRoot '\/etc\/apache2'\\n\"\ntest Httpd.directive get d1s =\n { \"directive\" = \"ServerRoot\"\n { \"arg\" = \"'\/etc\/apache2'\" }\n }\n\nlet d2 = \"ScriptAlias \/cgi-bin\/ \/usr\/lib\/cgi-bin\/\\n\"\ntest Httpd.directive get d2 =\n { \"directive\" = \"ScriptAlias\"\n { \"arg\" = \"\/cgi-bin\/\" }\n { \"arg\" = \"\/usr\/lib\/cgi-bin\/\" }\n }\n\nlet d3 = \"LockFile \/var\/lock\/apache2\/accept.lock\\n\"\ntest Httpd.directive get d3 =\n { \"directive\" = \"LockFile\"\n { \"arg\" = \"\/var\/lock\/apache2\/accept.lock\" }\n }\n\nlet c1 = \"\n<IfModule>\n<\/IfModule>\n\"\nlet c1_put =\n\"\n<IfModule foo bar>\n<\/IfModule>\n\"\n\n\ntest Httpd.lns get c1 = { }{ \"IfModule\" }\n\ntest Httpd.lns put c1 after set \"\/IfModule\/arg[1]\" \"foo\";\n set \"\/IfModule\/arg[2]\" \"bar\" = c1_put\n\nlet c2 = \"\n<IfModule !mpm_winnt.c>\n <IfModule !mpm_netware.c>\n LockFile \/var\/lock\/apache2\/accept.lock\n <\/IfModule>\n<\/IfModule>\n\"\n\ntest Httpd.lns get c2 =\n { }\n { \"IfModule\"\n { \"arg\" = \"!mpm_winnt.c\" }\n { \"IfModule\"\n { \"arg\" = \"!mpm_netware.c\" }\n { \"directive\" = \"LockFile\"\n { \"arg\" = \"\/var\/lock\/apache2\/accept.lock\" }\n }\n }\n }\n\n(* arguments must be the first child of the section *)\ntest Httpd.lns put c2 after rm \"\/IfModule\/arg\";\n insb \"arg\" \"\/IfModule\/*[1]\";\n set \"\/IfModule\/arg\" \"foo\" =\n\"\n<IfModule foo>\n <IfModule !mpm_netware.c>\n LockFile \/var\/lock\/apache2\/accept.lock\n <\/IfModule>\n<\/IfModule>\n\"\n\nlet c3 = \"\n<IfModule mpm_event_module>\n StartServers 2\n MaxClients 150\n MinSpareThreads 25\n MaxSpareThreads 75\n ThreadLimit 64\n ThreadsPerChild 25\n MaxRequestsPerChild 0\n<\/IfModule>\n\"\n\ntest Httpd.lns get c3 =\n { }\n { \"IfModule\"\n { \"arg\" = \"mpm_event_module\" }\n { \"directive\" = \"StartServers\"\n { \"arg\" = \"2\" }\n }\n { \"directive\" = \"MaxClients\"\n { \"arg\" = \"150\" }\n }\n { \"directive\" = \"MinSpareThreads\"\n { \"arg\" = \"25\" }\n }\n { \"directive\" = \"MaxSpareThreads\"\n { \"arg\" = \"75\" }\n }\n { \"directive\" = \"ThreadLimit\"\n { \"arg\" = \"64\" }\n }\n { \"directive\" = \"ThreadsPerChild\"\n { \"arg\" = \"25\" }\n }\n { \"directive\" = \"MaxRequestsPerChild\"\n { \"arg\" = \"0\" }\n }\n }\n\n\n\nlet c4 = \"\n<Files ~ \\\"^\\.ht\\\">\n Order allow,deny\n Deny from all\n Satisfy all\n<\/Files>\n\"\n\ntest Httpd.lns get c4 =\n { }\n { \"Files\"\n { \"arg\" = \"~\" }\n { \"arg\" = \"\\\"^\\.ht\\\"\" }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"Deny\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n { \"directive\" = \"Satisfy\"\n { \"arg\" = \"all\" }\n }\n }\n\n\n\nlet c5 = \"LogFormat \\\"%{User-agent}i\\\" agent\\n\"\ntest Httpd.lns get c5 =\n { \"directive\" = \"LogFormat\"\n { \"arg\" = \"\\\"%{User-agent}i\\\"\" }\n { \"arg\" = \"agent\" }\n }\n\nlet c7 = \"LogFormat \\\"%v:%p %h %l %u %t \\\\\"%r\\\\\" %>s %O \\\\\"%{Referer}i\\\\\" \\\\\"%{User-Agent}i\\\\\"\\\" vhost_combined\\n\"\ntest Httpd.lns get c7 =\n { \"directive\" = \"LogFormat\"\n { \"arg\" = \"\\\"%v:%p %h %l %u %t \\\\\"%r\\\\\" %>s %O \\\\\"%{Referer}i\\\\\" \\\\\"%{User-Agent}i\\\\\"\\\"\" }\n { \"arg\" = \"vhost_combined\" }\n }\n\nlet c8 = \"IndexIgnore .??* *~ *# RCS CVS *,v *,t \\n\"\ntest Httpd.directive get c8 =\n { \"directive\" = \"IndexIgnore\"\n { \"arg\" = \".??*\" }\n { \"arg\" = \"*~\" }\n { \"arg\" = \"*#\" }\n { \"arg\" = \"RCS\" }\n { \"arg\" = \"CVS\" }\n { \"arg\" = \"*,v\" }\n { \"arg\" = \"*,t\" }\n }\n\n(* FIXME: not yet supported:\n * The backslash \"\\\" may be used as the last character on a line to indicate\n * that the directive continues onto the next line. There must be no other\n * characters or white space between the backslash and the end of the line.\n *)\nlet multiline = \"Options Indexes \\\nFollowSymLinks MultiViews\n\"\n\ntest Httpd.directive get multiline =\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"FollowSymLinks\" }\n { \"arg\" = \"MultiViews\" }\n }\n\n\nlet conf2 = \"<VirtualHost *:80>\n ServerAdmin webmaster@localhost\n\n DocumentRoot \/var\/www\n <Directory \/>\n Options FollowSymLinks\n AllowOverride None\n <\/Directory>\n <Directory \/var\/www\/>\n Options Indexes FollowSymLinks MultiViews\n AllowOverride None\n Order allow,deny\n allow from all\n <\/Directory>\n\n ScriptAlias \/cgi-bin\/ \/usr\/lib\/cgi-bin\/\n <Directory \\\"\/usr\/lib\/cgi-bin\\\">\n AllowOverride None\n Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch\n Order allow,deny\n Allow from all\n <\/Directory>\n\n ErrorLog \/var\/log\/apache2\/error.log\n\n # Possible values include: debug, info, notice, warn, error, crit,\n # alert, emerg.\n LogLevel warn\n\n CustomLog \/var\/log\/apache2\/access.log combined\n\n SSLRequireSSL\n\n Alias \/doc\/ \\\"\/usr\/share\/doc\/\\\"\n <Directory \\\"\/usr\/share\/doc\/\\\">\n Options Indexes MultiViews FollowSymLinks\n AllowOverride None\n Order deny,allow\n Deny from all\n Allow from 127.0.0.0\/255.0.0.0 ::1\/128\n <\/Directory>\n\n<\/VirtualHost>\n\"\n\ntest Httpd.lns get conf2 =\n { \"VirtualHost\"\n { \"arg\" = \"*:80\" }\n { \"directive\" = \"ServerAdmin\"\n { \"arg\" = \"webmaster@localhost\" }\n }\n { }\n { \"directive\" = \"DocumentRoot\"\n { \"arg\" = \"\/var\/www\" }\n }\n { \"Directory\"\n { \"arg\" = \"\/\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"FollowSymLinks\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n }\n { \"Directory\"\n { \"arg\" = \"\/var\/www\/\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"FollowSymLinks\" }\n { \"arg\" = \"MultiViews\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n }\n { }\n { \"directive\" = \"ScriptAlias\"\n { \"arg\" = \"\/cgi-bin\/\" }\n { \"arg\" = \"\/usr\/lib\/cgi-bin\/\" }\n }\n { \"Directory\"\n { \"arg\" = \"\\\"\/usr\/lib\/cgi-bin\\\"\" }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Options\"\n { \"arg\" = \"+ExecCGI\" }\n { \"arg\" = \"-MultiViews\" }\n { \"arg\" = \"+SymLinksIfOwnerMatch\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"Allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n }\n { }\n { \"directive\" = \"ErrorLog\"\n { \"arg\" = \"\/var\/log\/apache2\/error.log\" }\n }\n { }\n { \"#comment\" = \"Possible values include: debug, info, notice, warn, error, crit,\" }\n { \"#comment\" = \"alert, emerg.\" }\n { \"directive\" = \"LogLevel\"\n { \"arg\" = \"warn\" }\n }\n { }\n { \"directive\" = \"CustomLog\"\n { \"arg\" = \"\/var\/log\/apache2\/access.log\" }\n { \"arg\" = \"combined\" }\n }\n { }\n { \"directive\" = \"SSLRequireSSL\" }\n { }\n { \"directive\" = \"Alias\"\n { \"arg\" = \"\/doc\/\" }\n { \"arg\" = \"\\\"\/usr\/share\/doc\/\\\"\" }\n }\n { \"Directory\"\n { \"arg\" = \"\\\"\/usr\/share\/doc\/\\\"\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"MultiViews\" }\n { \"arg\" = \"FollowSymLinks\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"deny,allow\" }\n }\n { \"directive\" = \"Deny\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n { \"directive\" = \"Allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"127.0.0.0\/255.0.0.0\" }\n { \"arg\" = \"::1\/128\" }\n }\n }\n { }\n }\n\n(* Eol comment *)\ntest Httpd.lns get \"<a> # a comment\nMyDirective Foo\n<\/a>\\n\" =\n { \"a\"\n { \"#comment\" = \"a comment\" }\n { \"directive\" = \"MyDirective\" { \"arg\" = \"Foo\" } } }\n\ntest Httpd.lns get \"<a>\n# a comment\n<\/a>\\n\" =\n { \"a\" { \"#comment\" = \"a comment\" } }\n\n(* Test: Httpd.lns\n Newlines inside quoted value (GH issue #104) *)\ntest Httpd.lns get \"Single 'Foo\\\\\nbar'\nDouble \\\"Foo\\\\\nbar\\\"\\n\" =\n { \"directive\" = \"Single\"\n { \"arg\" = \"'Foo\\\\\\nbar'\" } }\n { \"directive\" = \"Double\"\n { \"arg\" = \"\\\"Foo\\\\\\nbar\\\"\" } }\n\n(* Test: Httpd.lns\n Support >= in tags (GH #154) *)\nlet versioncheck = \"\n<IfVersion = 2.1>\n<IfModule !proxy_ajp_module>\nLoadModule proxy_ajp_module modules\/mod_proxy_ajp.so\n<\/IfModule>\n<\/IfVersion>\n\n<IfVersion >= 2.4>\n<IfModule !proxy_ajp_module>\nLoadModule proxy_ajp_module modules\/mod_proxy_ajp.so\n<\/IfModule>\n<\/IfVersion>\n\"\n\ntest Httpd.lns get versioncheck =\n { }\n { \"IfVersion\"\n { \"arg\" = \"=\" }\n { \"arg\" = \"2.1\" }\n { \"IfModule\"\n { \"arg\" = \"!proxy_ajp_module\" }\n { \"directive\" = \"LoadModule\"\n { \"arg\" = \"proxy_ajp_module\" }\n { \"arg\" = \"modules\/mod_proxy_ajp.so\" }\n }\n }\n }\n {}\n { \"IfVersion\"\n { \"arg\" = \">=\" }\n { \"arg\" = \"2.4\" }\n { \"IfModule\"\n { \"arg\" = \"!proxy_ajp_module\" }\n { \"directive\" = \"LoadModule\"\n { \"arg\" = \"proxy_ajp_module\" }\n { \"arg\" = \"modules\/mod_proxy_ajp.so\" }\n }\n }\n }\n\n\n(* GH #220 *)\nlet double_comment = \"<IfDefine Foo>\n##\n## Comment\n##\n<\/IfDefine>\\n\"\n\ntest Httpd.lns get double_comment =\n { \"IfDefine\"\n { \"arg\" = \"Foo\" }\n { \"#comment\" = \"#\" }\n { \"#comment\" = \"# Comment\" }\n { \"#comment\" = \"#\" }\n }\n\nlet single_comment = \"<IfDefine Foo>\n#\n## Comment\n##\n<\/IfDefine>\\n\"\n\ntest Httpd.lns get single_comment =\n { \"IfDefine\"\n { \"arg\" = \"Foo\" }\n { \"#comment\" = \"# Comment\" }\n { \"#comment\" = \"#\" }\n }\n\nlet single_empty = \"<IfDefine Foo>\n#\n\n<\/IfDefine>\\n\"\ntest Httpd.lns get single_empty =\n { \"IfDefine\"\n { \"arg\" = \"Foo\" }\n }\n\nlet eol_empty = \"<IfDefine Foo> #\n<\/IfDefine>\\n\"\ntest Httpd.lns get eol_empty =\n { \"IfDefine\"\n { \"arg\" = \"Foo\" }\n }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"252b90749c263017c4443edf0787c35ff91f2872","subject":"Group: add test for disabled account ('!' in password field)","message":"Group: add test for disabled account ('!' in password field)\n","repos":"dafugg\/augeas,raphink\/augeas,mlichvar\/augeas,hercules-team\/augeas,jtopjian\/augeas,domcleal\/augeas,pevalme\/augeas,jtopjian\/augeas,manandbytes\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,dafugg\/augeas,kunkku\/augeas,kunkku\/augeas,kumy\/augeas,domcleal\/augeas,jjlin\/augeas,kumy\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,ptoscano\/augeas,manandbytes\/augeas,dafugg\/augeas,kumy\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,mchf\/augeas,pevalme\/augeas,mchf\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,ptoscano\/augeas,raphink\/augeas,MikaelSmith\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,kumy\/augeas,lutter\/augeas,hercules-team\/augeas,jasperla\/augeas,lutter\/augeas","old_file":"lenses\/tests\/test_group.aug","new_file":"lenses\/tests\/test_group.aug","new_contents":"module Test_group =\n\nlet conf = \"bin:x:2:\naudio:x:29:joe\navahi-autoipd:!:113:bill,martha\n\"\n\ntest Group.lns get conf =\n { \"bin\"\n { \"password\" = \"x\" }\n { \"gid\" = \"2\" } }\n { \"audio\"\n { \"password\" = \"x\" }\n { \"gid\" = \"29\" }\n { \"user\" = \"joe\" } }\n { \"avahi-autoipd\"\n { \"password\" = \"!\" }\n { \"gid\" = \"113\" }\n { \"user\" = \"bill\"}\n { \"user\" = \"martha\"} }\n\n(* Password field can be empty *)\ntest Group.lns get \"root::0:root\\n\" =\n { \"root\"\n { \"password\" = \"\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"root\" } }\n\n(* Password field can be disabled by ! or * *)\ntest Group.lns get \"testgrp:!:0:testusr\\n\" =\n { \"testgrp\"\n { \"password\" = \"!\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"testusr\" } }\n\ntest Group.lns get \"testgrp:*:0:testusr\\n\" =\n { \"testgrp\"\n { \"password\" = \"*\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"testusr\" } }\n","old_contents":"module Test_group =\n\nlet conf = \"bin:x:2:\naudio:x:29:joe\navahi-autoipd:x:113:bill,martha\n\"\n\ntest Group.lns get conf =\n { \"bin\"\n { \"password\" = \"x\" }\n { \"gid\" = \"2\" } }\n { \"audio\"\n { \"password\" = \"x\" }\n { \"gid\" = \"29\" }\n { \"user\" = \"joe\" } }\n { \"avahi-autoipd\"\n { \"password\" = \"x\" }\n { \"gid\" = \"113\" }\n { \"user\" = \"bill\"}\n { \"user\" = \"martha\"} }\n\n(* Password field can be empty *)\ntest Group.lns get \"root::0:root\\n\" =\n { \"root\"\n { \"password\" = \"\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"root\" } }\n\n(* Password field can be disabled by ! or * *)\ntest Group.lns get \"testgrp:!:0:testusr\\n\" =\n { \"testgrp\"\n { \"password\" = \"!\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"testusr\" } }\n\ntest Group.lns get \"testgrp:*:0:testusr\\n\" =\n { \"testgrp\"\n { \"password\" = \"*\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"testusr\" } }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"702c734dcfdcbeb4445d5b2babbc942ee2c6cfff","subject":"Add CR as a white space char in RX.space_in","message":"Add CR as a white space char in RX.space_in\n\nCR is used in the IniFile lens as of EOL. To avoid concat ambig between\nIniFile.store_to_eol and IniFile.eol, CR has to be added to Rx.space_in. This\nchange do not break any existing lens in the repository.\n","repos":"MikaelSmith\/augeas,mchf\/augeas,hercules-team\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,kumy\/augeas,dafugg\/augeas,dafugg\/augeas,pevalme\/augeas,pevalme\/augeas,jasperla\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas,dafugg\/augeas,lutter\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,ptoscano\/augeas,mchf\/augeas,lutter\/augeas,jtopjian\/augeas,kumy\/augeas,ptoscano\/augeas,kumy\/augeas,raphink\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,manandbytes\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jtopjian\/augeas,pevalme\/augeas,jasperla\/augeas,mlichvar\/augeas,jjlin\/augeas,kunkku\/augeas,kunkku\/augeas","old_file":"lenses\/rx.aug","new_file":"lenses\/rx.aug","new_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Group: Spaces *)\n(* Variable: space\n A mandatory space or tab *)\nlet space = \/[ \\t]+\/\n\n(* Variable: opt_space\n An optional space or tab *)\nlet opt_space = \/[ \\t]*\/\n\n(* Variable: cl\n A continued line with a backslash *)\nlet cl = \/[ \\t]*\\\\\\\\\\n[ \\t]*\/\n\n(* Variable: cl_or_space\n A <cl> or a <space> *)\nlet cl_or_space = cl | space\n\n(* Variable: cl_or_opt_space\n A <cl> or a <opt_space> *)\nlet cl_or_opt_space = cl | opt_space\n\n(* Group: General strings *)\n\n(* Variable: space_in\n A string which not starting or ending with a space *)\nlet space_in = \/[^ \\r\\t\\n].*[^ \\r\\t\\n]|[^ \\t\\n\\r]\/\n\n(* Variable: no_spaces\n A string with no spaces *)\nlet no_spaces = \/[^ \\t\\r\\n]+\/\n\n(* Variable: word\n An alphanumeric string *)\nlet word = \/[A-Za-z0-9_.-]+\/\n\n(* Variable: integer\n One or more digits *)\nlet integer = \/[0-9]+\/\n\n(* Variable: relinteger\n A relative <integer> *)\nlet relinteger = \/[-+]?[0-9]+\/\n\n(* Variable: relinteger_noplus\n A relative <integer>, without explicit plus sign *)\nlet relinteger_noplus = \/[-]?[0-9]+\/\n\n(* Variable: decimal\n A decimal value (using ',' or '.' as a separator) *)\nlet decimal = \/[0-9]+([.,][0-9]+)?\/\n\n(* Variable: reldecimal\n A relative <decimal> *)\nlet reldecimal = \/[+-]?[0-9]+([.,][0-9]+)?\/\n\n(* Variable: byte\n A byte (0 - 255) *)\nlet byte = \/25[0-5]?|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9]\/\n\n(* Variable: hex\n A hex value *)\nlet hex = \/0x[0-9a-fA-F]+\/\n\n(* Variable: octal\n An octal value *)\nlet octal = \/0[0-7]+\/\n\n(* Variable: fspath\n A filesystem path *)\nlet fspath = \/[^ \\t\\n]+\/\n\n(* Group: All but... *)\n(* Variable: neg1\n Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n(*\n * Group: IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\n\n(* Variable: ipv4 *)\nlet ipv4 =\n let dot = \".\" in\n byte . dot . byte . dot . byte . dot . byte\n\n(* Variable: ipv6 *)\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\n\n(* Variable: ip\n An <ipv4> or <ipv6> *)\nlet ip = ipv4 | ipv6\n\n\n(* Variable: hostname\n A valid RFC 1123 hostname *)\nlet hostname = \/(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*(\n [A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])\/\n\n(*\n * Variable: device_name\n * A Linux device name like eth0 or i2c-0. Might still be too restrictive\n *)\n\nlet device_name = \/[a-zA-Z0-9_?.+:!-]+\/\n\n(*\n * Variable: email_addr\n * To be refined\n *)\nlet email_addr = \/[A-Za-z0-9_+.-]+@[A-Za-z0-9_.-]+\/\n","old_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Group: Spaces *)\n(* Variable: space\n A mandatory space or tab *)\nlet space = \/[ \\t]+\/\n\n(* Variable: opt_space\n An optional space or tab *)\nlet opt_space = \/[ \\t]*\/\n\n(* Variable: cl\n A continued line with a backslash *)\nlet cl = \/[ \\t]*\\\\\\\\\\n[ \\t]*\/\n\n(* Variable: cl_or_space\n A <cl> or a <space> *)\nlet cl_or_space = cl | space\n\n(* Variable: cl_or_opt_space\n A <cl> or a <opt_space> *)\nlet cl_or_opt_space = cl | opt_space\n\n(* Group: General strings *)\n\n(* Variable: space_in\n A string which not starting or ending with a space *)\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\n\n(* Variable: no_spaces\n A string with no spaces *)\nlet no_spaces = \/[^ \\t\\r\\n]+\/\n\n(* Variable: word\n An alphanumeric string *)\nlet word = \/[A-Za-z0-9_.-]+\/\n\n(* Variable: integer\n One or more digits *)\nlet integer = \/[0-9]+\/\n\n(* Variable: relinteger\n A relative <integer> *)\nlet relinteger = \/[-+]?[0-9]+\/\n\n(* Variable: relinteger_noplus\n A relative <integer>, without explicit plus sign *)\nlet relinteger_noplus = \/[-]?[0-9]+\/\n\n(* Variable: decimal\n A decimal value (using ',' or '.' as a separator) *)\nlet decimal = \/[0-9]+([.,][0-9]+)?\/\n\n(* Variable: reldecimal\n A relative <decimal> *)\nlet reldecimal = \/[+-]?[0-9]+([.,][0-9]+)?\/\n\n(* Variable: byte\n A byte (0 - 255) *)\nlet byte = \/25[0-5]?|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9]\/\n\n(* Variable: hex\n A hex value *)\nlet hex = \/0x[0-9a-fA-F]+\/\n\n(* Variable: octal\n An octal value *)\nlet octal = \/0[0-7]+\/\n\n(* Variable: fspath\n A filesystem path *)\nlet fspath = \/[^ \\t\\n]+\/\n\n(* Group: All but... *)\n(* Variable: neg1\n Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n(*\n * Group: IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\n\n(* Variable: ipv4 *)\nlet ipv4 =\n let dot = \".\" in\n byte . dot . byte . dot . byte . dot . byte\n\n(* Variable: ipv6 *)\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\n\n(* Variable: ip\n An <ipv4> or <ipv6> *)\nlet ip = ipv4 | ipv6\n\n\n(* Variable: hostname\n A valid RFC 1123 hostname *)\nlet hostname = \/(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*(\n [A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])\/\n\n(*\n * Variable: device_name\n * A Linux device name like eth0 or i2c-0. Might still be too restrictive\n *)\n\nlet device_name = \/[a-zA-Z0-9_?.+:!-]+\/\n\n(*\n * Variable: email_addr\n * To be refined\n *)\nlet email_addr = \/[A-Za-z0-9_+.-]+@[A-Za-z0-9_.-]+\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3a86a3380e3878aa022113b9c03635ad647b0d64","subject":"Dhcpd: add Red Hat's dhcpd.conf locations","message":"Dhcpd: add Red Hat's dhcpd.conf locations\n\nRHEL 5 uses \/etc\/dhcpd.conf.\nRHEL 6 uses \/etc\/dhcp\/dhcpd.conf.\n\nSigned-off-by: Michael Chapman <a17fed27eaa842282862ff7c1b9c8395a26ac320@very.puzzling.org>\n","repos":"manandbytes\/augeas,kunkku\/augeas,jjlin\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,lutter\/augeas,raphink\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,jasperla\/augeas,mchf\/augeas,MikaelSmith\/augeas,dafugg\/augeas,kunkku\/augeas,ptoscano\/augeas,jjlin\/augeas,dafugg\/augeas,pevalme\/augeas,domcleal\/augeas,mlichvar\/augeas,raphink\/augeas,domcleal\/augeas,mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,ptoscano\/augeas,mchf\/augeas,ptoscano\/augeas,dafugg\/augeas,lutter\/augeas,domcleal\/augeas,jjlin\/augeas,pevalme\/augeas,kumy\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,jasperla\/augeas","old_file":"lenses\/dhcpd.aug","new_file":"lenses\/dhcpd.aug","new_contents":"(*\nModule: Dhcpd\n BIND dhcp 3 server configuration module for Augeas\n\nAuthor: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\nAbout: Reference\n Reference: manual of dhcpd.conf and dhcp-eval\n Follow dhclient module for tree structure\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Directive without argument.\n Set this dhcpd server authoritative on the domain.\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/authoritative\n\n Directives with integer or string argument.\n Set max-lease-time to one hour:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/max-lease-time 3600\n\n Options are declared as a list, even for single values.\n Set the domain of the network:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name\/arg example.org\n Set two name server:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[1] foo.example.org\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[2] bar.example.org\n\n Create the subnet 172.16.0.1 with 10 addresses:\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last() + 1]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/network 172.16.0.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/netmask 255.255.255.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/from 172.16.0.10\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/to 172.16.0.20\n\n Create a new group \"foo\" with one static host. Nodes type and address are ordered.\n > ins group after \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/*[last()]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[last()]\/host foo\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/type \"ethernet\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/address \"00:00:00:aa:bb:cc\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/fixed-address 172.16.0.100\n\nAbout: Configuration files\n This lens applies to \/etc\/dhcpd3\/dhcpd.conf. See <filter>.\n*)\n\nmodule Dhcpd =\n\nautoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\nlet dels (s:string) = del s s\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet indent = Util.indent\nlet eos = comment?\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\nlet sep_osp = del \/[ \\t]*\/ \"\"\nlet sep_scl = del \/[ \\t]*;([ \\t]*\\n)*\/ \";\\n\"\nlet sep_obr = del \/[ \\t]*\\{([ \\t]*\\n)*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t]*\\}([ \\t]*\\n)*\/ \"}\\n\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \", \"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\nlet scl = del \";\" \";\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\nlet ip = Rx.ipv4\n\n(* Define fields *)\n\n(* borrowed from sysconfig.aug *)\n (* Chars allowed in a bare string *)\n let bchar = \/[^ \\t\\n\"'\\\\{}#,()]|\\\\\\\\.\/\n let qchar = \/[\"']\/ (* \" *)\n\n (* We split the handling of right hand sides into a few cases:\n * bare - strings that contain no spaces, optionally enclosed in\n * single or double quotes\n * dquot - strings that contain at least one space or apostrophe,\n * which must be enclosed in double quotes\n * squot - strings that contain an unescaped double quote\n *)\n let bare = del qchar? \"\" . store (bchar+) . del qchar? \"\"\n let dquot =\n del qchar \"\\\"\" . store (bchar* . \/[ \\t']\/ . bchar*)+ . del qchar \"\\\"\"\n let squot =\n dels \"'\" . store ((bchar|\/[ \\t]\/)* . \"\\\"\" . (bchar|\/[ \\t]\/)*)+ . dels \"'\"\n\nlet sto_to_spc = store \/[^\\\\#,;\\{\\}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_to_scl = store \/[^ \\t;][^;\\n=]+[^ \\t;]|[^ \\t;=]+\/\n\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * NO ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_noarg_re = \"authoritative\"\n | \"primary\"\n | \"secondary\"\n\nlet stmt_noarg = [ indent\n . key stmt_noarg_re\n . sep_scl\n . eos ]\n\n(************************************************************************\n * INT ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_integer_re = \"default-lease-time\"\n | \"max-lease-time\"\n | \"min-lease-time\"\n | \/lease[ ]+limit\/\n | \"port\"\n | \/peer[ ]+port\/\n | \"max-response-delay\"\n | \"max-unacked-updates\"\n | \"mclt\"\n | \"split\"\n | \/load[ ]+balance[ ]+max[ ]+seconds\/\n | \"max-lease-misbalance\"\n | \"max-lease-ownership\"\n | \"min-balance\"\n | \"max-balance\"\n | \"adaptive-lease-time-threshold\"\n | \"dynamic-bootp-lease-length\"\n | \"local-port\"\n | \"min-sec\"\n | \"omapi-port\"\n | \"ping-timeout\"\n | \"remote-port\"\n\nlet stmt_integer = [ indent\n . key stmt_integer_re\n . sep_spc\n . sto_number\n . sep_scl\n . eos ]\n\n(************************************************************************\n * STRING ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_string_re = \"ddns-update-style\"\n | \"ddns-updates\"\n | \"ddns-hostname\"\n | \"ddns-domainname\"\n | \"ddns-rev-domainname\"\n | \"log-facility\"\n | \"filename\"\n | \"server-name\"\n | \"fixed-address\"\n | \/failover[ ]+peer\/\n | \"use-host-decl-names\"\n | \"next-server\"\n | \"address\"\n | \/peer[ ]+address\/\n | \"type\"\n | \"file\"\n | \"algorithm\"\n | \"secret\"\n | \"key\"\n | \"include\"\n | \"hba\"\n | \"boot-unknown-clients\"\n | \"db-time-format\"\n | \"do-forward-updates\"\n | \"dynamic-bootp-lease-cutoff\"\n | \"get-lease-hostnames\"\n | \"infinite-is-reserved\"\n | \"lease-file-name\"\n | \"local-address\"\n | \"one-lease-per-client\"\n | \"pid-file-name\"\n | \"ping-check\"\n | \"server-identifier\"\n | \"site-option-space\"\n | \"stash-agent-options\"\n | \"update-conflict-detection\"\n | \"update-optimization\"\n | \"update-static-leases\"\n | \"use-host-decl-names\"\n | \"use-lease-addr-for-default-route\"\n | \"vendor-option-space\"\n\nlet stmt_string_tpl (l:lens) = [ indent\n . key stmt_string_re\n . sep_spc\n . l\n . sep_scl\n . eos ]\n\nlet stmt_string = stmt_string_tpl bare |stmt_string_tpl squot | stmt_string_tpl dquot\n\n(************************************************************************\n * RANGE STATEMENTS\n *************************************************************************)\n\nlet stmt_range = [ indent\n . key \"range\"\n . sep_spc\n . [ label \"flag\" . store \/dynamic-bootp\/ . sep_spc ]?\n . [ label \"from\" . store ip . sep_spc ]?\n . [ label \"to\" . store ip ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * HARDWARE STATEMENTS\n *************************************************************************)\n\nlet stmt_hardware = [ indent\n . key \"hardware\"\n . sep_spc\n . [ label \"type\" . store \/ethernet|tokenring\/ ]\n . sep_spc\n . [ label \"address\" . store \/[a-fA-F0-9:-]+\/ ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * OPTION STATEMENTS\n *************************************************************************)\n(* The general case is considering options as a list *)\n\nlet stmt_option_code = [ label \"label\" . store word . sep_spc ]\n . [ key \"code\" . sep_spc . store word ]\n . sep_eq\n . [ label \"type\" . store word ]\n\n\nlet stmt_option_list = ([ label \"arg\" . bare ] | [ label \"arg\" . dquot ] | [ label \"arg\" . squot ])\n . ( sep_com . ([ label \"arg\" . bare ] | [ label \"arg\" . dquot ] | [ label \"arg\" . squot ]))*\n\nlet stmt_option_basic = [ key word . sep_spc . stmt_option_list ]\nlet stmt_option_extra = [ key word . sep_spc . store \/true|false\/ . sep_spc . stmt_option_list ]\n\nlet stmt_option_body = stmt_option_basic | stmt_option_extra\n\nlet stmt_option1 = [ indent\n . key \"option\"\n . sep_spc\n . stmt_option_body\n . sep_scl\n . eos ]\n\nlet stmt_option2 = [ indent\n . dels \"option\" . label \"rfc-code\"\n . sep_spc\n . stmt_option_code\n . sep_scl\n . eos ]\n\nlet stmt_option = stmt_option1 | stmt_option2\n\n(************************************************************************\n * SUBCLASS STATEMENTS\n *************************************************************************)\n(* this statement is not well documented in the manual dhcpd.conf\n we support basic use case *)\n\nlet stmt_subclass = [ indent . key \"subclass\" . sep_spc .\n ([ label \"name\" . dquot ]|\n [ label \"name\" . squot ]|\n [ label \"name\" . bare ]) . sep_spc .\n [ label \"value\" . bare ] . sep_scl . eos ]\n\n(************************************************************************\n * ALLOW\/DENY STATEMENTS\n *************************************************************************)\n(* We have to use special key for allow\/deny members of\n to avoid ambiguity in the put direction *)\n\nlet allow_deny_re = \"unknown-clients\"\n | \/dynamic[ ]+bootp[ ]+clients\/\n | \/authenticated[ ]+clients\/\n | \/unauthenticated[ ]+clients\/\n\nlet stmt_secu_re = \"allow\"\n | \"deny\"\n\nlet del_allow = del \/allow[ ]+members[ ]+of\/ \"allow members of\"\nlet del_deny = del \/deny[ \\t]+members[ \\t]+of\/ \"deny members of\"\n\nlet stmt_secu_tpl (l:lens) (s:string) =\n [ indent . l . sep_spc . label s . bare . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . squot . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . dquot . sep_scl . eos ]\n\nlet stmt_secu = [ indent . key stmt_secu_re . sep_spc .\n store allow_deny_re . sep_scl . eos ] |\n stmt_secu_tpl del_allow \"allow-members-of\" |\n stmt_secu_tpl del_deny \"deny-members-of\"\n\n(************************************************************************\n * MATCH STATEMENTS\n *************************************************************************)\n\nlet sto_fct = store (word . \/[ \\t]*\\([^)]*\\)\/)\nlet sto_option = store (\/option[ ]+\/ . word)\nlet sto_com = \/[^ \\t\\n,\\(\\)][^,\\(\\)]*[^ \\t\\n,\\(\\)]|[^ \\t\\n,\\(\\)]+\/ | word . \/[ \\t]*\\([^)]*\\)\/\nlet fct_re = \"substring\" | \"binary-to-ascii\"\n\nlet fct_args = [ label \"args\" . dels \"(\" . sep_osp .\n ([ label \"arg\" . store sto_com ] . [ label \"arg\" . sep_com . store sto_com ]+) .\n sep_osp . dels \")\" ]\n\nlet stmt_match_if = [ dels \"if\" . sep_spc . store fct_re . sep_osp . label \"function\" . fct_args ] .\n sep_eq . ([ label \"value\" . bare ]|[ label \"value\" . squot ]|[ label \"value\" . dquot ])\n\nlet stmt_match_pfv = [ label \"function\" . store \"pick-first-value\" . sep_spc .\n dels \"(\" . sep_osp .\n [ label \"args\" .\n [ label \"arg\" . store sto_com ] .\n [ sep_com . label \"arg\" . store sto_com ]+ ] .\n dels \")\" ]\n\nlet stmt_match_tpl (l:lens) = [ indent . key \"match\" . sep_spc . l . sep_scl . eos ]\n\nlet stmt_match = stmt_match_tpl (stmt_match_if | stmt_match_pfv )\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n(* Blocks doesn't support comments at the end of the closing bracket *)\n\nlet stmt_entry = stmt_secu\n | stmt_option\n | stmt_hardware\n | stmt_range\n | stmt_string\n | stmt_integer\n | stmt_noarg\n | stmt_match\n | stmt_subclass\n | empty\n | comment\n\nlet stmt_block_noarg_re = \"pool\"\n | \"group\"\n | \"allow-update\"\n\nlet stmt_block_noarg (body:lens)\n = [ indent\n . key stmt_block_noarg_re\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_arg_re = \"host\"\n | \"class\"\n | \"shared-network\"\n | \/failover[ ]+peer\/\n | \"zone\"\n | \"key\"\n\nlet stmt_block_arg (body:lens)\n = [ indent\n . key stmt_block_arg_re\n . sep_spc\n . sto_to_spc\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_subnet (body:lens)\n = [ indent\n . key \"subnet\"\n . sep_spc\n . [ label \"network\" . store ip ]\n . sep_spc\n . [ key \"netmask\" . sep_spc . store ip ]\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet all_block (body:lens) =\n let lns1 = stmt_block_subnet body in\n let lns2 = stmt_block_arg body in\n let lns3 = stmt_block_noarg body in\n (lns1 | lns2 | lns3 | stmt_entry)\n\nlet rec lns_staging = stmt_entry|all_block lns_staging\nlet lns = (lns_staging)*\n\nlet filter = incl \"\/etc\/dhcp3\/dhcpd.conf\"\n . incl \"\/etc\/dhcp\/dhcpd.conf\"\n . incl \"\/etc\/dhcpd.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Dhcpd\n BIND dhcp 3 server configuration module for Augeas\n\nAuthor: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\nAbout: Reference\n Reference: manual of dhcpd.conf and dhcp-eval\n Follow dhclient module for tree structure\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Directive without argument.\n Set this dhcpd server authoritative on the domain.\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/authoritative\n\n Directives with integer or string argument.\n Set max-lease-time to one hour:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/max-lease-time 3600\n\n Options are declared as a list, even for single values.\n Set the domain of the network:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name\/arg example.org\n Set two name server:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[1] foo.example.org\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[2] bar.example.org\n\n Create the subnet 172.16.0.1 with 10 addresses:\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last() + 1]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/network 172.16.0.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/netmask 255.255.255.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/from 172.16.0.10\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/to 172.16.0.20\n\n Create a new group \"foo\" with one static host. Nodes type and address are ordered.\n > ins group after \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/*[last()]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[last()]\/host foo\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/type \"ethernet\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/address \"00:00:00:aa:bb:cc\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/fixed-address 172.16.0.100\n\nAbout: Configuration files\n This lens applies to \/etc\/dhcpd3\/dhcpd.conf. See <filter>.\n*)\n\nmodule Dhcpd =\n\nautoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\nlet dels (s:string) = del s s\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet indent = Util.indent\nlet eos = comment?\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\nlet sep_osp = del \/[ \\t]*\/ \"\"\nlet sep_scl = del \/[ \\t]*;([ \\t]*\\n)*\/ \";\\n\"\nlet sep_obr = del \/[ \\t]*\\{([ \\t]*\\n)*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t]*\\}([ \\t]*\\n)*\/ \"}\\n\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \", \"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\nlet scl = del \";\" \";\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\nlet ip = Rx.ipv4\n\n(* Define fields *)\n\n(* borrowed from sysconfig.aug *)\n (* Chars allowed in a bare string *)\n let bchar = \/[^ \\t\\n\"'\\\\{}#,()]|\\\\\\\\.\/\n let qchar = \/[\"']\/ (* \" *)\n\n (* We split the handling of right hand sides into a few cases:\n * bare - strings that contain no spaces, optionally enclosed in\n * single or double quotes\n * dquot - strings that contain at least one space or apostrophe,\n * which must be enclosed in double quotes\n * squot - strings that contain an unescaped double quote\n *)\n let bare = del qchar? \"\" . store (bchar+) . del qchar? \"\"\n let dquot =\n del qchar \"\\\"\" . store (bchar* . \/[ \\t']\/ . bchar*)+ . del qchar \"\\\"\"\n let squot =\n dels \"'\" . store ((bchar|\/[ \\t]\/)* . \"\\\"\" . (bchar|\/[ \\t]\/)*)+ . dels \"'\"\n\nlet sto_to_spc = store \/[^\\\\#,;\\{\\}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_to_scl = store \/[^ \\t;][^;\\n=]+[^ \\t;]|[^ \\t;=]+\/\n\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * NO ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_noarg_re = \"authoritative\"\n | \"primary\"\n | \"secondary\"\n\nlet stmt_noarg = [ indent\n . key stmt_noarg_re\n . sep_scl\n . eos ]\n\n(************************************************************************\n * INT ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_integer_re = \"default-lease-time\"\n | \"max-lease-time\"\n | \"min-lease-time\"\n | \/lease[ ]+limit\/\n | \"port\"\n | \/peer[ ]+port\/\n | \"max-response-delay\"\n | \"max-unacked-updates\"\n | \"mclt\"\n | \"split\"\n | \/load[ ]+balance[ ]+max[ ]+seconds\/\n | \"max-lease-misbalance\"\n | \"max-lease-ownership\"\n | \"min-balance\"\n | \"max-balance\"\n | \"adaptive-lease-time-threshold\"\n | \"dynamic-bootp-lease-length\"\n | \"local-port\"\n | \"min-sec\"\n | \"omapi-port\"\n | \"ping-timeout\"\n | \"remote-port\"\n\nlet stmt_integer = [ indent\n . key stmt_integer_re\n . sep_spc\n . sto_number\n . sep_scl\n . eos ]\n\n(************************************************************************\n * STRING ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_string_re = \"ddns-update-style\"\n | \"ddns-updates\"\n | \"ddns-hostname\"\n | \"ddns-domainname\"\n | \"ddns-rev-domainname\"\n | \"log-facility\"\n | \"filename\"\n | \"server-name\"\n | \"fixed-address\"\n | \/failover[ ]+peer\/\n | \"use-host-decl-names\"\n | \"next-server\"\n | \"address\"\n | \/peer[ ]+address\/\n | \"type\"\n | \"file\"\n | \"algorithm\"\n | \"secret\"\n | \"key\"\n | \"include\"\n | \"hba\"\n | \"boot-unknown-clients\"\n | \"db-time-format\"\n | \"do-forward-updates\"\n | \"dynamic-bootp-lease-cutoff\"\n | \"get-lease-hostnames\"\n | \"infinite-is-reserved\"\n | \"lease-file-name\"\n | \"local-address\"\n | \"one-lease-per-client\"\n | \"pid-file-name\"\n | \"ping-check\"\n | \"server-identifier\"\n | \"site-option-space\"\n | \"stash-agent-options\"\n | \"update-conflict-detection\"\n | \"update-optimization\"\n | \"update-static-leases\"\n | \"use-host-decl-names\"\n | \"use-lease-addr-for-default-route\"\n | \"vendor-option-space\"\n\nlet stmt_string_tpl (l:lens) = [ indent\n . key stmt_string_re\n . sep_spc\n . l\n . sep_scl\n . eos ]\n\nlet stmt_string = stmt_string_tpl bare |stmt_string_tpl squot | stmt_string_tpl dquot\n\n(************************************************************************\n * RANGE STATEMENTS\n *************************************************************************)\n\nlet stmt_range = [ indent\n . key \"range\"\n . sep_spc\n . [ label \"flag\" . store \/dynamic-bootp\/ . sep_spc ]?\n . [ label \"from\" . store ip . sep_spc ]?\n . [ label \"to\" . store ip ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * HARDWARE STATEMENTS\n *************************************************************************)\n\nlet stmt_hardware = [ indent\n . key \"hardware\"\n . sep_spc\n . [ label \"type\" . store \/ethernet|tokenring\/ ]\n . sep_spc\n . [ label \"address\" . store \/[a-fA-F0-9:-]+\/ ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * OPTION STATEMENTS\n *************************************************************************)\n(* The general case is considering options as a list *)\n\nlet stmt_option_code = [ label \"label\" . store word . sep_spc ]\n . [ key \"code\" . sep_spc . store word ]\n . sep_eq\n . [ label \"type\" . store word ]\n\n\nlet stmt_option_list = ([ label \"arg\" . bare ] | [ label \"arg\" . dquot ] | [ label \"arg\" . squot ])\n . ( sep_com . ([ label \"arg\" . bare ] | [ label \"arg\" . dquot ] | [ label \"arg\" . squot ]))*\n\nlet stmt_option_basic = [ key word . sep_spc . stmt_option_list ]\nlet stmt_option_extra = [ key word . sep_spc . store \/true|false\/ . sep_spc . stmt_option_list ]\n\nlet stmt_option_body = stmt_option_basic | stmt_option_extra\n\nlet stmt_option1 = [ indent\n . key \"option\"\n . sep_spc\n . stmt_option_body\n . sep_scl\n . eos ]\n\nlet stmt_option2 = [ indent\n . dels \"option\" . label \"rfc-code\"\n . sep_spc\n . stmt_option_code\n . sep_scl\n . eos ]\n\nlet stmt_option = stmt_option1 | stmt_option2\n\n(************************************************************************\n * SUBCLASS STATEMENTS\n *************************************************************************)\n(* this statement is not well documented in the manual dhcpd.conf\n we support basic use case *)\n\nlet stmt_subclass = [ indent . key \"subclass\" . sep_spc .\n ([ label \"name\" . dquot ]|\n [ label \"name\" . squot ]|\n [ label \"name\" . bare ]) . sep_spc .\n [ label \"value\" . bare ] . sep_scl . eos ]\n\n(************************************************************************\n * ALLOW\/DENY STATEMENTS\n *************************************************************************)\n(* We have to use special key for allow\/deny members of\n to avoid ambiguity in the put direction *)\n\nlet allow_deny_re = \"unknown-clients\"\n | \/dynamic[ ]+bootp[ ]+clients\/\n | \/authenticated[ ]+clients\/\n | \/unauthenticated[ ]+clients\/\n\nlet stmt_secu_re = \"allow\"\n | \"deny\"\n\nlet del_allow = del \/allow[ ]+members[ ]+of\/ \"allow members of\"\nlet del_deny = del \/deny[ \\t]+members[ \\t]+of\/ \"deny members of\"\n\nlet stmt_secu_tpl (l:lens) (s:string) =\n [ indent . l . sep_spc . label s . bare . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . squot . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . dquot . sep_scl . eos ]\n\nlet stmt_secu = [ indent . key stmt_secu_re . sep_spc .\n store allow_deny_re . sep_scl . eos ] |\n stmt_secu_tpl del_allow \"allow-members-of\" |\n stmt_secu_tpl del_deny \"deny-members-of\"\n\n(************************************************************************\n * MATCH STATEMENTS\n *************************************************************************)\n\nlet sto_fct = store (word . \/[ \\t]*\\([^)]*\\)\/)\nlet sto_option = store (\/option[ ]+\/ . word)\nlet sto_com = \/[^ \\t\\n,\\(\\)][^,\\(\\)]*[^ \\t\\n,\\(\\)]|[^ \\t\\n,\\(\\)]+\/ | word . \/[ \\t]*\\([^)]*\\)\/\nlet fct_re = \"substring\" | \"binary-to-ascii\"\n\nlet fct_args = [ label \"args\" . dels \"(\" . sep_osp .\n ([ label \"arg\" . store sto_com ] . [ label \"arg\" . sep_com . store sto_com ]+) .\n sep_osp . dels \")\" ]\n\nlet stmt_match_if = [ dels \"if\" . sep_spc . store fct_re . sep_osp . label \"function\" . fct_args ] .\n sep_eq . ([ label \"value\" . bare ]|[ label \"value\" . squot ]|[ label \"value\" . dquot ])\n\nlet stmt_match_pfv = [ label \"function\" . store \"pick-first-value\" . sep_spc .\n dels \"(\" . sep_osp .\n [ label \"args\" .\n [ label \"arg\" . store sto_com ] .\n [ sep_com . label \"arg\" . store sto_com ]+ ] .\n dels \")\" ]\n\nlet stmt_match_tpl (l:lens) = [ indent . key \"match\" . sep_spc . l . sep_scl . eos ]\n\nlet stmt_match = stmt_match_tpl (stmt_match_if | stmt_match_pfv )\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n(* Blocks doesn't support comments at the end of the closing bracket *)\n\nlet stmt_entry = stmt_secu\n | stmt_option\n | stmt_hardware\n | stmt_range\n | stmt_string\n | stmt_integer\n | stmt_noarg\n | stmt_match\n | stmt_subclass\n | empty\n | comment\n\nlet stmt_block_noarg_re = \"pool\"\n | \"group\"\n | \"allow-update\"\n\nlet stmt_block_noarg (body:lens)\n = [ indent\n . key stmt_block_noarg_re\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_arg_re = \"host\"\n | \"class\"\n | \"shared-network\"\n | \/failover[ ]+peer\/\n | \"zone\"\n | \"key\"\n\nlet stmt_block_arg (body:lens)\n = [ indent\n . key stmt_block_arg_re\n . sep_spc\n . sto_to_spc\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_subnet (body:lens)\n = [ indent\n . key \"subnet\"\n . sep_spc\n . [ label \"network\" . store ip ]\n . sep_spc\n . [ key \"netmask\" . sep_spc . store ip ]\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet all_block (body:lens) =\n let lns1 = stmt_block_subnet body in\n let lns2 = stmt_block_arg body in\n let lns3 = stmt_block_noarg body in\n (lns1 | lns2 | lns3 | stmt_entry)\n\nlet rec lns_staging = stmt_entry|all_block lns_staging\nlet lns = (lns_staging)*\n\nlet xfm = transform lns (incl \"\/etc\/dhcp3\/dhcpd.conf\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ac49161fb185f2cd3b0ad257e76f45aa8462d082","subject":"Sysctl: exclude \/etc\/sysctl.d\/README.sysctl","message":"Sysctl: exclude \/etc\/sysctl.d\/README.sysctl\n","repos":"lutter\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,mchf\/augeas,pevalme\/augeas,dafugg\/augeas,lutter\/augeas,kumy\/augeas,hercules-team\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,jjlin\/augeas,mlichvar\/augeas,jtopjian\/augeas,dafugg\/augeas,pevalme\/augeas,jasperla\/augeas,dafugg\/augeas,kumy\/augeas,kumy\/augeas,raphink\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,kunkku\/augeas,pevalme\/augeas,raphink\/augeas,mchf\/augeas,MikaelSmith\/augeas,kumy\/augeas,lutter\/augeas,ptoscano\/augeas,jtopjian\/augeas,manandbytes\/augeas,mlichvar\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/sysctl.aug","new_file":"lenses\/sysctl.aug","new_contents":"(*\nModule: Sysctl\n Parses \/etc\/sysctl.conf and \/etc\/sysctl.d\/*\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: Reference\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/sysctl.conf and \/etc\/sysctl.d\/*. See <filter>.\n\nAbout: Examples\n The <Test_Sysctl> file contains various examples and tests.\n*)\n\nmodule Sysctl =\nautoload xfm\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/sysctl.conf\"\n . incl \"\/etc\/sysctl.d\/*\"\n . excl \"\/etc\/sysctl.d\/README\"\n . excl \"\/etc\/sysctl.d\/README.sysctl\"\n . Util.stdexcl\n\n(* View: comment *)\nlet comment = Util.comment_generic \/[ \\t]*[#;][ \\t]*\/ \"# \"\n\n(* View: lns\n The sysctl lens *)\nlet lns = (Util.empty | comment | Simplevars.entry)*\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sysctl\n Parses \/etc\/sysctl.conf and \/etc\/sysctl.d\/*\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: Reference\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/sysctl.conf and \/etc\/sysctl.d\/*. See <filter>.\n\nAbout: Examples\n The <Test_Sysctl> file contains various examples and tests.\n*)\n\nmodule Sysctl =\nautoload xfm\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/sysctl.conf\"\n . incl \"\/etc\/sysctl.d\/*\"\n . excl \"\/etc\/sysctl.d\/README\"\n . Util.stdexcl\n\n(* View: comment *)\nlet comment = Util.comment_generic \/[ \\t]*[#;][ \\t]*\/ \"# \"\n\n(* View: lns\n The sysctl lens *)\nlet lns = (Util.empty | comment | Simplevars.entry)*\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4b853563d340207189891490de75b4c3d478de5c","subject":"Parse available sites for nginx (#471)","message":"Parse available sites for nginx (#471)\n\nSome of the configuration for nginx at least for Debian & Ubuntu can be found at `\/etc\/nginx\/sites-available\/`. These files are specific to each server nginx is going to proxy.","repos":"kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,hercules-team\/augeas,manandbytes\/augeas,lutter\/augeas,ptoscano\/augeas,hercules-team\/augeas,kunkku\/augeas,pevalme\/augeas,mlichvar\/augeas,mlichvar\/augeas,lutter\/augeas,kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,mlichvar\/augeas","old_file":"lenses\/nginx.aug","new_file":"lenses\/nginx.aug","new_contents":"(* Module: Nginx\n Nginx module for Augeas\n\nAuthors: Ian Berry <iberry@barracuda.com>\n Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n\n This module was built to support a limited subset of nginx\n configuration syntax. It works fine with simple blocks and\n field\/value lines.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/nginx\/nginx.conf. See <filter>.\n\nAbout: Examples\n The <Test_Nginx> file contains various examples and tests.\n\nAbout: TODO\n * Convert statement keyworks for a regex\n * Support more advanced block syntax (location)\n*)\n\nmodule Nginx =\n\nautoload xfm\n\n(* Variable: word *)\nlet word = \/[A-Za-z0-9_.:-]+\/\n\n(* Variable: block_re\n The keywords reserved for block entries *)\nlet block_re = \"http\" | \"events\" | \"server\" | \"mail\" | \"stream\"\n\n(* All block keywords, including the ones we treat specially *)\nlet block_re_all = block_re | \"if\" | \"location\" | \"geo\" | \"map\"\n | \"split_clients\" | \"upstream\"\n\n(* View: simple\n A simple entry *)\nlet simple =\n let kw = word - block_re_all\n in let mask = [ label \"mask\" . Util.del_str \"\/\" . store Rx.integer ]\n in let sto = store \/[^ \\t\\n;][^;]*\/ . Sep.semicolon\n in [ Util.indent . key kw . mask? . Sep.space . sto . (Util.eol|Util.comment_eol) ]\n\n(* View: server\n A simple server entry *)\nlet server =\n [ Util.indent . label \"@server\" . Util.del_str \"server\"\n . [ Sep.space . label \"@address\" . store word ]\n . [ Sep.space . key word . (Sep.equal . store word)? ]*\n . Sep.semicolon\n . (Util.eol|Util.comment_eol) ]\n\nlet arg (name:string) (rx:regexp) =\n [ label name . Sep.space . store rx ]\n\n(* Match any argument (as much as possible) *)\nlet any_rx =\n let bare_rx = \/[^\" \\t\\n{][^ \\t\\n{]*\/ in\n let dquote_rx = \/\"([^\\\"]|\\\\.)*\"\/ in\n bare_rx | dquote_rx\n\nlet any_arg (name:string) = arg name any_rx\n\n(* 'if' conditions are enclosed in matching parens which we can't match\n precisely with a regular expression. Instead, we gobble up anything that\n doesn't contain an opening brace. That can of course lead to trouble if\n a condition actually contains an opening brace *)\nlet block_if = key \"if\"\n . arg \"#cond\" \/\\(([^ \\t\\n{]|[ \\t\\n][^{])*\\)\/\n\nlet block_location = key \"location\"\n . (arg \"#comp\" \/=|~|~\\*|\\^~\/)?\n . any_arg \"#uri\"\n\nlet block_geo = key \"geo\"\n . (any_arg \"#address\")?\n . any_arg \"#geo\"\n\nlet block_map = key \"map\"\n . any_arg \"#source\"\n . any_arg \"#variable\"\n\nlet block_split_clients = key \"split_clients\"\n . any_arg \"#string\"\n . any_arg \"#variable\"\n\nlet block_upstream = key \"upstream\"\n . any_arg \"#name\"\n\nlet block_head = key block_re\n | block_if\n | block_location\n | block_geo\n | block_map\n | block_split_clients\n | block_upstream\n\n(* View: block\n A block containing <simple> entries *)\nlet block (entry : lens) =\n [ Util.indent . block_head\n . Build.block_newlines entry Util.comment\n . Util.eol ]\n\nlet rec directive = simple | server | block directive\n\n(* View: lns *)\nlet lns = ( Util.comment | Util.empty | directive )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/nginx\/nginx.conf\"\n . incl \"\/etc\/nginx\/conf.d\/*.conf\"\n . incl \"\/etc\/nginx\/sites-available\/*\"\n . incl \"\/usr\/portage\/www-servers\/nginx\/files\/nginx.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/nginx.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/conf.d\/*.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/sites-available\/*\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Module: Nginx\n Nginx module for Augeas\n\nAuthors: Ian Berry <iberry@barracuda.com>\n Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n\n This module was built to support a limited subset of nginx\n configuration syntax. It works fine with simple blocks and\n field\/value lines.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/nginx\/nginx.conf. See <filter>.\n\nAbout: Examples\n The <Test_Nginx> file contains various examples and tests.\n\nAbout: TODO\n * Convert statement keyworks for a regex\n * Support more advanced block syntax (location)\n*)\n\nmodule Nginx =\n\nautoload xfm\n\n(* Variable: word *)\nlet word = \/[A-Za-z0-9_.:-]+\/\n\n(* Variable: block_re\n The keywords reserved for block entries *)\nlet block_re = \"http\" | \"events\" | \"server\" | \"mail\" | \"stream\"\n\n(* All block keywords, including the ones we treat specially *)\nlet block_re_all = block_re | \"if\" | \"location\" | \"geo\" | \"map\"\n | \"split_clients\" | \"upstream\"\n\n(* View: simple\n A simple entry *)\nlet simple =\n let kw = word - block_re_all\n in let mask = [ label \"mask\" . Util.del_str \"\/\" . store Rx.integer ]\n in let sto = store \/[^ \\t\\n;][^;]*\/ . Sep.semicolon\n in [ Util.indent . key kw . mask? . Sep.space . sto . (Util.eol|Util.comment_eol) ]\n\n(* View: server\n A simple server entry *)\nlet server =\n [ Util.indent . label \"@server\" . Util.del_str \"server\"\n . [ Sep.space . label \"@address\" . store word ]\n . [ Sep.space . key word . (Sep.equal . store word)? ]*\n . Sep.semicolon\n . (Util.eol|Util.comment_eol) ]\n\nlet arg (name:string) (rx:regexp) =\n [ label name . Sep.space . store rx ]\n\n(* Match any argument (as much as possible) *)\nlet any_rx =\n let bare_rx = \/[^\" \\t\\n{][^ \\t\\n{]*\/ in\n let dquote_rx = \/\"([^\\\"]|\\\\.)*\"\/ in\n bare_rx | dquote_rx\n\nlet any_arg (name:string) = arg name any_rx\n\n(* 'if' conditions are enclosed in matching parens which we can't match\n precisely with a regular expression. Instead, we gobble up anything that\n doesn't contain an opening brace. That can of course lead to trouble if\n a condition actually contains an opening brace *)\nlet block_if = key \"if\"\n . arg \"#cond\" \/\\(([^ \\t\\n{]|[ \\t\\n][^{])*\\)\/\n\nlet block_location = key \"location\"\n . (arg \"#comp\" \/=|~|~\\*|\\^~\/)?\n . any_arg \"#uri\"\n\nlet block_geo = key \"geo\"\n . (any_arg \"#address\")?\n . any_arg \"#geo\"\n\nlet block_map = key \"map\"\n . any_arg \"#source\"\n . any_arg \"#variable\"\n\nlet block_split_clients = key \"split_clients\"\n . any_arg \"#string\"\n . any_arg \"#variable\"\n\nlet block_upstream = key \"upstream\"\n . any_arg \"#name\"\n\nlet block_head = key block_re\n | block_if\n | block_location\n | block_geo\n | block_map\n | block_split_clients\n | block_upstream\n\n(* View: block\n A block containing <simple> entries *)\nlet block (entry : lens) =\n [ Util.indent . block_head\n . Build.block_newlines entry Util.comment\n . Util.eol ]\n\nlet rec directive = simple | server | block directive\n\n(* View: lns *)\nlet lns = ( Util.comment | Util.empty | directive )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/nginx\/nginx.conf\"\n . incl \"\/etc\/nginx\/conf.d\/*.conf\"\n . incl \"\/usr\/portage\/www-servers\/nginx\/files\/nginx.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/nginx.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/conf.d\/*.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e8fd77a3c29a5c534c48a06e56c46a70acdb83c1","subject":"* lenses\/tests\/test_sysconfig.aug: use a variable 'lns' for Shellvars.lns","message":"* lenses\/tests\/test_sysconfig.aug: use a variable 'lns' for Shellvars.lns\n","repos":"jjlin\/augeas,mchf\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,dafugg\/augeas,mchf\/augeas,MikaelSmith\/augeas,raphink\/augeas,dafugg\/augeas,pevalme\/augeas,hercules-team\/augeas,hercules-team\/augeas,lutter\/augeas,jjlin\/augeas,dafugg\/augeas,jasperla\/augeas,jtopjian\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,lutter\/augeas,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,jtopjian\/augeas,kunkku\/augeas,kumy\/augeas,kumy\/augeas,pevalme\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,pevalme\/augeas,jasperla\/augeas,manandbytes\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\" = \"f\" } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\" = \"f\" } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\" = \"*debug*\"\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\" = \"${!LC_*}\" }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { }\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test Shellvars.lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test Shellvars.lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test Shellvars.lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test Shellvars.lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test Shellvars.lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test Shellvars.lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test Shellvars.lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test Shellvars.lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test Shellvars.lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test Shellvars.lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test Shellvars.lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test Shellvars.lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test Shellvars.lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test Shellvars.lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test Shellvars.lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test Shellvars.lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test Shellvars.lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test Shellvars.lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test Shellvars.lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test Shellvars.lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test Shellvars.lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test Shellvars.lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test Shellvars.lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test Shellvars.lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test Shellvars.lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Test semicolons *)\n test Shellvars.lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test Shellvars.lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test Shellvars.lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test Shellvars.lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test Shellvars.lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\" = \"f\" } } }\n\n (* Select *)\n test Shellvars.lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test Shellvars.lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\" = \"f\" } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\" = \"*debug*\"\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\" = \"${!LC_*}\" }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { }\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"fb749ea4d1ba4ecd95a5cec6aa7b20b010ef04a8","subject":"Httpd: Define an eol_comment in section to allow for \\n before comment","message":"Httpd: Define an eol_comment in section to allow for \\n before comment\n","repos":"MikaelSmith\/augeas,pevalme\/augeas,pevalme\/augeas,jasperla\/augeas,mlichvar\/augeas,dafugg\/augeas,mchf\/augeas,lutter\/augeas,ptoscano\/augeas,kunkku\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,MikaelSmith\/augeas,lutter\/augeas,kunkku\/augeas,jasperla\/augeas,raphink\/augeas,hercules-team\/augeas,mlichvar\/augeas,jjlin\/augeas,dafugg\/augeas,ptoscano\/augeas,ptoscano\/augeas,jtopjian\/augeas,raphink\/augeas,jjlin\/augeas,hercules-team\/augeas,kunkku\/augeas,mlichvar\/augeas,manandbytes\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jtopjian\/augeas,mchf\/augeas,jjlin\/augeas","old_file":"lenses\/httpd.aug","new_file":"lenses\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\r\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\r\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let eol_comment = Util.comment_generic \/[ \\t\\n]*#[ \\t]*\/ \"# \" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . (eol|eol_comment) . (body . (body|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\r\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\r\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . (eol|comment) . (body . (body|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6e2a1d7db075e82351938741ed53ea743c305d51","subject":"Add one-liner unit test for shellvars.aug","message":"Add one-liner unit test for shellvars.aug\n","repos":"mlichvar\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,jjlin\/augeas,ptoscano\/augeas,domcleal\/augeas,kunkku\/augeas,mchf\/augeas,lutter\/augeas,raphink\/augeas,kunkku\/augeas,lutter\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,pevalme\/augeas,kumy\/augeas,jasperla\/augeas,dafugg\/augeas,pevalme\/augeas,hercules-team\/augeas,kumy\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,kumy\/augeas,kumy\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,ptoscano\/augeas,jasperla\/augeas,jtopjian\/augeas,hercules-team\/augeas,mchf\/augeas,kunkku\/augeas,jtopjian\/augeas,jjlin\/augeas,manandbytes\/augeas,dafugg\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,jjlin\/augeas,domcleal\/augeas,manandbytes\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test Shellvars.lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test Shellvars.lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test Shellvars.lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test Shellvars.lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test Shellvars.lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test Shellvars.lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test Shellvars.lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test Shellvars.lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test Shellvars.lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test Shellvars.lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test Shellvars.lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test Shellvars.lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n (* For some reason, `` conflicts with comment_eol *)\n test Shellvars.lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab\"\n { \"#comment\" = \"c`\" } }\n\n test Shellvars.lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test Shellvars.lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test Shellvars.lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test Shellvars.lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test Shellvars.lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test Shellvars.lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test Shellvars.lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test Shellvars.lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test Shellvars.lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test Shellvars.lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n\n (* Test semicolons *)\n test Shellvars.lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test Shellvars.lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Comment or eol *)\n test Shellvars.lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test Shellvars.lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test Shellvars.lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test Shellvars.lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test Shellvars.lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test Shellvars.lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test Shellvars.lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test Shellvars.lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test Shellvars.lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test Shellvars.lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test Shellvars.lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test Shellvars.lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test Shellvars.lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n (* For some reason, `` conflicts with comment_eol *)\n test Shellvars.lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab\"\n { \"#comment\" = \"c`\" } }\n\n test Shellvars.lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test Shellvars.lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test Shellvars.lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test Shellvars.lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test Shellvars.lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test Shellvars.lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test Shellvars.lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test Shellvars.lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test Shellvars.lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test Shellvars.lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n\n (* Test semicolons *)\n test Shellvars.lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test Shellvars.lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Comment or eol *)\n test Shellvars.lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"80e4110a74ead4fc69328ce89f30b44187df982a","subject":"pg_hba: added debian systems path to filter - fixes #154.","message":"pg_hba: added debian systems path to filter - fixes #154.\n","repos":"kunkku\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,domcleal\/augeas,jjlin\/augeas,mchf\/augeas,kunkku\/augeas,ptoscano\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,jjlin\/augeas,dafugg\/augeas,manandbytes\/augeas,jjlin\/augeas,dafugg\/augeas,pevalme\/augeas,lutter\/augeas,mlichvar\/augeas,jasperla\/augeas,jtopjian\/augeas,raphink\/augeas,dafugg\/augeas,lutter\/augeas,mchf\/augeas,kumy\/augeas,mlichvar\/augeas,kumy\/augeas,ptoscano\/augeas,pevalme\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,kumy\/augeas,mlichvar\/augeas,pevalme\/augeas,hercules-team\/augeas","old_file":"lenses\/pg_hba.aug","new_file":"lenses\/pg_hba.aug","new_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:\\.]+(\\\/[0-9]+|[ \\t]+[0-9\\.]+)\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Pg_Hba\n Parses \/var\/lib\/pgsql\/data\/pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Configuration files\n This lens applies to \/var\/lib\/pgsql\/data\/pg_hba.conf. See <filter>.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:\\.]+(\\\/[0-9]+|[ \\t]+[0-9\\.]+)\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\")\n\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7c00aad011b7a06853de31bcc163066f36734be5","subject":"{ can be followed by spaces in xinetd.aug","message":"{ can be followed by spaces in xinetd.aug\n","repos":"jtopjian\/augeas,jjlin\/augeas,domcleal\/augeas,domcleal\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,kumy\/augeas,kunkku\/augeas,mlichvar\/augeas,mchf\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,pevalme\/augeas,ptoscano\/augeas,raphink\/augeas,hercules-team\/augeas,jasperla\/augeas,kumy\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kunkku\/augeas,lutter\/augeas,mlichvar\/augeas,manandbytes\/augeas,kunkku\/augeas,dafugg\/augeas,ptoscano\/augeas,manandbytes\/augeas,jtopjian\/augeas,mchf\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,dafugg\/augeas,lutter\/augeas,lutter\/augeas,domcleal\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,jjlin\/augeas,pevalme\/augeas,pevalme\/augeas,jasperla\/augeas,kumy\/augeas","old_file":"lenses\/xinetd.aug","new_file":"lenses\/xinetd.aug","new_contents":"(*\n * Module: Xinetd\n * Parses xinetd configuration files\n *\n * The structure of the lens and allowed attributes are ripped directly\n * from xinetd's parser in xinetd\/parse.c in xinetd's source checkout\n * The downside of being so precise here is that if attributes are added\n * they need to be added here, too. Writing a catchall entry, and getting\n * to typecheck correctly would be a huge pain.\n *\n * A really enterprising soul could tighten this down even further by\n * restricting the acceptable values for each attribute.\n *\n * Author: David Lutterkort\n *)\n\nmodule Xinetd =\n autoload xfm\n\n let comment = Util.comment\n let empty = Util.empty\n\n let name = key \/[^ \\t\\n\\\/=+-]+\/\n let bol_spc = del \/[ \\t]*\/ \"\\t\"\n let spc = del \/[ \\t]+\/ \" \"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let op_delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/) (\" \" . op . \" \")\n let eq = op_delim \"=\"\n\n let op = ([ label \"add\" . op_delim \"+=\" ]\n |[ label \"del\" . op_delim \"-=\" ]\n | eq)\n\n let value = store \/[^ \\t\\n]+\/\n\n let attr_one (n:regexp) =\n [ bol_spc . key n . eq . value . eol ]\n\n let attr_lst (n:regexp) (op_eq: lens) =\n [ bol_spc . key n . op_eq .\n [label \"value\" . value] . [label \"value\" . spc . value]* .\n eol ]\n\n let attr_lst_eq (n:regexp) = attr_lst n eq\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Variable: service_attr\n * Note:\n * It is much faster to combine, for example, all the attr_one\n * attributes into one regexp and pass that to a lens instead of\n * using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter\n * causes the type checker to work _very_ hard.\n *)\n\n let service_attr =\n attr_one (\"socket_type\" | \"protocol\" | \"wait\" | \"user\" | \"group\"\n |\"server\" | \"instances\" | \"rpc_version\" | \"rpc_number\"\n | \"id\" | \"port\" | \"nice\" | \"banner\" | \"bind\" | \"interface\"\n | \"per_source\" | \"groups\" | \"banner_success\" | \"banner_fail\"\n | \"disable\" | \"max_load\" | \"rlimit_as\" | \"rlimit_cpu\"\n | \"rlimit_data\" | \"rlimit_rss\" | \"rlimit_stack\" | \"v6only\"\n | \"deny_time\" | \"umask\" | \"mdns\" | \"libwrap\")\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\"server_args\" | \"log_type\" | \"access_times\" | \"type\"\n | \"flags\" | \"redirect\" | \"cps\")\n |attr_lst_op ( \"log_on_success\" | \"log_on_failure\"| \"only_from\"\n | \"no_access\" | \"env\" | \"passenv\")\n\n let default_attr =\n attr_one ( \"instances\" | \"banner\" | \"bind\" | \"interface\" | \"per_source\"\n | \"groups\" | \"banner_success\" | \"banner_fail\" | \"max_load\"\n | \"v6only\" | \"umask\" | \"mdns\")\n |attr_lst_eq \"cps\" (* really only two values, not a whole list *)\n |attr_lst_op ( \"log_type\" | \"log_on_success\" | \"log_on_failure\" | \"disabled\"\n | \"no_access\" | \"only_from\" | \"passenv\" | \"enabled\" )\n\n (* View: body\n * Note:\n * We would really like to say \"the body can contain any of a list\n * of a list of attributes, each of them at most once\"; but that\n * would require that we build a lens that matches the permutation\n * of all attributes; with around 40 individual attributes, that's\n * not computationally feasible, even if we didn't have to worry\n * about how to write that down. The resulting regular expressions\n * would simply be prohibitively large.\n *)\n let body (attr:lens) = del \/\\n\\{[ \\t]*\\n\/ \"\\n{\\n\"\n . (empty|comment|attr)*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n (* View: includes\n * Note:\n * It would be nice if we could use the directories given in include and\n * includedir directives to parse additional files instead of hardcoding\n * all the places where xinetd config files can be found; but that is\n * currently not possible, and implementing that has a good amount of\n * hairy corner cases to consider.\n *)\n let includes = [ key \/include|includedir\/\n . Util.del_ws_spc . store \/[^ \\t\\n]+\/ . eol ]\n\n let service =\n let sto_re = \/[^# \\t\\n\\\/]+\/ in\n [ key \"service\" . Sep.space . store sto_re . body service_attr ]\n\n let defaults = [ key \"defaults\" . del \/[ \\t]*\/ \"\" . body default_attr ]\n\n let lns = ( empty | comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\n * Module: Xinetd\n * Parses xinetd configuration files\n *\n * The structure of the lens and allowed attributes are ripped directly\n * from xinetd's parser in xinetd\/parse.c in xinetd's source checkout\n * The downside of being so precise here is that if attributes are added\n * they need to be added here, too. Writing a catchall entry, and getting\n * to typecheck correctly would be a huge pain.\n *\n * A really enterprising soul could tighten this down even further by\n * restricting the acceptable values for each attribute.\n *\n * Author: David Lutterkort\n *)\n\nmodule Xinetd =\n autoload xfm\n\n let comment = Util.comment\n let empty = Util.empty\n\n let name = key \/[^ \\t\\n\\\/=+-]+\/\n let bol_spc = del \/[ \\t]*\/ \"\\t\"\n let spc = del \/[ \\t]+\/ \" \"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let op_delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/) (\" \" . op . \" \")\n let eq = op_delim \"=\"\n\n let op = ([ label \"add\" . op_delim \"+=\" ]\n |[ label \"del\" . op_delim \"-=\" ]\n | eq)\n\n let value = store \/[^ \\t\\n]+\/\n\n let attr_one (n:regexp) =\n [ bol_spc . key n . eq . value . eol ]\n\n let attr_lst (n:regexp) (op_eq: lens) =\n [ bol_spc . key n . op_eq .\n [label \"value\" . value] . [label \"value\" . spc . value]* .\n eol ]\n\n let attr_lst_eq (n:regexp) = attr_lst n eq\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Variable: service_attr\n * Note:\n * It is much faster to combine, for example, all the attr_one\n * attributes into one regexp and pass that to a lens instead of\n * using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter\n * causes the type checker to work _very_ hard.\n *)\n\n let service_attr =\n attr_one (\"socket_type\" | \"protocol\" | \"wait\" | \"user\" | \"group\"\n |\"server\" | \"instances\" | \"rpc_version\" | \"rpc_number\"\n | \"id\" | \"port\" | \"nice\" | \"banner\" | \"bind\" | \"interface\"\n | \"per_source\" | \"groups\" | \"banner_success\" | \"banner_fail\"\n | \"disable\" | \"max_load\" | \"rlimit_as\" | \"rlimit_cpu\"\n | \"rlimit_data\" | \"rlimit_rss\" | \"rlimit_stack\" | \"v6only\"\n | \"deny_time\" | \"umask\" | \"mdns\" | \"libwrap\")\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\"server_args\" | \"log_type\" | \"access_times\" | \"type\"\n | \"flags\" | \"redirect\" | \"cps\")\n |attr_lst_op ( \"log_on_success\" | \"log_on_failure\"| \"only_from\"\n | \"no_access\" | \"env\" | \"passenv\")\n\n let default_attr =\n attr_one ( \"instances\" | \"banner\" | \"bind\" | \"interface\" | \"per_source\"\n | \"groups\" | \"banner_success\" | \"banner_fail\" | \"max_load\"\n | \"v6only\" | \"umask\" | \"mdns\")\n |attr_lst_eq \"cps\" (* really only two values, not a whole list *)\n |attr_lst_op ( \"log_type\" | \"log_on_success\" | \"log_on_failure\" | \"disabled\"\n | \"no_access\" | \"only_from\" | \"passenv\" | \"enabled\" )\n\n (* View: body\n * Note:\n * We would really like to say \"the body can contain any of a list\n * of a list of attributes, each of them at most once\"; but that\n * would require that we build a lens that matches the permutation\n * of all attributes; with around 40 individual attributes, that's\n * not computationally feasible, even if we didn't have to worry\n * about how to write that down. The resulting regular expressions\n * would simply be prohibitively large.\n *)\n let body (attr:lens) = Util.del_str \"\\n{\\n\"\n . (empty|comment|attr)*\n . del \/[ \\t]*}[ \\t]*\\n\/ \"}\\n\"\n\n (* View: includes\n * Note:\n * It would be nice if we could use the directories given in include and\n * includedir directives to parse additional files instead of hardcoding\n * all the places where xinetd config files can be found; but that is\n * currently not possible, and implementing that has a good amount of\n * hairy corner cases to consider.\n *)\n let includes = [ key \/include|includedir\/\n . Util.del_ws_spc . store \/[^ \\t\\n]+\/ . eol ]\n\n let service =\n let sto_re = \/[^# \\t\\n\\\/]+\/ in\n [ key \"service\" . Sep.space . store sto_re . body service_attr ]\n\n let defaults = [ key \"defaults\" . del \/[ \\t]*\/ \"\" . body default_attr ]\n\n let lns = ( empty | comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5d669e4eb0db597c74d4332002e3e5bf97d28e13","subject":"CronAllow: remove accompanying test, moved into Simplelines test earlier","message":"CronAllow: remove accompanying test, moved into Simplelines test earlier\n","repos":"hercules-team\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas,manandbytes\/augeas,ptoscano\/augeas,mlichvar\/augeas,pevalme\/augeas,kumy\/augeas,dafugg\/augeas,jtopjian\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,jasperla\/augeas,GeoffWilliams\/augeas,kumy\/augeas,ptoscano\/augeas,jjlin\/augeas,jasperla\/augeas,jtopjian\/augeas,mlichvar\/augeas,manandbytes\/augeas,kunkku\/augeas,kumy\/augeas,MikaelSmith\/augeas,domcleal\/augeas,jjlin\/augeas,jjlin\/augeas,dafugg\/augeas,kunkku\/augeas,MikaelSmith\/augeas,pevalme\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,mchf\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,lutter\/augeas,raphink\/augeas,mchf\/augeas,lutter\/augeas,domcleal\/augeas,raphink\/augeas,kumy\/augeas","old_file":"lenses\/tests\/test_cronallow.aug","new_file":"lenses\/tests\/test_cronallow.aug","new_contents":"","old_contents":"module Test_cronallow =\n\n let example = \"# Test comment\n#\nuser1\nanother\n\nuser2\n\"\n\n test CronAllow.lns get example =\n { \"#comment\" = \"Test comment\" }\n { }\n { \"1\" = \"user1\" }\n { \"2\" = \"another\" }\n { }\n { \"3\" = \"user2\" }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6f680e56441635839b37898eebea36f1845b5406","subject":"Properties: add test for empty comment","message":"Properties: add test for empty comment\n","repos":"mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas,mchf\/augeas,mlichvar\/augeas,mchf\/augeas,kunkku\/augeas,ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,lutter\/augeas,kunkku\/augeas,manandbytes\/augeas,manandbytes\/augeas,lutter\/augeas,lutter\/augeas,pevalme\/augeas,pevalme\/augeas,pevalme\/augeas,kunkku\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_properties.aug","new_file":"lenses\/tests\/test_properties.aug","new_contents":"module Test_properties =\n let conf = \"\n#\n# Test tomcat properties file\n#tomcat.commented.value=1\n # config\ntomcat.port = 8080\ntomcat.application.name=testapp\n tomcat.application.description=my test application\nproperty.with_underscore=works\nempty.property=\nempty.property.withtrailingspaces= \\n! more comments\nkey: value\nkey2:value2\nkey3 :value3\nkey4:=value4\n\nlong.description=this is a description that happens to span \\\n\tmore than one line with a combination of tabs and \\\n spaces \\ \\nor not\n\n# comment break\n\nshort.break = a\\\n b\n\n=empty_key\n =empty_key\n\ncheeses\n\nspaces only\nmulti spaces\n indented spaces\n\n\\= =A\nspace and = equals\nspace with \\\n multiline\n\nescaped\\:colon=value\nescaped\\=equals=value\nescaped\\ space=value\n\"\n\n(* Other tests that aren't supported yet\noverflow.description=\\\n just wanted to indent it\n*)\n\nlet lns = Properties.lns\n\ntest lns get conf =\n { } { }\n { \"#comment\" = \"Test tomcat properties file\" }\n { \"#comment\" = \"tomcat.commented.value=1\" }\n { \"#comment\" = \"config\" }\n { \"tomcat.port\" = \"8080\" }\n { \"tomcat.application.name\" = \"testapp\" }\n { \"tomcat.application.description\" = \"my test application\" }\n { \"property.with_underscore\" = \"works\" }\n { \"empty.property\" }\n { \"empty.property.withtrailingspaces\" }\n { \"!comment\" = \"more comments\" }\n { \"key\" = \"value\" }\n { \"key2\" = \"value2\" }\n { \"key3\" = \"value3\" }\n { \"key4\" = \"=value4\" }\n {}\n { \"long.description\" = \" < multi > \"\n { = \"this is a description that happens to span \" }\n { = \"more than one line with a combination of tabs and \" }\n { = \"spaces \" }\n { = \"or not\" }\n }\n {}\n { \"#comment\" = \"comment break\" }\n {}\n { \"short.break\" = \" < multi > \"\n { = \"a\" }\n { = \"b\" }\n }\n {}\n { = \"empty_key\" }\n { = \"empty_key\" }\n {}\n { \"cheeses\" }\n {}\n { \"spaces\" = \"only\" }\n { \"multi\" = \"spaces\" }\n { \"indented\" = \"spaces\" }\n {}\n { \"\\\\=\" = \"A\" }\n { \"space\" = \"and = equals\" }\n { \"space\" = \" < multi > \"\n { = \"with \" }\n { = \"multiline\" }\n }\n {}\n { \"escaped\\:colon\" = \"value\" }\n { \"escaped\\=equals\" = \"value\" }\n { \"escaped\\ space\" = \"value\" }\ntest lns put conf after\n set \"tomcat.port\" \"99\";\n set \"tomcat.application.host\" \"foo.network.com\"\n = \"\n#\n# Test tomcat properties file\n#tomcat.commented.value=1\n # config\ntomcat.port = 99\ntomcat.application.name=testapp\n tomcat.application.description=my test application\nproperty.with_underscore=works\nempty.property=\nempty.property.withtrailingspaces= \\n! more comments\nkey: value\nkey2:value2\nkey3 :value3\nkey4:=value4\n\nlong.description=this is a description that happens to span \\\n\tmore than one line with a combination of tabs and \\\n spaces \\ \\nor not\n\n# comment break\n\nshort.break = a\\\n b\n\n=empty_key\n =empty_key\n\ncheeses\n\nspaces only\nmulti spaces\n indented spaces\n\n\\= =A\nspace and = equals\nspace with \\\n multiline\n\nescaped\\:colon=value\nescaped\\=equals=value\nescaped\\ space=value\ntomcat.application.host=foo.network.com\n\"\n\n(* GH issue #19: value on new line *)\ntest lns get \"k=\\\nb\\\nc\\n\" =\n { \"k\" = \" < multi > \"\n { } { = \"b\" } { = \"c\" } }\n\ntest lns get \"tomcat.util.scan.DefaultJarScanner.jarsToSkip=\\\nbootstrap.jar,commons-daemon.jar,tomcat-juli.jar\\n\" =\n { \"tomcat.util.scan.DefaultJarScanner.jarsToSkip\" = \" < multi > \"\n { } { = \"bootstrap.jar,commons-daemon.jar,tomcat-juli.jar\" } }\n\n","old_contents":"module Test_properties =\n let conf = \"\n# Test tomcat properties file\n#tomcat.commented.value=1\n # config\ntomcat.port = 8080\ntomcat.application.name=testapp\n tomcat.application.description=my test application\nproperty.with_underscore=works\nempty.property=\nempty.property.withtrailingspaces= \\n! more comments\nkey: value\nkey2:value2\nkey3 :value3\nkey4:=value4\n\nlong.description=this is a description that happens to span \\\n\tmore than one line with a combination of tabs and \\\n spaces \\ \\nor not\n\n# comment break\n\nshort.break = a\\\n b\n\n=empty_key\n =empty_key\n\ncheeses\n\nspaces only\nmulti spaces\n indented spaces\n\n\\= =A\nspace and = equals\nspace with \\\n multiline\n\nescaped\\:colon=value\nescaped\\=equals=value\nescaped\\ space=value\n\"\n\n(* Other tests that aren't supported yet\noverflow.description=\\\n just wanted to indent it\n*)\n\nlet lns = Properties.lns\n\ntest lns get conf =\n { }\n { \"#comment\" = \"Test tomcat properties file\" }\n { \"#comment\" = \"tomcat.commented.value=1\" }\n { \"#comment\" = \"config\" }\n { \"tomcat.port\" = \"8080\" }\n { \"tomcat.application.name\" = \"testapp\" }\n { \"tomcat.application.description\" = \"my test application\" }\n { \"property.with_underscore\" = \"works\" }\n { \"empty.property\" }\n { \"empty.property.withtrailingspaces\" }\n { \"!comment\" = \"more comments\" }\n { \"key\" = \"value\" }\n { \"key2\" = \"value2\" }\n { \"key3\" = \"value3\" }\n { \"key4\" = \"=value4\" }\n {}\n { \"long.description\" = \" < multi > \"\n { = \"this is a description that happens to span \" }\n { = \"more than one line with a combination of tabs and \" }\n { = \"spaces \" }\n { = \"or not\" }\n }\n {}\n { \"#comment\" = \"comment break\" }\n {}\n { \"short.break\" = \" < multi > \"\n { = \"a\" }\n { = \"b\" }\n }\n {}\n { = \"empty_key\" }\n { = \"empty_key\" }\n {}\n { \"cheeses\" }\n {}\n { \"spaces\" = \"only\" }\n { \"multi\" = \"spaces\" }\n { \"indented\" = \"spaces\" }\n {}\n { \"\\\\=\" = \"A\" }\n { \"space\" = \"and = equals\" }\n { \"space\" = \" < multi > \"\n { = \"with \" }\n { = \"multiline\" }\n }\n {}\n { \"escaped\\:colon\" = \"value\" }\n { \"escaped\\=equals\" = \"value\" }\n { \"escaped\\ space\" = \"value\" }\ntest lns put conf after\n set \"tomcat.port\" \"99\";\n set \"tomcat.application.host\" \"foo.network.com\"\n = \"\n# Test tomcat properties file\n#tomcat.commented.value=1\n # config\ntomcat.port = 99\ntomcat.application.name=testapp\n tomcat.application.description=my test application\nproperty.with_underscore=works\nempty.property=\nempty.property.withtrailingspaces= \\n! more comments\nkey: value\nkey2:value2\nkey3 :value3\nkey4:=value4\n\nlong.description=this is a description that happens to span \\\n\tmore than one line with a combination of tabs and \\\n spaces \\ \\nor not\n\n# comment break\n\nshort.break = a\\\n b\n\n=empty_key\n =empty_key\n\ncheeses\n\nspaces only\nmulti spaces\n indented spaces\n\n\\= =A\nspace and = equals\nspace with \\\n multiline\n\nescaped\\:colon=value\nescaped\\=equals=value\nescaped\\ space=value\ntomcat.application.host=foo.network.com\n\"\n\n(* GH issue #19: value on new line *)\ntest lns get \"k=\\\nb\\\nc\\n\" =\n { \"k\" = \" < multi > \"\n { } { = \"b\" } { = \"c\" } }\n\ntest lns get \"tomcat.util.scan.DefaultJarScanner.jarsToSkip=\\\nbootstrap.jar,commons-daemon.jar,tomcat-juli.jar\\n\" =\n { \"tomcat.util.scan.DefaultJarScanner.jarsToSkip\" = \" < multi > \"\n { } { = \"bootstrap.jar,commons-daemon.jar,tomcat-juli.jar\" } }\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e5b0d10ddb9c594d55c042ac04d6dfd3c8d0d69c","subject":"Add documentation to test_keepalived.aug","message":"Add documentation to test_keepalived.aug\n","repos":"jjlin\/augeas,dafugg\/augeas,jtopjian\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,jasperla\/augeas,mlichvar\/augeas,kunkku\/augeas,manandbytes\/augeas,ptoscano\/augeas,kunkku\/augeas,jtopjian\/augeas,raphink\/augeas,jasperla\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,jjlin\/augeas,kumy\/augeas,pevalme\/augeas,lutter\/augeas,kumy\/augeas,kumy\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,domcleal\/augeas,kumy\/augeas,mlichvar\/augeas,ptoscano\/augeas,domcleal\/augeas,raphink\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,mchf\/augeas,pevalme\/augeas,pevalme\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,ptoscano\/augeas,dafugg\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,lutter\/augeas","old_file":"lenses\/tests\/test_keepalived.aug","new_file":"lenses\/tests\/test_keepalived.aug","new_contents":"(*\nModule: Test_Keepalived\n Provides unit tests and examples for the <Keepalived> lens.\n*)\n\nmodule Test_Keepalived =\n\n(* Variable: conf\n A full configuration file *)\n let conf = \"! This is a comment \n! Configuration File for keepalived \n\nglobal_defs { \n ! this is who emails will go to on alerts \n notification_email { \n admins@example.com \n fakepager@example.com \n ! add a few more email addresses here if you would like \n } \n notification_email_from admins@example.com \n\n smtp_server 127.0.0.1 ! I use the local machine to relay mail \n smtp_connect_timeout 30 \n\n ! each load balancer should have a different ID \n ! this will be used in SMTP alerts, so you should make \n ! each router easily identifiable \n lvs_id LVS_EXAMPLE_01 \n} \n\nvrrp_sync_group VG1 { \n group { \n inside_network # name of vrrp_instance (below)\n outside_network # One for each moveable IP. \n } \n} \n\nvrrp_instance VI_1 { \n state MASTER \n interface eth0 \n\n\ttrack_interface {\n\t\teth0 # Back\n\t\teth1 # DMZ\n\t}\n\ttrack_script {\n\t\tcheck_apache2 # weight = +2 si ok, 0 si nok\n\t}\n\tgarp_master_delay 5\n\tpriority 50\n\tadvert_int 2\n\tauthentication {\n\t\tauth_type PASS\n\t\tauth_pass mypass\n\t}\n\tvirtual_ipaddress {\n\t\t10.234.66.146\/32 dev eth0\n\t}\n \n lvs_sync_daemon_interface eth0 \n\tha_suspend\n\n notify_master \\\"\/svr\/scripts\/notify_master.sh\\\"\n notify_backup \\\"\/svr\/scripts\/notify_backup.sh\\\"\n notify_fault \\\"\/svr\/scripts\/notify_fault.sh\\\"\n\n ! each virtual router id must be unique per instance name! \n virtual_router_id 51 \n\n ! MASTER and BACKUP state are determined by the priority \n ! even if you specify MASTER as the state, the state will \n ! be voted on by priority (so if your state is MASTER but your \n ! priority is lower than the router with BACKUP, you will lose \n ! the MASTER state) \n ! I make it a habit to set priorities at least 50 points apart \n ! note that a lower number is lesser priority - lower gets less vote \n priority 150 \n\n ! how often should we vote, in seconds? \n advert_int 1 \n\n ! send an alert when this instance changes state from MASTER to BACKUP \n smtp_alert \n\n ! this authentication is for syncing between failover servers \n ! keepalived supports PASS, which is simple password \n ! authentication \n ! or AH, which is the IPSec authentication header. \n ! I don't use AH \n ! yet as many people have reported problems with it \n authentication { \n auth_type PASS \n auth_pass example \n } \n\n ! these are the IP addresses that keepalived will setup on this \n ! machine. Later in the config we will specify which real \n ! servers are behind these IPs \n ! without this block, keepalived will not setup and takedown the \n ! any IP addresses \n \n virtual_ipaddress { \n 192.168.1.11 \n 10.234.66.146\/32 dev vlan933 # parse it well\n ! and more if you want them \n } \n} \n\nvirtual_server 192.168.1.11 22 { \n delay_loop 6 \n\n ! use round-robin as a load balancing algorithm \n lb_algo rr \n\n ! we are doing NAT \n lb_kind NAT \n nat_mask 255.255.255.0 \n\n protocol TCP \n\n ! there can be as many real_server blocks as you need \n\n real_server 10.20.40.10 22 { \n\n ! if we used weighted round-robin or a similar lb algo, \n ! we include the weight of this server \n\n weight 1 \n\n ! here is a health checker for this server. \n ! we could use a custom script here (see the keepalived docs) \n ! but we will just make sure we can do a vanilla tcp connect() \n ! on port 22 \n ! if it fails, we will pull this realserver out of the pool \n ! and send email about the removal \n TCP_CHECK { \n connect_timeout 3 \n connect_port 22 \n } \n } \n} \n\nvirtual_server_group DNS_1 {\n 192.168.0.1 22\n 10.234.55.22-25 36\n 10.45.58.59\/32 27\n}\n\nvrrp_script chk_apache2 { # Requires keepalived-1.1.13\nscript \\\"killall -0 apache2\\\" # faster\ninterval 2 # check every 2 seconds\nweight 2 # add 2 points of prio if OK\n}\n\n! that's all\n\"\n\n\n(* Test: Keepalived.lns\n Test the full <conf> *)\n test Keepalived.lns get conf =\n { \"#comment\" = \"This is a comment\" }\n { \"#comment\" = \"Configuration File for keepalived\" }\n {}\n { \"global_defs\"\n { }\n { \"#comment\" = \"this is who emails will go to on alerts\" }\n { \"notification_email\"\n { }\n { \"email\" = \"admins@example.com\" }\n { \"email\" = \"fakepager@example.com\" }\n { \"#comment\" = \"add a few more email addresses here if you would like\" } }\n { \"notification_email_from\" = \"admins@example.com\" }\n { }\n { \"smtp_server\" = \"127.0.0.1\"\n { \"#comment\" = \"I use the local machine to relay mail\" } }\n { \"smtp_connect_timeout\" = \"30\" }\n {}\n { \"#comment\" = \"each load balancer should have a different ID\" }\n { \"#comment\" = \"this will be used in SMTP alerts, so you should make\" }\n { \"#comment\" = \"each router easily identifiable\" }\n { \"lvs_id\" = \"LVS_EXAMPLE_01\" } }\n {}\n { \"vrrp_sync_group\" = \"VG1\"\n { }\n { \"group\"\n { }\n { \"inside_network\"\n { \"#comment\" = \"name of vrrp_instance (below)\" } }\n { \"outside_network\"\n { \"#comment\" = \"One for each moveable IP.\" } } } }\n {}\n { \"vrrp_instance\" = \"VI_1\"\n { }\n { \"state\" = \"MASTER\" }\n { \"interface\" = \"eth0\" }\n { }\n { \"track_interface\"\n { }\n { \"eth0\" { \"#comment\" = \"Back\" } }\n { \"eth1\" { \"#comment\" = \"DMZ\" } } }\n { \"track_script\"\n { }\n { \"check_apache2\" { \"#comment\" = \"weight = +2 si ok, 0 si nok\" } } }\n { \"garp_master_delay\" = \"5\" }\n { \"priority\" = \"50\" }\n { \"advert_int\" = \"2\" }\n { \"authentication\"\n { }\n { \"auth_type\" = \"PASS\" }\n { \"auth_pass\" = \"mypass\" } }\n { \"virtual_ipaddress\"\n { }\n { \"ipaddr\" = \"10.234.66.146\"\n { \"prefixlen\" = \"32\" }\n { \"dev\" = \"eth0\" } } }\n { }\n { \"lvs_sync_daemon_interface\" = \"eth0\" }\n { \"ha_suspend\" }\n { }\n { \"notify_master\" = \"\\\"\/svr\/scripts\/notify_master.sh\\\"\" }\n { \"notify_backup\" = \"\\\"\/svr\/scripts\/notify_backup.sh\\\"\" }\n { \"notify_fault\" = \"\\\"\/svr\/scripts\/notify_fault.sh\\\"\" }\n { }\n { \"#comment\" = \"each virtual router id must be unique per instance name!\" }\n { \"virtual_router_id\" = \"51\" }\n { }\n { \"#comment\" = \"MASTER and BACKUP state are determined by the priority\" }\n { \"#comment\" = \"even if you specify MASTER as the state, the state will\" }\n { \"#comment\" = \"be voted on by priority (so if your state is MASTER but your\" }\n { \"#comment\" = \"priority is lower than the router with BACKUP, you will lose\" }\n { \"#comment\" = \"the MASTER state)\" }\n { \"#comment\" = \"I make it a habit to set priorities at least 50 points apart\" }\n { \"#comment\" = \"note that a lower number is lesser priority - lower gets less vote\" }\n { \"priority\" = \"150\" }\n { }\n { \"#comment\" = \"how often should we vote, in seconds?\" }\n { \"advert_int\" = \"1\" }\n { }\n { \"#comment\" = \"send an alert when this instance changes state from MASTER to BACKUP\" }\n { \"smtp_alert\" }\n { }\n { \"#comment\" = \"this authentication is for syncing between failover servers\" }\n { \"#comment\" = \"keepalived supports PASS, which is simple password\" }\n { \"#comment\" = \"authentication\" }\n { \"#comment\" = \"or AH, which is the IPSec authentication header.\" }\n { \"#comment\" = \"I don't use AH\" }\n { \"#comment\" = \"yet as many people have reported problems with it\" }\n { \"authentication\"\n { }\n { \"auth_type\" = \"PASS\" }\n { \"auth_pass\" = \"example\" } }\n { }\n { \"#comment\" = \"these are the IP addresses that keepalived will setup on this\" }\n { \"#comment\" = \"machine. Later in the config we will specify which real\" }\n { \"#comment\" = \"servers are behind these IPs\" }\n { \"#comment\" = \"without this block, keepalived will not setup and takedown the\" }\n { \"#comment\" = \"any IP addresses\" }\n { }\n { \"virtual_ipaddress\"\n { }\n { \"ipaddr\" = \"192.168.1.11\" }\n { \"ipaddr\" = \"10.234.66.146\"\n { \"prefixlen\" = \"32\" }\n { \"dev\" = \"vlan933\" }\n { \"#comment\" = \"parse it well\" } }\n { \"#comment\" = \"and more if you want them\" } } }\n { }\n { \"virtual_server\"\n { \"ip\" = \"192.168.1.11\" }\n { \"port\" = \"22\" }\n { }\n { \"delay_loop\" = \"6\" }\n { }\n { \"#comment\" = \"use round-robin as a load balancing algorithm\" }\n { \"lb_algo\" = \"rr\" }\n { }\n { \"#comment\" = \"we are doing NAT\" }\n { \"lb_kind\" = \"NAT\" }\n { \"nat_mask\" = \"255.255.255.0\" }\n { }\n { \"protocol\" = \"TCP\" }\n { }\n { \"#comment\" = \"there can be as many real_server blocks as you need\" }\n { }\n { \"real_server\"\n { \"ip\" = \"10.20.40.10\" }\n { \"port\" = \"22\" }\n { }\n { }\n { \"#comment\" = \"if we used weighted round-robin or a similar lb algo,\" }\n { \"#comment\" = \"we include the weight of this server\" }\n { }\n { \"weight\" = \"1\" }\n { }\n { \"#comment\" = \"here is a health checker for this server.\" }\n { \"#comment\" = \"we could use a custom script here (see the keepalived docs)\" }\n { \"#comment\" = \"but we will just make sure we can do a vanilla tcp connect()\" }\n { \"#comment\" = \"on port 22\" }\n { \"#comment\" = \"if it fails, we will pull this realserver out of the pool\" }\n { \"#comment\" = \"and send email about the removal\" }\n { \"TCP_CHECK\"\n { }\n { \"connect_timeout\" = \"3\" }\n { \"connect_port\" = \"22\" } } } }\n { }\n { \"virtual_server_group\" = \"DNS_1\"\n { }\n { \"vip\"\n\t { \"ipaddr\" = \"192.168.0.1\" }\n\t { \"port\" = \"22\" } }\n\t { \"vip\"\n\t { \"ipaddr\" = \"10.234.55.22-25\" }\n\t { \"port\" = \"36\" } }\n\t { \"vip\"\n\t { \"ipaddr\" = \"10.45.58.59\"\n\t { \"prefixlen\" = \"32\" } }\n\t { \"port\" = \"27\" } } }\n { }\n { \"vrrp_script\" = \"chk_apache2\"\n { \"#comment\" = \"Requires keepalived-1.1.13\" }\n { \"script\" = \"\\\"killall -0 apache2\\\"\"\n { \"#comment\" = \"faster\" } }\n { \"interval\" = \"2\"\n { \"#comment\" = \"check every 2 seconds\" } }\n { \"weight\" = \"2\"\n { \"#comment\" = \"add 2 points of prio if OK\" } } }\n { }\n { \"#comment\" = \"that's all\" }\n\n","old_contents":"(* Test for keepalived lens *)\n\nmodule Test_keepalived =\n\n let conf = \"! This is a comment \n! Configuration File for keepalived \n\nglobal_defs { \n ! this is who emails will go to on alerts \n notification_email { \n admins@example.com \n fakepager@example.com \n ! add a few more email addresses here if you would like \n } \n notification_email_from admins@example.com \n\n smtp_server 127.0.0.1 ! I use the local machine to relay mail \n smtp_connect_timeout 30 \n\n ! each load balancer should have a different ID \n ! this will be used in SMTP alerts, so you should make \n ! each router easily identifiable \n lvs_id LVS_EXAMPLE_01 \n} \n\nvrrp_sync_group VG1 { \n group { \n inside_network # name of vrrp_instance (below)\n outside_network # One for each moveable IP. \n } \n} \n\nvrrp_instance VI_1 { \n state MASTER \n interface eth0 \n\n\ttrack_interface {\n\t\teth0 # Back\n\t\teth1 # DMZ\n\t}\n\ttrack_script {\n\t\tcheck_apache2 # weight = +2 si ok, 0 si nok\n\t}\n\tgarp_master_delay 5\n\tpriority 50\n\tadvert_int 2\n\tauthentication {\n\t\tauth_type PASS\n\t\tauth_pass mypass\n\t}\n\tvirtual_ipaddress {\n\t\t10.234.66.146\/32 dev eth0\n\t}\n \n lvs_sync_daemon_interface eth0 \n\tha_suspend\n\n notify_master \\\"\/svr\/scripts\/notify_master.sh\\\"\n notify_backup \\\"\/svr\/scripts\/notify_backup.sh\\\"\n notify_fault \\\"\/svr\/scripts\/notify_fault.sh\\\"\n\n ! each virtual router id must be unique per instance name! \n virtual_router_id 51 \n\n ! MASTER and BACKUP state are determined by the priority \n ! even if you specify MASTER as the state, the state will \n ! be voted on by priority (so if your state is MASTER but your \n ! priority is lower than the router with BACKUP, you will lose \n ! the MASTER state) \n ! I make it a habit to set priorities at least 50 points apart \n ! note that a lower number is lesser priority - lower gets less vote \n priority 150 \n\n ! how often should we vote, in seconds? \n advert_int 1 \n\n ! send an alert when this instance changes state from MASTER to BACKUP \n smtp_alert \n\n ! this authentication is for syncing between failover servers \n ! keepalived supports PASS, which is simple password \n ! authentication \n ! or AH, which is the IPSec authentication header. \n ! I don't use AH \n ! yet as many people have reported problems with it \n authentication { \n auth_type PASS \n auth_pass example \n } \n\n ! these are the IP addresses that keepalived will setup on this \n ! machine. Later in the config we will specify which real \n ! servers are behind these IPs \n ! without this block, keepalived will not setup and takedown the \n ! any IP addresses \n \n virtual_ipaddress { \n 192.168.1.11 \n 10.234.66.146\/32 dev vlan933 # parse it well\n ! and more if you want them \n } \n} \n\nvirtual_server 192.168.1.11 22 { \n delay_loop 6 \n\n ! use round-robin as a load balancing algorithm \n lb_algo rr \n\n ! we are doing NAT \n lb_kind NAT \n nat_mask 255.255.255.0 \n\n protocol TCP \n\n ! there can be as many real_server blocks as you need \n\n real_server 10.20.40.10 22 { \n\n ! if we used weighted round-robin or a similar lb algo, \n ! we include the weight of this server \n\n weight 1 \n\n ! here is a health checker for this server. \n ! we could use a custom script here (see the keepalived docs) \n ! but we will just make sure we can do a vanilla tcp connect() \n ! on port 22 \n ! if it fails, we will pull this realserver out of the pool \n ! and send email about the removal \n TCP_CHECK { \n connect_timeout 3 \n connect_port 22 \n } \n } \n} \n\nvirtual_server_group DNS_1 {\n 192.168.0.1 22\n 10.234.55.22-25 36\n 10.45.58.59\/32 27\n}\n\nvrrp_script chk_apache2 { # Requires keepalived-1.1.13\nscript \\\"killall -0 apache2\\\" # faster\ninterval 2 # check every 2 seconds\nweight 2 # add 2 points of prio if OK\n}\n\n! that's all\n\"\n\n\n test Keepalived.lns get conf =\n { \"#comment\" = \"This is a comment\" }\n { \"#comment\" = \"Configuration File for keepalived\" }\n {}\n { \"global_defs\"\n { }\n { \"#comment\" = \"this is who emails will go to on alerts\" }\n { \"notification_email\"\n { }\n { \"email\" = \"admins@example.com\" }\n { \"email\" = \"fakepager@example.com\" }\n { \"#comment\" = \"add a few more email addresses here if you would like\" } }\n { \"notification_email_from\" = \"admins@example.com\" }\n { }\n { \"smtp_server\" = \"127.0.0.1\"\n { \"#comment\" = \"I use the local machine to relay mail\" } }\n { \"smtp_connect_timeout\" = \"30\" }\n {}\n { \"#comment\" = \"each load balancer should have a different ID\" }\n { \"#comment\" = \"this will be used in SMTP alerts, so you should make\" }\n { \"#comment\" = \"each router easily identifiable\" }\n { \"lvs_id\" = \"LVS_EXAMPLE_01\" } }\n {}\n { \"vrrp_sync_group\" = \"VG1\"\n { }\n { \"group\"\n { }\n { \"inside_network\"\n { \"#comment\" = \"name of vrrp_instance (below)\" } }\n { \"outside_network\"\n { \"#comment\" = \"One for each moveable IP.\" } } } }\n {}\n { \"vrrp_instance\" = \"VI_1\"\n { }\n { \"state\" = \"MASTER\" }\n { \"interface\" = \"eth0\" }\n { }\n { \"track_interface\"\n { }\n { \"eth0\" { \"#comment\" = \"Back\" } }\n { \"eth1\" { \"#comment\" = \"DMZ\" } } }\n { \"track_script\"\n { }\n { \"check_apache2\" { \"#comment\" = \"weight = +2 si ok, 0 si nok\" } } }\n { \"garp_master_delay\" = \"5\" }\n { \"priority\" = \"50\" }\n { \"advert_int\" = \"2\" }\n { \"authentication\"\n { }\n { \"auth_type\" = \"PASS\" }\n { \"auth_pass\" = \"mypass\" } }\n { \"virtual_ipaddress\"\n { }\n { \"ipaddr\" = \"10.234.66.146\"\n { \"prefixlen\" = \"32\" }\n { \"dev\" = \"eth0\" } } }\n { }\n { \"lvs_sync_daemon_interface\" = \"eth0\" }\n { \"ha_suspend\" }\n { }\n { \"notify_master\" = \"\\\"\/svr\/scripts\/notify_master.sh\\\"\" }\n { \"notify_backup\" = \"\\\"\/svr\/scripts\/notify_backup.sh\\\"\" }\n { \"notify_fault\" = \"\\\"\/svr\/scripts\/notify_fault.sh\\\"\" }\n { }\n { \"#comment\" = \"each virtual router id must be unique per instance name!\" }\n { \"virtual_router_id\" = \"51\" }\n { }\n { \"#comment\" = \"MASTER and BACKUP state are determined by the priority\" }\n { \"#comment\" = \"even if you specify MASTER as the state, the state will\" }\n { \"#comment\" = \"be voted on by priority (so if your state is MASTER but your\" }\n { \"#comment\" = \"priority is lower than the router with BACKUP, you will lose\" }\n { \"#comment\" = \"the MASTER state)\" }\n { \"#comment\" = \"I make it a habit to set priorities at least 50 points apart\" }\n { \"#comment\" = \"note that a lower number is lesser priority - lower gets less vote\" }\n { \"priority\" = \"150\" }\n { }\n { \"#comment\" = \"how often should we vote, in seconds?\" }\n { \"advert_int\" = \"1\" }\n { }\n { \"#comment\" = \"send an alert when this instance changes state from MASTER to BACKUP\" }\n { \"smtp_alert\" }\n { }\n { \"#comment\" = \"this authentication is for syncing between failover servers\" }\n { \"#comment\" = \"keepalived supports PASS, which is simple password\" }\n { \"#comment\" = \"authentication\" }\n { \"#comment\" = \"or AH, which is the IPSec authentication header.\" }\n { \"#comment\" = \"I don't use AH\" }\n { \"#comment\" = \"yet as many people have reported problems with it\" }\n { \"authentication\"\n { }\n { \"auth_type\" = \"PASS\" }\n { \"auth_pass\" = \"example\" } }\n { }\n { \"#comment\" = \"these are the IP addresses that keepalived will setup on this\" }\n { \"#comment\" = \"machine. Later in the config we will specify which real\" }\n { \"#comment\" = \"servers are behind these IPs\" }\n { \"#comment\" = \"without this block, keepalived will not setup and takedown the\" }\n { \"#comment\" = \"any IP addresses\" }\n { }\n { \"virtual_ipaddress\"\n { }\n { \"ipaddr\" = \"192.168.1.11\" }\n { \"ipaddr\" = \"10.234.66.146\"\n { \"prefixlen\" = \"32\" }\n { \"dev\" = \"vlan933\" }\n { \"#comment\" = \"parse it well\" } }\n { \"#comment\" = \"and more if you want them\" } } }\n { }\n { \"virtual_server\"\n { \"ip\" = \"192.168.1.11\" }\n { \"port\" = \"22\" }\n { }\n { \"delay_loop\" = \"6\" }\n { }\n { \"#comment\" = \"use round-robin as a load balancing algorithm\" }\n { \"lb_algo\" = \"rr\" }\n { }\n { \"#comment\" = \"we are doing NAT\" }\n { \"lb_kind\" = \"NAT\" }\n { \"nat_mask\" = \"255.255.255.0\" }\n { }\n { \"protocol\" = \"TCP\" }\n { }\n { \"#comment\" = \"there can be as many real_server blocks as you need\" }\n { }\n { \"real_server\"\n { \"ip\" = \"10.20.40.10\" }\n { \"port\" = \"22\" }\n { }\n { }\n { \"#comment\" = \"if we used weighted round-robin or a similar lb algo,\" }\n { \"#comment\" = \"we include the weight of this server\" }\n { }\n { \"weight\" = \"1\" }\n { }\n { \"#comment\" = \"here is a health checker for this server.\" }\n { \"#comment\" = \"we could use a custom script here (see the keepalived docs)\" }\n { \"#comment\" = \"but we will just make sure we can do a vanilla tcp connect()\" }\n { \"#comment\" = \"on port 22\" }\n { \"#comment\" = \"if it fails, we will pull this realserver out of the pool\" }\n { \"#comment\" = \"and send email about the removal\" }\n { \"TCP_CHECK\"\n { }\n { \"connect_timeout\" = \"3\" }\n { \"connect_port\" = \"22\" } } } }\n { }\n { \"virtual_server_group\" = \"DNS_1\"\n { }\n { \"vip\"\n\t { \"ipaddr\" = \"192.168.0.1\" }\n\t { \"port\" = \"22\" } }\n\t { \"vip\"\n\t { \"ipaddr\" = \"10.234.55.22-25\" }\n\t { \"port\" = \"36\" } }\n\t { \"vip\"\n\t { \"ipaddr\" = \"10.45.58.59\"\n\t { \"prefixlen\" = \"32\" } }\n\t { \"port\" = \"27\" } } }\n { }\n { \"vrrp_script\" = \"chk_apache2\"\n { \"#comment\" = \"Requires keepalived-1.1.13\" }\n { \"script\" = \"\\\"killall -0 apache2\\\"\"\n { \"#comment\" = \"faster\" } }\n { \"interval\" = \"2\"\n { \"#comment\" = \"check every 2 seconds\" } }\n { \"weight\" = \"2\"\n { \"#comment\" = \"add 2 points of prio if OK\" } } }\n { }\n { \"#comment\" = \"that's all\" }\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d8ed1401cd9944df6ab67d89d49eb41d7d06d969","subject":"Httpd: include \/etc\/httpd\/conf\/httpd.conf used on Fedora\/RHEL","message":"Httpd: include \/etc\/httpd\/conf\/httpd.conf used on Fedora\/RHEL\n\nFixes https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=688149\n","repos":"kumy\/augeas,mlichvar\/augeas,jtopjian\/augeas,lutter\/augeas,raphink\/augeas,kumy\/augeas,hercules-team\/augeas,pevalme\/augeas,domcleal\/augeas,jtopjian\/augeas,dafugg\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,ptoscano\/augeas,mchf\/augeas,manandbytes\/augeas,hercules-team\/augeas,jjlin\/augeas,raphink\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,MikaelSmith\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,mchf\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,dafugg\/augeas,jasperla\/augeas,pevalme\/augeas,domcleal\/augeas,mlichvar\/augeas,manandbytes\/augeas,kumy\/augeas,domcleal\/augeas,lutter\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,ptoscano\/augeas","old_file":"lenses\/httpd.aug","new_file":"lenses\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPLv2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\nlet sep_spc = Sep.space\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_\\.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9\\._\\-]*\/\n\nlet comment = Util.comment\nlet eol = Util.eol\nlet empty = Util.empty\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let h = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n [ indent . dels \"<\" . square word h . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPLv2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\nlet sep_spc = Sep.space\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_\\.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9\\._\\-]*\/\n\nlet comment = Util.comment\nlet eol = Util.eol\nlet empty = Util.empty\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let h = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n [ indent . dels \"<\" . square word h . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7af39a8f6fe9a6e8f214797183c8dea68a9e5a99","subject":"Sshd: map comments as '#comment' nodes","message":"Sshd: map comments as '#comment' nodes\n","repos":"jtopjian\/augeas,kunkku\/augeas,bkearney\/augeas,kumy\/augeas,camptocamp\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas,camptocamp\/augeas,GeoffWilliams\/augeas,bkearney\/augeas,lutter\/augeas,jasperla\/augeas,mlichvar\/augeas,dafugg\/augeas,bkearney\/augeas,jtopjian\/augeas,domcleal\/augeas,ptoscano\/augeas,lutter\/augeas,jjlin\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,ptoscano\/augeas,manandbytes\/augeas,kumy\/augeas,kumy\/augeas,mchf\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,manandbytes\/augeas,camptocamp\/augeas,kunkku\/augeas,dafugg\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,MikaelSmith\/augeas,domcleal\/augeas,mlichvar\/augeas,lutter\/augeas,MikaelSmith\/augeas,jasperla\/augeas,ptoscano\/augeas,pevalme\/augeas,dafugg\/augeas,bkearney\/augeas,pevalme\/augeas,kumy\/augeas,camptocamp\/augeas,mchf\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas","old_file":"lenses\/sshd.aug","new_file":"lenses\/sshd.aug","new_contents":"(*\nModule: Sshd\n Parses \/etc\/ssh\/sshd_config\n\nAuthor: David Lutterkort lutter@redhat.com\n Dominique Dumont dominique.dumont@hp.com\n\nAbout: Reference\n sshd_config man page.\n See http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=sshd_config&sektion=5\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get your current setup\n > print \/files\/etc\/ssh\/sshd_config\n ...\n\n * Set X11Forwarding to \"no\"\n > set \/files\/etc\/ssh\/sshd_config\/X11Forwarding \"no\"\n\n More advanced usage:\n\n * Set a Match section\n > set \/files\/etc\/ssh\/sshd_config\/Match[1]\/Condition\/User \"foo\"\n > set \/files\/etc\/ssh\/sshd_config\/Match[1]\/Settings\/X11Forwarding \"yes\"\n\n Saving your file:\n\n > save\n\n\nAbout: CAVEATS\n\n In sshd_config, Match blocks must be located at the end of the file.\n This means that any new \"global\" parameters (i.e. outside of a Match\n block) must be written before the first Match block. By default,\n Augeas will write new parameters at the end of the file.\n\n I.e. if you have a Match section and no ChrootDirectory parameter,\n this command:\n\n > set \/files\/etc\/ssh\/sshd_config\/ChrootDirectory \"foo\"\n\n will be stored in a new node after the Match section and Augeas will\n refuse to save sshd_config file.\n\n To create a new parameter as the right place, you must first create\n a new Augeas node before the Match section:\n\n > ins ChrootDirectory before \/files\/etc\/ssh\/sshd_config\/Match\n\n Then, you can set the parameter\n\n > set \/files\/etc\/ssh\/sshd_config\/ChrootDirectory \"foo\"\n\n\nAbout: Configuration files\n This lens applies to \/etc\/ssh\/sshd_config\n\n*)\n\nmodule Sshd =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let sep = Util.del_ws_spc\n\n let key_re = \/[A-Za-z0-9]+\/ \n - \/MACs|Match|AcceptEnv|Subsystem|(Allow|Deny)(Groups|Users)\/\n\n let comment = Util.comment\n let empty = Util.empty\n\n let array_entry (k:string) =\n let value = store \/[^ \\t\\n]+\/ in\n [ key k . [ sep . seq k . value]* . eol ]\n\n let other_entry =\n let value = store \/[^ \\t\\n]+([ \\t]+[^ \\t\\n]+)*\/ in\n [ key key_re . sep . value . eol ]\n\n let accept_env = array_entry \"AcceptEnv\"\n\n let allow_groups = array_entry \"AllowGroups\"\n let allow_users = array_entry \"AllowUsers\"\n let deny_groups = array_entry \"DenyGroups\"\n let deny_users = array_entry \"DenyUsers\"\n\n let subsystemvalue = \n let value = store \/[^ \\t\\n]+\/ in\n [ key \/[A-Za-z0-9]+\/ . sep . value . eol ] \n\n let subsystem = \n let value = store \/[^ \\t\\n]+([ \\t]+[^ \\t\\n]+)*\/ in\n [ key \"Subsystem\" . sep . subsystemvalue ] \n\n let macs =\n let mac_value = store \/[^, \\t\\n]+\/ in\n [ key \"MACs\" . sep .\n [ seq \"macs\" . mac_value ] .\n ([ seq \"macs\" . Util.del_str \",\" . mac_value])* .\n eol ]\n\n let condition_entry =\n let value = store \/[^ \\t\\n]+\/ in\n [ sep . key \/[A-Za-z0-9]+\/ . sep . value ]\n\n let match_cond = \n [ label \"Condition\" . condition_entry+ . eol ]\n\n let match_entry = \n ( comment | empty | (Util.indent . other_entry) )\n\n let match =\n [ key \"Match\" . match_cond\n . [ label \"Settings\" . match_entry+ ]\n ]\n\n let lns = (comment | empty | accept_env | allow_groups | allow_users\n | deny_groups | subsystem | deny_users | macs \n | other_entry ) * . match*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/sshd_config\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Sshd\n Parses \/etc\/ssh\/sshd_config\n\nAuthor: David Lutterkort lutter@redhat.com\n Dominique Dumont dominique.dumont@hp.com\n\nAbout: Reference\n sshd_config man page.\n See http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=sshd_config&sektion=5\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get your current setup\n > print \/files\/etc\/ssh\/sshd_config\n ...\n\n * Set X11Forwarding to \"no\"\n > set \/files\/etc\/ssh\/sshd_config\/X11Forwarding \"no\"\n\n More advanced usage:\n\n * Set a Match section\n > set \/files\/etc\/ssh\/sshd_config\/Match[1]\/Condition\/User \"foo\"\n > set \/files\/etc\/ssh\/sshd_config\/Match[1]\/Settings\/X11Forwarding \"yes\"\n\n Saving your file:\n\n > save\n\n\nAbout: CAVEATS\n\n In sshd_config, Match blocks must be located at the end of the file.\n This means that any new \"global\" parameters (i.e. outside of a Match\n block) must be written before the first Match block. By default,\n Augeas will write new parameters at the end of the file.\n\n I.e. if you have a Match section and no ChrootDirectory parameter,\n this command:\n\n > set \/files\/etc\/ssh\/sshd_config\/ChrootDirectory \"foo\"\n\n will be stored in a new node after the Match section and Augeas will\n refuse to save sshd_config file.\n\n To create a new parameter as the right place, you must first create\n a new Augeas node before the Match section:\n\n > ins ChrootDirectory before \/files\/etc\/ssh\/sshd_config\/Match\n\n Then, you can set the parameter\n\n > set \/files\/etc\/ssh\/sshd_config\/ChrootDirectory \"foo\"\n\n\nAbout: Configuration files\n This lens applies to \/etc\/ssh\/sshd_config\n\n*)\n\nmodule Sshd =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let sep = Util.del_ws_spc\n\n let key_re = \/[A-Za-z0-9]+\/ \n - \/MACs|Match|AcceptEnv|Subsystem|(Allow|Deny)(Groups|Users)\/\n\n let comment = [ del \/(#.*|[ \\t]*)\\n\/ \"\\n\" ]\n\n let array_entry (k:string) =\n let value = store \/[^ \\t\\n]+\/ in\n [ key k . [ sep . seq k . value]* . eol ]\n\n let other_entry =\n let value = store \/[^ \\t\\n]+([ \\t]+[^ \\t\\n]+)*\/ in\n [ key key_re . sep . value . eol ]\n\n let accept_env = array_entry \"AcceptEnv\"\n\n let allow_groups = array_entry \"AllowGroups\"\n let allow_users = array_entry \"AllowUsers\"\n let deny_groups = array_entry \"DenyGroups\"\n let deny_users = array_entry \"DenyUsers\"\n\n let subsystemvalue = \n let value = store \/[^ \\t\\n]+\/ in\n [ key \/[A-Za-z0-9]+\/ . sep . value . eol ] \n\n let subsystem = \n let value = store \/[^ \\t\\n]+([ \\t]+[^ \\t\\n]+)*\/ in\n [ key \"Subsystem\" . sep . subsystemvalue ] \n\n let macs =\n let mac_value = store \/[^, \\t\\n]+\/ in\n [ key \"MACs\" . sep .\n [ seq \"macs\" . mac_value ] .\n ([ seq \"macs\" . Util.del_str \",\" . mac_value])* .\n eol ]\n\n let condition_entry =\n let value = store \/[^ \\t\\n]+\/ in\n [ sep . key \/[A-Za-z0-9]+\/ . sep . value ]\n\n let match_cond = \n [ label \"Condition\" . condition_entry+ . eol ]\n\n let match_entry = \n ( comment | (Util.indent . other_entry) )\n\n let match =\n [ key \"Match\" . match_cond\n . [ label \"Settings\" . match_entry+ ]\n ]\n\n let lns = (comment | accept_env | allow_groups | allow_users\n | deny_groups | subsystem | deny_users | macs \n | other_entry ) * . match*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/sshd_config\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4be260f5e3295a178cdf8b2a03cffa1e089e71b8","subject":"Shellvars: include lbu.conf","message":"Shellvars: include lbu.conf\n\nAlpine Linux Local Backup Utility\n","repos":"lutter\/augeas,mlichvar\/augeas,pevalme\/augeas,ptoscano\/augeas,manandbytes\/augeas,mchf\/augeas,lutter\/augeas,mlichvar\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas,ptoscano\/augeas,lutter\/augeas,pevalme\/augeas,manandbytes\/augeas,mchf\/augeas,kunkku\/augeas,hercules-team\/augeas,kunkku\/augeas,pevalme\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lbu\/lbu.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7bc8f2f50a7ddaa3d2d4bacc3eefd4e39ed0ee3f","subject":"openvpn: simple ipv6 regex to save memory for tests","message":"openvpn: simple ipv6 regex to save memory for tests\n","repos":"ptoscano\/augeas,hercules-team\/augeas,mchf\/augeas,dafugg\/augeas,ptoscano\/augeas,pevalme\/augeas,lutter\/augeas,lutter\/augeas,manandbytes\/augeas,mchf\/augeas,hercules-team\/augeas,kunkku\/augeas,kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,dafugg\/augeas,mlichvar\/augeas,pevalme\/augeas,lutter\/augeas,mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,dafugg\/augeas,manandbytes\/augeas","old_file":"lenses\/openvpn.aug","new_file":"lenses\/openvpn.aug","new_contents":"(* OpenVPN module for Augeas\n Author: Raphael Pinson <raphink@gmail.com>\n Author: Justin Akers <dafugg@gmail.com>\n\n Reference: http:\/\/openvpn.net\/index.php\/documentation\/howto.html\n Reference: https:\/\/community.openvpn.net\/openvpn\/wiki\/Openvpn23ManPage\n\n TODO: Inline file support\n*)\n\n\nmodule OpenVPN =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet indent = Util.indent\n\n(* Define separators *)\nlet sep = Util.del_ws_spc\n\n(* Define value regexps.\n Custom simplified ipv6 used instead of Rx.ipv6 as the augeas Travis instances\n are limited to 2GB of memory. Using 'ipv6_re = Rx.ipv6' consumes an extra\n 2GB of memory and thus the test is OOM-killed.\n*)\nlet ipv6_re = \/[0-9A-Fa-f:]+\/\nlet ipv4_re = Rx.ipv4\nlet ip_re = ipv4_re|ipv6_re\nlet num_re = Rx.integer\nlet fn_re = \/[^#; \\t\\n][^#;\\n]*[^#; \\t\\n]|[^#; \\t\\n]\/\nlet fn_safe_re = \/[^#; \\t\\r\\n]+\/\nlet an_re = \/[a-z][a-z0-9_-]*\/\nlet hn_re = Rx.hostname\nlet port_re = \/[0-9]+\/\nlet host_re = ip_re|hn_re\nlet proto_re = \/(tcp|udp)\/\nlet proto_ext_re = \/(udp|tcp-client|tcp-server)\/\nlet alg_re = \/(none|[A-Za-z][A-Za-z0-9-]+)\/\nlet ipv6_bits_re = ipv6_re . \/\\\/[0-9]+\/\n\n(* Define store aliases *)\nlet ip = store ip_re\nlet num = store num_re\nlet filename = store fn_re\nlet filename_safe = store fn_safe_re\nlet hostname = store hn_re\nlet sto_to_dquote = store \/[^\"\\n]+\/ (* \" Emacs, relax *)\nlet port = store port_re\nlet host = store host_re\nlet proto = store proto_re\nlet proto_ext = store proto_ext_re\n\n(* define comments and empty lines *)\nlet comment = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \"# \"\nlet comment_or_eol = eol | Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \" # \"\n\nlet empty = Util.empty\n\n\n(************************************************************************\n * SINGLE VALUES\n *\n * - local => IP|hostname\n * - port => num\n * - proto => udp|tcp-client|tcp-server\n * - proto-force => udp|tcp\n * - mode => p2p|server\n * - dev => (tun|tap)\\d*\n * - dev-node => filename\n * - ca => filename\n * - config => filename\n * - cert => filename\n * - key => filename\n * - dh => filename\n * - ifconfig-pool-persist => filename\n * - learn-address => filename\n * - cipher => [A-Z0-9-]+\n * - max-clients => num\n * - user => alphanum\n * - group => alphanum\n * - status => filename\n * - log => filename\n * - log-append => filename\n * - client-config-dir => filename\n * - verb => num\n * - mute => num\n * - fragment => num\n * - mssfix => num\n * - connect-retry num\n * - connect-retry-max num\n * - connect-timeout num\n * - http-proxy-timeout num\n * - max-routes num\n * - ns-cert-type => \"server\"\n * - resolv-retry => \"infinite\"\n * - script-security => [0-3] (execve|system)?\n * - ipchange => command\n * - topology => type\n *************************************************************************)\n\nlet single_host = \"local\" | \"tls-remote\"\nlet single_ip = \"lladdr\"\nlet single_ipv6_bits = \"iroute-ipv6\"\n | \"server-ipv6\"\n | \"ifconfig-ipv6-pool\"\nlet single_num = \"port\"\n | \"max-clients\"\n | \"verb\"\n | \"mute\"\n | \"fragment\"\n | \"mssfix\"\n | \"connect-retry\"\n | \"connect-retry-max\"\n | \"connect-timeout\"\n | \"http-proxy-timeout\"\n | \"resolv-retry\"\n | \"lport\"\n | \"rport\"\n | \"max-routes\"\n | \"max-routes-per-client\"\n | \"route-metric\"\n | \"tun-mtu\"\n | \"tun-mtu-extra\"\n | \"shaper\"\n | \"ping\"\n | \"ping-exit\"\n | \"ping-restart\"\n | \"sndbuf\"\n | \"rcvbuf\"\n | \"txqueuelen\"\n | \"link-mtu\"\n | \"nice\"\n | \"management-log-cache\"\n | \"bcast-buffers\"\n | \"tcp-queue-limit\"\n | \"server-poll-timeout\"\n | \"keysize\"\n | \"pkcs11-pin-cache\"\n | \"tls-timeout\"\n | \"reneg-bytes\"\n | \"reneg-pkts\"\n | \"reneg-sec\"\n | \"hand-window\"\n | \"tran-window\"\nlet single_fn = \"ca\"\n | \"cert\"\n | \"extra-certs\"\n | \"config\"\n | \"key\"\n | \"dh\"\n | \"log\"\n | \"log-append\"\n | \"client-config-dir\"\n | \"dev-node\"\n | \"cd\"\n | \"chroot\"\n | \"writepid\"\n | \"client-config-dir\"\n | \"tmp-dir\"\n | \"replay-persist\"\n | \"ca\"\n | \"capath\"\n | \"pkcs12\"\n | \"pkcs11-id\"\n | \"askpass\"\n | \"tls-export-cert\"\n | \"x509-track\"\nlet single_an = \"user\"\n | \"group\"\n | \"management-client-user\"\n | \"management-client-group\"\nlet single_cmd = \"ipchange\"\n | \"iproute\"\n | \"route-up\"\n | \"route-pre-down\"\n | \"mark\"\n | \"up\"\n | \"down\"\n | \"setcon\"\n | \"echo\"\n | \"client-connect\"\n | \"client-disconnect\"\n | \"learn-address\"\n | \"tls-verify\"\n\nlet single_entry (kw:regexp) (re:regexp)\n = [ key kw . sep . store re . comment_or_eol ]\n\nlet single_opt_entry (kw:regexp) (re:regexp)\n = [ key kw . (sep . store re)? .comment_or_eol ]\n\nlet single = single_entry single_num num_re\n \t | single_entry single_fn fn_re\n\t | single_entry single_an an_re\n\t | single_entry single_host host_re\n\t | single_entry single_ip ip_re\n | single_entry single_ipv6_bits ipv6_bits_re\n | single_entry single_cmd fn_re\n\t | single_entry \"proto\" proto_ext_re\n\t | single_entry \"proto-force\" proto_re\n\t | single_entry \"mode\" \/(p2p|server)\/\n | single_entry \"dev\" \/(tun|tap)[0-9]*|null\/\n\t | single_entry \"dev-type\" \/(tun|tap)\/\n\t | single_entry \"topology\" \/(net30|p2p|subnet)\/\n\t | single_entry \"cipher\" alg_re\n\t | single_entry \"auth\" alg_re\n\t | single_entry \"resolv-retry\" \"infinite\"\n\t | single_entry \"script-security\" \/[0-3]( execve| system)?\/\n\t | single_entry \"route-gateway\" (host_re|\/dhcp\/)\n\t | single_entry \"mtu-disc\" \/(no|maybe|yes)\/\n\t | single_entry \"remap-usr1\" \/SIG(HUP|TERM)\/\n\t | single_entry \"socket-flags\" \/(TCP_NODELAY)\/\n | single_entry \"auth-retry\" \/(none|nointeract|interact)\/\n | single_entry \"tls-version-max\" Rx.decimal\n | single_entry \"verify-hash\" \/([A-Za-z0-9]{2}:)+[A-Za-z0-9]{2}\/\n | single_entry \"pkcs11-cert-private\" \/[01]\/\n | single_entry \"pkcs11-protected-authentication\" \/[01]\/\n | single_entry \"pkcs11-private-mode\" \/[A-Za-z0-9]+\/\n | single_entry \"key-method\" \/[12]\/\n | single_entry \"ns-cert-type\" \/(client|server)\/\n | single_entry \"remote-cert-tls\" \/(client|server)\/\n\nlet single_opt = single_opt_entry \"comp-lzo\" \/(yes|no|adaptive)\/\n | single_opt_entry \"syslog\" fn_re\n | single_opt_entry \"daemon\" fn_re\n | single_opt_entry \"auth-user-pass\" fn_re\n | single_opt_entry \"explicit-exit-notify\" num_re\n | single_opt_entry \"engine\" fn_re\n\n(************************************************************************\n * DOUBLE VALUES\n *************************************************************************)\n\nlet double_entry (kw:regexp) (a:string) (aval:regexp) (b:string) (bval:regexp)\n = [ key kw\n . sep . [ label a . store aval ]\n . sep . [ label b . store bval ]\n . comment_or_eol\n ]\n\nlet double_secopt_entry (kw:regexp) (a:string) (aval:regexp) (b:string) (bval:regexp)\n = [ key kw\n . sep . [ label a . store aval ]\n . (sep . [ label b . store bval ])?\n . comment_or_eol\n ]\n\n\nlet double = double_entry \"keepalive\" \"ping\" num_re \"timeout\" num_re\n | double_entry \"hash-size\" \"real\" num_re \"virtual\" num_re\n | double_entry \"ifconfig\" \"local\" ip_re \"remote\" ip_re\n | double_entry \"connect-freq\" \"num\" num_re \"sec\" num_re\n | double_entry \"verify-x509-name\" \"name\" hn_re \"type\"\n \/(subject|name|name-prefix)\/\n | double_entry \"ifconfig-ipv6\" \"address\" ipv6_bits_re \"remote\" ipv6_re\n | double_entry \"ifconfig-ipv6-push\" \"address\" ipv6_bits_re \"remote\" ipv6_re\n | double_secopt_entry \"iroute\" \"local\" ip_re \"netmask\" ip_re\n | double_secopt_entry \"stale-routes-check\" \"age\" num_re \"interval\" num_re\n | double_secopt_entry \"ifconfig-pool-persist\"\n \"file\" fn_safe_re \"seconds\" num_re\n | double_secopt_entry \"secret\" \"file\" fn_safe_re \"direction\" \/[01]\/\n | double_secopt_entry \"prng\" \"algorithm\" alg_re \"nsl\" num_re\n | double_secopt_entry \"replay-window\" \"window-size\" num_re \"seconds\" num_re\n\n\n(************************************************************************\n * FLAGS\n *************************************************************************)\n\nlet flag_words = \"client-to-client\"\n | \"duplicate-cn\"\n\t | \"persist-key\"\n\t | \"persist-tun\"\n\t | \"client\"\n\t | \"remote-random\"\n\t | \"nobind\"\n\t | \"mute-replay-warnings\"\n\t | \"http-proxy-retry\"\n\t | \"socks-proxy-retry\"\n | \"remote-random-hostname\"\n | \"show-proxy-settings\"\n | \"float\"\n | \"bind\"\n | \"nobind\"\n | \"tun-ipv6\"\n | \"ifconfig-noexec\"\n | \"ifconfig-nowarn\"\n | \"route-noexec\"\n | \"route-nopull\"\n | \"allow-pull-fqdn\"\n | \"mtu-test\"\n | \"ping-timer-rem\"\n | \"persist-tun\"\n | \"persist-local-ip\"\n | \"persist-remote-ip\"\n | \"mlock\"\n | \"up-delay\"\n | \"down-pre\"\n | \"up-restart\"\n | \"disable-occ\"\n | \"errors-to-stderr\"\n | \"passtos\"\n | \"suppress-timestamps\"\n | \"fast-io\"\n | \"multihome\"\n | \"comp-noadapt\"\n | \"management-client\"\n | \"management-query-passwords\"\n | \"management-query-proxy\"\n | \"management-query-remote\"\n | \"management-forget-disconnect\"\n | \"management-hold\"\n | \"management-signal\"\n | \"management-up-down\"\n | \"management-client-auth\"\n | \"management-client-pf\"\n | \"push-reset\"\n | \"push-peer-info\"\n | \"disable\"\n | \"ifconfig-pool-linear\"\n | \"client-to-client\"\n | \"duplicate-cn\"\n | \"ccd-exclusive\"\n | \"tcp-nodelay\"\n | \"opt-verify\"\n | \"auth-user-pass-optional\"\n | \"client-cert-not-required\"\n | \"username-as-common-name\"\n | \"pull\"\n | \"key-direction\"\n | \"no-replay\"\n | \"mute-replay-warnings\"\n | \"no-iv\"\n | \"use-prediction-resistance\"\n | \"test-crypto\"\n | \"tls-server\"\n | \"tls-client\"\n | \"pkcs11-id-management\"\n | \"single-session\"\n | \"tls-exit\"\n | \"auth-nocache\"\n | \"show-ciphers\"\n | \"show-digests\"\n | \"show-tls\"\n | \"show-engines\"\n | \"genkey\"\n | \"mktun\"\n | \"rmtun\"\n\n\nlet flag_entry (kw:regexp)\n = [ key kw . comment_or_eol ]\n\nlet flag = flag_entry flag_words\n\n\n(************************************************************************\n * OTHER FIELDS\n *\n * - server => IP IP [nopool]\n * - server-bridge => IP IP IP IP\n * - route\t => host host [host [num]]\n * - push => \"string\"\n * - tls-auth => filename [01]\n * - remote => hostname\/IP [num] [(tcp|udp)]\n * - management => IP num filename\n * - http-proxy => host port [filename|keyword] [method]\n * - http-proxy-option => (VERSION decimal|AGENT string)\n * ...\n * and many others\n *\n *************************************************************************)\n\nlet server = [ key \"server\"\n . sep . [ label \"address\" . ip ]\n . sep . [ label \"netmask\" . ip ]\n . (sep . [ key \"nopool\" ]) ?\n . comment_or_eol\n ]\n\nlet server_bridge =\n let ip_params = [ label \"address\" . ip ] . sep\n . [ label \"netmask\" . ip ] . sep\n . [ label \"start\" . ip ] . sep\n . [ label \"end\" . ip ] in\n [ key \"server-bridge\"\n . sep . (ip_params|store \/(nogw)\/)\n . comment_or_eol\n ]\n\nlet route =\n let route_net_kw = store (\/(vpn_gateway|net_gateway|remote_host)\/|host_re) in\n [ key \"route\" . sep\n . [ label \"address\" . route_net_kw ]\n . (sep . [ label \"netmask\" . store (ip_re|\/default\/) ]\n . (sep . [ label \"gateway\" . route_net_kw ]\n . (sep . [ label \"metric\" . store (\/default\/|num_re)] )?\n )?\n )?\n . comment_or_eol\n ]\n\nlet route_ipv6 =\n let route_net_re = \/(vpn_gateway|net_gateway|remote_host)\/ in\n [ key \"route-ipv6\" . sep\n . [ label \"network\" . store (route_net_re|ipv6_bits_re) ]\n . (sep . [ label \"gateway\" . store (route_net_re|ipv6_re) ]\n . (sep . [ label \"metric\" . store (\/default\/|num_re)] )?\n )?\n . comment_or_eol\n ]\n\nlet push = [ key \"push\" . sep\n . Quote.do_dquote sto_to_dquote\n\t\t . comment_or_eol\n ]\n\nlet tls_auth = [ key \"tls-auth\" . sep\n . [ label \"key\" . filename ] . sep\n\t\t . [ label \"is_client\" . store \/[01]\/ ] . comment_or_eol\n ]\n\nlet remote = [ key \"remote\" . sep\n . [ label \"server\" . host ]\n\t\t . (sep . [label \"port\" . port]\n . (sep . [label \"proto\" . proto]) ? ) ?\n . comment_or_eol\n\t\t ]\n\nlet http_proxy =\n let auth_method_re = \/(none|basic|ntlm)\/ in\n let auth_method = store auth_method_re in\n [ key \"http-proxy\"\n . sep . [ label \"server\" . host ]\n . sep . [ label \"port\" . port ]\n . (sep . [ label \"auth\" . filename_safe ]\n . (sep . [ label \"auth-method\" . auth_method ]) ? )?\n . comment_or_eol\n ]\n\nlet http_proxy_option = [ key \"http-proxy-option\"\n . sep . [ label \"option\" . store \/(VERSION|AGENT)\/ ]\n . sep . [ label \"value\" . filename ]\n . comment_or_eol\n ]\n\nlet socks_proxy = [ key \"socks-proxy\"\n . sep . [ label \"server\" . host ]\n . (sep . [ label \"port\" . port ]\n . (sep . [ label \"auth\" . filename_safe ])? )?\n . comment_or_eol\n ]\n\nlet port_share = [ key \"port-share\"\n . sep . [ label \"host\" . host ]\n . sep . [ label \"port\" . port ]\n . (sep . [ label \"dir\" . filename ])?\n . comment_or_eol\n ]\n\nlet route_delay = [ key \"route-delay\"\n . (sep . [ label \"seconds\" . num ]\n . (sep . [ label \"win-seconds\" . num ] ) ?\n )?\n . comment_or_eol\n ]\n\nlet inetd = [ key \"inetd\"\n . (sep . [label \"mode\" . store \/(wait|nowait)\/ ]\n . (sep . [ label \"progname\" . filename ] ) ?\n )?\n . comment_or_eol\n ]\n\nlet inactive = [ key \"inactive\"\n . sep . [ label \"seconds\" . num ]\n . (sep . [ label \"bytes\" . num ] ) ?\n . comment_or_eol\n ]\n\nlet client_nat = [ key \"client-nat\"\n . sep . [ label \"type\" . store \/(snat|dnat)\/ ]\n . sep . [ label \"network\" . ip ]\n . sep . [ label \"netmask\" . ip ]\n . sep . [ label \"alias\" . ip ]\n . comment_or_eol\n ]\n\nlet status = [ key \"status\"\n . sep . [ label \"file\" . filename_safe ]\n . (sep . [ label \"repeat-seconds\" . num ]) ?\n . comment_or_eol\n ]\n\nlet plugin = [ key \"plugin\"\n . sep . [ label \"file\" . filename_safe ]\n . (sep . [ label \"init-string\" . filename ]) ?\n . comment_or_eol\n ]\n\nlet management = [ key \"management\" . sep\n . [ label \"server\" . ip ]\n . sep . [ label \"port\" . port ]\n . (sep . [ label \"pwfile\" . filename ] ) ?\n . comment_or_eol\n ]\n\nlet auth_user_pass_verify = [ key \"auth-user-pass-verify\"\n . sep . [ Quote.quote_spaces (label \"command\") ]\n . sep . [ label \"method\" . store \/via-(env|file)\/ ]\n . comment_or_eol\n ]\n\nlet static_challenge = [ key \"static-challenge\"\n . sep . [ Quote.quote_spaces (label \"text\") ]\n . sep . [ label \"echo\" . store \/[01]\/ ]\n . comment_or_eol\n ]\n\nlet cryptoapicert = [ key \"cryptoapicert\" . sep . Quote.dquote\n . [ key \/[A-Z]+\/ . Sep.colon . store \/[A-Za-z _-]+\/ ]\n . Quote.dquote . comment_or_eol\n ]\n\nlet setenv =\n let envvar = \/[^#;\\\/ \\t\\n][A-Za-z0-9_-]+\/ in\n [ key (\"setenv\"|\"setenv-safe\")\n . sep . [ key envvar . sep . store fn_re ]\n . comment_or_eol\n ]\n\nlet redirect =\n let redirect_flag = \/(local|autolocal|def1|bypass-dhcp|bypass-dns|block-local)\/ in\n let redirect_key = \"redirect-gateway\" | \"redirect-private\" in\n [ key redirect_key\n . (sep . [ label \"flag\" . store redirect_flag ] ) +\n . comment_or_eol\n ]\n\nlet tls_cipher =\n let ciphername = \/[A-Za-z0-9!_-]+\/ in\n [ key \"tls-cipher\" . sep\n . [label \"cipher\" . store ciphername]\n . (Sep.colon . [label \"cipher\" . store ciphername])*\n . comment_or_eol\n ]\n\nlet remote_cert_ku =\n let usage = [label \"usage\" . store \/[A-Za-z0-9]{1,2}\/] in\n [ key \"remote-cert-ku\" . sep . usage . (sep . usage)* . comment_or_eol ]\n\n(* FIXME: Surely there's a nicer way to do this *)\nlet remote_cert_eku =\n let oid = [label \"oid\" . store \/[0-9]+\\.([0-9]+\\.)*[0-9]+\/] in\n let symbolic = [Quote.do_quote_opt\n (label \"symbol\" . store \/[A-Za-z0-9][A-Za-z0-9 _-]*[A-Za-z0-9]\/)] in\n [ key \"remote-cert-eku\" . sep . (oid|symbolic) . comment_or_eol ]\n\nlet status_version = [ key \"status-version\"\n . (sep . num) ?\n . comment_or_eol\n ]\n\nlet ifconfig_pool = [ key \"ifconfig-pool\"\n . sep . [ label \"start\" . ip ]\n . sep . [ label \"end\" . ip ]\n . (sep . [ label \"netmask\" . ip ])?\n . comment_or_eol\n ]\n\nlet ifconfig_push = [ key \"ifconfig-push\"\n . sep . [ label \"local\" . ip ]\n . sep . [ label \"remote-netmask\" . ip ]\n . (sep . [ label \"alias\" . store \/[A-Za-z0-9_-]+\/ ] )?\n . comment_or_eol\n ]\n\nlet ignore_unknown_option = [ key \"ignore-unknown-option\"\n . (sep . [ label \"opt\" . store \/[A-Za-z0-9_-]+\/ ] ) +\n . comment_or_eol\n ]\n\nlet tls_version_min = [ key \"tls-version-min\"\n . sep . store Rx.decimal\n . (sep . [ key \"or-highest\" ]) ?\n . comment_or_eol\n ]\n\nlet crl_verify = [ key \"crl-verify\"\n . sep . filename_safe\n . (sep . [ key \"dir\" ]) ?\n . comment_or_eol\n ]\n\nlet x509_username_field =\n let fieldname = \/[A-Za-z0-9_-]+\/ in\n let extfield = ([key \/ext\/ . Sep.colon . store fieldname]) in\n let subjfield = ([label \"subj\" . store fieldname]) in\n [ key \"x509-username-field\"\n . sep . (extfield|subjfield)\n . comment_or_eol\n ]\n\nlet other = server\n | server_bridge\n | route\n | push\n | tls_auth\n | remote\n | http_proxy\n | http_proxy_option\n | socks_proxy\n | management\n | route_delay\n | client_nat\n | redirect\n | inactive\n | setenv\n | inetd\n | status\n | status_version\n | plugin\n | ifconfig_pool\n | ifconfig_push\n | ignore_unknown_option\n | auth_user_pass_verify\n | port_share\n | static_challenge\n | tls_version_min\n | tls_cipher\n | cryptoapicert\n | x509_username_field\n | remote_cert_ku\n | remote_cert_eku\n | crl_verify\n | route_ipv6\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = ( comment | empty | single | single_opt | double | flag | other )*\n\nlet filter = (incl \"\/etc\/openvpn\/client.conf\")\n . (incl \"\/etc\/openvpn\/server.conf\")\n\nlet xfm = transform lns filter\n\n\n\n","old_contents":"(* OpenVPN module for Augeas\n Author: Raphael Pinson <raphink@gmail.com>\n Author: Justin Akers <dafugg@gmail.com>\n\n Reference: http:\/\/openvpn.net\/index.php\/documentation\/howto.html\n Reference: https:\/\/community.openvpn.net\/openvpn\/wiki\/Openvpn23ManPage\n\n TODO: Inline file support\n*)\n\n\nmodule OpenVPN =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet indent = Util.indent\n\n(* Define separators *)\nlet sep = Util.del_ws_spc\n\n(* Define value regexps *)\nlet ip_re = Rx.ip\nlet num_re = Rx.integer\nlet fn_re = \/[^#; \\t\\n][^#;\\n]*[^#; \\t\\n]|[^#; \\t\\n]\/\nlet fn_safe_re = \/[^#; \\t\\r\\n]+\/\nlet an_re = \/[a-z][a-z0-9_-]*\/\nlet hn_re = Rx.hostname\nlet port_re = \/[0-9]+\/\nlet host_re = ip_re|hn_re\nlet proto_re = \/(tcp|udp)\/\nlet proto_ext_re = \/(udp|tcp-client|tcp-server)\/\nlet alg_re = \/(none|[A-Za-z][A-Za-z0-9-]+)\/\nlet ipv6_bits_re = Rx.ipv6 . \/\\\/[0-9]+\/\n\n(* Define store aliases *)\nlet ip = store ip_re\nlet num = store num_re\nlet filename = store fn_re\nlet filename_safe = store fn_safe_re\nlet hostname = store hn_re\nlet sto_to_dquote = store \/[^\"\\n]+\/ (* \" Emacs, relax *)\nlet port = store port_re\nlet host = store host_re\nlet proto = store proto_re\nlet proto_ext = store proto_ext_re\n\n(* define comments and empty lines *)\nlet comment = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \"# \"\nlet comment_or_eol = eol | Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \" # \"\n\nlet empty = Util.empty\n\n\n(************************************************************************\n * SINGLE VALUES\n *\n * - local => IP|hostname\n * - port => num\n * - proto => udp|tcp-client|tcp-server\n * - proto-force => udp|tcp\n * - mode => p2p|server\n * - dev => (tun|tap)\\d*\n * - dev-node => filename\n * - ca => filename\n * - config => filename\n * - cert => filename\n * - key => filename\n * - dh => filename\n * - ifconfig-pool-persist => filename\n * - learn-address => filename\n * - cipher => [A-Z0-9-]+\n * - max-clients => num\n * - user => alphanum\n * - group => alphanum\n * - status => filename\n * - log => filename\n * - log-append => filename\n * - client-config-dir => filename\n * - verb => num\n * - mute => num\n * - fragment => num\n * - mssfix => num\n * - connect-retry num\n * - connect-retry-max num\n * - connect-timeout num\n * - http-proxy-timeout num\n * - max-routes num\n * - ns-cert-type => \"server\"\n * - resolv-retry => \"infinite\"\n * - script-security => [0-3] (execve|system)?\n * - ipchange => command\n * - topology => type\n *************************************************************************)\n\nlet single_host = \"local\" | \"tls-remote\"\nlet single_ip = \"lladdr\"\nlet single_ipv6_bits = \"iroute-ipv6\"\n | \"server-ipv6\"\n | \"ifconfig-ipv6-pool\"\nlet single_num = \"port\"\n | \"max-clients\"\n | \"verb\"\n | \"mute\"\n | \"fragment\"\n | \"mssfix\"\n | \"connect-retry\"\n | \"connect-retry-max\"\n | \"connect-timeout\"\n | \"http-proxy-timeout\"\n | \"resolv-retry\"\n | \"lport\"\n | \"rport\"\n | \"max-routes\"\n | \"max-routes-per-client\"\n | \"route-metric\"\n | \"tun-mtu\"\n | \"tun-mtu-extra\"\n | \"shaper\"\n | \"ping\"\n | \"ping-exit\"\n | \"ping-restart\"\n | \"sndbuf\"\n | \"rcvbuf\"\n | \"txqueuelen\"\n | \"link-mtu\"\n | \"nice\"\n | \"management-log-cache\"\n | \"bcast-buffers\"\n | \"tcp-queue-limit\"\n | \"server-poll-timeout\"\n | \"keysize\"\n | \"pkcs11-pin-cache\"\n | \"tls-timeout\"\n | \"reneg-bytes\"\n | \"reneg-pkts\"\n | \"reneg-sec\"\n | \"hand-window\"\n | \"tran-window\"\nlet single_fn = \"ca\"\n | \"cert\"\n | \"extra-certs\"\n | \"config\"\n | \"key\"\n | \"dh\"\n | \"log\"\n | \"log-append\"\n | \"client-config-dir\"\n | \"dev-node\"\n | \"cd\"\n | \"chroot\"\n | \"writepid\"\n | \"client-config-dir\"\n | \"tmp-dir\"\n | \"replay-persist\"\n | \"ca\"\n | \"capath\"\n | \"pkcs12\"\n | \"pkcs11-id\"\n | \"askpass\"\n | \"tls-export-cert\"\n | \"x509-track\"\nlet single_an = \"user\"\n | \"group\"\n | \"management-client-user\"\n | \"management-client-group\"\nlet single_cmd = \"ipchange\"\n | \"iproute\"\n | \"route-up\"\n | \"route-pre-down\"\n | \"mark\"\n | \"up\"\n | \"down\"\n | \"setcon\"\n | \"echo\"\n | \"client-connect\"\n | \"client-disconnect\"\n | \"learn-address\"\n | \"tls-verify\"\n\nlet single_entry (kw:regexp) (re:regexp)\n = [ key kw . sep . store re . comment_or_eol ]\n\nlet single_opt_entry (kw:regexp) (re:regexp)\n = [ key kw . (sep . store re)? .comment_or_eol ]\n\nlet single = single_entry single_num num_re\n \t | single_entry single_fn fn_re\n\t | single_entry single_an an_re\n\t | single_entry single_host host_re\n\t | single_entry single_ip ip_re\n | single_entry single_ipv6_bits ipv6_bits_re\n | single_entry single_cmd fn_re\n\t | single_entry \"proto\" proto_ext_re\n\t | single_entry \"proto-force\" proto_re\n\t | single_entry \"mode\" \/(p2p|server)\/\n | single_entry \"dev\" \/(tun|tap)[0-9]*|null\/\n\t | single_entry \"dev-type\" \/(tun|tap)\/\n\t | single_entry \"topology\" \/(net30|p2p|subnet)\/\n\t | single_entry \"cipher\" alg_re\n\t | single_entry \"auth\" alg_re\n\t | single_entry \"resolv-retry\" \"infinite\"\n\t | single_entry \"script-security\" \/[0-3]( execve| system)?\/\n\t | single_entry \"route-gateway\" (host_re|\/dhcp\/)\n\t | single_entry \"mtu-disc\" \/(no|maybe|yes)\/\n\t | single_entry \"remap-usr1\" \/SIG(HUP|TERM)\/\n\t | single_entry \"socket-flags\" \/(TCP_NODELAY)\/\n | single_entry \"auth-retry\" \/(none|nointeract|interact)\/\n | single_entry \"tls-version-max\" Rx.decimal\n | single_entry \"verify-hash\" \/([A-Za-z0-9]{2}:)+[A-Za-z0-9]{2}\/\n | single_entry \"pkcs11-cert-private\" \/[01]\/\n | single_entry \"pkcs11-protected-authentication\" \/[01]\/\n | single_entry \"pkcs11-private-mode\" \/[A-Za-z0-9]+\/\n | single_entry \"key-method\" \/[12]\/\n | single_entry \"ns-cert-type\" \/(client|server)\/\n | single_entry \"remote-cert-tls\" \/(client|server)\/\n\nlet single_opt = single_opt_entry \"comp-lzo\" \/(yes|no|adaptive)\/\n | single_opt_entry \"syslog\" fn_re\n | single_opt_entry \"daemon\" fn_re\n | single_opt_entry \"auth-user-pass\" fn_re\n | single_opt_entry \"explicit-exit-notify\" num_re\n | single_opt_entry \"engine\" fn_re\n\n(************************************************************************\n * DOUBLE VALUES\n *************************************************************************)\n\nlet double_entry (kw:regexp) (a:string) (aval:regexp) (b:string) (bval:regexp)\n = [ key kw\n . sep . [ label a . store aval ]\n . sep . [ label b . store bval ]\n . comment_or_eol\n ]\n\nlet double_secopt_entry (kw:regexp) (a:string) (aval:regexp) (b:string) (bval:regexp)\n = [ key kw\n . sep . [ label a . store aval ]\n . (sep . [ label b . store bval ])?\n . comment_or_eol\n ]\n\n\nlet double = double_entry \"keepalive\" \"ping\" num_re \"timeout\" num_re\n | double_entry \"hash-size\" \"real\" num_re \"virtual\" num_re\n | double_entry \"ifconfig\" \"local\" ip_re \"remote\" ip_re\n | double_entry \"connect-freq\" \"num\" num_re \"sec\" num_re\n | double_entry \"verify-x509-name\" \"name\" hn_re \"type\"\n \/(subject|name|name-prefix)\/\n | double_entry \"ifconfig-ipv6\" \"address\" ipv6_bits_re \"remote\" Rx.ipv6\n | double_entry \"ifconfig-ipv6-push\" \"address\" ipv6_bits_re \"remote\" Rx.ipv6\n | double_secopt_entry \"iroute\" \"local\" ip_re \"netmask\" ip_re\n | double_secopt_entry \"stale-routes-check\" \"age\" num_re \"interval\" num_re\n | double_secopt_entry \"ifconfig-pool-persist\"\n \"file\" fn_safe_re \"seconds\" num_re\n | double_secopt_entry \"secret\" \"file\" fn_safe_re \"direction\" \/[01]\/\n | double_secopt_entry \"prng\" \"algorithm\" alg_re \"nsl\" num_re\n | double_secopt_entry \"replay-window\" \"window-size\" num_re \"seconds\" num_re\n\n\n(************************************************************************\n * FLAGS\n *************************************************************************)\n\nlet flag_words = \"client-to-client\"\n | \"duplicate-cn\"\n\t | \"persist-key\"\n\t | \"persist-tun\"\n\t | \"client\"\n\t | \"remote-random\"\n\t | \"nobind\"\n\t | \"mute-replay-warnings\"\n\t | \"http-proxy-retry\"\n\t | \"socks-proxy-retry\"\n | \"remote-random-hostname\"\n | \"show-proxy-settings\"\n | \"float\"\n | \"bind\"\n | \"nobind\"\n | \"tun-ipv6\"\n | \"ifconfig-noexec\"\n | \"ifconfig-nowarn\"\n | \"route-noexec\"\n | \"route-nopull\"\n | \"allow-pull-fqdn\"\n | \"mtu-test\"\n | \"ping-timer-rem\"\n | \"persist-tun\"\n | \"persist-local-ip\"\n | \"persist-remote-ip\"\n | \"mlock\"\n | \"up-delay\"\n | \"down-pre\"\n | \"up-restart\"\n | \"disable-occ\"\n | \"errors-to-stderr\"\n | \"passtos\"\n | \"suppress-timestamps\"\n | \"fast-io\"\n | \"multihome\"\n | \"comp-noadapt\"\n | \"management-client\"\n | \"management-query-passwords\"\n | \"management-query-proxy\"\n | \"management-query-remote\"\n | \"management-forget-disconnect\"\n | \"management-hold\"\n | \"management-signal\"\n | \"management-up-down\"\n | \"management-client-auth\"\n | \"management-client-pf\"\n | \"push-reset\"\n | \"push-peer-info\"\n | \"disable\"\n | \"ifconfig-pool-linear\"\n | \"client-to-client\"\n | \"duplicate-cn\"\n | \"ccd-exclusive\"\n | \"tcp-nodelay\"\n | \"opt-verify\"\n | \"auth-user-pass-optional\"\n | \"client-cert-not-required\"\n | \"username-as-common-name\"\n | \"pull\"\n | \"key-direction\"\n | \"no-replay\"\n | \"mute-replay-warnings\"\n | \"no-iv\"\n | \"use-prediction-resistance\"\n | \"test-crypto\"\n | \"tls-server\"\n | \"tls-client\"\n | \"pkcs11-id-management\"\n | \"single-session\"\n | \"tls-exit\"\n | \"auth-nocache\"\n | \"show-ciphers\"\n | \"show-digests\"\n | \"show-tls\"\n | \"show-engines\"\n | \"genkey\"\n | \"mktun\"\n | \"rmtun\"\n\n\nlet flag_entry (kw:regexp)\n = [ key kw . comment_or_eol ]\n\nlet flag = flag_entry flag_words\n\n\n(************************************************************************\n * OTHER FIELDS\n *\n * - server => IP IP [nopool]\n * - server-bridge => IP IP IP IP\n * - route\t => host host [host [num]]\n * - push => \"string\"\n * - tls-auth => filename [01]\n * - remote => hostname\/IP [num] [(tcp|udp)]\n * - management => IP num filename\n * - http-proxy => host port [filename|keyword] [method]\n * - http-proxy-option => (VERSION decimal|AGENT string)\n * ...\n * and many others\n *\n *************************************************************************)\n\nlet server = [ key \"server\"\n . sep . [ label \"address\" . ip ]\n . sep . [ label \"netmask\" . ip ]\n . (sep . [ key \"nopool\" ]) ?\n . comment_or_eol\n ]\n\nlet server_bridge =\n let ip_params = [ label \"address\" . ip ] . sep\n . [ label \"netmask\" . ip ] . sep\n . [ label \"start\" . ip ] . sep\n . [ label \"end\" . ip ] in\n [ key \"server-bridge\"\n . sep . (ip_params|store \/(nogw)\/)\n . comment_or_eol\n ]\n\nlet route =\n let route_net_kw = store (\/(vpn_gateway|net_gateway|remote_host)\/|host_re) in\n [ key \"route\" . sep\n . [ label \"address\" . route_net_kw ]\n . (sep . [ label \"netmask\" . store (ip_re|\/default\/) ]\n . (sep . [ label \"gateway\" . route_net_kw ]\n . (sep . [ label \"metric\" . store (\/default\/|num_re)] )?\n )?\n )?\n . comment_or_eol\n ]\n\nlet route_ipv6 =\n let route_net_re = \/(vpn_gateway|net_gateway|remote_host)\/ in\n [ key \"route-ipv6\" . sep\n . [ label \"network\" . store (route_net_re|ipv6_bits_re) ]\n . (sep . [ label \"gateway\" . store (route_net_re|Rx.ipv6) ]\n . (sep . [ label \"metric\" . store (\/default\/|num_re)] )?\n )?\n . comment_or_eol\n ]\n\nlet push = [ key \"push\" . sep\n . Quote.do_dquote sto_to_dquote\n\t\t . comment_or_eol\n ]\n\nlet tls_auth = [ key \"tls-auth\" . sep\n . [ label \"key\" . filename ] . sep\n\t\t . [ label \"is_client\" . store \/[01]\/ ] . comment_or_eol\n ]\n\nlet remote = [ key \"remote\" . sep\n . [ label \"server\" . host ]\n\t\t . (sep . [label \"port\" . port]\n . (sep . [label \"proto\" . proto]) ? ) ?\n . comment_or_eol\n\t\t ]\n\nlet http_proxy =\n let auth_method_re = \/(none|basic|ntlm)\/ in\n let auth_method = store auth_method_re in\n [ key \"http-proxy\"\n . sep . [ label \"server\" . host ]\n . sep . [ label \"port\" . port ]\n . (sep . [ label \"auth\" . filename_safe ]\n . (sep . [ label \"auth-method\" . auth_method ]) ? )?\n . comment_or_eol\n ]\n\nlet http_proxy_option = [ key \"http-proxy-option\"\n . sep . [ label \"option\" . store \/(VERSION|AGENT)\/ ]\n . sep . [ label \"value\" . filename ]\n . comment_or_eol\n ]\n\nlet socks_proxy = [ key \"socks-proxy\"\n . sep . [ label \"server\" . host ]\n . (sep . [ label \"port\" . port ]\n . (sep . [ label \"auth\" . filename_safe ])? )?\n . comment_or_eol\n ]\n\nlet port_share = [ key \"port-share\"\n . sep . [ label \"host\" . host ]\n . sep . [ label \"port\" . port ]\n . (sep . [ label \"dir\" . filename ])?\n . comment_or_eol\n ]\n\nlet route_delay = [ key \"route-delay\"\n . (sep . [ label \"seconds\" . num ]\n . (sep . [ label \"win-seconds\" . num ] ) ?\n )?\n . comment_or_eol\n ]\n\nlet inetd = [ key \"inetd\"\n . (sep . [label \"mode\" . store \/(wait|nowait)\/ ]\n . (sep . [ label \"progname\" . filename ] ) ?\n )?\n . comment_or_eol\n ]\n\nlet inactive = [ key \"inactive\"\n . sep . [ label \"seconds\" . num ]\n . (sep . [ label \"bytes\" . num ] ) ?\n . comment_or_eol\n ]\n\nlet client_nat = [ key \"client-nat\"\n . sep . [ label \"type\" . store \/(snat|dnat)\/ ]\n . sep . [ label \"network\" . ip ]\n . sep . [ label \"netmask\" . ip ]\n . sep . [ label \"alias\" . ip ]\n . comment_or_eol\n ]\n\nlet status = [ key \"status\"\n . sep . [ label \"file\" . filename_safe ]\n . (sep . [ label \"repeat-seconds\" . num ]) ?\n . comment_or_eol\n ]\n\nlet plugin = [ key \"plugin\"\n . sep . [ label \"file\" . filename_safe ]\n . (sep . [ label \"init-string\" . filename ]) ?\n . comment_or_eol\n ]\n\nlet management = [ key \"management\" . sep\n . [ label \"server\" . ip ]\n . sep . [ label \"port\" . port ]\n . (sep . [ label \"pwfile\" . filename ] ) ?\n . comment_or_eol\n ]\n\nlet auth_user_pass_verify = [ key \"auth-user-pass-verify\"\n . sep . [ Quote.quote_spaces (label \"command\") ]\n . sep . [ label \"method\" . store \/via-(env|file)\/ ]\n . comment_or_eol\n ]\n\nlet static_challenge = [ key \"static-challenge\"\n . sep . [ Quote.quote_spaces (label \"text\") ]\n . sep . [ label \"echo\" . store \/[01]\/ ]\n . comment_or_eol\n ]\n\nlet cryptoapicert = [ key \"cryptoapicert\" . sep . Quote.dquote\n . [ key \/[A-Z]+\/ . Sep.colon . store \/[A-Za-z _-]+\/ ]\n . Quote.dquote . comment_or_eol\n ]\n\nlet setenv =\n let envvar = \/[^#;\\\/ \\t\\n][A-Za-z0-9_-]+\/ in\n [ key (\"setenv\"|\"setenv-safe\")\n . sep . [ key envvar . sep . store fn_re ]\n . comment_or_eol\n ]\n\nlet redirect =\n let redirect_flag = \/(local|autolocal|def1|bypass-dhcp|bypass-dns|block-local)\/ in\n let redirect_key = \"redirect-gateway\" | \"redirect-private\" in\n [ key redirect_key\n . (sep . [ label \"flag\" . store redirect_flag ] ) +\n . comment_or_eol\n ]\n\nlet tls_cipher =\n let ciphername = \/[A-Za-z0-9!_-]+\/ in\n [ key \"tls-cipher\" . sep\n . [label \"cipher\" . store ciphername]\n . (Sep.colon . [label \"cipher\" . store ciphername])*\n . comment_or_eol\n ]\n\nlet remote_cert_ku =\n let usage = [label \"usage\" . store \/[A-Za-z0-9]{1,2}\/] in\n [ key \"remote-cert-ku\" . sep . usage . (sep . usage)* . comment_or_eol ]\n\n(* FIXME: Surely there's a nicer way to do this *)\nlet remote_cert_eku =\n let oid = [label \"oid\" . store \/[0-9]+\\.([0-9]+\\.)*[0-9]+\/] in\n let symbolic = [Quote.do_quote_opt\n (label \"symbol\" . store \/[A-Za-z0-9][A-Za-z0-9 _-]*[A-Za-z0-9]\/)] in\n [ key \"remote-cert-eku\" . sep . (oid|symbolic) . comment_or_eol ]\n\nlet status_version = [ key \"status-version\"\n . (sep . num) ?\n . comment_or_eol\n ]\n\nlet ifconfig_pool = [ key \"ifconfig-pool\"\n . sep . [ label \"start\" . ip ]\n . sep . [ label \"end\" . ip ]\n . (sep . [ label \"netmask\" . ip ])?\n . comment_or_eol\n ]\n\nlet ifconfig_push = [ key \"ifconfig-push\"\n . sep . [ label \"local\" . ip ]\n . sep . [ label \"remote-netmask\" . ip ]\n . (sep . [ label \"alias\" . store \/[A-Za-z0-9_-]+\/ ] )?\n . comment_or_eol\n ]\n\nlet ignore_unknown_option = [ key \"ignore-unknown-option\"\n . (sep . [ label \"opt\" . store \/[A-Za-z0-9_-]+\/ ] ) +\n . comment_or_eol\n ]\n\nlet tls_version_min = [ key \"tls-version-min\"\n . sep . store Rx.decimal\n . (sep . [ key \"or-highest\" ]) ?\n . comment_or_eol\n ]\n\nlet crl_verify = [ key \"crl-verify\"\n . sep . filename_safe\n . (sep . [ key \"dir\" ]) ?\n . comment_or_eol\n ]\n\nlet x509_username_field =\n let fieldname = \/[A-Za-z0-9_-]+\/ in\n let extfield = ([key \/ext\/ . Sep.colon . store fieldname]) in\n let subjfield = ([label \"subj\" . store fieldname]) in\n [ key \"x509-username-field\"\n . sep . (extfield|subjfield)\n . comment_or_eol\n ]\n\nlet other = server\n | server_bridge\n | route\n | push\n | tls_auth\n | remote\n | http_proxy\n | http_proxy_option\n | socks_proxy\n | management\n | route_delay\n | client_nat\n | redirect\n | inactive\n | setenv\n | inetd\n | status\n | status_version\n | plugin\n | ifconfig_pool\n | ifconfig_push\n | ignore_unknown_option\n | auth_user_pass_verify\n | port_share\n | static_challenge\n | tls_version_min\n | tls_cipher\n | cryptoapicert\n | x509_username_field\n | remote_cert_ku\n | remote_cert_eku\n | crl_verify\n | route_ipv6\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = ( comment | empty | single | single_opt | double | flag | other )*\n\nlet filter = (incl \"\/etc\/openvpn\/client.conf\")\n . (incl \"\/etc\/openvpn\/server.conf\")\n\nlet xfm = transform lns filter\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2afa3289cb57187f704d7c42480fcdfbd0c303da","subject":"Adapt comments for NaturalDocs parsing","message":"Adapt comments for NaturalDocs parsing\n","repos":"mlichvar\/augeas,camptocamp\/augeas,domcleal\/augeas,camptocamp\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,lutter\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,kumy\/augeas,mchf\/augeas,ptoscano\/augeas,bkearney\/augeas,MikaelSmith\/augeas,kumy\/augeas,bkearney\/augeas,jjlin\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,domcleal\/augeas,ptoscano\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,dafugg\/augeas,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,jjlin\/augeas,mchf\/augeas,mlichvar\/augeas,jjlin\/augeas,camptocamp\/augeas,lutter\/augeas,camptocamp\/augeas,dafugg\/augeas,bkearney\/augeas,jasperla\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,hercules-team\/augeas,jasperla\/augeas,bkearney\/augeas,kunkku\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,raphink\/augeas","old_file":"lenses\/xinetd.aug","new_file":"lenses\/xinetd.aug","new_contents":"(*\n * Module: Xinetd\n * Parses xinetd configuration files\n *\n * The structure of the lens and allowed attributes are ripped directly\n * from xinetd's parser in xinetd\/parse.c in xinetd's source checkout \n * The downside of being so precise here is that if attributes are added\n * they need to be added here, too. Writing a catchall entry, and getting\n * to typecheck correctly would be a huge pain. \n *\n * A really enterprising soul could tighten this down even further by \n * restricting the acceptable values for each attribute. \n * \n * Author: David Lutterkort\n *)\n\nmodule Xinetd =\n autoload xfm\n\n let comment = [ del \/[ \\t]*(#.*|[ \\t]*)\\n\/ \"#\\n\" ]\n\n let name = key \/[^ \\t\\n\\\/+-=]+\/\n let opt_spc = del \/[ \\t]*\/ \"\"\n let spc = del \/[ \\t]+\/ \" \"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let eq = opt_spc . Util.del_str \"=\"\n\n let op = opt_spc . ([ label \"add\" . Util.del_str \"+=\" ]\n |[ label \"del\" . Util.del_str \"-=\" ]\n |Util.del_str \"=\")\n\n let value = store \/[^ \\t\\n]+\/\n\n let attr_one (n:regexp) =\n [ opt_spc . key n . eq . spc . value . eol ]\n\n let attr_lst (n:regexp) (op_eq: lens) =\n [ opt_spc . key n . op_eq . [label \"value\" . spc . value]* . eol ]\n\n let attr_lst_eq (n:regexp) = attr_lst n eq\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Variable: service_attr\n * Note: \n * It is much faster to combine, for example, all the attr_one \n * attributes into one regexp and pass that to a lens instead of \n * using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter \n * causes the type checker to work _very_ hard. \n *)\n\n let service_attr =\n attr_one (\"socket_type\" | \"protocol\" | \"wait\" | \"user\" | \"group\"\n |\"server\" | \"instances\" | \"rpc_version\" | \"rpc_number\"\n | \"id\" | \"port\" | \"nice\" | \"banner\" | \"bind\" | \"interface\"\n | \"per_source\" | \"groups\" | \"banner_success\" | \"banner_fail\"\n | \"disable\" | \"max_load\" | \"rlimit_as\" | \"rlimit_cpu\"\n | \"rlimit_data\" | \"rlimit_rss\" | \"rlimit_stack\" | \"v6only\"\n | \"deny_time\" | \"umask\" | \"mdns\" | \"libwrap\")\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\"server_args\" | \"log_type\" | \"access_times\" | \"type\"\n | \"flags\" | \"redirect\" | \"cps\")\n |attr_lst_op ( \"log_on_success\" | \"log_on_failure\"| \"only_from\"\n | \"no_access\" | \"env\" | \"passenv\")\n\n let default_attr =\n attr_one ( \"instances\" | \"banner\" | \"bind\" | \"interface\" | \"per_source\"\n | \"groups\" | \"banner_success\" | \"banner_fail\" | \"max_load\"\n | \"v6only\" | \"umask\" | \"mdns\")\n |attr_lst_eq \"cps\" (* really only two values, not a whole list *)\n |attr_lst_op ( \"log_type\" | \"log_on_success\" | \"log_on_failure\" | \"disabled\"\n | \"no_access\" | \"only_from\" | \"passenv\" | \"enabled\" )\n\n (* View: body\n * Note: \n * We would really like to say \"the body can contain any of a list \n * of a list of attributes, each of them at most once\"; but that \n * would require that we build a lens that matches the permutation \n * of all attributes; with around 40 individual attributes, that's \n * not computationally feasible, even if we didn't have to worry \n * about how to write that down. The resulting regular expressions \n * would simply be prohibitively large. \n *)\n let body (attr:lens) = Util.del_str \"\\n{\\n\"\n . (comment|attr)*\n . del \/[ \\t]*}[ \\t]*\\n\/ \"}\\n\"\n\n (* View: includes\n * Note:\n * It would be nice if we could use the directories given in include and\n * includedir directives to parse additional files instead of hardcoding \n * all the places where xinetd config files can be found; but that is \n * currently not possible, and implementing that has a good amount of \n * hairy corner cases to consider. \n *)\n let includes = [ key \/include|includedir\/\n . Util.del_ws_spc . store \/[^ \\t\\n]+\/ . eol ]\n\n let service = \n let key_re = \/[^ \\t\\n\\\/]+\/ - \/include|includedir|defaults\/ in\n [ del \/service[ \\t]+\/ \"service \" . key key_re . body service_attr ]\n\n let defaults = [ key \"defaults\" . del \/[ \\t]*\/ \"\" . body default_attr ]\n\n let lns = ( comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Process xinetd config files *)\n(* The structure of the lens and allowed attributes are ripped directly *)\n(* from xinetd's parser in xinetd\/parse.c in xinetd's source checkout *)\n(* The downside of being so precise here is that if attributes are added *)\n(* they need to be added here, too. Writing a catchall entry, and getting *)\n(* to typecheck correctly would be a huge pain. *)\n(* A really enterprising soul could tighten this down even further by *)\n(* restricting the acceptable values for each attribute. *)\nmodule Xinetd =\n autoload xfm\n\n let comment = [ del \/[ \\t]*(#.*|[ \\t]*)\\n\/ \"#\\n\" ]\n\n let name = key \/[^ \\t\\n\\\/+-=]+\/\n let opt_spc = del \/[ \\t]*\/ \"\"\n let spc = del \/[ \\t]+\/ \" \"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let eq = opt_spc . Util.del_str \"=\"\n\n let op = opt_spc . ([ label \"add\" . Util.del_str \"+=\" ]\n |[ label \"del\" . Util.del_str \"-=\" ]\n |Util.del_str \"=\")\n\n let value = store \/[^ \\t\\n]+\/\n\n let attr_one (n:regexp) =\n [ opt_spc . key n . eq . spc . value . eol ]\n\n let attr_lst (n:regexp) (op_eq: lens) =\n [ opt_spc . key n . op_eq . [label \"value\" . spc . value]* . eol ]\n\n let attr_lst_eq (n:regexp) = attr_lst n eq\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Note: it is much faster to combine, for example, all the attr_one *)\n (* attributes into one regexp and pass that to a lens instead of *)\n (* using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter *)\n (* causes the type checker to work _very_ hard. *)\n\n let service_attr =\n attr_one (\"socket_type\" | \"protocol\" | \"wait\" | \"user\" | \"group\"\n |\"server\" | \"instances\" | \"rpc_version\" | \"rpc_number\"\n | \"id\" | \"port\" | \"nice\" | \"banner\" | \"bind\" | \"interface\"\n | \"per_source\" | \"groups\" | \"banner_success\" | \"banner_fail\"\n | \"disable\" | \"max_load\" | \"rlimit_as\" | \"rlimit_cpu\"\n | \"rlimit_data\" | \"rlimit_rss\" | \"rlimit_stack\" | \"v6only\"\n | \"deny_time\" | \"umask\" | \"mdns\" | \"libwrap\")\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\"server_args\" | \"log_type\" | \"access_times\" | \"type\"\n | \"flags\" | \"redirect\" | \"cps\")\n |attr_lst_op ( \"log_on_success\" | \"log_on_failure\"| \"only_from\"\n | \"no_access\" | \"env\" | \"passenv\")\n\n let default_attr =\n attr_one ( \"instances\" | \"banner\" | \"bind\" | \"interface\" | \"per_source\"\n | \"groups\" | \"banner_success\" | \"banner_fail\" | \"max_load\"\n | \"v6only\" | \"umask\" | \"mdns\")\n |attr_lst_eq \"cps\" (* really only two values, not a whole list *)\n |attr_lst_op ( \"log_type\" | \"log_on_success\" | \"log_on_failure\" | \"disabled\"\n | \"no_access\" | \"only_from\" | \"passenv\" | \"enabled\" )\n\n (* Note: we would really like to say \"the body can contain any of a list *)\n (* of a list of attributes, each of them at most once\"; but that *)\n (* would require that we build a lens that matches the permutation *)\n (* of all attributes; with around 40 individual attributes, that's *)\n (* not computationally feasible, even if we didn't have to worry *)\n (* about how to write that down. The resulting regular expressions *)\n (* would simply be prohibitively large. *)\n let body (attr:lens) = Util.del_str \"\\n{\\n\"\n . (comment|attr)*\n . del \/[ \\t]*}[ \\t]*\\n\/ \"}\\n\"\n\n (* It would be nice if we could use the directories given in include and *)\n (* includedir directives to parse additional files instead of hardcoding *)\n (* all the places where xinetd config files can be found; but that is *)\n (* currently not possible, and implementing that has a good amount of *)\n (* hairy corner cases to consider. *)\n let includes = [ key \/include|includedir\/\n . Util.del_ws_spc . store \/[^ \\t\\n]+\/ . eol ]\n\n let service = \n let key_re = \/[^ \\t\\n\\\/]+\/ - \/include|includedir|defaults\/ in\n [ del \/service[ \\t]+\/ \"service \" . key key_re . body service_attr ]\n\n let defaults = [ key \"defaults\" . del \/[ \\t]*\/ \"\" . body default_attr ]\n\n let lns = ( comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e9de2de3cba7d2738f976dbc1be1a34cddb84f67","subject":"Json: parse verbatim escaped spaces and newlines in quotes","message":"Json: parse verbatim escaped spaces and newlines in quotes\n","repos":"pevalme\/augeas,kunkku\/augeas,mchf\/augeas,dafugg\/augeas,kunkku\/augeas,manandbytes\/augeas,mchf\/augeas,ptoscano\/augeas,lutter\/augeas,pevalme\/augeas,pevalme\/augeas,dafugg\/augeas,ptoscano\/augeas,mlichvar\/augeas,ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,lutter\/augeas,manandbytes\/augeas,lutter\/augeas,mlichvar\/augeas,hercules-team\/augeas","old_file":"lenses\/json.aug","new_file":"lenses\/json.aug","new_contents":"module Json =\n\n(* A generic lens for Json files *)\n(* Based on the following grammar from http:\/\/www.json.org\/ *)\n(* Object ::= '{'Members ? '}' *)\n(* Members ::= Pair+ *)\n(* Pair ::= String ':' Value *)\n(* Array ::= '[' Elements ']' *)\n(* Elements ::= Value ( \",\" Value )* *)\n(* Value ::= String | Number | Object | Array | \"true\" | \"false\" | \"null\" *)\n(* String ::= \"\\\"\" Char* \"\\\"\" *)\n(* Number ::= \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ *)\n\n\nlet ws = del \/[ \\t\\n]*\/ \"\"\nlet comment = Util.empty_c_style | Util.comment_c_style | Util.comment_multiline\nlet comments = comment* . Sep.opt_space\n\nlet comma = Util.del_str \",\" . comments\nlet colon = Util.del_str \":\" . comments\nlet lbrace = Util.del_str \"{\" . comments\nlet rbrace = Util.del_str \"}\"\nlet lbrack = Util.del_str \"[\" . comments\nlet rbrack = Util.del_str \"]\"\n\nlet str_store = Quote.dquote . store \/([^\\\\\\\\\"]|\\\\\\\\(\"|n|r|t|\\\\\\\\))*\/ . Quote.dquote (* \" Emacs, relax *)\n\nlet number = [ label \"number\" . store \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/\n . comments ]\nlet str = [ label \"string\" . str_store . comments ]\n\nlet const (r:regexp) = [ label \"const\" . store r . comments ]\n\nlet fix_value (value:lens) =\n let array = [ label \"array\" . lbrack\n . ( ( Build.opt_list value comma . rbrack . comments )\n | (rbrack . ws) ) ]\n in let pair = [ label \"entry\" . str_store . ws . colon . value ]\n in let obj = [ label \"dict\" . lbrace\n . ( ( Build.opt_list pair comma. rbrace . comments )\n | (rbrace . ws ) ) ]\n in (str | number | obj | array | const \/true|false|null\/)\n\n(* Process arbitrarily deeply nested JSON objects *)\nlet rec rlns = fix_value rlns\n\nlet lns = comments . rlns\n","old_contents":"module Json =\n\n(* A generic lens for Json files *)\n(* Based on the following grammar from http:\/\/www.json.org\/ *)\n(* Object ::= '{'Members ? '}' *)\n(* Members ::= Pair+ *)\n(* Pair ::= String ':' Value *)\n(* Array ::= '[' Elements ']' *)\n(* Elements ::= Value ( \",\" Value )* *)\n(* Value ::= String | Number | Object | Array | \"true\" | \"false\" | \"null\" *)\n(* String ::= \"\\\"\" Char* \"\\\"\" *)\n(* Number ::= \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ *)\n\n\nlet ws = del \/[ \\t\\n]*\/ \"\"\nlet comment = Util.empty_c_style | Util.comment_c_style | Util.comment_multiline\nlet comments = comment* . Sep.opt_space\n\nlet comma = Util.del_str \",\" . comments\nlet colon = Util.del_str \":\" . comments\nlet lbrace = Util.del_str \"{\" . comments\nlet rbrace = Util.del_str \"}\"\nlet lbrack = Util.del_str \"[\" . comments\nlet rbrack = Util.del_str \"]\"\n\nlet str_store = Quote.dquote . store \/([^\\\\\\\\\"]|\\\\\\\\(\"|\\\\\\\\))*\/ . Quote.dquote (* \" Emacs, relax *)\n\nlet number = [ label \"number\" . store \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/\n . comments ]\nlet str = [ label \"string\" . str_store . comments ]\n\nlet const (r:regexp) = [ label \"const\" . store r . comments ]\n\nlet fix_value (value:lens) =\n let array = [ label \"array\" . lbrack\n . ( ( Build.opt_list value comma . rbrack . comments )\n | (rbrack . ws) ) ]\n in let pair = [ label \"entry\" . str_store . ws . colon . value ]\n in let obj = [ label \"dict\" . lbrace\n . ( ( Build.opt_list pair comma. rbrace . comments )\n | (rbrace . ws ) ) ]\n in (str | number | obj | array | const \/true|false|null\/)\n\n(* Process arbitrarily deeply nested JSON objects *)\nlet rec rlns = fix_value rlns\n\nlet lns = comments . rlns\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9ab39258aea0913a307cca6bceef225625fa2f35","subject":"Interfaces: fix documentation typos","message":"Interfaces: fix documentation typos\n\n","repos":"pevalme\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,manandbytes\/augeas,ptoscano\/augeas,kunkku\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas,manandbytes\/augeas,mchf\/augeas,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas","old_file":"lenses\/interfaces.aug","new_file":"lenses\/interfaces.aug","new_contents":"(* Interfaces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man interfaces\n\n*)\n\nmodule Interfaces =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\n\n(* Define separators *)\n\n(* a line can be extended across multiple lines by making the last *)\n(* character a backslash *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Define fields *)\nlet sto_to_eol = store \/([^\\\\ \\t\\n].*[^\\\\ \\t\\n]|[^\\\\ \\t\\n])\/ . eol\nlet sto_to_spc = store \/[^\\\\ \\t\\n]+\/\n\n(* Define comments and empty lines *)\n\n(* note that the comment definition from Util does not support *)\n(* splitting lines with a backlash *)\nlet comment = Util.comment\n\nlet empty = Util.empty\n\n(* Define tree stanza_ids *)\nlet stanza_id (t:string) = key t . sep_spc . sto_to_spc\nlet stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ]\n\n(* Define reserved words and multi-value options *)\nlet stanza_word =\n \/(source(-directory)?|iface|auto|allow-[a-z-]+|mapping|bond-slaves|bridge-ports)\/\n\n(* Define stanza option indentation *)\nlet stanza_indent = del \/[ \\t]*\/ \" \"\n\n(* Define additional lines for multi-line stanzas *)\nlet stanza_option = [ stanza_indent\n . key ( \/[a-z0-9_-]+\/ - stanza_word )\n . sep_spc\n . sto_to_eol ]\n\n(* Define space-separated array *)\nlet array (r:regexp) (t:string) = del r t . label t . counter t\n . [ sep_spc . seq t . sto_to_spc ]+\n\n(************************************************************************\n * AUTO\n *************************************************************************)\n\nlet auto = [ array \/(allow-)?auto\/ \"auto\" . eol ]\n\n(************************************************************************\n * GENERIC ALLOW\n *************************************************************************)\n\nlet allow = [ key ( \/allow-[a-z-]+\/ - \"allow-auto\" )\n . counter \"allow_seq\"\n . [ sep_spc . seq \"allow_seq\" . sto_to_spc ]+\n . eol ]\n\n(************************************************************************\n * MAPPING\n *************************************************************************)\n\nlet mapping = [ stanza_id \"mapping\"\n . eol\n . (stanza_option|comment|empty)+ ]\n\n(************************************************************************\n * IFACE\n *************************************************************************)\n\nlet multi_option (t:string) = [ stanza_indent . array t t . eol ]\n\nlet iface = [ Util.indent\n . stanza_id \"iface\"\n . stanza_param \"family\"\n . stanza_param \"method\"\n . eol\n . ( stanza_option\n | multi_option \"bond-slaves\"\n | multi_option \"bridge-ports\"\n | comment\n | empty )* ]\n\n(************************************************************************\n * SOURCE\n *************************************************************************)\n\nlet source = [ key \"source\" . sep_spc . sto_to_eol ]\n\n(************************************************************************\n * SOURCE-DIRECTORY\n *************************************************************************)\n\nlet source_directory = [ key \"source-directory\" . sep_spc . sto_to_eol ]\n\n(************************************************************************\n * STANZAS\n *************************************************************************)\n\n(* The auto and hotplug stanzas always consist of one line only, while\n iface and mapping can spand along more lines. Comment nodes are\n inserted in the tree as direct children of the root node only when they\n come after an auto or hotplug stanza, otherwise they are considered part\n of an iface or mapping block *)\n\nlet stanza_single = (auto|allow|source|source_directory) . (comment|empty)*\nlet stanza_multi = iface|mapping\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\n let lns = (comment|empty)* . (stanza_multi | stanza_single)*\n\n let filter = (incl \"\/etc\/network\/interfaces\")\n . (incl \"\/etc\/network\/interfaces.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man interfaces\n\n*)\n\nmodule Interfaces =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\n\n(* Define separators *)\n\n(* a line can be extended across multiple lines by making the last *)\n(* character a backslash *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Define fields *)\nlet sto_to_eol = store \/([^\\\\ \\t\\n].*[^\\\\ \\t\\n]|[^\\\\ \\t\\n])\/ . eol\nlet sto_to_spc = store \/[^\\\\ \\t\\n]+\/\n\n(* Define comments and empty lines *)\n\n(* note that the comment definition from Util does not support *)\n(* splitting lines with a backlash *)\nlet comment = Util.comment\n\nlet empty = Util.empty\n\n(* Define tree stanza_ids *)\nlet stanza_id (t:string) = key t . sep_spc . sto_to_spc\nlet stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ]\n\n(* Define reseverved words and multi-value options*)\nlet stanza_word =\n \/(source(-directory)?|iface|auto|allow-[a-z-]+|mapping|bond-slaves|bridge-ports)\/\n\n(* Define stanza option indentation *)\nlet stanza_indent = del \/[ \\t]*\/ \" \"\n\n(* Define additional lines for multi-line stanzas *)\nlet stanza_option = [ stanza_indent\n . key ( \/[a-z0-9_-]+\/ - stanza_word )\n . sep_spc\n . sto_to_eol ]\n\n(* Define space-separated array *)\nlet array (r:regexp) (t:string) = del r t . label t . counter t\n . [ sep_spc . seq t . sto_to_spc ]+\n\n(************************************************************************\n * AUTO\n *************************************************************************)\n\nlet auto = [ array \/(allow-)?auto\/ \"auto\" . eol ]\n\n(************************************************************************\n * GENERIC ALLOW\n *************************************************************************)\n\nlet allow = [ key ( \/allow-[a-z-]+\/ - \"allow-auto\" )\n . counter \"allow_seq\"\n . [ sep_spc . seq \"allow_seq\" . sto_to_spc ]+\n . eol ]\n\n(************************************************************************\n * MAPPING\n *************************************************************************)\n\nlet mapping = [ stanza_id \"mapping\"\n . eol\n . (stanza_option|comment|empty)+ ]\n\n(************************************************************************\n * IFACE\n *************************************************************************)\n\nlet multi_option (t:string) = [ stanza_indent . array t t . eol ]\n\nlet iface = [ Util.indent\n . stanza_id \"iface\"\n . stanza_param \"family\"\n . stanza_param \"method\"\n . eol\n . ( stanza_option\n | multi_option \"bond-slaves\"\n | multi_option \"bridge-ports\"\n | comment\n | empty )* ]\n\n(************************************************************************\n * SOURCE\n *************************************************************************)\n\nlet source = [ key \"source\" . sep_spc . sto_to_eol ]\n\n(************************************************************************\n * SOURCE-DIRECTORY\n *************************************************************************)\n\nlet source_directory = [ key \"source-directory\" . sep_spc . sto_to_eol ]\n\n(************************************************************************\n * STANZAS\n *************************************************************************)\n\n(* The auto and hotplug stanzas always consist of one line only, while\n iface and mapping can spand along more lines. Comment nodes are\n inserted in the tree as direct children of the root node only when they\n come after an auto or hotplug stanza, otherwise they are considered part\n of a iface or mapping block *)\n\nlet stanza_single = (auto|allow|source|source_directory) . (comment|empty)*\nlet stanza_multi = iface|mapping\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\n let lns = (comment|empty)* . (stanza_multi | stanza_single)*\n\n let filter = (incl \"\/etc\/network\/interfaces\")\n . (incl \"\/etc\/network\/interfaces.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5aede84cbddeee48d2722c5e36b53f2b2b596cf4","subject":"Permit ! in block titles, which is permitted in modern versions of Dovecot m Please enter the commit message for your changes. Lines starting","message":"Permit ! in block titles, which is permitted in modern versions of Dovecot\nm Please enter the commit message for your changes. Lines starting\n","repos":"kunkku\/augeas,kunkku\/augeas,kunkku\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,hercules-team\/augeas,ptoscano\/augeas,mlichvar\/augeas,mlichvar\/augeas","old_file":"lenses\/dovecot.aug","new_file":"lenses\/dovecot.aug","new_contents":"(*\nModule: Dovecot\n Parses dovecot configuration files.\n\nAuthor: Serge Smetana <serge.smetana@gmail.com>\n Acunote http:\/\/www.acunote.com\n Pluron, Inc. http:\/\/pluron.com\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Configuration files\n This lens applies to \/etc\/dovecot\/dovecot.conf and files in\n \/etc\/dovecot\/conf.d\/. See <filter>.\n\nAbout: Examples\n The <Test_Dovecot> file contains various examples and tests.\n\nAbout: TODO\n Support for multiline values like queries in dict-sql.conf\n*)\n\nmodule Dovecot =\n\n autoload xfm\n\n(******************************************************************\n * Group: USEFUL PRIMITIVES\n ******************************************************************)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: empty\nMap empty lines. *)\nlet empty = Util.empty\n\n(* View: comment\nMap comments in \"#comment\" nodes. *)\nlet comment = Util.comment\n\n(* View: eq *)\nlet eq = del \/[ \\t]*=\/ \" =\"\n\n(* Variable: any *)\nlet any = Rx.no_spaces\n\n(* Variable: value\nMatch any value after \" =\".\nShould not start and end with spaces. May contain spaces inside *)\nlet value = any . (Rx.space . any)*\n\n(* View: command_start *)\nlet command_start = Util.del_str \"!\"\n\n\n(******************************************************************\n * Group: ENTRIES\n ******************************************************************)\n\n(* Variable: commands *)\nlet commands = \/include|include_try\/\n\n(* Variable: block_names *)\nlet block_names = \/dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener\/\n\n(* Variable: keys\nMatch any possible key except commands and block names. *)\nlet keys = Rx.word - (commands | block_names)\n\n(* View: entry\nMap simple \"key = value\" entries including \"key =\" entries with empty value. *)\nlet entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]\n\n(* View: command\nMap commands started with \"!\". *)\nlet command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nBased off Quote.dquote_spaces\n\nParameters:\n lns1:lens - the lens before\n lns2:lens - the lens after\n*)\nlet dquote_spaces (lns1:lens) (lns2:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\"\\n]*[ \\t]+[^\"\\n]*\/)\n in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ]\n\nlet mailbox = indent\n . dquote_spaces\n (key \/mailbox\/ . Sep.space)\n (Build.block_newlines_spc entry comment . eol)\n\nlet block_ldelim_newlines_re = \/[ \\t]+\\{([ \\t\\n]*\\n)?\/\n\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in del block_ldelim_newlines_re Build.block_ldelim_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default\n\n(* View: block\nMap block enclosed in brackets recursively.\nBlock may be indented and have optional argument.\nBlock body may have entries, comments, empty lines, and nested blocks recursively. *)\nlet rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store \/!?[\\\/A-Za-z0-9_-]+\/))? . block_newlines (entry|block|mailbox) comment . eol ]\n\n\n(******************************************************************\n * Group: LENS AND FILTER\n ******************************************************************)\n\n(* View: lns\nThe Dovecot lens *)\nlet lns = (comment|empty|entry|command|block)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/etc\/dovecot\/conf.d\/*.conf\")\n . incl \"\/usr\/local\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/usr\/local\/etc\/dovecot\/conf.d\/*.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Dovecot\n Parses dovecot configuration files.\n\nAuthor: Serge Smetana <serge.smetana@gmail.com>\n Acunote http:\/\/www.acunote.com\n Pluron, Inc. http:\/\/pluron.com\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Configuration files\n This lens applies to \/etc\/dovecot\/dovecot.conf and files in\n \/etc\/dovecot\/conf.d\/. See <filter>.\n\nAbout: Examples\n The <Test_Dovecot> file contains various examples and tests.\n\nAbout: TODO\n Support for multiline values like queries in dict-sql.conf\n*)\n\nmodule Dovecot =\n\n autoload xfm\n\n(******************************************************************\n * Group: USEFUL PRIMITIVES\n ******************************************************************)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: empty\nMap empty lines. *)\nlet empty = Util.empty\n\n(* View: comment\nMap comments in \"#comment\" nodes. *)\nlet comment = Util.comment\n\n(* View: eq *)\nlet eq = del \/[ \\t]*=\/ \" =\"\n\n(* Variable: any *)\nlet any = Rx.no_spaces\n\n(* Variable: value\nMatch any value after \" =\".\nShould not start and end with spaces. May contain spaces inside *)\nlet value = any . (Rx.space . any)*\n\n(* View: command_start *)\nlet command_start = Util.del_str \"!\"\n\n\n(******************************************************************\n * Group: ENTRIES\n ******************************************************************)\n\n(* Variable: commands *)\nlet commands = \/include|include_try\/\n\n(* Variable: block_names *)\nlet block_names = \/dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener\/\n\n(* Variable: keys\nMatch any possible key except commands and block names. *)\nlet keys = Rx.word - (commands | block_names)\n\n(* View: entry\nMap simple \"key = value\" entries including \"key =\" entries with empty value. *)\nlet entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]\n\n(* View: command\nMap commands started with \"!\". *)\nlet command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nBased off Quote.dquote_spaces\n\nParameters:\n lns1:lens - the lens before\n lns2:lens - the lens after\n*)\nlet dquote_spaces (lns1:lens) (lns2:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\"\\n]*[ \\t]+[^\"\\n]*\/)\n in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ]\n\nlet mailbox = indent\n . dquote_spaces\n (key \/mailbox\/ . Sep.space)\n (Build.block_newlines_spc entry comment . eol)\n\nlet block_ldelim_newlines_re = \/[ \\t]+\\{([ \\t\\n]*\\n)?\/\n\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in del block_ldelim_newlines_re Build.block_ldelim_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default\n\n(* View: block\nMap block enclosed in brackets recursively.\nBlock may be indented and have optional argument.\nBlock body may have entries, comments, empty lines, and nested blocks recursively. *)\nlet rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store \/[\\\/A-Za-z0-9_-]+\/))? . block_newlines (entry|block|mailbox) comment . eol ]\n\n\n(******************************************************************\n * Group: LENS AND FILTER\n ******************************************************************)\n\n(* View: lns\nThe Dovecot lens *)\nlet lns = (comment|empty|entry|command|block)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/etc\/dovecot\/conf.d\/*.conf\")\n . incl \"\/usr\/local\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/usr\/local\/etc\/dovecot\/conf.d\/*.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ca9acc0dc887707536b0bf6cc4bc37258ce92752","subject":"graphviz.aug: space is optional before options","message":"graphviz.aug: space is optional before options\n","repos":"manandbytes\/augeas,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,manandbytes\/augeas,jjlin\/augeas,kunkku\/augeas,domcleal\/augeas,lutter\/augeas,jtopjian\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kumy\/augeas,dafugg\/augeas,raphink\/augeas,ptoscano\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jjlin\/augeas,kumy\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,pevalme\/augeas,domcleal\/augeas,jjlin\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,mlichvar\/augeas,ptoscano\/augeas,jtopjian\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,domcleal\/augeas,lutter\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas,dafugg\/augeas","old_file":"lenses\/graphviz.aug","new_file":"lenses\/graphviz.aug","new_contents":"(*\nModule: Graphviz\n Parses graphviz files.\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to graphviz files.\n\nAbout: Examples\n The <Test_Graphviz> file contains various examples and tests.\n*)\n\nmodule Graphviz =\n\n(* View: name *)\nlet name =\n let reserved = \"node\" | \"graph\"\n in store ( (\"\\\"\" . \/[^\"]*\/ . \"\\\"\")\n | (\/[A-Za-z0-9_.]+\/ - reserved) )\n\n(* View: eol\n Special eol using semicolons and\/or newlines *)\nlet eol = del \/[ \\t]*((;\\n?)|\\n)\/ \";\\n\"\n\n(* View: block\n A block construct, using Build.block_generic\n in order to pass our special definition of <eol> *)\nlet block (kw:regexp) (entry:lens) =\n [ key kw\n . Sep.space . name\n . Build.block_generic (* Use our definition of eol *)\n (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n Build.block_ldelim_re \/;?[ \\t\\n]*\\}\/ (* Allow semicol *)\n Build.block_ldelim_default Build.block_rdelim_default ]\n\n(* View: variable_generic\n A generic way of parsing variables\n with or without double quotes *)\nlet variable_generic (reserved:regexp) =\n Build.key_value (Rx.word - reserved) Sep.space_equal name\n\n(* View: variable *)\nlet variable =\n let reserved = \"subgraph\" | \"node\"\n in variable_generic reserved\n\n(* View: options\n A list of options for <nodes> or <links> *)\nlet options = \n let reserved = \"node\" | \"link_type\"\n in let option = variable_generic reserved\n in let comma = del \/,[ \\t\\n]*\/ \",\"\n in Sep.opt_space . del \/\\[[ \\t]*\/ \"[\"\n . Build.opt_list option comma\n . del \/[ \\t]*\\]\/ \"]\"\n\n(* View: link *)\nlet link =\n let link_node = [ label \"node\" . name ]\n in let link_type = [ label \"link_type\" . Sep.opt_space\n . store \/\\<?\\-\\-?\\>?\/ . Sep.opt_space ]\n in [ label \"link\"\n . Build.list link_node link_type\n . options? ]\n\n(* View: node *)\nlet node = [ label \"node\" . name . options? ]\n\n(* View: nodelist\n Several <nodes> can be declared at once in a nodelist.\n This cannot be declared as simply a list of <nodes>,\n since it would be ambiguous in the put direction. *)\nlet nodelist = [ label \"nodelist\" . Build.list node Sep.space ]\n\n(* View: default_node\n General settings for <nodes> *)\nlet default_node = [ Build.xchgs \"node\" \"@node\" . options ]\n\n(* View: default_graph\n General settings for <graphs> *)\nlet default_graph = [ Build.xchgs \"graph\" \"@graph\" . options ]\n\n(* View: entry\n A general entry *)\nlet entry = (link | variable | node | nodelist\n | default_node | default_graph)\n\n(* View: subgraph\n Recursive *)\nlet rec subgraph = block \"subgraph\" (subgraph | entry)\n\n(* View: graph\n The top-level graph *)\nlet graph = block \/(di)?graph\/ (subgraph | entry) . Util.eol\n\n(* View: lns\n The graphviz lens *)\nlet lns = (Util.comment | Util.empty)* . graph\n\n\n","old_contents":"(*\nModule: Graphviz\n Parses graphviz files.\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to graphviz files.\n\nAbout: Examples\n The <Test_Graphviz> file contains various examples and tests.\n*)\n\nmodule Graphviz =\n\n(* View: name *)\nlet name =\n let reserved = \"node\" | \"graph\"\n in store ( (\"\\\"\" . \/[^\"]*\/ . \"\\\"\")\n | (\/[A-Za-z0-9_.]+\/ - reserved) )\n\n(* View: eol\n Special eol using semicolons and\/or newlines *)\nlet eol = del \/[ \\t]*((;\\n?)|\\n)\/ \";\\n\"\n\n(* View: block\n A block construct, using Build.block_generic\n in order to pass our special definition of <eol> *)\nlet block (kw:regexp) (entry:lens) =\n [ key kw\n . Sep.space . name\n . Build.block_generic (* Use our definition of eol *)\n (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n Build.block_ldelim_re \/;?[ \\t\\n]*\\}\/ (* Allow semicol *)\n Build.block_ldelim_default Build.block_rdelim_default ]\n\n(* View: variable_generic\n A generic way of parsing variables\n with or without double quotes *)\nlet variable_generic (reserved:regexp) =\n Build.key_value (Rx.word - reserved) Sep.space_equal name\n\n(* View: variable *)\nlet variable =\n let reserved = \"subgraph\" | \"node\"\n in variable_generic reserved\n\n(* View: options\n A list of options for <nodes> or <links> *)\nlet options = \n let reserved = \"node\" | \"link_type\"\n in let option = variable_generic reserved\n in let comma = del \/,[ \\t\\n]*\/ \",\"\n in Sep.space . del \/\\[[ \\t]*\/ \"[\"\n . Build.opt_list option comma\n . del \/[ \\t]*\\]\/ \"]\"\n\n(* View: link *)\nlet link =\n let link_node = [ label \"node\" . name ]\n in let link_type = [ label \"link_type\" . Sep.opt_space\n . store \/\\<?\\-\\-?\\>?\/ . Sep.opt_space ]\n in [ label \"link\"\n . Build.list link_node link_type\n . options? ]\n\n(* View: node *)\nlet node = [ label \"node\" . name . options? ]\n\n(* View: nodelist\n Several <nodes> can be declared at once in a nodelist.\n This cannot be declared as simply a list of <nodes>,\n since it would be ambiguous in the put direction. *)\nlet nodelist = [ label \"nodelist\" . Build.list node Sep.space ]\n\n(* View: default_node\n General settings for <nodes> *)\nlet default_node = [ Build.xchgs \"node\" \"@node\" . options ]\n\n(* View: default_graph\n General settings for <graphs> *)\nlet default_graph = [ Build.xchgs \"graph\" \"@graph\" . options ]\n\n(* View: entry\n A general entry *)\nlet entry = (link | variable | node | nodelist\n | default_node | default_graph)\n\n(* View: subgraph\n Recursive *)\nlet rec subgraph = block \"subgraph\" (subgraph | entry)\n\n(* View: graph\n The top-level graph *)\nlet graph = block \/(di)?graph\/ (subgraph | entry) . Util.eol\n\n(* View: lns\n The graphviz lens *)\nlet lns = (Util.comment | Util.empty)* . graph\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9b929f3e9350c4e7d95f905513be9b18aaec8706","subject":"Logrotate: no functional change; remove tabs","message":"Logrotate: no functional change; remove tabs\n","repos":"pevalme\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,pevalme\/augeas,mchf\/augeas,lutter\/augeas,manandbytes\/augeas,kunkku\/augeas,pevalme\/augeas,jjlin\/augeas,hercules-team\/augeas,jtopjian\/augeas,dafugg\/augeas,dafugg\/augeas,ptoscano\/augeas,dafugg\/augeas,lutter\/augeas,jjlin\/augeas,ptoscano\/augeas,jasperla\/augeas,hercules-team\/augeas,kunkku\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,MikaelSmith\/augeas,jjlin\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mchf\/augeas,ptoscano\/augeas,raphink\/augeas,jasperla\/augeas,manandbytes\/augeas,raphink\/augeas,jtopjian\/augeas","old_file":"lenses\/logrotate.aug","new_file":"lenses\/logrotate.aug","new_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Sep.space\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = Rx.relinteger\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = \/\\\/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n let indent = del Rx.opt_space \"\\t\"\n\n (* define omments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) = [ label kw . store select ]\n let value_to_eol (kw:string) (value:regexp) = Build.key_value kw sep_val (store value)\n let flag_to_eol (kw:string) = Build.flag kw\n let list_to_eol (kw:string) = [ key kw . list_item+ ]\n\n\n (* Defaults *)\n\n let create =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"create\" .\n ( mode | mode . owner | mode . owner . group )? ]\n\n let su =\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"su\" .\n ( owner | owner . group )? ]\n\n let tabooext = [ key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ ]\n\n let attrs = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/\n | value_to_eol \"rotate\" num\n | create\n | flag_to_eol \"nocreate\"\n | su\n | value_to_eol \"include\" word\n | select_to_eol \"missingok\" \/(no)?missingok\/\n | select_to_eol \"compress\" \/(no)?compress\/\n | select_to_eol \"delaycompress\" \/(no)?delaycompress\/\n | select_to_eol \"ifempty\" \/(not)?ifempty\/\n | select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/\n | value_to_eol \"size\" size\n | tabooext\n | value_to_eol \"olddir\" word\n | flag_to_eol \"noolddir\"\n | value_to_eol \"mail\" word\n | flag_to_eol \"mailfirst\"\n | flag_to_eol \"maillast\"\n | flag_to_eol \"nomail\"\n | value_to_eol \"errors\" word\n | value_to_eol \"extension\" word\n | select_to_eol \"dateext\" \/(no)?dateext\/\n | value_to_eol \"dateformat\" word\n | value_to_eol \"compresscmd\" word\n | value_to_eol \"uncompresscmd\" word\n | value_to_eol \"compressext\" word\n | list_to_eol \"compressoptions\"\n | select_to_eol \"copy\" \/(no)?copy\/\n | select_to_eol \"copytruncate\" \/(no)?copytruncate\/\n | value_to_eol \"maxage\" num\n | value_to_eol \"minsize\" size\n | select_to_eol \"shred\" \/(no)?shred\/\n | value_to_eol \"shredcycles\" num\n | value_to_eol \"start\" num\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . Util.del_str \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ key hook_names . eol .\n hook_lines? .\n del \/[ \\t]*endscript\/ \"\\tendscript\" ]\n\n (* Define rule *)\n\n let body = Build.block_newlines\n (indent . (attrs | hooks) . eol)\n Util.comment\n\n let rule =\n let filename_entry = [ label \"file\" . store filename ] in\n let filename_sep = del \/[ \\t\\n]+\/ \" \" in\n let filenames = Build.opt_list filename_entry filename_sep in\n [ label \"rule\" . Util.indent . filenames . body . eol ]\n\n let lns = ( comment | empty | (attrs . eol) | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Sep.space\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = Rx.relinteger\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = \/\\\/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n let indent = del Rx.opt_space \"\\t\"\n\n (* define omments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) = [ label kw . store select ]\n let value_to_eol (kw:string) (value:regexp) = Build.key_value kw sep_val (store value)\n let flag_to_eol (kw:string) = Build.flag kw\n let list_to_eol (kw:string) = [ key kw . list_item+ ]\n\n\n (* Defaults *)\n\n let create =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"create\" .\n ( mode | mode . owner | mode . owner . group )? ]\n\n let su =\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"su\" .\n ( owner | owner . group )? ]\n\n let tabooext = [ key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ ]\n\n let attrs = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/\n | value_to_eol \"rotate\" num\n\t\t| create\n\t\t| flag_to_eol \"nocreate\"\n\t\t| su\n\t\t| value_to_eol \"include\" word\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/\n\t\t| select_to_eol \"compress\" \/(no)?compress\/\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/\n\t\t| value_to_eol \"size\" size\n\t\t| tabooext\n\t\t| value_to_eol \"olddir\" word\n\t\t| flag_to_eol \"noolddir\"\n\t\t| value_to_eol \"mail\" word\n\t\t| flag_to_eol \"mailfirst\"\n\t\t| flag_to_eol \"maillast\"\n\t\t| flag_to_eol \"nomail\"\n\t\t| value_to_eol \"errors\" word\n\t\t| value_to_eol \"extension\" word\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/\n | value_to_eol \"dateformat\" word\n\t\t| value_to_eol \"compresscmd\" word\n\t\t| value_to_eol \"uncompresscmd\" word\n\t\t| value_to_eol \"compressext\" word\n\t\t| list_to_eol \"compressoptions\"\n\t\t| select_to_eol \"copy\" \/(no)?copy\/\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/\n\t\t| value_to_eol \"maxage\" num\n\t\t| value_to_eol \"minsize\" size\n\t\t| select_to_eol \"shred\" \/(no)?shred\/\n\t\t| value_to_eol \"shredcycles\" num\n\t\t| value_to_eol \"start\" num\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . Util.del_str \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ key hook_names . eol .\n hook_lines? .\n del \/[ \\t]*endscript\/ \"\\tendscript\" ]\n\n (* Define rule *)\n\n let body = Build.block_newlines\n (indent . (attrs | hooks) . eol)\n Util.comment\n\n let rule =\n let filename_entry = [ label \"file\" . store filename ] in\n let filename_sep = del \/[ \\t\\n]+\/ \" \" in\n let filenames = Build.opt_list filename_entry filename_sep in\n [ label \"rule\" . Util.indent . filenames . body . eol ]\n\n let lns = ( comment | empty | (attrs . eol) | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"de28f593aaa00f49f793fa32a15408788b24db48","subject":"Multipath: updated for multipath-0.4.9-99.el7","message":"Multipath: updated for multipath-0.4.9-99.el7\n\n","repos":"ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,mlichvar\/augeas,manandbytes\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas,lutter\/augeas,pevalme\/augeas,ptoscano\/augeas,kunkku\/augeas,mchf\/augeas,mlichvar\/augeas,pevalme\/augeas,mchf\/augeas,lutter\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas","old_file":"lenses\/multipath.aug","new_file":"lenses\/multipath.aug","new_contents":"(* Process \/etc\/multipath.conf *)\n(* The lens is based on the multipath.conf(5) man page *)\nmodule Multipath =\n\nautoload xfm\n\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\nlet eol = Util.eol\n\nlet ws = del \/[ \\t]+\/ \" \"\nlet indent = del \/[ \\t]*\/ \"\"\n(* We require that braces are always followed by a newline *)\nlet obr = del \/\\{([ \\t]*)\\n\/ \"{\\n\"\nlet cbr = del \/[ \\t]*}[ \\t]*\\n\/ \"}\\n\"\n\nlet ikey (k:regexp) = indent . key k\n\nlet section (n:regexp) (b:lens) =\n [ ikey n . ws . obr . (b|empty|comment)* . cbr ]\n\nlet kv (k:regexp) (v:regexp) =\n [ ikey k . ws . store v . eol ]\n\n(* FIXME: it would be much more concise to write *)\n(* [ key k . ws . (bare | quoted) ] *)\n(* but the typechecker trips over that *)\nlet qstr (k:regexp) =\n let delq = del \/['\"]\/ \"\\\"\" in\n let bare = del \/[\"']?\/ \"\" . store \/[^\"' \\t\\n]+\/ . del \/[\"']?\/ \"\" in\n let quoted = delq . store \/.*[ \\t].*\/ . delq in\n [ ikey k . ws . bare . eol ]\n |[ ikey k . ws . quoted . eol ]\n\nlet wwid = kv \"wwid\" (Rx.word|\"*\")\n\n(* Settings that can be changed in various places *)\nlet common_setting =\n qstr \"path_selector\"\n |kv \"path_grouping_policy\" \/failover|multibus|group_by_(serial|prio|node_name)\/\n |kv \"path_checker\" \/tur|emc_clariion|hp_sw|rdac|directio|rdb|readsector0\/\n |kv \"prio\" \/const|emc|alua|ontap|rdac|hp_sw|hds|random|weightedpath\/\n |qstr \"prio_args\"\n |kv \"failback\" (Rx.integer | \/immediate|manual|followover\/)\n |kv \"rr_weight\" \/priorities|uniform\/\n |kv \"flush_on_last_del\" \/yes|no\/\n |kv \"user_friendly_names\" \/yes|no\/\n |kv \"no_path_retry\" (Rx.integer | \/fail|queue\/)\n |kv \/rr_min_io(_q)?\/ Rx.integer\n |qstr \"features\"\n |kv \"reservation_key\" Rx.word\n |kv \"deferred_remove\" \/yes|no\/\n |kv \"delay_watch_checks\" (Rx.integer | \"no\")\n |kv \"delay_wait_checks\" (Rx.integer | \"no\")\n |kv \"skip_kpartx\" \/yes|no\/\n (* Deprecated settings for backwards compatibility *)\n |qstr \/(getuid|prio)_callout\/\n (* Settings not documented in `man multipath.conf` *)\n |kv \/rr_min_io_rq\/ Rx.integer\n |kv \"udev_dir\" Rx.fspath\n |qstr \"selector\"\n |kv \"async_timeout\" Rx.integer\n |kv \"pg_timeout\" Rx.word\n |kv \"h_on_last_deleassign_maps\" \/yes|no\/\n |qstr \"uid_attribute\"\n |kv \"hwtable_regex_match\" \/yes|no|on|off\/\n |kv \"reload_readwrite\" \/yes|no\/\n\nlet default_setting =\n common_setting\n |kv \"polling_interval\" Rx.integer\n |kv \"max_polling_interval\" Rx.integer\n |kv \"multipath_dir\" Rx.fspath\n |kv \"find_multipaths\" \/yes|no\/\n |kv \"verbosity\" \/[0-6]\/\n |kv \"reassign_maps\" \/yes|no\/\n |kv \"uid_attrribute\" Rx.word\n |kv \"max_fds\" (Rx.integer|\"max\")\n |kv \"checker_timeout\" Rx.integer\n |kv \"fast_io_fail_tmo\" (Rx.integer|\"off\")\n |kv \"dev_loss_tmo\" (Rx.integer|\"infinity\")\n |kv \"queue_without_daemon\" \/yes|no\/\n |kv \"bindings_file\" Rx.fspath\n |kv \"wwids_file\" Rx.fspath\n |kv \"log_checker_err\" \/once|always\/\n |kv \"retain_attached_hw_handler\" \/yes|no\/\n |kv \"detect_prio\" \/yes|no\/\n |kv \"hw_str_match\" \/yes|no\/\n |kv \"force_sync\" \/yes|no\/\n |kv \"config_dir\" Rx.fspath\n |kv \"missing_uev_wait_timeout\" Rx.integer\n |kv \"ignore_new_boot_devs\" \/yes|no\/\n |kv \"retrigger_tries\" Rx.integer\n |kv \"retrigger_delay\" Rx.integer\n |kv \"new_bindings_in_boot\" \/yes|no\/\n\n(* A device subsection *)\nlet device =\n let setting =\n qstr \/vendor|product|product_blacklist|hardware_handler|alias_prefix\/\n |default_setting in\n section \"device\" setting\n\n(* The defaults section *)\nlet defaults =\n section \"defaults\" default_setting\n\n(* The blacklist and blacklist_exceptions sections *)\nlet blacklist =\n let setting =\n wwid\n |qstr \"devnode\"\n |device in\n section \/blacklist(_exceptions)?\/ setting\n\n(* A multipath subsection *)\nlet multipath =\n let setting =\n wwid\n |qstr \"alias\"\n |common_setting in\n section \"multipath\" setting\n\n(* The multipaths section *)\nlet multipaths =\n section \"multipaths\" multipath\n\n(* The devices section *)\nlet devices =\n section \"devices\" device\n\nlet lns = (comment|empty|defaults|blacklist|devices|multipaths)*\n\nlet xfm = transform lns (incl \"\/etc\/multipath.conf\" .\n incl \"\/etc\/multipath\/conf.d\/*.conf\")\n","old_contents":"(* Process \/etc\/multipath.conf *)\n(* The lens is based on the multipath.conf(5) man page *)\nmodule Multipath =\n\nautoload xfm\n\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\nlet eol = Util.eol\n\nlet ws = del \/[ \\t]+\/ \" \"\nlet indent = del \/[ \\t]*\/ \"\"\n(* We require that braces are always followed by a newline *)\nlet obr = del \/\\{([ \\t]*)\\n\/ \"{\\n\"\nlet cbr = del \/[ \\t]*}[ \\t]*\\n\/ \"}\\n\"\n\nlet ikey (k:regexp) = indent . key k\n\nlet section (n:regexp) (b:lens) =\n [ ikey n . ws . obr . (b|empty|comment)* . cbr ]\n\nlet kv (k:regexp) (v:regexp) =\n [ ikey k . ws . store v . eol ]\n\n(* FIXME: it would be much more concise to write *)\n(* [ key k . ws . (bare | quoted) ] *)\n(* but the typechecker trips over that *)\nlet qstr (k:regexp) =\n let delq = del \/['\"]\/ \"\\\"\" in\n let bare = del \/[\"']?\/ \"\" . store \/[^\"' \\t\\n]+\/ . del \/[\"']?\/ \"\" in\n let quoted = delq . store \/.*[ \\t].*\/ . delq in\n [ ikey k . ws . bare . eol ]\n |[ ikey k . ws . quoted . eol ]\n\nlet wwid = kv \"wwid\" (Rx.word|\"*\")\n\n(* Settings that can be changed in various places *)\nlet common_setting =\n kv \"path_grouping_policy\"\n \/failover|multibus|group_by_(serial|prio|node_name)\/\n |qstr \/(getuid|prio)_callout\/\n |qstr \/path_(selector|checker)|features\/\n |kv \"failback\" (Rx.integer | \/immediate|manual\/)\n |kv \"rr_weight\" \/priorities|uniform\/\n |kv \"no_path_retry\" (Rx.integer | \/fail|queue\/)\n |kv \/rr_min_io(_rq)?\/ Rx.integer\n |kv \"flush_on_last_del\" \/yes|no\/\n |kv \"reservation_key\" Rx.word\n |kv \"delay_watch_checks\" (Rx.integer|\"no\")\n |kv \"delay_wait_checks\" (Rx.integer|\"no\")\n\nlet default_setting =\n kv \"polling_interval\" Rx.integer\n |kv \"udev_dir\" Rx.fspath\n |qstr \"selector\"\n |kv \"user_friendly_names\" \/yes|no\/\n |kv \"dev_loss_tmo\" Rx.integer\n |kv \"fast_io_fail_tmo\" Rx.integer\n |kv \"verbosity\" \/[0-6]\/\n |kv \"reassign_maps\" \/yes|no\/\n |kv \"prio\" Rx.word\n |kv \"max_fds\" Rx.integer\n |kv \"find_multipaths\" \/yes|no\/\n |kv \"checker_timeout\" Rx.integer\n |kv \"hwtable_regex_match\" \/yes|no\/\n |kv \"reload_readwrite\" \/yes|no\/\n |kv \"replace_wwid_whitespace\" \/yes|no\/\n |kv \"force_sync\" \/yes|no\/\n |kv \"config_dir\" Rx.fspath\n (* SUSE extensions *)\n |kv \"async_timeout\" Rx.integer\n |kv \"max_polling_interval\" Rx.integer\n |kv \"pg_timeout\" Rx.word\n |kv \"bindings_file\" Rx.fspath\n |kv \"multipath_dir\" Rx.fspath\n |kv \"alias_prefix\" Rx.word\n |kv \"queue_without_daemon\" \/yes|no\/\n |kv \"h_on_last_deleassign_maps\" \/yes|no\/\n |qstr \"prio_args\"\n (* SUSE extensions SP3 *)\n |qstr \"uid_attribute\"\n |kv \"wwids_file\" Rx.fspath\n |kv \"log_checker_err\" Rx.word\n |kv \"retain_attached_hw_handler\" \/yes|no\/\n |kv \"detect_prio\" \/yes|no\/\n\n(* A device subsection *)\nlet device =\n let setting =\n qstr \/vendor|product|product_blacklist|hardware_handler\/\n |common_setting\n |default_setting in\n section \"device\" setting\n\n(* The defaults section *)\nlet defaults =\n let setting =\n common_setting\n |default_setting\n in section \"defaults\" setting\n\n(* The blacklist and blacklist_exceptions sections *)\nlet blacklist =\n let setting =\n wwid\n |qstr \"devnode\"\n |device in\n section \/blacklist(_exceptions)?\/ setting\n\n(* A multipath subsection *)\nlet multipath =\n let setting =\n wwid\n |qstr \"alias\"\n |common_setting in\n section \"multipath\" setting\n\n(* The multipaths section *)\nlet multipaths =\n section \"multipaths\" multipath\n\n(* The devices section *)\nlet devices =\n section \"devices\" device\n\nlet lns = (comment|empty|defaults|blacklist|devices|multipaths)*\n\nlet xfm = transform lns (incl \"\/etc\/multipath.conf\" .\n incl \"\/etc\/multipath\/conf.d\/*.conf\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7f92c1be2d9b433b08797b81d2971455b4ee2772","subject":"Mdadm: use case-insensitive regexps","message":"Mdadm: use case-insensitive regexps\n","repos":"domcleal\/augeas,ptoscano\/augeas,raphink\/augeas,MikaelSmith\/augeas,jjlin\/augeas,jasperla\/augeas,mlichvar\/augeas,ptoscano\/augeas,mchf\/augeas,mlichvar\/augeas,lutter\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,kunkku\/augeas,jjlin\/augeas,dafugg\/augeas,ptoscano\/augeas,mchf\/augeas,dafugg\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,kunkku\/augeas,kunkku\/augeas,kumy\/augeas,kumy\/augeas,manandbytes\/augeas,hercules-team\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,manandbytes\/augeas,lutter\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,lutter\/augeas,kumy\/augeas,mlichvar\/augeas,jasperla\/augeas,domcleal\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,raphink\/augeas","old_file":"lenses\/mdadm_conf.aug","new_file":"lenses\/mdadm_conf.aug","new_contents":"(******************************************************************************\nMdadm_conf module for Augeas\n\nAuthor: Matthew Booth <mbooth@redhat.com>\n\nCopyright (C):\n 2011 Red Hat Inc.\n\nReference:\n mdadm(5)\n config.c and policy.c from mdadm-3.2.2\n\nLicense:\n This file is licensed under the LGPLv2+.\n\nThis is a lens for \/etc\/mdadm.conf. It aims to parse every valid configuration\nfile as of version 3.2.2, and many invalid ones too. This last point is a\nfeature, not a bug! madm will generate warnings for invalid configuration which\ndo not prevent correct operation of the tool. Wherever possible, we try to\nallow for this behaviour.\n\nKeywords in mdadm.conf are matched with a case-insensitive prefix match of at\nleast 3 characters. Keys in key\/value pairs are also matched case-insensitively,\nbut require a full match. The exception is POLICY and PART-POLICY, where keys\nare matched case-sensitively.\n\nN.B. We can't use case-insensitive regular expressions in most places due to bug\n#147.\n*******************************************************************************)\n\nmodule Mdadm_conf =\n\n autoload xfm\n\n\n(******************************************************************************\n * PRIMITIVES\n ******************************************************************************)\n\nlet eol = Util.comment_or_eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet value = \/[^ \\t\\n#]+\/\nlet value_no_eq = \/[^ \\t\\n#=]+\/\nlet value_no_eq_sl = \/[^ \\t\\n#=\\\/]+\/\n\nlet continuation = \/\\n[ \\t]+\/\nlet space = \/[ \\t]+\/\nlet value_sep = ( del ( continuation | space . continuation? ) \" \"\n | comment . del space \" \" )\n\n(* We parse specific keys rather than having a catch-all owing to the varying\ncase of the syntax. This means the user can rely on 'array\/uuid' rather than\nadditionally testing for 'array\/UUID'.\n\nIt would be good to have an additional catchall, but I haven't been able to make\nthat work.\n*)\nlet keyvalue (r:regexp) (lc:string) (uc:string) =\n [ del ( r . \/=\/ ) ( uc . \"=\" ) . label lc . store value ]\n\nlet simplevalue (r:regexp) (lc:string) (uc:string) =\n [ del r uc . label lc\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * DEVICES\n ******************************************************************************)\n\nlet dev_re = \/dev(i(ce?)?)?\/i\n\nlet dev_containers_re = \/containers\/i\nlet dev_partitions_re = \/partitions\/i\n\nlet dev_containers = [ del dev_containers_re \"containers\" . label \"containers\" ]\nlet dev_partitions = [ del dev_partitions_re \"partitions\" . label \"partitions\" ]\nlet dev_device = [ label \"name\". store ( value - dev_containers_re) ]\n\n(* Strictly there must be at least 1 device, but we err on the side of parsing\n*)\nlet dev_devices = ( value_sep . ( dev_containers\n | dev_partitions\n | dev_device ) )*\n\nlet device = [ del dev_re \"DEVICE\" . label \"device\" . dev_devices . eol ]\n\n\n(******************************************************************************\n * ARRAY\n ******************************************************************************)\n\nlet array_re = \/arr(ay?)?\/i\n\nlet arr_auto_re = \/auto\/i\nlet arr_bitmap_re = \/bitmap\/i\nlet arr_container_re = \/container\/i\nlet arr_devices_re = \/devices\/i\nlet arr_disks_re = \/disks\/i (* Undocumented *)\nlet arr_level_re = \/level\/i\nlet arr_member_re = \/member\/i\nlet arr_metadata_re = \/metadata\/i\nlet arr_name_re = \/name\/i\nlet arr_num_devices_re = \/num-devices\/i\nlet arr_spare_group_re = \/spare-group\/i\nlet arr_spares_re = \/spares\/i\nlet arr_super_minor_re = \/super-minor\/i\nlet arr_uuid_re = \/uuid\/i\n\nlet arr_devicename = [ store value_no_eq . label \"devicename\" ]\n\nlet arr_auto = keyvalue arr_auto_re \"auto\" \"AUTO\"\nlet arr_bitmap = keyvalue arr_bitmap_re \"bitmap\" \"BITMAP\"\nlet arr_container = keyvalue arr_container_re \"container\" \"CONTAINER\"\nlet arr_devices = keyvalue arr_devices_re \"devices\" \"DEVICES\"\nlet arr_disks = keyvalue arr_disks_re \"disks\" \"DISKS\"\nlet arr_level = keyvalue arr_level_re \"level\" \"LEVEL\"\nlet arr_member = keyvalue arr_member_re \"member\" \"MEMBER\"\nlet arr_metadata = keyvalue arr_metadata_re \"metadata\" \"METADATA\"\nlet arr_name = keyvalue arr_name_re \"name\" \"NAME\"\nlet arr_num_devices = keyvalue arr_num_devices_re \"num-devices\" \"NUM-DEVICES\"\nlet arr_spare_group = keyvalue arr_spare_group_re \"spare-group\" \"SPARE-GROUP\"\nlet arr_spares = keyvalue arr_spares_re \"spares\" \"SPARES\"\nlet arr_super_minor = keyvalue arr_super_minor_re \"super-minor\" \"SUPER-MINOR\"\nlet arr_uuid = keyvalue arr_uuid_re \"uuid\" \"UUID\"\n\nlet arr_options = ( value_sep . ( arr_devicename\n | arr_auto\n | arr_bitmap\n | arr_container\n | arr_devices\n | arr_disks\n | arr_level\n | arr_member\n | arr_metadata\n | arr_name\n | arr_num_devices\n | arr_spare_group\n | arr_spares\n | arr_super_minor\n | arr_uuid ) )*\n\nlet array = [ del array_re \"ARRAY\" . label \"array\" . arr_options . eol ]\n\n\n(******************************************************************************\n * MAILADDR\n ******************************************************************************)\n\nlet mailaddr_re = \/mai(l(a(d(dr?)?)?)?)?\/i\n\n(* We intentially allow multiple mailaddr values here, even though this is\ninvalid and would produce a warning. This is better than not parsing the file.\n*)\nlet mailaddr = simplevalue mailaddr_re \"mailaddr\" \"MAILADDR\"\n\n\n(******************************************************************************\n * MAILFROM\n ******************************************************************************)\n\n(* N.B. MAILFROM can only be abbreviated to 5 characters *)\nlet mailfrom_re = \/mailf(r(om?)?)?\/i\n\nlet mailfrom = [ del mailfrom_re \"MAILFROM\" . label \"mailfrom\"\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * PROGRAM\n ******************************************************************************)\n\nlet program_re = \/pro(g(r(am?)?)?)?\/i\n\nlet program = simplevalue program_re \"program\" \"PROGRAM\"\n\n\n(******************************************************************************\n * CREATE\n ******************************************************************************)\n\nlet create_re = \/cre(a(te?)?)?\/i\n\nlet cre_auto_re = \/auto\/i\nlet cre_owner_re = \/owner\/i\nlet cre_group_re = \/group\/i\nlet cre_mode_re = \/mode\/i\nlet cre_metadata_re = \/metadata\/i\nlet cre_symlinks_re = \/symlinks\/i\n\nlet cre_auto = keyvalue cre_auto_re \"auto\" \"AUTO\"\nlet cre_group = keyvalue cre_group_re \"group\" \"GROUP\"\nlet cre_metadata = keyvalue cre_metadata_re \"metadata\" \"METADATA\"\nlet cre_mode = keyvalue cre_mode_re \"mode\" \"MODE\"\nlet cre_owner = keyvalue cre_owner_re \"owner\" \"OWNER\"\nlet cre_symlinks = keyvalue cre_symlinks_re \"symlinks\" \"SYMLINKS\"\n\nlet cre_options = ( value_sep . ( arr_auto\n | cre_owner\n | cre_group\n | cre_mode\n | cre_metadata\n | cre_symlinks) )*\n\nlet create = [ del create_re \"CREATE\" . label \"create\" . cre_options . eol ]\n\n\n(******************************************************************************\n * HOMEHOST\n ******************************************************************************)\n\nlet homehost_re = \/hom(e(h(o(st?)?)?)?)?\/i\n\nlet homehost = simplevalue homehost_re \"homehost\" \"HOMEHOST\"\n\n\n(******************************************************************************\n * AUTO\n ******************************************************************************)\n\nlet auto_re = \/auto?\/i\n\nlet aut_plus = [ key \"+\" . store value ]\nlet aut_minus = [ key \"-\" . store value ]\nlet aut_homehost = [ del \/homehost\/i \"homehost\" . label \"homehost\" ]\n\nlet aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )*\n\nlet auto = [ del auto_re \"AUTO\" . label \"auto\" . aut_list . eol ]\n\n\n(******************************************************************************\n * POLICY and PART-POLICY\n ******************************************************************************)\n\n(* PART-POLICY is undocumented. A cursory inspection of the parsing code\nsuggests it's parsed the same way as POLICY, but treated slightly differently\nthereafter. *)\n\nlet policy_re = \/pol(i(cy?)?)?\/i\nlet part_policy_re = \/par(t(-(p(o(l(i(cy?)?)?)?)?)?)?)?\/i\n\n(* Unlike everything else, policy keys are matched case sensitive. This means we\ndon't have to mess around with explicit option matching, as the match string is\nfixed for a working configuration. *)\n\nlet pol_option (act:string) =\n [ del ( act . \"=\" ) ( act . \"=\" ) . label act . store value ]\n\nlet pol_options = ( value_sep . [ key value_no_eq_sl . del \"=\" \"=\"\n . store value ] )*\n\nlet policy = [ del policy_re \"POLICY\" . label \"policy\"\n . pol_options . eol ]\nlet part_policy = [ del part_policy_re \"PART-POLICY\" . label \"part-policy\"\n . pol_options . eol ]\n\n\n(******************************************************************************\n * LENS\n ******************************************************************************)\n\nlet lns = (comment\n | empty\n | device\n | array\n | mailaddr\n | mailfrom\n | program\n | create\n | homehost\n | auto\n | policy\n | part_policy )*\n\nlet filter = incl \"\/etc\/mdadm.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(******************************************************************************\nMdadm_conf module for Augeas\n\nAuthor: Matthew Booth <mbooth@redhat.com>\n\nCopyright (C):\n 2011 Red Hat Inc.\n\nReference:\n mdadm(5)\n config.c and policy.c from mdadm-3.2.2\n\nLicense:\n This file is licensed under the LGPLv2+.\n\nThis is a lens for \/etc\/mdadm.conf. It aims to parse every valid configuration\nfile as of version 3.2.2, and many invalid ones too. This last point is a\nfeature, not a bug! madm will generate warnings for invalid configuration which\ndo not prevent correct operation of the tool. Wherever possible, we try to\nallow for this behaviour.\n\nKeywords in mdadm.conf are matched with a case-insensitive prefix match of at\nleast 3 characters. Keys in key\/value pairs are also matched case-insensitively,\nbut require a full match. The exception is POLICY and PART-POLICY, where keys\nare matched case-sensitively.\n\nN.B. We can't use case-insensitive regular expressions in most places due to bug\n#147.\n*******************************************************************************)\n\nmodule Mdadm_conf =\n\n autoload xfm\n\n\n(******************************************************************************\n * PRIMITIVES\n ******************************************************************************)\n\nlet eol = Util.comment_or_eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet value = \/[^ \\t\\n#]+\/\nlet value_no_eq = \/[^ \\t\\n#=]+\/\nlet value_no_eq_sl = \/[^ \\t\\n#=\\\/]+\/\n\nlet continuation = \/\\n[ \\t]+\/\nlet space = \/[ \\t]+\/\nlet value_sep = ( del ( continuation | space . continuation? ) \" \"\n | comment . del space \" \" )\n\n(* We parse specific keys rather than having a catch-all owing to the varying\ncase of the syntax. This means the user can rely on 'array\/uuid' rather than\nadditionally testing for 'array\/UUID'.\n\nIt would be good to have an additional catchall, but I haven't been able to make\nthat work.\n*)\nlet keyvalue (r:regexp) (lc:string) (uc:string) =\n [ del ( r . \/=\/ ) ( uc . \"=\" ) . label lc . store value ]\n\nlet simplevalue (r:regexp) (lc:string) (uc:string) =\n [ del r uc . label lc\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * DEVICES\n ******************************************************************************)\n\nlet dev_re = \/[dD][eE][vV]([iI]([cC][eE]?)?)?\/\n\nlet dev_containers_re = \/[cC][oO][nN][tT][aA][iI][nN][eE][rR][sS]\/\nlet dev_partitions_re = \/[pP][aA][rR][tT][iI][tT][iI][oO][nN][sS]\/\n\nlet dev_containers = [ del dev_containers_re \"containers\" . label \"containers\" ]\nlet dev_partitions = [ del dev_partitions_re \"partitions\" . label \"partitions\" ]\nlet dev_device = [ label \"name\". store ( value\n - dev_containers_re\n - dev_partitions_re ) ]\n\n(* Strictly there must be at least 1 device, but we err on the side of parsing\n*)\nlet dev_devices = ( value_sep . ( dev_containers\n | dev_partitions\n | dev_device ) )*\n\nlet device = [ del dev_re \"DEVICE\" . label \"device\" . dev_devices . eol ]\n\n\n(******************************************************************************\n * ARRAY\n ******************************************************************************)\n\nlet array_re = \/[aA][rR][rR]([aA][yY]?)?\/\n\nlet arr_auto_re = \/[aA][uU][tT][oO]\/\nlet arr_bitmap_re = \/[bB][iI][tT][mM][aA][pP]\/\nlet arr_container_re = \/[cC][oO][nN][tT][aA][iI][nN][eE][rR]\/\nlet arr_devices_re = \/[dD][eE][vV][iI][cC][eE][sS]\/\nlet arr_disks_re = \/[dD][iI][sS][kK][sS]\/ (* Undocumented *)\nlet arr_level_re = \/[lL][eE][vV][eE][lL]\/\nlet arr_member_re = \/[mM][eE][mM][bB][eE][rR]\/\nlet arr_metadata_re = \/[mM][eE][tT][aA][dD][aA][tT][aA]\/\nlet arr_name_re = \/[nN][aA][mM][eE]\/\nlet arr_num_devices_re = \/[nN][uU][mM]-[dD][eE][vV][iI][cC][eE][sS]\/\nlet arr_spare_group_re = \/[sS][pP][aA][rR][eE]-[gG][rR][oO][uU][pP]\/\nlet arr_spares_re = \/[sS][pP][aA][rR][eE][sS]\/\nlet arr_super_minor_re = \/[sS][uU][pP][eE][rR]-[mM][iI][nN][oO][rR]\/\nlet arr_uuid_re = \/[uU][uU][iI][dD]\/\n\nlet arr_devicename = [ store value_no_eq . label \"devicename\" ]\n\nlet arr_auto = keyvalue arr_auto_re \"auto\" \"AUTO\"\nlet arr_bitmap = keyvalue arr_bitmap_re \"bitmap\" \"BITMAP\"\nlet arr_container = keyvalue arr_container_re \"container\" \"CONTAINER\"\nlet arr_devices = keyvalue arr_devices_re \"devices\" \"DEVICES\"\nlet arr_disks = keyvalue arr_disks_re \"disks\" \"DISKS\"\nlet arr_level = keyvalue arr_level_re \"level\" \"LEVEL\"\nlet arr_member = keyvalue arr_member_re \"member\" \"MEMBER\"\nlet arr_metadata = keyvalue arr_metadata_re \"metadata\" \"METADATA\"\nlet arr_name = keyvalue arr_name_re \"name\" \"NAME\"\nlet arr_num_devices = keyvalue arr_num_devices_re \"num-devices\" \"NUM-DEVICES\"\nlet arr_spare_group = keyvalue arr_spare_group_re \"spare-group\" \"SPARE-GROUP\"\nlet arr_spares = keyvalue arr_spares_re \"spares\" \"SPARES\"\nlet arr_super_minor = keyvalue arr_super_minor_re \"super-minor\" \"SUPER-MINOR\"\nlet arr_uuid = keyvalue arr_uuid_re \"uuid\" \"UUID\"\n\nlet arr_options = ( value_sep . ( arr_devicename\n | arr_auto\n | arr_bitmap\n | arr_container\n | arr_devices\n | arr_disks\n | arr_level\n | arr_member\n | arr_metadata\n | arr_name\n | arr_num_devices\n | arr_spare_group\n | arr_spares\n | arr_super_minor\n | arr_uuid ) )*\n\nlet array = [ del array_re \"ARRAY\" . label \"array\" . arr_options . eol ]\n\n\n(******************************************************************************\n * MAILADDR\n ******************************************************************************)\n\nlet mailaddr_re = \/[mM][aA][iI]([lL]([aA]([dD]([dD][rR]?)?)?)?)?\/\n\n(* We intentially allow multiple mailaddr values here, even though this is\ninvalid and would produce a warning. This is better than not parsing the file.\n*)\nlet mailaddr = simplevalue mailaddr_re \"mailaddr\" \"MAILADDR\"\n\n\n(******************************************************************************\n * MAILFROM\n ******************************************************************************)\n\n(* N.B. MAILFROM can only be abbreviated to 5 characters *)\nlet mailfrom_re = \/[mM][aA][iI][lL][fF]([rR]([oO][mM]?)?)?\/\n\nlet mailfrom = [ del mailfrom_re \"MAILFROM\" . label \"mailfrom\"\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * PROGRAM\n ******************************************************************************)\n\nlet program_re = \/[pP][rR][oO]([gG]([rR]([aA][mM]?)?)?)?\/\n\nlet program = simplevalue program_re \"program\" \"PROGRAM\"\n\n\n(******************************************************************************\n * CREATE\n ******************************************************************************)\n\nlet create_re = \/[cC][rR][eE]([aA]([tT][eE]?)?)?\/\n\nlet cre_auto_re = \/[aA][uU][tT][oO]\/\nlet cre_owner_re = \/[oO][wW][nN][eE][rR]\/\nlet cre_group_re = \/[gG][rR][oO][uU][pP]\/\nlet cre_mode_re = \/[mM][oO][dD][eE]\/\nlet cre_metadata_re = \/[mM][eE][tT][aA][dD][aA][tT][aA]\/\nlet cre_symlinks_re = \/[sS][yY][mM][lL][iI][nN][kK][sS]\/\n\nlet cre_auto = keyvalue cre_auto_re \"auto\" \"AUTO\"\nlet cre_group = keyvalue cre_group_re \"group\" \"GROUP\"\nlet cre_metadata = keyvalue cre_metadata_re \"metadata\" \"METADATA\"\nlet cre_mode = keyvalue cre_mode_re \"mode\" \"MODE\"\nlet cre_owner = keyvalue cre_owner_re \"owner\" \"OWNER\"\nlet cre_symlinks = keyvalue cre_symlinks_re \"symlinks\" \"SYMLINKS\"\n\nlet cre_options = ( value_sep . ( arr_auto\n | cre_owner\n | cre_group\n | cre_mode\n | cre_metadata\n | cre_symlinks) )*\n\nlet create = [ del create_re \"CREATE\" . label \"create\" . cre_options . eol ]\n\n\n(******************************************************************************\n * HOMEHOST\n ******************************************************************************)\n\nlet homehost_re = \/[hH][oO][mM]([eE]([hH]([oO]([sS][tT]?)?)?)?)?\/\n\nlet homehost = simplevalue homehost_re \"homehost\" \"HOMEHOST\"\n\n\n(******************************************************************************\n * AUTO\n ******************************************************************************)\n\nlet auto_re = \/[aA][uU][tT][oO]?\/\n\nlet aut_plus = [ key \"+\" . store value ]\nlet aut_minus = [ key \"-\" . store value ]\nlet aut_homehost = [ del \/homehost\/i \"homehost\" . label \"homehost\" ]\n\nlet aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )*\n\nlet auto = [ del auto_re \"AUTO\" . label \"auto\" . aut_list . eol ]\n\n\n(******************************************************************************\n * POLICY and PART-POLICY\n ******************************************************************************)\n\n(* PART-POLICY is undocumented. A cursory inspection of the parsing code\nsuggests it's parsed the same way as POLICY, but treated slightly differently\nthereafter. *)\n\nlet policy_re = \/[pP][oO][lL]([iI]([cC][yY]?)?)?\/\nlet part_policy_re =\n \/[pP][aA][rR]([tT](-([pP]([oO]([lL]([iI]([cC][yY]?)?)?)?)?)?)?)?\/\n\n(* Unlike everything else, policy keys are matched case sensitive. This means we\ndon't have to mess around with explicit option matching, as the match string is\nfixed for a working configuration. *)\n\nlet pol_option (act:string) =\n [ del ( act . \"=\" ) ( act . \"=\" ) . label act . store value ]\n\nlet pol_options = ( value_sep . [ key value_no_eq_sl . del \"=\" \"=\"\n . store value ] )*\n\nlet policy = [ del policy_re \"POLICY\" . label \"policy\"\n . pol_options . eol ]\nlet part_policy = [ del part_policy_re \"PART-POLICY\" . label \"part-policy\"\n . pol_options . eol ]\n\n\n(******************************************************************************\n * LENS\n ******************************************************************************)\n\nlet lns = (comment\n | empty\n | device\n | array\n | mailaddr\n | mailfrom\n | program\n | create\n | homehost\n | auto\n | policy\n | part_policy )*\n\nlet filter = incl \"\/etc\/mdadm.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1e3695ad49b90b56e210d5de76e5b5381c0ca303","subject":"Json: improve readability","message":"Json: improve readability\n","repos":"jjlin\/augeas,manandbytes\/augeas,mlichvar\/augeas,manandbytes\/augeas,ptoscano\/augeas,pevalme\/augeas,lutter\/augeas,kunkku\/augeas,dafugg\/augeas,jjlin\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,mlichvar\/augeas,mchf\/augeas,pevalme\/augeas,kunkku\/augeas,jjlin\/augeas,kunkku\/augeas,hercules-team\/augeas,hercules-team\/augeas,lutter\/augeas,mchf\/augeas,dafugg\/augeas","old_file":"lenses\/json.aug","new_file":"lenses\/json.aug","new_contents":"module Json =\n\n(* A generic lens for Json files *)\n(* Based on the following grammar from http:\/\/www.json.org\/ *)\n(* Object ::= '{'Members ? '}' *)\n(* Members ::= Pair+ *)\n(* Pair ::= String ':' Value *)\n(* Array ::= '[' Elements ']' *)\n(* Elements ::= Value ( \",\" Value )* *)\n(* Value ::= String | Number | Object | Array | \"true\" | \"false\" | \"null\" *)\n(* String ::= \"\\\"\" Char* \"\\\"\" *)\n(* Number ::= \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ *)\n\n\nlet ws = del \/[ \\t\\n]*\/ \"\"\nlet comment = Util.empty_c_style | Util.comment_c_style | Util.comment_multiline\nlet comments = comment* . Sep.opt_space\n\nlet comma = Util.del_str \",\" . comments\nlet colon = Util.del_str \":\" . comments\nlet lbrace = Util.del_str \"{\" . comments\nlet rbrace = Util.del_str \"}\"\nlet lbrack = Util.del_str \"[\" . comments\nlet rbrack = Util.del_str \"]\"\n\nlet str_store = Quote.dquote . store \/[^\"]*\/ . Quote.dquote (* \" Emacs, relax *)\n\nlet number = [ label \"number\" . store \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/\n . comments ]\nlet str = [ label \"string\" . str_store . comments ]\n\nlet const (r:regexp) = [ label \"const\" . store r . comments ]\n\nlet fix_value (value:lens) =\n let array = [ label \"array\" . lbrack\n . ( ( Build.opt_list value comma . rbrack . comments )\n | (rbrack . ws) ) ]\n in let pair = [ label \"entry\" . str_store . ws . colon . value ]\n in let obj = [ label \"dict\" . lbrace\n . ( ( Build.opt_list pair comma. rbrace . comments )\n | (rbrace . ws ) ) ]\n in (str | number | obj | array | const \/true|false|null\/)\n\n(* Process arbitrarily deeply nested JSON objects *)\nlet rec rlns = fix_value rlns\n\nlet lns = comments . rlns\n","old_contents":"module Json =\n\n(* A generic lens for Json files *)\n(* Based on the following grammar from http:\/\/www.json.org\/ *)\n(* Object ::= '{'Members ? '}' *)\n(* Members ::= Pair+ *)\n(* Pair ::= String ':' Value *)\n(* Array ::= '[' Elements ']' *)\n(* Elements ::= Value ( \",\" Value )* *)\n(* Value ::= String | Number | Object | Array | \"true\" | \"false\" | \"null\" *)\n(* String ::= \"\\\"\" Char* \"\\\"\" *)\n(* Number ::= \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ *)\n\n\nlet ws = del \/[ \\t\\n]*\/ \"\"\nlet comment = Util.empty_c_style | Util.comment_c_style | Util.comment_multiline\nlet comments = comment* . Sep.opt_space\n\nlet comma = Util.del_str \",\" . comments\nlet colon = Util.del_str \":\" . comments\nlet lbrace = Util.del_str \"{\" . comments\nlet rbrace = Util.del_str \"}\"\nlet lbrack = Util.del_str \"[\" . comments\nlet rbrack = Util.del_str \"]\"\n\nlet str_store = Quote.dquote . store \/[^\"]*\/ . Quote.dquote (* \" Emacs, relax *)\n\nlet number = [ label \"number\" . store \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ . comments ]\nlet str = [ label \"string\" . str_store . comments ]\n\nlet const (r:regexp) = [ label \"const\" . store r . comments ]\n\nlet fix_value (value:lens) =\n let array = [ label \"array\" . lbrack . ((Build.opt_list value comma . rbrack . comments) | (rbrack . ws)) ] in\n let pair = [ label \"entry\" . str_store . ws . colon . value ] in\n let obj = [ label \"dict\" . lbrace . ((Build.opt_list pair comma. rbrace . comments) | (rbrace . ws)) ] in\n (str | number | obj | array | const \/true|false|null\/)\n\n(* Process arbitrarily deeply nested JSON objects *)\nlet rec rlns = fix_value rlns\n\nlet lns = comments . rlns\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"dc7d47a6a4be4473c3a732b1402e8d149936a6c6","subject":"Disable autoload transform for the fai_diskconfig","message":"Disable autoload transform for the fai_diskconfig\n\nAutoload transform with only standard exclude makes failing the glob_for_lens\nxpath test. fai_diskconfig does this. As a temporary fix, we disable transform\nfrom fai_diskconfig.\n","repos":"hercules-team\/augeas-do-not-use,lutter\/augeas,domcleal\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,raphink\/augeas,ptoscano\/augeas,kumy\/augeas,domcleal\/augeas,kumy\/augeas,jtopjian\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,pevalme\/augeas,mchf\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,pevalme\/augeas,domcleal\/augeas,raphink\/augeas,kunkku\/augeas,jjlin\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,lutter\/augeas,dafugg\/augeas,jasperla\/augeas,kunkku\/augeas,pevalme\/augeas,kunkku\/augeas,jtopjian\/augeas,hercules-team\/augeas,hercules-team\/augeas,jjlin\/augeas,dafugg\/augeas,jasperla\/augeas,dafugg\/augeas,jjlin\/augeas,lutter\/augeas,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,GeoffWilliams\/augeas,mchf\/augeas","old_file":"lenses\/fai_diskconfig.aug","new_file":"lenses\/fai_diskconfig.aug","new_contents":"(*\nModule: FAI_DiskConfig\n Parses disk_config files for FAI\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to the FAI wiki where possible:\n http:\/\/wiki.fai-project.org\/wiki\/Setup-storage#New_configuration_file_syntax\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n*)\n\nmodule FAI_DiskConfig =\n\n(* autoload xfm *)\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: space *)\nlet space = Sep.space\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: tag\n A generic tag beginning with a colon *)\nlet tag (re:regexp) = [ Util.del_str \":\" . key re ]\n\n(* Variable: generic_opt\n A generic key\/value option *)\nlet generic_opt (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . store kw ]\n\n\n(************************************************************************\n * Group: RECORDS\n *************************************************************************)\n\n\n(* Group: volume *)\n\n(* Variable: mountpoint_kw *)\nlet mountpoint_kw = \"-\" (* do not mount *)\n | \"swap\" (* swap space *)\n (* fully qualified path; if :encrypt is given, the partition\n * will be encrypted, the key is generated automatically *)\n | \/\\\/[^: \\t\\n]*\/\n\n(* Variable: encrypt\n encrypt tag *)\nlet encrypt = tag \"encrypt\"\n\n(* Variable: mountpoint *)\nlet mountpoint = [ label \"mountpoint\" . store mountpoint_kw\n (* encrypt is only for the fspath, but we parse it anyway *)\n . encrypt?]\n\n(* Variable: resize\n resize tag *)\nlet resize = tag \"resize\"\n\n(* Variable: size_kw\n Regexps for size *)\nlet size_kw = \/[0-9]+[kMGTP%]?(-([0-9]+[kMGTP%]?)?)?\/\n | \/-[0-9]+[kMGTP%]?\/\n\n(* Variable: size *)\nlet size = [ label \"size\" . store size_kw . resize? ]\n\n(* Variable: filesystem_kw\n Regexps for filesystem *)\nlet filesystem_kw = \"-\"\n | \"swap\"\n (* NOTE: Restraining this regexp would improve perfs *)\n | (Rx.no_spaces - \"-\" - \"swap\") (* mkfs.xxx must exist *)\n\n(* Variable: filesystem *)\nlet filesystem = [ label \"filesystem\" . store filesystem_kw ]\n\n\n(* Variable: mount_option_value *)\nlet mount_option_value = [ label \"value\" . Util.del_str \"=\"\n . store \/[^,= \\t\\n]+\/ ]\n\n(* Variable: mount_option\n Counting options *)\nlet mount_option = [ seq \"mount_option\"\n . store \/[^,= \\t\\n]+\/\n . mount_option_value? ]\n\n(* Variable: mount_options\n An array of <mount_option>s *)\nlet mount_options = [ label \"mount_options\"\n . counter \"mount_option\"\n . Build.opt_list mount_option Sep.comma ]\n\n(* Variable: fs_option *)\nlet fs_option =\n [ key \/createopts|tuneopts\/\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: fs_options\n An array of <fs_option>s *)\nlet fs_options =\n (* options to append to mkfs.xxx and to the filesystem-specific\n * tuning tool *)\n [ label \"fs_options\" . Build.opt_list fs_option Sep.space ]\n\n(* Variable: volume_full *)\nlet volume_full (type:lens) (third_field:lens) =\n [ type . space\n . mountpoint .space\n (* The third field changes depending on types *)\n . third_field . space\n . filesystem . space\n . mount_options\n . (space . fs_options)? ]\n\n(* Variable: name\n LVM volume group name *)\nlet name = [ label \"name\" . store \/[^\\\/ \\t\\n]+\/ ]\n\n(* Variable: partition\n An optional partition number for <disk> *)\nlet partition = [ label \"partition\" . Util.del_str \".\" . store \/[0-9]+\/ ]\n\n(* Variable: disk *)\nlet disk = [ label \"disk\" . store \/[^\\., \\t\\n]+\/ . partition? ]\n\n(* Variable: vg_option\n An option for <volume_vg> *)\nlet vg_option =\n [ key \"pvcreateopts\"\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: volume_vg *)\nlet volume_vg = [ key \"vg\"\n . space . name\n . space . disk\n . (space . vg_option)? ]\n\n(* Variable: spare_missing *)\nlet spare_missing = tag \/spare|missing\/\n\n(* Variable: disk_with_opt\n A <disk> with a spare\/missing option for raids *)\nlet disk_with_opt = [ label \"disk\" . store \/[^:\\., \\t\\n]+\/ . partition?\n . spare_missing* ]\n\n(* Variable: disk_list\n A list of <disk_with_opt>s *)\nlet disk_list = Build.opt_list disk_with_opt Sep.comma\n\n(* Variable: type_label_lv *)\nlet type_label_lv = label \"lv\"\n . [ label \"vg\" . store (\/[^# \\t\\n-]+\/ - \"raw\") ]\n . Util.del_str \"-\"\n . [ label \"name\" . store \/[^ \\t\\n]+\/ ]\n\n(* Variable: volume_tmpfs *)\nlet volume_tmpfs =\n [ key \"tmpfs\" . space\n . mountpoint .space\n . size . space\n . mount_options\n . (space . fs_options)? ]\n\n(* TODO: assign each volume type to a specific disk_config type *)\n(* Variable: volume_entry\n An <volume> entry *)\nlet volume_entry = volume_full (key \"primary\") size (* for physical disks only *)\n | volume_full (key \"logical\") size (* for physical disks only *)\n | volume_full (key \/raid[0156]\/) disk_list (* raid level *)\n | volume_full (key \"raw-disk\") size\n | volume_full type_label_lv size (* lvm logical volume: vg name and lv name *)\n | volume_vg\n | volume_tmpfs\n\n(* Variable: volume *)\nlet volume = volume_entry . eol\n\n(* Variable: volume_or_comment\n A succesion of <volume>s and <comment>s *)\nlet volume_or_comment =\n volume | (volume . (volume|empty|comment)* . volume)\n\n(* Variable: disk_config_entry *)\nlet disk_config_entry (kw:regexp) (opt:lens) =\n [ key \"disk_config\" . space . store kw\n . (space . opt)* . eol\n . volume_or_comment? ]\n\n(* Variable: lvmoption *)\nlet lvmoption =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/,\\s\\-]+-[^\\\/, \\t\\n-]+)*\/\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt \"preserve_reinstall\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* attempt to resize partitions *)\n | generic_opt \"resize\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: raidoption *)\nlet raidoption =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[0-9]+(,[0-9]+)*\/\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt \"preserve_reinstall\" \/[0-9]+(,[0-9]+)*\/\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: option *)\nlet option =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[0-9]+(,[0-9]+)*\/\n (* preserve partitions -- unless the system is installed\n for the first time *)\n | generic_opt \"preserve_reinstall\" \/[0-9]+(,[0-9]+)*\/\n (* attempt to resize partitions *)\n | generic_opt \"resize\" \/[0-9]+(,[0-9]+)*\/\n (* write a disklabel - default is msdos *)\n | generic_opt \"disklabel\" \/msdos|gpt\/\n (* mark a partition bootable, default is \/ *)\n | generic_opt \"bootable\" Rx.integer\n (* do not assume the disk to be a physical device, use with xen *)\n | [ key \"virtual\" ]\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: disk_config *)\nlet disk_config =\n let other_label = Rx.fspath - \"lvm\" - \"raid\" - \"end\" - \/disk[0-9]+\/ in\n disk_config_entry \"lvm\" lvmoption\n | disk_config_entry \"raid\" raidoption\n | disk_config_entry \"end\" option (* there shouldn't be an option here *)\n | disk_config_entry \/disk[0-9]+\/ option\n | disk_config_entry other_label option\n\n(* Variable: lns\n The disk_config lens *)\nlet lns = (disk_config|comment|empty)*\n\n\n(* let xfm = transform lns Util.stdexcl *)\n","old_contents":"(*\nModule: FAI_DiskConfig\n Parses disk_config files for FAI\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to the FAI wiki where possible:\n http:\/\/wiki.fai-project.org\/wiki\/Setup-storage#New_configuration_file_syntax\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n*)\n\nmodule FAI_DiskConfig =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: space *)\nlet space = Sep.space\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: tag\n A generic tag beginning with a colon *)\nlet tag (re:regexp) = [ Util.del_str \":\" . key re ]\n\n(* Variable: generic_opt\n A generic key\/value option *)\nlet generic_opt (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . store kw ]\n\n\n(************************************************************************\n * Group: RECORDS\n *************************************************************************)\n\n\n(* Group: volume *)\n\n(* Variable: mountpoint_kw *)\nlet mountpoint_kw = \"-\" (* do not mount *)\n | \"swap\" (* swap space *)\n (* fully qualified path; if :encrypt is given, the partition\n * will be encrypted, the key is generated automatically *)\n | \/\\\/[^: \\t\\n]*\/\n\n(* Variable: encrypt\n encrypt tag *)\nlet encrypt = tag \"encrypt\"\n\n(* Variable: mountpoint *)\nlet mountpoint = [ label \"mountpoint\" . store mountpoint_kw\n (* encrypt is only for the fspath, but we parse it anyway *)\n . encrypt?]\n\n(* Variable: resize\n resize tag *)\nlet resize = tag \"resize\"\n\n(* Variable: size_kw\n Regexps for size *)\nlet size_kw = \/[0-9]+[kMGTP%]?(-([0-9]+[kMGTP%]?)?)?\/\n | \/-[0-9]+[kMGTP%]?\/\n\n(* Variable: size *)\nlet size = [ label \"size\" . store size_kw . resize? ]\n\n(* Variable: filesystem_kw\n Regexps for filesystem *)\nlet filesystem_kw = \"-\"\n | \"swap\"\n (* NOTE: Restraining this regexp would improve perfs *)\n | (Rx.no_spaces - \"-\" - \"swap\") (* mkfs.xxx must exist *)\n\n(* Variable: filesystem *)\nlet filesystem = [ label \"filesystem\" . store filesystem_kw ]\n\n\n(* Variable: mount_option_value *)\nlet mount_option_value = [ label \"value\" . Util.del_str \"=\"\n . store \/[^,= \\t\\n]+\/ ]\n\n(* Variable: mount_option\n Counting options *)\nlet mount_option = [ seq \"mount_option\"\n . store \/[^,= \\t\\n]+\/\n . mount_option_value? ]\n\n(* Variable: mount_options\n An array of <mount_option>s *)\nlet mount_options = [ label \"mount_options\"\n . counter \"mount_option\"\n . Build.opt_list mount_option Sep.comma ]\n\n(* Variable: fs_option *)\nlet fs_option =\n [ key \/createopts|tuneopts\/\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: fs_options\n An array of <fs_option>s *)\nlet fs_options =\n (* options to append to mkfs.xxx and to the filesystem-specific\n * tuning tool *)\n [ label \"fs_options\" . Build.opt_list fs_option Sep.space ]\n\n(* Variable: volume_full *)\nlet volume_full (type:lens) (third_field:lens) =\n [ type . space\n . mountpoint .space\n (* The third field changes depending on types *)\n . third_field . space\n . filesystem . space\n . mount_options\n . (space . fs_options)? ]\n\n(* Variable: name\n LVM volume group name *)\nlet name = [ label \"name\" . store \/[^\\\/ \\t\\n]+\/ ]\n\n(* Variable: partition\n An optional partition number for <disk> *)\nlet partition = [ label \"partition\" . Util.del_str \".\" . store \/[0-9]+\/ ]\n\n(* Variable: disk *)\nlet disk = [ label \"disk\" . store \/[^\\., \\t\\n]+\/ . partition? ]\n\n(* Variable: vg_option\n An option for <volume_vg> *)\nlet vg_option =\n [ key \"pvcreateopts\"\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: volume_vg *)\nlet volume_vg = [ key \"vg\"\n . space . name\n . space . disk\n . (space . vg_option)? ]\n\n(* Variable: spare_missing *)\nlet spare_missing = tag \/spare|missing\/\n\n(* Variable: disk_with_opt\n A <disk> with a spare\/missing option for raids *)\nlet disk_with_opt = [ label \"disk\" . store \/[^:\\., \\t\\n]+\/ . partition?\n . spare_missing* ]\n\n(* Variable: disk_list\n A list of <disk_with_opt>s *)\nlet disk_list = Build.opt_list disk_with_opt Sep.comma\n\n(* Variable: type_label_lv *)\nlet type_label_lv = label \"lv\"\n . [ label \"vg\" . store (\/[^# \\t\\n-]+\/ - \"raw\") ]\n . Util.del_str \"-\"\n . [ label \"name\" . store \/[^ \\t\\n]+\/ ]\n\n(* Variable: volume_tmpfs *)\nlet volume_tmpfs =\n [ key \"tmpfs\" . space\n . mountpoint .space\n . size . space\n . mount_options\n . (space . fs_options)? ]\n\n(* TODO: assign each volume type to a specific disk_config type *)\n(* Variable: volume_entry\n An <volume> entry *)\nlet volume_entry = volume_full (key \"primary\") size (* for physical disks only *)\n | volume_full (key \"logical\") size (* for physical disks only *)\n | volume_full (key \/raid[0156]\/) disk_list (* raid level *)\n | volume_full (key \"raw-disk\") size\n | volume_full type_label_lv size (* lvm logical volume: vg name and lv name *)\n | volume_vg\n | volume_tmpfs\n\n(* Variable: volume *)\nlet volume = volume_entry . eol\n\n(* Variable: volume_or_comment\n A succesion of <volume>s and <comment>s *)\nlet volume_or_comment =\n volume | (volume . (volume|empty|comment)* . volume)\n\n(* Variable: disk_config_entry *)\nlet disk_config_entry (kw:regexp) (opt:lens) =\n [ key \"disk_config\" . space . store kw\n . (space . opt)* . eol\n . volume_or_comment? ]\n\n(* Variable: lvmoption *)\nlet lvmoption =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/,\\s\\-]+-[^\\\/, \\t\\n-]+)*\/\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt \"preserve_reinstall\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* attempt to resize partitions *)\n | generic_opt \"resize\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: raidoption *)\nlet raidoption =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[0-9]+(,[0-9]+)*\/\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt \"preserve_reinstall\" \/[0-9]+(,[0-9]+)*\/\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: option *)\nlet option =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[0-9]+(,[0-9]+)*\/\n (* preserve partitions -- unless the system is installed\n for the first time *)\n | generic_opt \"preserve_reinstall\" \/[0-9]+(,[0-9]+)*\/\n (* attempt to resize partitions *)\n | generic_opt \"resize\" \/[0-9]+(,[0-9]+)*\/\n (* write a disklabel - default is msdos *)\n | generic_opt \"disklabel\" \/msdos|gpt\/\n (* mark a partition bootable, default is \/ *)\n | generic_opt \"bootable\" Rx.integer\n (* do not assume the disk to be a physical device, use with xen *)\n | [ key \"virtual\" ]\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: disk_config *)\nlet disk_config =\n let other_label = Rx.fspath - \"lvm\" - \"raid\" - \"end\" - \/disk[0-9]+\/ in\n disk_config_entry \"lvm\" lvmoption\n | disk_config_entry \"raid\" raidoption\n | disk_config_entry \"end\" option (* there shouldn't be an option here *)\n | disk_config_entry \/disk[0-9]+\/ option\n | disk_config_entry other_label option\n\n(* Variable: lns\n The disk_config lens *)\nlet lns = (disk_config|comment|empty)*\n\n\nlet xfm = transform lns Util.stdexcl\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e095ae690ba0b1bd69c525493522ea47653a5964","subject":"Shellvars: exclude non-shell files in tests\/root\/etc\/sysconfig","message":"Shellvars: exclude non-shell files in tests\/root\/etc\/sysconfig\n","repos":"jjlin\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,mchf\/augeas,jtopjian\/augeas,jjlin\/augeas,domcleal\/augeas,ptoscano\/augeas,raphink\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,raphink\/augeas,jasperla\/augeas,pevalme\/augeas,jasperla\/augeas,dafugg\/augeas,kumy\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,domcleal\/augeas,mchf\/augeas,kumy\/augeas,ptoscano\/augeas,jjlin\/augeas,kumy\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,dafugg\/augeas,lutter\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,lutter\/augeas,domcleal\/augeas,kumy\/augeas,pevalme\/augeas,manandbytes\/augeas,manandbytes\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"kernel\" .\n sc_excl \"ip*tables\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"874a86c3c35e9cff46e676293e1ba4b35649f8c8","subject":"Support configuration file for Squid 3","message":"Support configuration file for Squid 3\n","repos":"mchf\/augeas,jasperla\/augeas,ptoscano\/augeas,jtopjian\/augeas,dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,kunkku\/augeas,hercules-team\/augeas,manandbytes\/augeas,raphink\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,ptoscano\/augeas,pevalme\/augeas,pevalme\/augeas,ptoscano\/augeas,dafugg\/augeas,lutter\/augeas,manandbytes\/augeas,mlichvar\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,jjlin\/augeas,MikaelSmith\/augeas,mchf\/augeas,jjlin\/augeas,hercules-team\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,lutter\/augeas,mlichvar\/augeas,kunkku\/augeas,raphink\/augeas,lutter\/augeas","old_file":"lenses\/squid.aug","new_file":"lenses\/squid.aug","new_contents":"(* Squid module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: the self-documented default squid.conf file\n\n*)\n\nmodule Squid =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet indent = Util.indent\n\nlet word = \/[A-Za-z0-9!_.-]+(\\[[0-9]+\\])?\/\nlet sto_to_spc = store \/[^# \\t\\n]+\/\nlet sto_to_eol = store \/([^# \\t\\n][^#\\n]*[^# \\t\\n])|[^# \\t\\n]\/\n\nlet comment = Util.comment\nlet empty = Util.empty\nlet comment_or_eol = Util.comment_or_eol\nlet value (kw:string)\n = [ spc . label kw . sto_to_spc ]\n\nlet value_space_in (kw:string)\n = [ spc . label kw . sto_to_eol ]\n\nlet parameters = [ label \"parameters\"\n . counter \"parameters\"\n . [ spc . seq \"parameters\" . sto_to_spc ]+ ]\n\n(************************************************************************\n * SPACEVARS SETTINGS\n *************************************************************************)\n\nlet entry_re = \"accept_filter\"\n | \"access_log\"\n | \"acl_uses_indirect_client\"\n | \"adaptation_access\"\n | \"adaptation_service_set\"\n | \"allow_underscore\"\n | \"always_direct\"\n | \"announce_file\"\n | \"announce_host\"\n | \"announce_period\"\n | \"announce_port\"\n | \"append_domain\"\n | \"as_whois_server\"\n | \"authenticate_cache_garbage_interval\"\n | \"authenticate_ip_shortcircuit_access\"\n | \"authenticate_ip_shortcircuit_ttl\"\n | \"authenticate_ip_ttl\"\n | \"authenticate_ttl\"\n | \"background_ping_rate\"\n | \"balance_on_multiple_ip\"\n | \"broken_posts\"\n | \"buffered_logs\"\n | \"cache\"\n | \"cache_dir\"\n | \"cache_dns_program\"\n | \"cache_effective_group\"\n | \"cache_effective_user\"\n | \"cache_log\"\n | \"cache_mem\"\n | \"cache_mgr\"\n | \"cachemgr_passwd\"\n | \"cache_peer\"\n | \"cache_peer_access\"\n | \"cache_peer_domain\"\n | \"cache_replacement_policy\"\n | \"cache_store_log\"\n | \"cache_swap_high\"\n | \"cache_swap_low\"\n | \"cache_swap_state\"\n | \"cache_vary\"\n | \"check_hostnames\"\n | \"chroot\"\n | \"client_db\"\n | \"client_lifetime\"\n | \"client_netmask\"\n | \"client_persistent_connections\"\n | \"clientside_tos\"\n | \"collapsed_forwarding\"\n | \"connect_timeout\"\n | \"coredump_dir\"\n | \"dead_peer_timeout\"\n | \"debug_options\"\n | \"delay_access\"\n | \"delay_class\"\n | \"delay_initial_bucket_level\"\n | \"delay_parameters\"\n | \"delay_pools\"\n | \"delay_pool_uses_indirect_client\"\n | \"deny_info\"\n | \"detect_broken_pconn\"\n | \"digest_bits_per_entry\"\n | \"digest_generation\"\n | \"digest_rebuild_chunk_percentage\"\n | \"digest_rebuild_period\"\n | \"digest_rewrite_period\"\n | \"digest_swapout_chunk_size\"\n | \"diskd_program\"\n | \"dns_children\"\n | \"dns_defnames\"\n | \"dns_nameservers\"\n | \"dns_retransmit_interval\"\n | \"dns_testnames\"\n | \"dns_timeout\"\n | \"dns_v4_fallback\"\n | \"ecap_enable\"\n | \"ecap_service\"\n | \"email_err_data\"\n | \"emulate_httpd_log\"\n | \"err_html_text\"\n | \"error_default_language\"\n | \"error_directory\"\n | \"error_log_languages\"\n | \"error_map\"\n | \"err_page_stylesheet\"\n | \"esi_parser\"\n | \"external_acl_type\"\n | \"external_refresh_check\"\n | \"follow_x_forwarded_for\"\n | \"forwarded_for\"\n | \"forward_log\"\n | \"forward_timeout\"\n | \"fqdncache_size\"\n | \"ftp_epsv_all\"\n | \"ftp_list_width\"\n | \"ftp_passive\"\n | \"ftp_sanitycheck\"\n | \"ftp_telnet_protocol\"\n | \"ftp_user\"\n | \"global_internal_static\"\n | \"half_closed_clients\"\n | \"header_access\"\n | \"header_replace\"\n | \"hierarchy_stoplist\"\n | \"high_memory_warning\"\n | \"high_page_fault_warning\"\n | \"high_response_time_warning\"\n | \"hostname_aliases\"\n | \"hosts_file\"\n | \"htcp_access\"\n | \"htcp_clr_access\"\n | \"htcp_port\"\n | \"http_accel_surrogate_remote\"\n | \"http_access2\"\n | \"httpd_accel_no_pmtu_disc\"\n | \"httpd_accel_surrogate_id\"\n | \"httpd_suppress_version_string\"\n | \"http_port\"\n | \"http_reply_access\"\n | \"https_port\"\n | \"icap_access\"\n | \"icap_class\"\n | \"icap_client_username_encode\"\n | \"icap_client_username_header\"\n | \"icap_connect_timeout\"\n | \"icap_default_options_ttl\"\n | \"icap_enable\"\n | \"icap_io_timeout\"\n | \"icap_persistent_connections\"\n | \"icap_preview_enable\"\n | \"icap_preview_size\"\n | \"icap_send_client_ip\"\n | \"icap_send_client_username\"\n | \"icap_service\"\n | \"icap_service_failure_limit\"\n | \"icap_service_revival_delay\"\n | \"icon_directory\"\n | \"icp_access\"\n | \"icp_hit_stale\"\n | \"icp_port\"\n | \"icp_query_timeout\"\n | \"ident_lookup_access\"\n | \"ident_timeout\"\n | \"ie_refresh\"\n | \"ignore_expect_100\"\n | \"ignore_ims_on_miss\"\n | \"ignore_unknown_nameservers\"\n | \"incoming_dns_average\"\n | \"incoming_http_average\"\n | \"incoming_icp_average\"\n | \"incoming_rate\"\n | \"ipcache_high\"\n | \"ipcache_low\"\n | \"ipcache_size\"\n | \"loadable_modules\"\n | \"location_rewrite_access\"\n | \"location_rewrite_children\"\n | \"location_rewrite_concurrency\"\n | \"location_rewrite_program\"\n | \"log_access\"\n | \"logfile_daemon\"\n | \"logfile_rotate\"\n | \"logformat\"\n | \"log_fqdn\"\n | \"log_icp_queries\"\n | \"log_ip_on_direct\"\n | \"log_mime_hdrs\"\n | \"log_uses_indirect_client\"\n | \"mail_from\"\n | \"mail_program\"\n | \"max_filedescriptors\"\n | \"maximum_icp_query_timeout\"\n | \"maximum_object_size\"\n | \"maximum_object_size_in_memory\"\n | \"maximum_single_addr_tries\"\n | \"max_open_disk_fds\"\n | \"max_stale\"\n | \"mcast_groups\"\n | \"mcast_icp_query_timeout\"\n | \"mcast_miss_addr\"\n | \"mcast_miss_encode_key\"\n | \"mcast_miss_port\"\n | \"mcast_miss_ttl\"\n | \"memory_pools\"\n | \"memory_pools_limit\"\n | \"memory_replacement_policy\"\n | \"mime_table\"\n | \"min_dns_poll_cnt\"\n | \"min_http_poll_cnt\"\n | \"min_icp_poll_cnt\"\n | \"minimum_direct_hops\"\n | \"minimum_direct_rtt\"\n | \"minimum_expiry_time\"\n | \"minimum_icp_query_timeout\"\n | \"minimum_object_size\"\n | \"miss_access\"\n | \"negative_dns_ttl\"\n | \"negative_ttl\"\n | \"neighbor_type_domain\"\n | \"netdb_filename\"\n | \"netdb_high\"\n | \"netdb_low\"\n | \"netdb_ping_period\"\n | \"never_direct\"\n | \"no_cache\"\n | \"nonhierarchical_direct\"\n | \"offline_mode\"\n | \"pconn_timeout\"\n | \"peer_connect_timeout\"\n | \"persistent_connection_after_error\"\n | \"persistent_request_timeout\"\n | \"pid_filename\"\n | \"pinger_enable\"\n | \"pinger_program\"\n | \"pipeline_prefetch\"\n | \"positive_dns_ttl\"\n | \"prefer_direct\"\n | \"qos_flows\"\n | \"query_icmp\"\n | \"quick_abort_max\"\n | \"quick_abort_min\"\n | \"quick_abort_pct\"\n | \"range_offset_limit\"\n | \"read_ahead_gap\"\n | \"read_timeout\"\n | \"redirector_bypass\"\n | \"referer_log\"\n | \"refresh_all_ims\"\n | \"refresh_stale_hit\"\n | \"relaxed_header_parser\"\n | \"reload_into_ims\"\n | \"reply_body_max_size\"\n | \"reply_header_access\"\n | \"reply_header_max_size\"\n | \"request_body_max_size\"\n | \"request_entities\"\n | \"request_header_access\"\n | \"request_header_max_size\"\n | \"request_timeout\"\n | \"retry_on_error\"\n | \"server_http11\"\n | \"server_persistent_connections\"\n | \"short_icon_urls\"\n | \"shutdown_lifetime\"\n | \"sleep_after_fork\"\n | \"snmp_access\"\n | \"snmp_incoming_address\"\n | \"snmp_outgoing_address\"\n | \"snmp_port\"\n | \"ssl_bump\"\n | \"ssl_engine\"\n | \"sslpassword_program\"\n | \"sslproxy_cafile\"\n | \"sslproxy_capath\"\n | \"sslproxy_cert_error\"\n | \"sslproxy_cipher\"\n | \"sslproxy_client_certificate\"\n | \"sslproxy_client_key\"\n | \"sslproxy_flags\"\n | \"sslproxy_options\"\n | \"sslproxy_version\"\n | \"ssl_unclean_shutdown\"\n | \"store_avg_object_size\"\n | \"store_dir_select_algorithm\"\n | \"store_objects_per_bucket\"\n | \"storeurl_access\"\n | \"storeurl_rewrite_children\"\n | \"storeurl_rewrite_concurrency\"\n | \"storeurl_rewrite_program\"\n | \"strip_query_terms\"\n | \"tcp_outgoing_address\"\n | \"tcp_outgoing_tos\"\n | \"tcp_recv_bufsize\"\n | \"test_reachability\"\n | \"udp_incoming_address\"\n | \"udp_outgoing_address\"\n | \"umask\"\n | \"unique_hostname\"\n | \"unlinkd_program\"\n | \"update_headers\"\n | \"uri_whitespace\"\n | \"url_rewrite_access\"\n | \"url_rewrite_bypass\"\n | \"url_rewrite_children\"\n | \"url_rewrite_concurrency\"\n | \"url_rewrite_host_header\"\n | \"url_rewrite_program\"\n | \"useragent_log\"\n | \"vary_ignore_expire\"\n | \"via\"\n | \"visible_hostname\"\n | \"wccp2_address\"\n | \"wccp2_assignment_method\"\n | \"wccp2_forwarding_method\"\n | \"wccp2_rebuild_wait\"\n | \"wccp2_return_method\"\n | \"wccp2_router\"\n | \"wccp2_service\"\n | \"wccp2_service_info\"\n | \"wccp2_weight\"\n | \"wccp_address\"\n | \"wccp_router\"\n | \"wccp_version\"\n | \"windows_ipaddrchangemonitor\"\n | \"zero_buffers\"\n | \"zph_local\"\n | \"zph_mode\"\n | \"zph_option\"\n | \"zph_parent\"\n | \"zph_sibling\"\n\nlet entry = indent . (Build.key_ws_value entry_re)\n\n(************************************************************************\n * AUTH\n *************************************************************************)\n\nlet auth_re = \"auth_param\"\nlet auth = indent\n . [ key \"auth_param\"\n . value \"scheme\"\n . value \"parameter\"\n . (value_space_in \"setting\") ?\n . comment_or_eol ]\n\n(************************************************************************\n * ACL\n *************************************************************************)\n\nlet acl_re = \"acl\"\nlet acl = indent\n . [ key acl_re . spc\n . [ key word\n . value \"type\"\n . value \"setting\"\n . parameters?\n . comment_or_eol ] ]\n\n(************************************************************************\n * HTTP ACCESS\n *************************************************************************)\n\nlet http_access_re\n = \"http_access\"\n | \"upgrade_http0.9\"\n | \"broken_vary_encoding\"\n\nlet http_access\n = indent\n . [ key http_access_re\n . spc\n . [ key \/allow|deny\/\n . spc\n . sto_to_spc\n . parameters? ]\n . comment_or_eol ]\n\n(************************************************************************\n * REFRESH PATTERN\n *************************************************************************)\n\nlet refresh_pattern_option_re = \"override-expire\"\n\t\t | \"override-lastmod\"\n\t\t | \"reload-into-ims\"\n\t\t | \"ignore-reload\"\n\t\t | \"ignore-no-cache\"\n\t\t | \"ignore-no-store\"\n\t\t | \"ignore-must-revalidate\"\n\t\t | \"ignore-private\"\n\t\t | \"ignore-auth\"\n\t\t | \"refresh-ims\"\n\t\t | \"store-stale\"\n\nlet refresh_pattern = indent . [ key \"refresh_pattern\" . spc\n . [ label \"case_insensitive\" . Util.del_str \"-i\" . spc ]?\n . store \/[^ \\t\\n]+\/ . spc\n . [ label \"min\" . store Rx.integer ] . spc\n . [ label \"percent\" . store Rx.integer . Util.del_str \"%\" ] . spc\n . [ label \"max\" . store Rx.integer ]\n . (spc . Build.opt_list [ label \"option\" . store refresh_pattern_option_re ] spc)?\n . comment_or_eol ]\n\n(************************************************************************\n * EXTENSION METHODS\n *************************************************************************)\n\nlet extension_methods = indent . [ key \"extension_methods\" . spc\n . Build.opt_list [ seq \"extension_method\" . store Rx.word ] spc\n . comment_or_eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry|auth|acl|http_access|refresh_pattern|extension_methods)*\n\nlet filter = incl \"\/etc\/squid\/squid.conf\"\n . incl \"\/etc\/squid3\/squid.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Squid module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: the self-documented default squid.conf file\n\n*)\n\nmodule Squid =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet indent = Util.indent\n\nlet word = \/[A-Za-z0-9!_.-]+(\\[[0-9]+\\])?\/\nlet sto_to_spc = store \/[^# \\t\\n]+\/\nlet sto_to_eol = store \/([^# \\t\\n][^#\\n]*[^# \\t\\n])|[^# \\t\\n]\/\n\nlet comment = Util.comment\nlet empty = Util.empty\nlet comment_or_eol = Util.comment_or_eol\nlet value (kw:string)\n = [ spc . label kw . sto_to_spc ]\n\nlet value_space_in (kw:string)\n = [ spc . label kw . sto_to_eol ]\n\nlet parameters = [ label \"parameters\"\n . counter \"parameters\"\n . [ spc . seq \"parameters\" . sto_to_spc ]+ ]\n\n(************************************************************************\n * SPACEVARS SETTINGS\n *************************************************************************)\n\nlet entry_re = \"accept_filter\"\n | \"access_log\"\n | \"acl_uses_indirect_client\"\n | \"adaptation_access\"\n | \"adaptation_service_set\"\n | \"allow_underscore\"\n | \"always_direct\"\n | \"announce_file\"\n | \"announce_host\"\n | \"announce_period\"\n | \"announce_port\"\n | \"append_domain\"\n | \"as_whois_server\"\n | \"authenticate_cache_garbage_interval\"\n | \"authenticate_ip_shortcircuit_access\"\n | \"authenticate_ip_shortcircuit_ttl\"\n | \"authenticate_ip_ttl\"\n | \"authenticate_ttl\"\n | \"background_ping_rate\"\n | \"balance_on_multiple_ip\"\n | \"broken_posts\"\n | \"buffered_logs\"\n | \"cache\"\n | \"cache_dir\"\n | \"cache_dns_program\"\n | \"cache_effective_group\"\n | \"cache_effective_user\"\n | \"cache_log\"\n | \"cache_mem\"\n | \"cache_mgr\"\n | \"cachemgr_passwd\"\n | \"cache_peer\"\n | \"cache_peer_access\"\n | \"cache_peer_domain\"\n | \"cache_replacement_policy\"\n | \"cache_store_log\"\n | \"cache_swap_high\"\n | \"cache_swap_low\"\n | \"cache_swap_state\"\n | \"cache_vary\"\n | \"check_hostnames\"\n | \"chroot\"\n | \"client_db\"\n | \"client_lifetime\"\n | \"client_netmask\"\n | \"client_persistent_connections\"\n | \"clientside_tos\"\n | \"collapsed_forwarding\"\n | \"connect_timeout\"\n | \"coredump_dir\"\n | \"dead_peer_timeout\"\n | \"debug_options\"\n | \"delay_access\"\n | \"delay_class\"\n | \"delay_initial_bucket_level\"\n | \"delay_parameters\"\n | \"delay_pools\"\n | \"delay_pool_uses_indirect_client\"\n | \"deny_info\"\n | \"detect_broken_pconn\"\n | \"digest_bits_per_entry\"\n | \"digest_generation\"\n | \"digest_rebuild_chunk_percentage\"\n | \"digest_rebuild_period\"\n | \"digest_rewrite_period\"\n | \"digest_swapout_chunk_size\"\n | \"diskd_program\"\n | \"dns_children\"\n | \"dns_defnames\"\n | \"dns_nameservers\"\n | \"dns_retransmit_interval\"\n | \"dns_testnames\"\n | \"dns_timeout\"\n | \"dns_v4_fallback\"\n | \"ecap_enable\"\n | \"ecap_service\"\n | \"email_err_data\"\n | \"emulate_httpd_log\"\n | \"err_html_text\"\n | \"error_default_language\"\n | \"error_directory\"\n | \"error_log_languages\"\n | \"error_map\"\n | \"err_page_stylesheet\"\n | \"esi_parser\"\n | \"external_acl_type\"\n | \"external_refresh_check\"\n | \"follow_x_forwarded_for\"\n | \"forwarded_for\"\n | \"forward_log\"\n | \"forward_timeout\"\n | \"fqdncache_size\"\n | \"ftp_epsv_all\"\n | \"ftp_list_width\"\n | \"ftp_passive\"\n | \"ftp_sanitycheck\"\n | \"ftp_telnet_protocol\"\n | \"ftp_user\"\n | \"global_internal_static\"\n | \"half_closed_clients\"\n | \"header_access\"\n | \"header_replace\"\n | \"hierarchy_stoplist\"\n | \"high_memory_warning\"\n | \"high_page_fault_warning\"\n | \"high_response_time_warning\"\n | \"hostname_aliases\"\n | \"hosts_file\"\n | \"htcp_access\"\n | \"htcp_clr_access\"\n | \"htcp_port\"\n | \"http_accel_surrogate_remote\"\n | \"http_access2\"\n | \"httpd_accel_no_pmtu_disc\"\n | \"httpd_accel_surrogate_id\"\n | \"httpd_suppress_version_string\"\n | \"http_port\"\n | \"http_reply_access\"\n | \"https_port\"\n | \"icap_access\"\n | \"icap_class\"\n | \"icap_client_username_encode\"\n | \"icap_client_username_header\"\n | \"icap_connect_timeout\"\n | \"icap_default_options_ttl\"\n | \"icap_enable\"\n | \"icap_io_timeout\"\n | \"icap_persistent_connections\"\n | \"icap_preview_enable\"\n | \"icap_preview_size\"\n | \"icap_send_client_ip\"\n | \"icap_send_client_username\"\n | \"icap_service\"\n | \"icap_service_failure_limit\"\n | \"icap_service_revival_delay\"\n | \"icon_directory\"\n | \"icp_access\"\n | \"icp_hit_stale\"\n | \"icp_port\"\n | \"icp_query_timeout\"\n | \"ident_lookup_access\"\n | \"ident_timeout\"\n | \"ie_refresh\"\n | \"ignore_expect_100\"\n | \"ignore_ims_on_miss\"\n | \"ignore_unknown_nameservers\"\n | \"incoming_dns_average\"\n | \"incoming_http_average\"\n | \"incoming_icp_average\"\n | \"incoming_rate\"\n | \"ipcache_high\"\n | \"ipcache_low\"\n | \"ipcache_size\"\n | \"loadable_modules\"\n | \"location_rewrite_access\"\n | \"location_rewrite_children\"\n | \"location_rewrite_concurrency\"\n | \"location_rewrite_program\"\n | \"log_access\"\n | \"logfile_daemon\"\n | \"logfile_rotate\"\n | \"logformat\"\n | \"log_fqdn\"\n | \"log_icp_queries\"\n | \"log_ip_on_direct\"\n | \"log_mime_hdrs\"\n | \"log_uses_indirect_client\"\n | \"mail_from\"\n | \"mail_program\"\n | \"max_filedescriptors\"\n | \"maximum_icp_query_timeout\"\n | \"maximum_object_size\"\n | \"maximum_object_size_in_memory\"\n | \"maximum_single_addr_tries\"\n | \"max_open_disk_fds\"\n | \"max_stale\"\n | \"mcast_groups\"\n | \"mcast_icp_query_timeout\"\n | \"mcast_miss_addr\"\n | \"mcast_miss_encode_key\"\n | \"mcast_miss_port\"\n | \"mcast_miss_ttl\"\n | \"memory_pools\"\n | \"memory_pools_limit\"\n | \"memory_replacement_policy\"\n | \"mime_table\"\n | \"min_dns_poll_cnt\"\n | \"min_http_poll_cnt\"\n | \"min_icp_poll_cnt\"\n | \"minimum_direct_hops\"\n | \"minimum_direct_rtt\"\n | \"minimum_expiry_time\"\n | \"minimum_icp_query_timeout\"\n | \"minimum_object_size\"\n | \"miss_access\"\n | \"negative_dns_ttl\"\n | \"negative_ttl\"\n | \"neighbor_type_domain\"\n | \"netdb_filename\"\n | \"netdb_high\"\n | \"netdb_low\"\n | \"netdb_ping_period\"\n | \"never_direct\"\n | \"no_cache\"\n | \"nonhierarchical_direct\"\n | \"offline_mode\"\n | \"pconn_timeout\"\n | \"peer_connect_timeout\"\n | \"persistent_connection_after_error\"\n | \"persistent_request_timeout\"\n | \"pid_filename\"\n | \"pinger_enable\"\n | \"pinger_program\"\n | \"pipeline_prefetch\"\n | \"positive_dns_ttl\"\n | \"prefer_direct\"\n | \"qos_flows\"\n | \"query_icmp\"\n | \"quick_abort_max\"\n | \"quick_abort_min\"\n | \"quick_abort_pct\"\n | \"range_offset_limit\"\n | \"read_ahead_gap\"\n | \"read_timeout\"\n | \"redirector_bypass\"\n | \"referer_log\"\n | \"refresh_all_ims\"\n | \"refresh_stale_hit\"\n | \"relaxed_header_parser\"\n | \"reload_into_ims\"\n | \"reply_body_max_size\"\n | \"reply_header_access\"\n | \"reply_header_max_size\"\n | \"request_body_max_size\"\n | \"request_entities\"\n | \"request_header_access\"\n | \"request_header_max_size\"\n | \"request_timeout\"\n | \"retry_on_error\"\n | \"server_http11\"\n | \"server_persistent_connections\"\n | \"short_icon_urls\"\n | \"shutdown_lifetime\"\n | \"sleep_after_fork\"\n | \"snmp_access\"\n | \"snmp_incoming_address\"\n | \"snmp_outgoing_address\"\n | \"snmp_port\"\n | \"ssl_bump\"\n | \"ssl_engine\"\n | \"sslpassword_program\"\n | \"sslproxy_cafile\"\n | \"sslproxy_capath\"\n | \"sslproxy_cert_error\"\n | \"sslproxy_cipher\"\n | \"sslproxy_client_certificate\"\n | \"sslproxy_client_key\"\n | \"sslproxy_flags\"\n | \"sslproxy_options\"\n | \"sslproxy_version\"\n | \"ssl_unclean_shutdown\"\n | \"store_avg_object_size\"\n | \"store_dir_select_algorithm\"\n | \"store_objects_per_bucket\"\n | \"storeurl_access\"\n | \"storeurl_rewrite_children\"\n | \"storeurl_rewrite_concurrency\"\n | \"storeurl_rewrite_program\"\n | \"strip_query_terms\"\n | \"tcp_outgoing_address\"\n | \"tcp_outgoing_tos\"\n | \"tcp_recv_bufsize\"\n | \"test_reachability\"\n | \"udp_incoming_address\"\n | \"udp_outgoing_address\"\n | \"umask\"\n | \"unique_hostname\"\n | \"unlinkd_program\"\n | \"update_headers\"\n | \"uri_whitespace\"\n | \"url_rewrite_access\"\n | \"url_rewrite_bypass\"\n | \"url_rewrite_children\"\n | \"url_rewrite_concurrency\"\n | \"url_rewrite_host_header\"\n | \"url_rewrite_program\"\n | \"useragent_log\"\n | \"vary_ignore_expire\"\n | \"via\"\n | \"visible_hostname\"\n | \"wccp2_address\"\n | \"wccp2_assignment_method\"\n | \"wccp2_forwarding_method\"\n | \"wccp2_rebuild_wait\"\n | \"wccp2_return_method\"\n | \"wccp2_router\"\n | \"wccp2_service\"\n | \"wccp2_service_info\"\n | \"wccp2_weight\"\n | \"wccp_address\"\n | \"wccp_router\"\n | \"wccp_version\"\n | \"windows_ipaddrchangemonitor\"\n | \"zero_buffers\"\n | \"zph_local\"\n | \"zph_mode\"\n | \"zph_option\"\n | \"zph_parent\"\n | \"zph_sibling\"\n\nlet entry = indent . (Build.key_ws_value entry_re)\n\n(************************************************************************\n * AUTH\n *************************************************************************)\n\nlet auth_re = \"auth_param\"\nlet auth = indent\n . [ key \"auth_param\"\n . value \"scheme\"\n . value \"parameter\"\n . (value_space_in \"setting\") ?\n . comment_or_eol ]\n\n(************************************************************************\n * ACL\n *************************************************************************)\n\nlet acl_re = \"acl\"\nlet acl = indent\n . [ key acl_re . spc\n . [ key word\n . value \"type\"\n . value \"setting\"\n . parameters?\n . comment_or_eol ] ]\n\n(************************************************************************\n * HTTP ACCESS\n *************************************************************************)\n\nlet http_access_re\n = \"http_access\"\n | \"upgrade_http0.9\"\n | \"broken_vary_encoding\"\n\nlet http_access\n = indent\n . [ key http_access_re\n . spc\n . [ key \/allow|deny\/\n . spc\n . sto_to_spc\n . parameters? ]\n . comment_or_eol ]\n\n(************************************************************************\n * REFRESH PATTERN\n *************************************************************************)\n\nlet refresh_pattern_option_re = \"override-expire\"\n\t\t | \"override-lastmod\"\n\t\t | \"reload-into-ims\"\n\t\t | \"ignore-reload\"\n\t\t | \"ignore-no-cache\"\n\t\t | \"ignore-no-store\"\n\t\t | \"ignore-must-revalidate\"\n\t\t | \"ignore-private\"\n\t\t | \"ignore-auth\"\n\t\t | \"refresh-ims\"\n\t\t | \"store-stale\"\n\nlet refresh_pattern = indent . [ key \"refresh_pattern\" . spc\n . [ label \"case_insensitive\" . Util.del_str \"-i\" . spc ]?\n . store \/[^ \\t\\n]+\/ . spc\n . [ label \"min\" . store Rx.integer ] . spc\n . [ label \"percent\" . store Rx.integer . Util.del_str \"%\" ] . spc\n . [ label \"max\" . store Rx.integer ]\n . (spc . Build.opt_list [ label \"option\" . store refresh_pattern_option_re ] spc)?\n . comment_or_eol ]\n\n(************************************************************************\n * EXTENSION METHODS\n *************************************************************************)\n\nlet extension_methods = indent . [ key \"extension_methods\" . spc\n . Build.opt_list [ seq \"extension_method\" . store Rx.word ] spc\n . comment_or_eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry|auth|acl|http_access|refresh_pattern|extension_methods)*\n\nlet filter = incl \"\/etc\/squid\/squid.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2afc78848c67f106c285fa90770d6a47c6e21b66","subject":"Add big WARNING to aptconf.aug","message":"Add big WARNING to aptconf.aug\n","repos":"domcleal\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mlichvar\/augeas,jtopjian\/augeas,dafugg\/augeas,pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,dafugg\/augeas,lutter\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,mchf\/augeas,jasperla\/augeas,hercules-team\/augeas,raphink\/augeas,lutter\/augeas,jtopjian\/augeas,raphink\/augeas,domcleal\/augeas,jjlin\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kumy\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kunkku\/augeas,jasperla\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas,domcleal\/augeas,ptoscano\/augeas,pevalme\/augeas,jjlin\/augeas","old_file":"lenses\/aptconf.aug","new_file":"lenses\/aptconf.aug","new_contents":"(*\nModule: AptConf\n Parses \/etc\/apt\/apt.conf and \/etc\/apt\/apt.conf.d\/*\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 apt.conf`\nwhere possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/apt\/apt.conf and \/etc\/apt\/apt.conf.d\/*.\nSee <filter>.\n*)\n\n\nmodule AptConf =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: eol\n And <Util.eol> end of line *)\nlet eol = Util.eol\n\n(* View: empty\n A C-style empty line *)\nlet empty = Util.empty_c_style\n\n(* View: indent\n An indentation *)\nlet indent = Util.indent\n\n(* View: comment_simple\n A one-line comment, C-style *)\nlet comment_simple = Util.comment_c_style\n\n(* View: comment_multi\n A multiline comment, C-style *)\nlet comment_multi = Util.comment_multiline\n\n(* View: comment\n A comment, either <comment_simple> or <comment_multi> *)\nlet comment = comment_simple | comment_multi\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n(* View: name_re\n Regex for entry names *)\nlet name_re = \/[A-Za-z][A-Za-z-]*\/\n\n(* View: name_re_colons\n Regex for entry names with colons *)\nlet name_re_colons = \/[A-Za-z][A-Za-z:-]*\/\n\n\n(* View: entry\n An apt.conf entry, recursive\n\n WARNING:\n This lens exploits a put ambiguity\n since apt.conf allows for both\n APT { Clean-Installed { \"true\" } }\n and APT::Clean-Installed \"true\";\n but we're chosing to map them the same way\n\n The recursive lens doesn't seem\n to care and defaults to the first\n item in the union.\n\n This is why the APT { Clean-Installed { \"true\"; } }\n form is listed first, since it supports\n all subnodes (which Dpkg::Conf) doesn't.\n\n Exchanging these two expressions in the union\n makes tests fails since the tree cannot\n be mapped back.\n\n This situation results in existing\n configuration being modified when the\n associated tree is modified. For example,\n changing the value of\n APT::Clean-Installed \"true\"; to \"false\"\n results in\n APT { Clean-Installed \"false\"; }\n (see unit tests)\n *)\nlet rec entry_noeol =\n let value =\n Util.del_str \"\\\"\" . store \/[^\"\\n]+\/\n . del \/\";?\/ \"\\\";\" in\n let opt_eol = del \/[ \\t\\n]*\/ \"\\n\" in\n let long_eol = del \/[ \\t]*\\n+\/ \"\\n\" in\n let list_elem = [ opt_eol . label \"@elem\" . value ] in\n let eol_comment = del \/([ \\t\\n]*\\n)?\/ \"\" . comment in\n [ key name_re . Sep.space . value ]\n | [ key name_re . del \/[ \\t\\n]*\\{\/ \" {\" .\n ( (opt_eol . entry_noeol) |\n list_elem |\n eol_comment\n )* .\n del \/[ \\t\\n]*\\};?\/ \"\\n};\" ]\n | [ key name_re . Util.del_str \"::\" . entry_noeol ]\n\nlet entry = indent . entry_noeol . eol\n\n\n(* View: include\n A file inclusion\n \/!\\ The manpage is not clear on the syntax *)\nlet include =\n [ indent . key \"#include\" . Sep.space\n . store Rx.fspath . eol ]\n\n\n(* View: clear\n A list of variables to clear\n \/!\\ The manpage is not clear on the syntax *)\nlet clear =\n let name = [ label \"name\" . store name_re_colons ] in\n [ indent . key \"#clear\" . Sep.space\n . Build.opt_list name Sep.space\n . eol ]\n\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns\n The apt.conf lens *)\nlet lns = (empty|comment|entry|include|clear)*\n\n\n(* View: filter *)\nlet filter = incl \"\/etc\/apt\/apt.conf\"\n . incl \"\/etc\/apt\/apt.conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: AptConf\n Parses \/etc\/apt\/apt.conf and \/etc\/apt\/apt.conf.d\/*\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 apt.conf`\nwhere possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/apt\/apt.conf and \/etc\/apt\/apt.conf.d\/*.\nSee <filter>.\n*)\n\n\nmodule AptConf =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: eol\n And <Util.eol> end of line *)\nlet eol = Util.eol\n\n(* View: empty\n A C-style empty line *)\nlet empty = Util.empty_c_style\n\n(* View: indent\n An indentation *)\nlet indent = Util.indent\n\n(* View: comment_simple\n A one-line comment, C-style *)\nlet comment_simple = Util.comment_c_style\n\n(* View: comment_multi\n A multiline comment, C-style *)\nlet comment_multi = Util.comment_multiline\n\n(* View: comment\n A comment, either <comment_simple> or <comment_multi> *)\nlet comment = comment_simple | comment_multi\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n(* View: name_re\n Regex for entry names *)\nlet name_re = \/[A-Za-z][A-Za-z-]*\/\n\n(* View: name_re_colons\n Regex for entry names with colons *)\nlet name_re_colons = \/[A-Za-z][A-Za-z:-]*\/\n\n\n(* View: entry\n An apt.conf entry, recursive *)\nlet rec entry_noeol =\n let value =\n Util.del_str \"\\\"\" . store \/[^\"\\n]+\/\n . del \/\";?\/ \"\\\";\" in\n let opt_eol = del \/[ \\t\\n]*\/ \"\\n\" in\n let long_eol = del \/[ \\t]*\\n+\/ \"\\n\" in\n let list_elem = [ opt_eol . label \"@elem\" . value ] in\n let eol_comment = del \/([ \\t\\n]*\\n)?\/ \"\" . comment in\n [ key name_re . Sep.space . value ]\n | [ key name_re . del \/[ \\t\\n]*\\{\/ \" {\" .\n ( (opt_eol . entry_noeol) |\n list_elem |\n eol_comment\n )* .\n del \/[ \\t\\n]*\\};?\/ \"\\n};\" ]\n | [ key name_re . Util.del_str \"::\" . entry_noeol ]\n\nlet entry = indent . entry_noeol . eol\n\n\n(* View: include\n A file inclusion\n \/!\\ The manpage is not clear on the syntax *)\nlet include =\n [ indent . key \"#include\" . Sep.space\n . store Rx.fspath . eol ]\n\n\n(* View: clear\n A list of variables to clear\n \/!\\ The manpage is not clear on the syntax *)\nlet clear =\n let name = [ label \"name\" . store name_re_colons ] in\n [ indent . key \"#clear\" . Sep.space\n . Build.opt_list name Sep.space\n . eol ]\n\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns\n The apt.conf lens *)\nlet lns = (empty|comment|entry|include|clear)*\n\n\n(* View: filter *)\nlet filter = incl \"\/etc\/apt\/apt.conf\"\n . incl \"\/etc\/apt\/apt.conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5d2fd6501d9cf41522cc7a2898aaab74df958af6","subject":"augeas-lens: added all RCODEs according to RFC6895","message":"augeas-lens: added all RCODEs according to RFC6895\n","repos":"CZ-NIC\/deckard,CZ-NIC\/deckard","old_file":"pydnstest\/deckard.aug","new_file":"pydnstest\/deckard.aug","new_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/#; ]+\/\n\nlet comment = del \/[;#]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;#][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;#][^\\n]*)?\\n)*\/ \"\\n\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/#; ]+(\\.[^.\\t\\n\\\/#; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9#;\\n \\t][^\\t\\n\\\/#; ]*\/) - class_re) ]\nlet data_re = \/([^ \\t\\n#;][^\\n#;]*[^ \\t\\n#;])|[^ \\t\\n#;]\/ (*Can not start nor end with whitespace but can have whitespace in the middle. Disjunction is there so we match strings of length one.*)\nlet data = [label \"data\" . store data_re ]\n\nlet ip_re = \/[0-9a-f.:]+\/\nlet hex_re = \/[0-9a-fA-F]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\" | \"BADSIG\" | \"BADKEY\" | \"BADTIME\" | \"BADMODE\" | \"BADNAME\" | \"BADALG\" | \"BADTRUNC\" | \"BADCOOKIE\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = [label \"record\" . domain . tab . (class . tab)? . type . comment_or_eol ]\nlet record = [label \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = [label \"section\" . section_question? . section_answer? . section_authority? . section_additional?]\n\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store hex_re ] . comment_or_eol\n\n(* This is quite dirty hack to match every combination of options given to entry since 'let normal = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)\n\nlet normal = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . ( normal | raw ) . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . space . store data_re . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\n(*let filter = incl \"\/home\/test\/*.rpl\"*)\nlet filter = incl \"\/media\/test\/27159fa1-67d4-4162-8707-cd67900f3b36\/stepan\/nic\/deckard_stable\/deckard\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","old_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/#; ]+\/\n\nlet comment = del \/[;#]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;#][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;#][^\\n]*)?\\n)*\/ \"\\n\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/#; ]+(\\.[^.\\t\\n\\\/#; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9#;\\n \\t][^\\t\\n\\\/#; ]*\/) - class_re) ]\nlet data_re = \/([^ \\t\\n#;][^\\n#;]*[^ \\t\\n#;])|[^ \\t\\n#;]\/ (*Can not start nor end with whitespace but can have whitespace in the middle. Disjunction is there so we match strings of length one.*)\nlet data = [label \"data\" . store data_re ]\n\nlet ip_re = \/[0-9a-f.:]+\/\nlet hex_re = \/[0-9a-fA-F]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\" | \"QUERY\" | \"IQUERY\" | \"STATUS\" | \"NOTIFY\" | \"UPDATE\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = [label \"record\" . domain . tab . (class . tab)? . type . comment_or_eol ]\nlet record = [label \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = [label \"section\" . section_question? . section_answer? . section_authority? . section_additional?]\n\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store hex_re ] . comment_or_eol\n\n(* This is quite dirty hack to match every combination of options given to entry since 'let normal = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)\n\nlet normal = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . ( normal | raw ) . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . space . store data_re . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\n(*let filter = incl \"\/home\/test\/*.rpl\"*)\nlet filter = incl \"\/media\/test\/27159fa1-67d4-4162-8707-cd67900f3b36\/stepan\/nic\/deckard_stable\/deckard\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Augeas"} {"commit":"71a182d551d443eed0d160271c68e5223c340bd5","subject":"graphviz.aug: names can be empty","message":"graphviz.aug: names can be empty\n","repos":"pevalme\/augeas,domcleal\/augeas,hercules-team\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jjlin\/augeas,jasperla\/augeas,mchf\/augeas,pevalme\/augeas,domcleal\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,mlichvar\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,dafugg\/augeas,jjlin\/augeas,mlichvar\/augeas,dafugg\/augeas,MikaelSmith\/augeas,kunkku\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,manandbytes\/augeas,manandbytes\/augeas,lutter\/augeas,ptoscano\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,mchf\/augeas,mlichvar\/augeas,raphink\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,jasperla\/augeas,jjlin\/augeas,lutter\/augeas,domcleal\/augeas,kumy\/augeas,jtopjian\/augeas","old_file":"lenses\/graphviz.aug","new_file":"lenses\/graphviz.aug","new_contents":"(*\nModule: Graphviz\n Parses graphviz files.\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to graphviz files.\n\nAbout: Examples\n The <Test_Graphviz> file contains various examples and tests.\n*)\n\nmodule Graphviz =\n\n(* View: name *)\nlet name =\n let reserved = \"node\" | \"graph\"\n in store ( (\"\\\"\" . \/[^\"]*\/ . \"\\\"\")\n | (\/[A-Za-z0-9_.]+\/ - reserved) )\n\n(* View: eol\n Special eol using semicolons and\/or newlines *)\nlet eol = del \/[ \\t]*((;\\n?)|\\n)\/ \";\\n\"\n\n(* View: block\n A block construct, using Build.block_generic\n in order to pass our special definition of <eol> *)\nlet block (kw:regexp) (entry:lens) =\n [ key kw\n . Sep.space . name\n . Build.block_generic (* Use our definition of eol *)\n (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n Build.block_ldelim_re \/;?[ \\t\\n]*\\}\/ (* Allow semicol *)\n Build.block_ldelim_default Build.block_rdelim_default ]\n\n(* View: variable_generic\n A generic way of parsing variables\n with or without double quotes *)\nlet variable_generic (reserved:regexp) =\n Build.key_value (Rx.word - reserved) Sep.space_equal name\n\n(* View: variable *)\nlet variable =\n let reserved = \"subgraph\" | \"node\"\n in variable_generic reserved\n\n(* View: options\n A list of options for <nodes> or <links> *)\nlet options = \n let reserved = \"node\" | \"link_type\"\n in let option = variable_generic reserved\n in let comma = del \/,[ \\t\\n]*\/ \",\"\n in Sep.space . del \/\\[[ \\t]*\/ \"[\"\n . Build.opt_list option comma\n . del \/[ \\t]*\\]\/ \"]\"\n\n(* View: link *)\nlet link =\n let link_node = [ label \"node\" . name ]\n in let link_type = [ label \"link_type\" . Sep.opt_space\n . store \/\\<?\\-\\-?\\>?\/ . Sep.opt_space ]\n in [ label \"link\"\n . Build.list link_node link_type\n . options? ]\n\n(* View: node *)\nlet node = [ label \"node\" . name . options? ]\n\n(* View: nodelist\n Several <nodes> can be declared at once in a nodelist.\n This cannot be declared as simply a list of <nodes>,\n since it would be ambiguous in the put direction. *)\nlet nodelist = [ label \"nodelist\" . Build.list node Sep.space ]\n\n(* View: default_node\n General settings for <nodes> *)\nlet default_node = [ Build.xchgs \"node\" \"@node\" . options ]\n\n(* View: default_graph\n General settings for <graphs> *)\nlet default_graph = [ Build.xchgs \"graph\" \"@graph\" . options ]\n\n(* View: entry\n A general entry *)\nlet entry = (link | variable | node | nodelist\n | default_node | default_graph)\n\n(* View: subgraph\n Recursive *)\nlet rec subgraph = block \"subgraph\" (subgraph | entry)\n\n(* View: graph\n The top-level graph *)\nlet graph = block \/(di)?graph\/ (subgraph | entry) . Util.eol\n\n(* View: lns\n The graphviz lens *)\nlet lns = (Util.comment | Util.empty)* . graph\n\n\n","old_contents":"(*\nModule: Graphviz\n Parses graphviz files.\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to graphviz files.\n\nAbout: Examples\n The <Test_Graphviz> file contains various examples and tests.\n*)\n\nmodule Graphviz =\n\n(* View: name *)\nlet name =\n let reserved = \"node\" | \"graph\"\n in store ( (\"\\\"\" . \/[^\"]+\/ . \"\\\"\")\n | (\/[A-Za-z0-9_.]+\/ - reserved) )\n\n(* View: eol\n Special eol using semicolons and\/or newlines *)\nlet eol = del \/[ \\t]*((;\\n?)|\\n)\/ \";\\n\"\n\n(* View: block\n A block construct, using Build.block_generic\n in order to pass our special definition of <eol> *)\nlet block (kw:regexp) (entry:lens) =\n [ key kw\n . Sep.space . name\n . Build.block_generic (* Use our definition of eol *)\n (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n Build.block_ldelim_re \/;?[ \\t\\n]*\\}\/ (* Allow semicol *)\n Build.block_ldelim_default Build.block_rdelim_default ]\n\n(* View: variable_generic\n A generic way of parsing variables\n with or without double quotes *)\nlet variable_generic (reserved:regexp) =\n Build.key_value (Rx.word - reserved) Sep.space_equal name\n\n(* View: variable *)\nlet variable =\n let reserved = \"subgraph\" | \"node\"\n in variable_generic reserved\n\n(* View: options\n A list of options for <nodes> or <links> *)\nlet options = \n let reserved = \"node\" | \"link_type\"\n in let option = variable_generic reserved\n in let comma = del \/,[ \\t\\n]*\/ \",\"\n in Sep.space . del \/\\[[ \\t]*\/ \"[\"\n . Build.opt_list option comma\n . del \/[ \\t]*\\]\/ \"]\"\n\n(* View: link *)\nlet link =\n let link_node = [ label \"node\" . name ]\n in let link_type = [ label \"link_type\" . Sep.opt_space\n . store \/\\<?\\-\\-?\\>?\/ . Sep.opt_space ]\n in [ label \"link\"\n . Build.list link_node link_type\n . options? ]\n\n(* View: node *)\nlet node = [ label \"node\" . name . options? ]\n\n(* View: nodelist\n Several <nodes> can be declared at once in a nodelist.\n This cannot be declared as simply a list of <nodes>,\n since it would be ambiguous in the put direction. *)\nlet nodelist = [ label \"nodelist\" . Build.list node Sep.space ]\n\n(* View: default_node\n General settings for <nodes> *)\nlet default_node = [ Build.xchgs \"node\" \"@node\" . options ]\n\n(* View: default_graph\n General settings for <graphs> *)\nlet default_graph = [ Build.xchgs \"graph\" \"@graph\" . options ]\n\n(* View: entry\n A general entry *)\nlet entry = (link | variable | node | nodelist\n | default_node | default_graph)\n\n(* View: subgraph\n Recursive *)\nlet rec subgraph = block \"subgraph\" (subgraph | entry)\n\n(* View: graph\n The top-level graph *)\nlet graph = block \/(di)?graph\/ (subgraph | entry) . Util.eol\n\n(* View: lns\n The graphviz lens *)\nlet lns = (Util.comment | Util.empty)* . graph\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"63e322699272dd26fc9014c672ea5ce9e4fb21e8","subject":"Shellvars: read \/etc\/firewalld\/firewalld.conf","message":"Shellvars: read \/etc\/firewalld\/firewalld.conf\n\nFixes https:\/\/fedorahosted.org\/augeas\/ticket\/363\n","repos":"lutter\/augeas,kunkku\/augeas,raphink\/augeas,ptoscano\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,raphink\/augeas,mlichvar\/augeas,mchf\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,ptoscano\/augeas,manandbytes\/augeas,jjlin\/augeas,jasperla\/augeas,mchf\/augeas,jtopjian\/augeas,manandbytes\/augeas,jasperla\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,dafugg\/augeas,pevalme\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,pevalme\/augeas,MikaelSmith\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9065efce9779a73c5c112c5f441b64f4860b640e","subject":"AptPreferences: Simplify\/Standardize the module","message":"AptPreferences: Simplify\/Standardize the module\n","repos":"raphink\/augeas,kunkku\/augeas,raphink\/augeas,kumy\/augeas,mchf\/augeas,mchf\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,manandbytes\/augeas,dafugg\/augeas,dafugg\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,MikaelSmith\/augeas,lutter\/augeas,hercules-team\/augeas,pevalme\/augeas,jtopjian\/augeas,dafugg\/augeas,jjlin\/augeas,mlichvar\/augeas,jasperla\/augeas,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,ptoscano\/augeas,mlichvar\/augeas,jjlin\/augeas,kumy\/augeas,kumy\/augeas,pevalme\/augeas,lutter\/augeas","old_file":"lenses\/aptpreferences.aug","new_file":"lenses\/aptpreferences.aug","new_contents":"(*\nModule: AptPreferences\n Apt\/preferences module for Augeas\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n*)\n\nmodule AptPreferences =\nautoload xfm\n\n(************************************************************************\n * Group: Entries\n ************************************************************************)\n\n(* View: colon *)\nlet colon = Util.delim \":\"\n\n(* View: pin_gen\n A generic pin\n\n Parameters:\n lbl:string - the label *)\nlet pin_gen (lbl:string) = store lbl\n . [ label lbl . Sep.space . store Rx.no_spaces ]\n\n(* View: pin_keys *)\nlet pin_keys = Build.key_value \/[aclnov]\/ Sep.equal (store \/[^, \\t\\n]+\/)\n\n(* View: pin_options *)\nlet pin_options =\n let comma = Util.delim \",\"\n in store \"release\" . Sep.space\n . Build.opt_list pin_keys comma\n\n(* View: version_pin *)\nlet version_pin = pin_gen \"version\"\n\n(* View: origin_pin *)\nlet origin_pin = pin_gen \"origin\"\n\n(* View: pin *)\nlet pin =\n let pin_value = pin_options | version_pin | origin_pin\n in Build.key_value_line \"Pin\" colon pin_value\n\n(* View: entries *)\nlet entries = Build.key_value_line (\"Explanation\"|\"Package\"|\"Pin-Priority\")\n colon (store Rx.space_in)\n | pin\n | Util.comment\n\n(* View: record *)\nlet record = [ seq \"record\" . entries+ ]\n\n(************************************************************************\n * Group: Lens\n ************************************************************************)\n\n(* View: lns *)\nlet lns = Util.empty* . (Build.opt_list record Util.eol+)?\n\n(* View: filter *)\nlet filter = incl \"\/etc\/apt\/preferences\"\n . incl \"\/etc\/apt\/preferences.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: AptPreferences\n Apt\/preferences module for Augeas\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n*)\n\nmodule AptPreferences =\n autoload xfm\n\n (************************************************************************\n * Group: Useful primitives and functions\n ************************************************************************)\n (* View: colon *)\n let colon = del \/:[ \\t]*\/ \": \"\n (* View: eol *)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n (* View: value_to_eol *)\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n (* View: value_to_spc *)\n let value_to_spc = store \/[^, \\t\\n]+\/\n (* View: comma *)\n let comma = del \/,[ \\t]*\/ \", \"\n (* View: equal *)\n let equal = Util.del_str \"=\"\n (* View: spc *)\n let spc = Util.del_ws_spc\n (* View: empty *)\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n (************************************************************************\n * View: simple_entry\n *\n * Parameters:\n * kw:string - the pattern to match as key\n ************************************************************************)\n let simple_entry (kw:string) = [ key kw . colon . value_to_eol . eol ]\n\n (************************************************************************\n * View: key_value\n *\n * Parameters:\n * kw:string - the pattern to match as key\n ************************************************************************)\n let key_value (kw:string) = [ key kw . equal . value_to_spc ]\n\n (************************************************************************\n * Group: Keywords\n ************************************************************************)\n (* View: pin_keys *)\n let pin_keys = key_value \"a\"\n | key_value \"c\"\n | key_value \"l\"\n | key_value \"n\"\n | key_value \"o\"\n | key_value \"v\"\n\n (* View: pin_options *)\n let pin_options = store \"release\" . spc . pin_keys . ( comma . pin_keys )*\n (* View: version_pin *)\n let version_pin = store \"version\" . [ label \"version\" . spc . store \/[^ \\t\\n]+\/ ]\n (* View: origin_pin *)\n let origin_pin = store \"origin\" . [ label \"origin\" . spc . store \/[^ \\t\\n]+\/ ]\n (* View: pin *)\n let pin = [ key \"Pin\" . colon . (pin_options | version_pin | origin_pin) . eol ]\n\n (* View: entries *)\n let entries = simple_entry \"Explanation\"\n | simple_entry \"Package\"\n | simple_entry \"Pin-Priority\"\n | pin\n | Util.comment\n\n (* View: record *)\n let record = [ seq \"record\" . entries+ ]\n\n (************************************************************************\n * Group: Lens\n ************************************************************************)\n (* View: lns *)\n let lns = (eol* . ( record . eol+ )* . record . eol* ) | eol\n\n (* View: filter *)\n let filter = incl \"\/etc\/apt\/preferences\"\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d6959e6211dc25040c9dd6bf8d75605a3a6155a0","subject":"Shellvars: reinstate \/etc\/sysconfig\/network","message":"Shellvars: reinstate \/etc\/sysconfig\/network\n\nFixes #330, RHBZ#904222, RHBZ#920609\n","repos":"jtopjian\/augeas,kumy\/augeas,pevalme\/augeas,MikaelSmith\/augeas,kumy\/augeas,dafugg\/augeas,dafugg\/augeas,manandbytes\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,kunkku\/augeas,jjlin\/augeas,jjlin\/augeas,raphink\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,pevalme\/augeas,jtopjian\/augeas,kumy\/augeas,lutter\/augeas,mlichvar\/augeas,manandbytes\/augeas,raphink\/augeas,kunkku\/augeas,mchf\/augeas,jjlin\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,jasperla\/augeas,ptoscano\/augeas,dafugg\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,kunkku\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n (* NetworkManager used to write files with '!' in them; this has\n been patched upstream. We need to ignore these files, because\n their name causes trouble during aug_init *)\n sc_excl \"network-scripts\/ifcfg-*!*\" .\n (* Ditto, brackets conflict with paths and cause aug_init failures *)\n sc_excl \"network-scripts\/ifcfg-*(*\" .\n sc_excl \"network-scripts\/ifcfg-*)*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n (* NetworkManager used to write files with '!' in them; this has\n been patched upstream. We need to ignore these files, because\n their name causes trouble during aug_init *)\n sc_excl \"network-scripts\/ifcfg-*!*\" .\n (* Ditto, brackets conflict with paths and cause aug_init failures *)\n sc_excl \"network-scripts\/ifcfg-*(*\" .\n sc_excl \"network-scripts\/ifcfg-*)*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"dd9d8a028ca27c27b3115070e1fd4af29138f3fb","subject":"Use the Quote module in dhcpd.aug","message":"Use the Quote module in dhcpd.aug\n","repos":"mlichvar\/augeas,jjlin\/augeas,ptoscano\/augeas,raphink\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,kumy\/augeas,lutter\/augeas,ptoscano\/augeas,hercules-team\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kumy\/augeas,jasperla\/augeas,manandbytes\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,mlichvar\/augeas,jjlin\/augeas,pevalme\/augeas,lutter\/augeas,mchf\/augeas,dafugg\/augeas,kunkku\/augeas,jtopjian\/augeas,pevalme\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,kumy\/augeas,kunkku\/augeas,manandbytes\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,mchf\/augeas,dafugg\/augeas,dafugg\/augeas,kumy\/augeas,raphink\/augeas","old_file":"lenses\/dhcpd.aug","new_file":"lenses\/dhcpd.aug","new_contents":"(*\nModule: Dhcpd\n BIND dhcp 3 server configuration module for Augeas\n\nAuthor: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\nAbout: Reference\n Reference: manual of dhcpd.conf and dhcp-eval\n Follow dhclient module for tree structure\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Directive without argument.\n Set this dhcpd server authoritative on the domain.\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/authoritative\n\n Directives with integer or string argument.\n Set max-lease-time to one hour:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/max-lease-time 3600\n\n Options are declared as a list, even for single values.\n Set the domain of the network:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name\/arg example.org\n Set two name server:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[1] foo.example.org\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[2] bar.example.org\n\n Create the subnet 172.16.0.1 with 10 addresses:\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last() + 1]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/network 172.16.0.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/netmask 255.255.255.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/from 172.16.0.10\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/to 172.16.0.20\n\n Create a new group \"foo\" with one static host. Nodes type and address are ordered.\n > ins group after \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/*[last()]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[last()]\/host foo\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/type \"ethernet\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/address \"00:00:00:aa:bb:cc\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/fixed-address 172.16.0.100\n\nAbout: Configuration files\n This lens applies to \/etc\/dhcpd3\/dhcpd.conf. See <filter>.\n*)\n\nmodule Dhcpd =\n\nautoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\nlet dels (s:string) = del s s\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet indent = Util.indent\nlet eos = comment?\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\nlet sep_osp = del \/[ \\t]*\/ \"\"\nlet sep_scl = del \/[ \\t]*;([ \\t]*\\n)*\/ \";\\n\"\nlet sep_obr = del \/[ \\t]*\\{([ \\t]*\\n)*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t]*\\}([ \\t]*\\n)*\/ \"}\\n\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \", \"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\nlet scl = del \";\" \";\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\nlet ip = Rx.ipv4\n\n(* Define fields *)\n\n(* adapted from sysconfig.aug *)\n (* Chars allowed in a bare string *)\n let bchar = \/[^ \\t\\n\"'\\\\{}#,()\\\/]|\\\\\\\\.\/\n let qchar = \/[\"']\/ (* \" *)\n\n (* We split the handling of right hand sides into a few cases:\n * bare - strings that contain no spaces, optionally enclosed in\n * single or double quotes\n * dquot - strings that contain at least one space, apostrophe or slash\n * which must be enclosed in double quotes\n * squot - strings that contain an unescaped double quote\n *)\n let bare = del qchar? \"\" . store (bchar+) . del qchar? \"\"\n let quote = Quote.do_quote (store (bchar* . \/[ \\t'\\\/]\/ . bchar*)+)\n\nlet sto_to_spc = store \/[^\\\\#,;\\{\\}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_to_scl = store \/[^ \\t;][^;\\n=]+[^ \\t;]|[^ \\t;=]+\/\n\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * NO ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_noarg_re = \"authoritative\"\n | \"primary\"\n | \"secondary\"\n\nlet stmt_noarg = [ indent\n . key stmt_noarg_re\n . sep_scl\n . eos ]\n\n(************************************************************************\n * INT ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_integer_re = \"default-lease-time\"\n | \"max-lease-time\"\n | \"min-lease-time\"\n | \/lease[ ]+limit\/\n | \"port\"\n | \/peer[ ]+port\/\n | \"max-response-delay\"\n | \"max-unacked-updates\"\n | \"mclt\"\n | \"split\"\n | \/load[ ]+balance[ ]+max[ ]+seconds\/\n | \"max-lease-misbalance\"\n | \"max-lease-ownership\"\n | \"min-balance\"\n | \"max-balance\"\n | \"adaptive-lease-time-threshold\"\n | \"dynamic-bootp-lease-length\"\n | \"local-port\"\n | \"min-sec\"\n | \"omapi-port\"\n | \"ping-timeout\"\n | \"remote-port\"\n\nlet stmt_integer = [ indent\n . key stmt_integer_re\n . sep_spc\n . sto_number\n . sep_scl\n . eos ]\n\n(************************************************************************\n * STRING ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_string_re = \"ddns-update-style\"\n | \"ddns-updates\"\n | \"ddns-hostname\"\n | \"ddns-domainname\"\n | \"ddns-rev-domainname\"\n | \"log-facility\"\n | \"filename\"\n | \"server-name\"\n | \"fixed-address\"\n | \/failover[ ]+peer\/\n | \"use-host-decl-names\"\n | \"next-server\"\n | \"address\"\n | \/peer[ ]+address\/\n | \"type\"\n | \"file\"\n | \"algorithm\"\n | \"secret\"\n | \"key\"\n | \"include\"\n | \"hba\"\n | \"boot-unknown-clients\"\n | \"db-time-format\"\n | \"do-forward-updates\"\n | \"dynamic-bootp-lease-cutoff\"\n | \"get-lease-hostnames\"\n | \"infinite-is-reserved\"\n | \"lease-file-name\"\n | \"local-address\"\n | \"one-lease-per-client\"\n | \"pid-file-name\"\n | \"ping-check\"\n | \"server-identifier\"\n | \"site-option-space\"\n | \"stash-agent-options\"\n | \"update-conflict-detection\"\n | \"update-optimization\"\n | \"update-static-leases\"\n | \"use-host-decl-names\"\n | \"use-lease-addr-for-default-route\"\n | \"vendor-option-space\"\n | \"primary\"\n\nlet stmt_string_tpl (l:lens) = [ indent\n . key stmt_string_re\n . sep_spc\n . l\n . sep_scl\n . eos ]\n\nlet stmt_string = stmt_string_tpl bare |stmt_string_tpl quote\n\n(************************************************************************\n * RANGE STATEMENTS\n *************************************************************************)\n\nlet stmt_range = [ indent\n . key \"range\"\n . sep_spc\n . [ label \"flag\" . store \/dynamic-bootp\/ . sep_spc ]?\n . [ label \"from\" . store ip . sep_spc ]?\n . [ label \"to\" . store ip ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * HARDWARE STATEMENTS\n *************************************************************************)\n\nlet stmt_hardware = [ indent\n . key \"hardware\"\n . sep_spc\n . [ label \"type\" . store \/ethernet|tokenring\/ ]\n . sep_spc\n . [ label \"address\" . store \/[a-fA-F0-9:-]+\/ ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * OPTION STATEMENTS\n *************************************************************************)\n(* The general case is considering options as a list *)\n\nlet stmt_option_code = [ label \"label\" . store word . sep_spc ]\n . [ key \"code\" . sep_spc . store word ]\n . sep_eq\n . [ label \"type\" . store word ]\n\n\nlet stmt_option_list = ([ label \"arg\" . bare ] | [ label \"arg\" . quote ])\n . ( sep_com . ([ label \"arg\" . bare ] | [ label \"arg\" . quote ]))*\n\nlet stmt_option_basic = [ key word . sep_spc . stmt_option_list ]\nlet stmt_option_extra = [ key word . sep_spc . store \/true|false\/ . sep_spc . stmt_option_list ]\n\nlet stmt_option_body = stmt_option_basic | stmt_option_extra\n\nlet stmt_option1 = [ indent\n . key \"option\"\n . sep_spc\n . stmt_option_body\n . sep_scl\n . eos ]\n\nlet stmt_option2 = [ indent\n . dels \"option\" . label \"rfc-code\"\n . sep_spc\n . stmt_option_code\n . sep_scl\n . eos ]\n\nlet stmt_option = stmt_option1 | stmt_option2\n\n(************************************************************************\n * SUBCLASS STATEMENTS\n *************************************************************************)\n(* this statement is not well documented in the manual dhcpd.conf\n we support basic use case *)\n\nlet stmt_subclass = [ indent . key \"subclass\" . sep_spc .\n ([ label \"name\" . quote ]|\n [ label \"name\" . bare ]) . sep_spc .\n [ label \"value\" . bare ] . sep_scl . eos ]\n\n(************************************************************************\n * ALLOW\/DENY STATEMENTS\n *************************************************************************)\n(* We have to use special key for allow\/deny members of\n to avoid ambiguity in the put direction *)\n\nlet allow_deny_re = \"unknown-clients\"\n | \/dynamic[ ]+bootp[ ]+clients\/\n | \/authenticated[ ]+clients\/\n | \/unauthenticated[ ]+clients\/\n\nlet stmt_secu_re = \"allow\"\n | \"deny\"\n\nlet del_allow = del \/allow[ ]+members[ ]+of\/ \"allow members of\"\nlet del_deny = del \/deny[ \\t]+members[ \\t]+of\/ \"deny members of\"\n\nlet stmt_secu_tpl (l:lens) (s:string) =\n [ indent . l . sep_spc . label s . bare . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . quote . sep_scl . eos ]\n\nlet stmt_secu = [ indent . key stmt_secu_re . sep_spc .\n store allow_deny_re . sep_scl . eos ] |\n stmt_secu_tpl del_allow \"allow-members-of\" |\n stmt_secu_tpl del_deny \"deny-members-of\"\n\n(************************************************************************\n * MATCH STATEMENTS\n *************************************************************************)\n\nlet sto_fct = store (word . \/[ \\t]*\\([^)]*\\)\/)\nlet sto_option = store (\/option[ ]+\/ . word)\nlet sto_com = \/[^ \\t\\n,\\(\\)][^,\\(\\)]*[^ \\t\\n,\\(\\)]|[^ \\t\\n,\\(\\)]+\/ | word . \/[ \\t]*\\([^)]*\\)\/\nlet fct_re = \"substring\" | \"binary-to-ascii\"\n\nlet fct_args = [ label \"args\" . dels \"(\" . sep_osp .\n ([ label \"arg\" . store sto_com ] . [ label \"arg\" . sep_com . store sto_com ]+) .\n sep_osp . dels \")\" ]\n\nlet stmt_match_if = [ dels \"if\" . sep_spc . store fct_re . sep_osp . label \"function\" . fct_args ] .\n sep_eq . ([ label \"value\" . bare ]|[ label \"value\" . quote ])\n\nlet stmt_match_pfv = [ label \"function\" . store \"pick-first-value\" . sep_spc .\n dels \"(\" . sep_osp .\n [ label \"args\" .\n [ label \"arg\" . store sto_com ] .\n [ sep_com . label \"arg\" . store sto_com ]+ ] .\n dels \")\" ]\n\nlet stmt_match_tpl (l:lens) = [ indent . key \"match\" . sep_spc . l . sep_scl . eos ]\n\nlet stmt_match = stmt_match_tpl (stmt_match_if | stmt_match_pfv )\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n(* Blocks doesn't support comments at the end of the closing bracket *)\n\nlet stmt_entry = stmt_secu\n | stmt_option\n | stmt_hardware\n | stmt_range\n | stmt_string\n | stmt_integer\n | stmt_noarg\n | stmt_match\n | stmt_subclass\n | empty\n | comment\n\nlet stmt_block_noarg_re = \"pool\"\n | \"group\"\n | \"allow-update\"\n\nlet stmt_block_noarg (body:lens)\n = [ indent\n . key stmt_block_noarg_re\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_arg_re = \"host\"\n | \"class\"\n | \"shared-network\"\n | \/failover[ ]+peer\/\n | \"zone\"\n | \"key\"\n\nlet stmt_block_arg (body:lens)\n = [ indent\n . key stmt_block_arg_re\n . sep_spc\n . sto_to_spc\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_subnet (body:lens)\n = [ indent\n . key \"subnet\"\n . sep_spc\n . [ label \"network\" . store ip ]\n . sep_spc\n . [ key \"netmask\" . sep_spc . store ip ]\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet all_block (body:lens) =\n let lns1 = stmt_block_subnet body in\n let lns2 = stmt_block_arg body in\n let lns3 = stmt_block_noarg body in\n (lns1 | lns2 | lns3 | stmt_entry)\n\nlet rec lns_staging = stmt_entry|all_block lns_staging\nlet lns = (lns_staging)*\n\nlet filter = incl \"\/etc\/dhcp3\/dhcpd.conf\"\n . incl \"\/etc\/dhcp\/dhcpd.conf\"\n . incl \"\/etc\/dhcpd.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Dhcpd\n BIND dhcp 3 server configuration module for Augeas\n\nAuthor: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\nAbout: Reference\n Reference: manual of dhcpd.conf and dhcp-eval\n Follow dhclient module for tree structure\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Directive without argument.\n Set this dhcpd server authoritative on the domain.\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/authoritative\n\n Directives with integer or string argument.\n Set max-lease-time to one hour:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/max-lease-time 3600\n\n Options are declared as a list, even for single values.\n Set the domain of the network:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name\/arg example.org\n Set two name server:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[1] foo.example.org\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[2] bar.example.org\n\n Create the subnet 172.16.0.1 with 10 addresses:\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last() + 1]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/network 172.16.0.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/netmask 255.255.255.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/from 172.16.0.10\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/to 172.16.0.20\n\n Create a new group \"foo\" with one static host. Nodes type and address are ordered.\n > ins group after \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/*[last()]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[last()]\/host foo\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/type \"ethernet\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/address \"00:00:00:aa:bb:cc\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/fixed-address 172.16.0.100\n\nAbout: Configuration files\n This lens applies to \/etc\/dhcpd3\/dhcpd.conf. See <filter>.\n*)\n\nmodule Dhcpd =\n\nautoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\nlet dels (s:string) = del s s\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet indent = Util.indent\nlet eos = comment?\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\nlet sep_osp = del \/[ \\t]*\/ \"\"\nlet sep_scl = del \/[ \\t]*;([ \\t]*\\n)*\/ \";\\n\"\nlet sep_obr = del \/[ \\t]*\\{([ \\t]*\\n)*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t]*\\}([ \\t]*\\n)*\/ \"}\\n\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \", \"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\nlet scl = del \";\" \";\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\nlet ip = Rx.ipv4\n\n(* Define fields *)\n\n(* adapted from sysconfig.aug *)\n (* Chars allowed in a bare string *)\n let bchar = \/[^ \\t\\n\"'\\\\{}#,()\\\/]|\\\\\\\\.\/\n let qchar = \/[\"']\/ (* \" *)\n\n (* We split the handling of right hand sides into a few cases:\n * bare - strings that contain no spaces, optionally enclosed in\n * single or double quotes\n * dquot - strings that contain at least one space, apostrophe or slash\n * which must be enclosed in double quotes\n * squot - strings that contain an unescaped double quote\n *)\n let bare = del qchar? \"\" . store (bchar+) . del qchar? \"\"\n let dquot =\n del qchar \"\\\"\" . store (bchar* . \/[ \\t'\\\/]\/ . bchar*)+ . del qchar \"\\\"\"\n let squot =\n dels \"'\" . store ((bchar|\/[ \\t\\\/]\/)* . \"\\\"\" . (bchar|\/[ \\t\\\/]\/)*)+ . dels \"'\"\n\nlet sto_to_spc = store \/[^\\\\#,;\\{\\}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_to_scl = store \/[^ \\t;][^;\\n=]+[^ \\t;]|[^ \\t;=]+\/\n\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * NO ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_noarg_re = \"authoritative\"\n | \"primary\"\n | \"secondary\"\n\nlet stmt_noarg = [ indent\n . key stmt_noarg_re\n . sep_scl\n . eos ]\n\n(************************************************************************\n * INT ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_integer_re = \"default-lease-time\"\n | \"max-lease-time\"\n | \"min-lease-time\"\n | \/lease[ ]+limit\/\n | \"port\"\n | \/peer[ ]+port\/\n | \"max-response-delay\"\n | \"max-unacked-updates\"\n | \"mclt\"\n | \"split\"\n | \/load[ ]+balance[ ]+max[ ]+seconds\/\n | \"max-lease-misbalance\"\n | \"max-lease-ownership\"\n | \"min-balance\"\n | \"max-balance\"\n | \"adaptive-lease-time-threshold\"\n | \"dynamic-bootp-lease-length\"\n | \"local-port\"\n | \"min-sec\"\n | \"omapi-port\"\n | \"ping-timeout\"\n | \"remote-port\"\n\nlet stmt_integer = [ indent\n . key stmt_integer_re\n . sep_spc\n . sto_number\n . sep_scl\n . eos ]\n\n(************************************************************************\n * STRING ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_string_re = \"ddns-update-style\"\n | \"ddns-updates\"\n | \"ddns-hostname\"\n | \"ddns-domainname\"\n | \"ddns-rev-domainname\"\n | \"log-facility\"\n | \"filename\"\n | \"server-name\"\n | \"fixed-address\"\n | \/failover[ ]+peer\/\n | \"use-host-decl-names\"\n | \"next-server\"\n | \"address\"\n | \/peer[ ]+address\/\n | \"type\"\n | \"file\"\n | \"algorithm\"\n | \"secret\"\n | \"key\"\n | \"include\"\n | \"hba\"\n | \"boot-unknown-clients\"\n | \"db-time-format\"\n | \"do-forward-updates\"\n | \"dynamic-bootp-lease-cutoff\"\n | \"get-lease-hostnames\"\n | \"infinite-is-reserved\"\n | \"lease-file-name\"\n | \"local-address\"\n | \"one-lease-per-client\"\n | \"pid-file-name\"\n | \"ping-check\"\n | \"server-identifier\"\n | \"site-option-space\"\n | \"stash-agent-options\"\n | \"update-conflict-detection\"\n | \"update-optimization\"\n | \"update-static-leases\"\n | \"use-host-decl-names\"\n | \"use-lease-addr-for-default-route\"\n | \"vendor-option-space\"\n | \"primary\"\n\nlet stmt_string_tpl (l:lens) = [ indent\n . key stmt_string_re\n . sep_spc\n . l\n . sep_scl\n . eos ]\n\nlet stmt_string = stmt_string_tpl bare |stmt_string_tpl squot | stmt_string_tpl dquot\n\n(************************************************************************\n * RANGE STATEMENTS\n *************************************************************************)\n\nlet stmt_range = [ indent\n . key \"range\"\n . sep_spc\n . [ label \"flag\" . store \/dynamic-bootp\/ . sep_spc ]?\n . [ label \"from\" . store ip . sep_spc ]?\n . [ label \"to\" . store ip ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * HARDWARE STATEMENTS\n *************************************************************************)\n\nlet stmt_hardware = [ indent\n . key \"hardware\"\n . sep_spc\n . [ label \"type\" . store \/ethernet|tokenring\/ ]\n . sep_spc\n . [ label \"address\" . store \/[a-fA-F0-9:-]+\/ ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * OPTION STATEMENTS\n *************************************************************************)\n(* The general case is considering options as a list *)\n\nlet stmt_option_code = [ label \"label\" . store word . sep_spc ]\n . [ key \"code\" . sep_spc . store word ]\n . sep_eq\n . [ label \"type\" . store word ]\n\n\nlet stmt_option_list = ([ label \"arg\" . bare ] | [ label \"arg\" . dquot ] | [ label \"arg\" . squot ])\n . ( sep_com . ([ label \"arg\" . bare ] | [ label \"arg\" . dquot ] | [ label \"arg\" . squot ]))*\n\nlet stmt_option_basic = [ key word . sep_spc . stmt_option_list ]\nlet stmt_option_extra = [ key word . sep_spc . store \/true|false\/ . sep_spc . stmt_option_list ]\n\nlet stmt_option_body = stmt_option_basic | stmt_option_extra\n\nlet stmt_option1 = [ indent\n . key \"option\"\n . sep_spc\n . stmt_option_body\n . sep_scl\n . eos ]\n\nlet stmt_option2 = [ indent\n . dels \"option\" . label \"rfc-code\"\n . sep_spc\n . stmt_option_code\n . sep_scl\n . eos ]\n\nlet stmt_option = stmt_option1 | stmt_option2\n\n(************************************************************************\n * SUBCLASS STATEMENTS\n *************************************************************************)\n(* this statement is not well documented in the manual dhcpd.conf\n we support basic use case *)\n\nlet stmt_subclass = [ indent . key \"subclass\" . sep_spc .\n ([ label \"name\" . dquot ]|\n [ label \"name\" . squot ]|\n [ label \"name\" . bare ]) . sep_spc .\n [ label \"value\" . bare ] . sep_scl . eos ]\n\n(************************************************************************\n * ALLOW\/DENY STATEMENTS\n *************************************************************************)\n(* We have to use special key for allow\/deny members of\n to avoid ambiguity in the put direction *)\n\nlet allow_deny_re = \"unknown-clients\"\n | \/dynamic[ ]+bootp[ ]+clients\/\n | \/authenticated[ ]+clients\/\n | \/unauthenticated[ ]+clients\/\n\nlet stmt_secu_re = \"allow\"\n | \"deny\"\n\nlet del_allow = del \/allow[ ]+members[ ]+of\/ \"allow members of\"\nlet del_deny = del \/deny[ \\t]+members[ \\t]+of\/ \"deny members of\"\n\nlet stmt_secu_tpl (l:lens) (s:string) =\n [ indent . l . sep_spc . label s . bare . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . squot . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . dquot . sep_scl . eos ]\n\nlet stmt_secu = [ indent . key stmt_secu_re . sep_spc .\n store allow_deny_re . sep_scl . eos ] |\n stmt_secu_tpl del_allow \"allow-members-of\" |\n stmt_secu_tpl del_deny \"deny-members-of\"\n\n(************************************************************************\n * MATCH STATEMENTS\n *************************************************************************)\n\nlet sto_fct = store (word . \/[ \\t]*\\([^)]*\\)\/)\nlet sto_option = store (\/option[ ]+\/ . word)\nlet sto_com = \/[^ \\t\\n,\\(\\)][^,\\(\\)]*[^ \\t\\n,\\(\\)]|[^ \\t\\n,\\(\\)]+\/ | word . \/[ \\t]*\\([^)]*\\)\/\nlet fct_re = \"substring\" | \"binary-to-ascii\"\n\nlet fct_args = [ label \"args\" . dels \"(\" . sep_osp .\n ([ label \"arg\" . store sto_com ] . [ label \"arg\" . sep_com . store sto_com ]+) .\n sep_osp . dels \")\" ]\n\nlet stmt_match_if = [ dels \"if\" . sep_spc . store fct_re . sep_osp . label \"function\" . fct_args ] .\n sep_eq . ([ label \"value\" . bare ]|[ label \"value\" . squot ]|[ label \"value\" . dquot ])\n\nlet stmt_match_pfv = [ label \"function\" . store \"pick-first-value\" . sep_spc .\n dels \"(\" . sep_osp .\n [ label \"args\" .\n [ label \"arg\" . store sto_com ] .\n [ sep_com . label \"arg\" . store sto_com ]+ ] .\n dels \")\" ]\n\nlet stmt_match_tpl (l:lens) = [ indent . key \"match\" . sep_spc . l . sep_scl . eos ]\n\nlet stmt_match = stmt_match_tpl (stmt_match_if | stmt_match_pfv )\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n(* Blocks doesn't support comments at the end of the closing bracket *)\n\nlet stmt_entry = stmt_secu\n | stmt_option\n | stmt_hardware\n | stmt_range\n | stmt_string\n | stmt_integer\n | stmt_noarg\n | stmt_match\n | stmt_subclass\n | empty\n | comment\n\nlet stmt_block_noarg_re = \"pool\"\n | \"group\"\n | \"allow-update\"\n\nlet stmt_block_noarg (body:lens)\n = [ indent\n . key stmt_block_noarg_re\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_arg_re = \"host\"\n | \"class\"\n | \"shared-network\"\n | \/failover[ ]+peer\/\n | \"zone\"\n | \"key\"\n\nlet stmt_block_arg (body:lens)\n = [ indent\n . key stmt_block_arg_re\n . sep_spc\n . sto_to_spc\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_subnet (body:lens)\n = [ indent\n . key \"subnet\"\n . sep_spc\n . [ label \"network\" . store ip ]\n . sep_spc\n . [ key \"netmask\" . sep_spc . store ip ]\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet all_block (body:lens) =\n let lns1 = stmt_block_subnet body in\n let lns2 = stmt_block_arg body in\n let lns3 = stmt_block_noarg body in\n (lns1 | lns2 | lns3 | stmt_entry)\n\nlet rec lns_staging = stmt_entry|all_block lns_staging\nlet lns = (lns_staging)*\n\nlet filter = incl \"\/etc\/dhcp3\/dhcpd.conf\"\n . incl \"\/etc\/dhcp\/dhcpd.conf\"\n . incl \"\/etc\/dhcpd.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"13c8da27c33dc298326ee3ae34ebdc48c87b53f0","subject":"Update group.aug to parse NIS entries","message":"Update group.aug to parse NIS entries","repos":"MikaelSmith\/augeas,raphink\/augeas,mlichvar\/augeas,lutter\/augeas,MikaelSmith\/augeas,kunkku\/augeas,raphink\/augeas,kunkku\/augeas,jjlin\/augeas,mchf\/augeas,dafugg\/augeas,dafugg\/augeas,jjlin\/augeas,jasperla\/augeas,kunkku\/augeas,dafugg\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,hercules-team\/augeas,hercules-team\/augeas,pevalme\/augeas,jjlin\/augeas,jtopjian\/augeas,lutter\/augeas,jtopjian\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,pevalme\/augeas,ptoscano\/augeas,ptoscano\/augeas,jasperla\/augeas,mchf\/augeas,manandbytes\/augeas","old_file":"lenses\/group.aug","new_file":"lenses\/group.aug","new_contents":"(* Group module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man 5 group\n\n*)\n\nmodule Group =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\n\nlet colon = Sep.colon\nlet comma = Sep.comma\n\nlet sto_to_spc = store Rx.space_in\nlet sto_to_col = store \/[^:\\n]+\/\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\nlet word = Rx.word\nlet password = \/[A-Za-z0-9_.!*-]*\/\nlet integer = Rx.integer\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet user = [ label \"user\" . store word ]\nlet user_list = Build.opt_list user comma\nlet params = [ label \"password\" . store password . colon ]\n . [ label \"gid\" . store integer . colon ]\n . user_list?\nlet entry = Build.key_value_line word colon params\n\n(* A NIS entry has nothing bar the +@::: bits. *)\nlet nisentry =\n let nisuser = \/\\+\\@[A-Za-z0-9_.-]+\/ in\n let colons = \":::\" in\n [ dels \"+@\" . label \"@nis\" . store word . dels colons . eol ]\n\nlet nisdefault =\n let overrides =\n colon\n . [ label \"password\" . store word? . colon ]\n . [ label \"gid\" . store integer? . colon ]\n . user_list? in\n [ dels \"+\" . label \"@nisdefault\" . overrides? . eol ]\n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry|nisentry|nisdefault) *\n\nlet filter = incl \"\/etc\/group\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Group module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man 5 group\n\n*)\n\nmodule Group =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet colon = Sep.colon\nlet comma = Sep.comma\n\nlet sto_to_spc = store Rx.space_in\n\nlet word = Rx.word\nlet password = \/[A-Za-z0-9_.!*-]*\/\nlet integer = Rx.integer\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet user = [ label \"user\" . store word ]\nlet user_list = Build.opt_list user comma\nlet params = [ label \"password\" . store password . colon ]\n . [ label \"gid\" . store integer . colon ]\n . user_list?\nlet entry = Build.key_value_line word colon params\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/group\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"713f77f200feb3f8fe10be415ba84048e4595e04","subject":"Move the 'coding' comment to the end of the file to fix the menu entry.","message":"Move the 'coding' comment to the end of the file to fix the menu entry.\n","repos":"kumy\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,kumy\/augeas,jasperla\/augeas,ptoscano\/augeas,raphink\/augeas,hercules-team\/augeas,pevalme\/augeas,dafugg\/augeas,jjlin\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,dafugg\/augeas,jjlin\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,mchf\/augeas,ptoscano\/augeas,hercules-team\/augeas,lutter\/augeas,kunkku\/augeas,raphink\/augeas,jtopjian\/augeas,mchf\/augeas,mlichvar\/augeas,kumy\/augeas,pevalme\/augeas,dafugg\/augeas,kunkku\/augeas,kumy\/augeas,lutter\/augeas,lutter\/augeas,jtopjian\/augeas,ptoscano\/augeas,jasperla\/augeas,pevalme\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/crypttab.aug","new_file":"lenses\/crypttab.aug","new_contents":"(*\nModule: Crypttab\n Parses \/etc\/crypttab from the cryptsetup package.\n\nAuthor: Fr\u00e9d\u00e9ric Lespez <frederic.lespez@free.fr>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man crypttab` where possible.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Create a new entry for an encrypted block devices\n > ins 01 after \/files\/etc\/crypttab\/*[last()]\n > set \/files\/etc\/crypttab\/01\/target crypt_sda2\n > set \/files\/etc\/crypttab\/01\/device \/dev\/sda2\n > set \/files\/etc\/crypttab\/01\/password \/dev\/random\n > set \/files\/etc\/crypttab\/01\/opt swap\n * Print the entry applying to the \"\/dev\/sda2\" device\n > print \/files\/etc\/crypttab\/01\n * Remove the entry applying to the \"\/dev\/sda2\" device\n > rm \/files\/etc\/crypttab\/*[device=\"\/dev\/sda2\"]\n\nAbout: Configuration files\n This lens applies to \/etc\/crypttab. See <filter>.\n*)\n\nmodule Crypttab =\n autoload xfm\n\n (************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* Group: Separators *)\n\n (* Variable: sep_tab *)\n let sep_tab = Sep.tab\n\n (* Variable: comma *)\n let comma = Sep.comma\n\n (* Group: Generic primitives *)\n\n (* Variable: eol *)\n let eol = Util.eol\n\n (* Variable: comment *)\n let comment = Util.comment\n\n (* Variable: empty *)\n let empty = Util.empty\n\n (* Variable: word *)\n let word = Rx.word\n\n (* Variable: optval *)\n let optval = \/[A-Za-z0-9_.:-]+\/\n\n (* Variable: target *)\n let target = Rx.device_name\n\n (* Variable: fspath *)\n let fspath = Rx.fspath\n\n (************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n (************************************************************************\n * View: comma_sep_list\n * A comma separated list of options (opt=value or opt)\n *************************************************************************)\n let comma_sep_list (l:string) =\n let value = [ label \"value\" . Util.del_str \"=\" . store optval ] in\n let lns = [ label l . store word . value? ] in\n Build.opt_list lns comma\n\n (************************************************************************\n * View: record\n * A crypttab record\n *************************************************************************)\n\n let record = [ seq \"entry\" .\n [ label \"target\" . store target ] . sep_tab .\n [ label \"device\" . store fspath ] .\n (sep_tab . [ label \"password\" . store fspath ] .\n ( sep_tab . comma_sep_list \"opt\")? )?\n . eol ]\n\n (*\n * View: lns\n * The crypttab lens\n *)\n let lns = ( empty | comment | record ) *\n\n (* Variable: filter *)\n let filter = (incl \"\/etc\/crypttab\")\n\n let xfm = transform lns filter\n\n(* coding: utf-8 *)\n","old_contents":"(* -*- coding: utf-8 -*-\nModule: Crypttab\n Parses \/etc\/crypttab from the cryptsetup package.\n\nAuthor: Fr\u00e9d\u00e9ric Lespez <frederic.lespez@free.fr>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man crypttab` where possible.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Create a new entry for an encrypted block devices\n > ins 01 after \/files\/etc\/crypttab\/*[last()]\n > set \/files\/etc\/crypttab\/01\/target crypt_sda2\n > set \/files\/etc\/crypttab\/01\/device \/dev\/sda2\n > set \/files\/etc\/crypttab\/01\/password \/dev\/random\n > set \/files\/etc\/crypttab\/01\/opt swap\n * Print the entry applying to the \"\/dev\/sda2\" device\n > print \/files\/etc\/crypttab\/01\n * Remove the entry applying to the \"\/dev\/sda2\" device\n > rm \/files\/etc\/crypttab\/*[device=\"\/dev\/sda2\"]\n\nAbout: Configuration files\n This lens applies to \/etc\/crypttab. See <filter>.\n*)\n\nmodule Crypttab =\n autoload xfm\n\n (************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* Group: Separators *)\n\n (* Variable: sep_tab *)\n let sep_tab = Sep.tab\n\n (* Variable: comma *)\n let comma = Sep.comma\n\n (* Group: Generic primitives *)\n\n (* Variable: eol *)\n let eol = Util.eol\n\n (* Variable: comment *)\n let comment = Util.comment\n\n (* Variable: empty *)\n let empty = Util.empty\n\n (* Variable: word *)\n let word = Rx.word\n\n (* Variable: optval *)\n let optval = \/[A-Za-z0-9_.:-]+\/\n\n (* Variable: target *)\n let target = Rx.device_name\n\n (* Variable: fspath *)\n let fspath = Rx.fspath\n\n (************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n (************************************************************************\n * View: comma_sep_list\n * A comma separated list of options (opt=value or opt)\n *************************************************************************)\n let comma_sep_list (l:string) =\n let value = [ label \"value\" . Util.del_str \"=\" . store optval ] in\n let lns = [ label l . store word . value? ] in\n Build.opt_list lns comma\n\n (************************************************************************\n * View: record\n * A crypttab record\n *************************************************************************)\n\n let record = [ seq \"entry\" .\n [ label \"target\" . store target ] . sep_tab .\n [ label \"device\" . store fspath ] .\n (sep_tab . [ label \"password\" . store fspath ] .\n ( sep_tab . comma_sep_list \"opt\")? )?\n . eol ]\n\n (*\n * View: lns\n * The crypttab lens\n *)\n let lns = ( empty | comment | record ) *\n\n (* Variable: filter *)\n let filter = (incl \"\/etc\/crypttab\")\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"24c82b738192dc9e7f5e55ae297c36bd57e7956f","subject":"Update splunk.aug","message":"Update splunk.aug\n\nUpdated augeas lens for Splunk to latest version from original author's github repo","repos":"wcooley\/puppet-splunk_conf","old_file":"lib\/augeas\/lenses\/splunk.aug","new_file":"lib\/augeas\/lenses\/splunk.aug","new_contents":"(*\n* Splunk module for Agueas\n* Author: Tim Brigham\n* Heavily based on inifile.aug by Raphael Pinson\n* and mysql.aug by Tim Stoop.\n* This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\nmodule Splunk =\nautoload xfm\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\nlet setting = IniFile.entry_re\nlet title = IniFile.indented_title_label \"target\" IniFile.record_label_re\nlet entry = [ key IniFile.entry_re . sep . IniFile.sto_to_comment . (comment|IniFile.eol) ] |\n [ key IniFile.entry_re . store \/\/ . (comment|IniFile.eol) ] |\n [ key \/\\![A-Za-z][A-Za-z0-9\\._-]+\/ . del \/ \/ \" \" . store \/\\\/[A-Za-z0-9\\.\\\/_-]+\/ . (comment|IniFile.eol) ] |\n comment\n\nlet record = IniFile.record title entry\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\nlet lns = record_anon | record*\n\nlet filter = incl \"\/opt\/splunk\/etc\/system\/local\/*.conf\"\n . incl \"\/opt\/splunk\/etc\/apps\/*\/local\/*.conf\"\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Splunk\n Parses \/opt\/splunk\/etc\/*\n\nAuthor: Tim Brigham\n\nAbout: Reference\n http:\/\/docs.splunk.com\/Documentation\/Splunk\/5.0.2\/Admin\/AboutConfigurationFiles\n\nAbout: License\n This file is licenced under the LGPL v2+\n\nAbout: Lens Usage\n Works like IniFile lens, with anonymous section for entries without enclosing section.\n\nAbout: Configuration files\n This lens applies to conf files under \/opt\/splunk\/etc See <filter>.\n\nAbout: Examples\n The <Test_Splunk> file contains various examples and tests.\n*)\n\nmodule Splunk =\n autoload xfm\n\n let comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n let sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n let empty = IniFile.empty\n\n let setting = IniFile.entry_re\n let title = IniFile.indented_title_label \"target\" IniFile.record_label_re\n let entry = [ key IniFile.entry_re . sep . IniFile.sto_to_eol? . IniFile.eol ] | comment\n\n\n let record = IniFile.record title entry\n let anon = [ label \".anon\" . (entry|empty)+ ]\n let lns = anon . (record)* | (record)*\n\n let filter = incl \"\/opt\/splunk\/etc\/system\/local\/*.conf\"\n . incl \"\/opt\/splunk\/etc\/apps\/*\/local\/*.conf\"\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"398de15edc658a8224aab85169ef0670c9ab3cc4","subject":"Rabbitmq: Adding some missing simple options","message":"Rabbitmq: Adding some missing simple options\n","repos":"ptoscano\/augeas,kunkku\/augeas,jjlin\/augeas,jjlin\/augeas,dafugg\/augeas,lutter\/augeas,pevalme\/augeas,mlichvar\/augeas,mchf\/augeas,lutter\/augeas,pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas,manandbytes\/augeas,kunkku\/augeas,mlichvar\/augeas,manandbytes\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,pevalme\/augeas,jjlin\/augeas,ptoscano\/augeas,dafugg\/augeas,mchf\/augeas,dafugg\/augeas","old_file":"lenses\/rabbitmq.aug","new_file":"lenses\/rabbitmq.aug","new_contents":"(*\nModule: Rabbitmq\n Parses Rabbitmq configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `http:\/\/www.rabbitmq.com\/configure.html` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Rabbitmq configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Rabbitmq> file contains various examples and tests.\n*)\nmodule Rabbitmq =\n\nautoload xfm\n\n(* View: listeners\n A tcp\/ssl listener *)\nlet listeners =\n let value = Erlang.make_value Erlang.integer\n | Erlang.tuple Erlang.quoted Erlang.integer\n in Erlang.list \/(tcp|ssl)_listeners\/ value\n\n\n(* View: ssl_options\n (Incomplete) list of SSL options *)\nlet ssl_options =\n let option = Erlang.value \/((ca)?cert|key)file\/ Erlang.path\n | Erlang.value \"verify\" Erlang.bare\n | Erlang.value \"verify_fun\" Erlang.boolean\n | Erlang.value \/fail_if_no_peer_cert|reuse_sessions\/ Erlang.boolean\n | Erlang.value \"depth\" Erlang.integer\n | Erlang.value \"password\" Erlang.quoted\n in Erlang.list \"ssl_options\" option\n\n(* View: disk_free_limit *)\nlet disk_free_limit =\n let value = Erlang.integer | Erlang.tuple Erlang.bare Erlang.decimal\n in Erlang.value \"disk_free_limit\" value\n\n(* View: log_levels *)\nlet log_levels =\n let category = Erlang.tuple Erlang.bare Erlang.bare\n in Erlang.list \"log_levels\" category\n\n(* View: cluster_nodes\n Can be a tuple `(nodes, node_type)` or simple `nodes` *)\nlet cluster_nodes =\n let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let value = Erlang.tuple nodes Erlang.bare\n | nodes\n in Erlang.value \"cluster_nodes\" value\n\n(* View: cluster_partition_handling\n Can be single value or\n `{pause_if_all_down, [nodes], ignore | autoheal}` *)\nlet cluster_partition_handling =\n let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let value = Erlang.tuple3 Erlang.bare nodes Erlang.bare\n | Erlang.bare\n in Erlang.value \"cluster_partition_handling\" value\n\n(* View: tcp_listen_options *)\nlet tcp_listen_options =\n let value = Erlang.make_value Erlang.bare\n | Erlang.tuple Erlang.bare Erlang.bare\n in Erlang.list \"tcp_listen_options\" value\n\n(* View: parameters\n Top-level parameters for the lens *)\nlet parameters = listeners\n | ssl_options\n | disk_free_limit\n | log_levels\n | Erlang.value \"vm_memory_high_watermark\" Erlang.decimal\n | Erlang.value \"vm_memory_high_watermark_paging_ratio\" Erlang.decimal\n | Erlang.value \"frame_max\" Erlang.integer\n | Erlang.value \"heartbeat\" Erlang.integer\n | Erlang.value \/default_(vhost|user|pass)\/ Erlang.glob\n | Erlang.value_list \"default_user_tags\" Erlang.bare\n | Erlang.value_list \"default_permissions\" Erlang.glob\n | cluster_nodes\n | Erlang.value_list \"server_properties\" Erlang.bare\n | Erlang.value \"collect_statistics\" Erlang.bare\n | Erlang.value \"collect_statistics_interval\" Erlang.integer\n | Erlang.value_list \"auth_mechanisms\" Erlang.quoted\n | Erlang.value_list \"auth_backends\" Erlang.bare\n | Erlang.value \"delegate_count\" Erlang.integer\n | Erlang.value_list \"trace_vhosts\" Erlang.bare\n | tcp_listen_options\n | Erlang.value \"hipe_compile\" Erlang.boolean\n | Erlang.value \"msg_store_index_module\" Erlang.bare\n | Erlang.value \"backing_queue_module\" Erlang.bare\n | Erlang.value \"msg_store_file_size_limit\" Erlang.integer\n | Erlang.value \"queue_index_max_journal_entries\" Erlang.integer\n | Erlang.value \"queue_index_embed_msgs_below\" Erlang.integer\n | cluster_partition_handling\n | Erlang.value \"handshake_timeout\" Erlang.integer\n | Erlang.value \"ssl_handshake_timeout\" Erlang.integer\n | Erlang.value \"channel_max\" Erlang.integer\n | Erlang.value_list \"loopback_users\" Erlang.glob\n | Erlang.value \"reverse_dns_lookups\" Erlang.boolean\n | Erlang.value \"cluster_keepalive_interval\" Erlang.integer\n | Erlang.value \"mnesia_table_loading_timeout\" Erlang.integer\n\n(* View: rabbit\n The rabbit <Erlang.application> config *)\nlet rabbit = Erlang.application \"rabbit\" parameters\n\n(* View: lns\n A top-level <Erlang.config> *)\nlet lns = Erlang.config rabbit\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/rabbitmq\/rabbitmq.config\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Rabbitmq\n Parses Rabbitmq configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `http:\/\/www.rabbitmq.com\/configure.html` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Rabbitmq configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Rabbitmq> file contains various examples and tests.\n*)\nmodule Rabbitmq =\n\nautoload xfm\n\n(* View: listeners\n A tcp\/ssl listener *)\nlet listeners =\n let value = Erlang.make_value Erlang.integer\n | Erlang.tuple Erlang.quoted Erlang.integer\n in Erlang.list \/(tcp|ssl)_listeners\/ value\n\n\n(* View: ssl_options\n (Incomplete) list of SSL options *)\nlet ssl_options =\n let option = Erlang.value \/((ca)?cert|key)file\/ Erlang.path\n | Erlang.value \"verify\" Erlang.bare\n | Erlang.value \"verify_fun\" Erlang.boolean\n | Erlang.value \/fail_if_no_peer_cert|reuse_sessions\/ Erlang.boolean\n | Erlang.value \"depth\" Erlang.integer\n | Erlang.value \"password\" Erlang.quoted\n in Erlang.list \"ssl_options\" option\n\n(* View: disk_free_limit *)\nlet disk_free_limit =\n let value = Erlang.integer | Erlang.tuple Erlang.bare Erlang.decimal\n in Erlang.value \"disk_free_limit\" value\n\n(* View: log_levels *)\nlet log_levels =\n let category = Erlang.tuple Erlang.bare Erlang.bare\n in Erlang.list \"log_levels\" category\n\n(* View: cluster_nodes\n Can be a tuple `(nodes, node_type)` or simple `nodes` *)\nlet cluster_nodes =\n let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let value = Erlang.tuple nodes Erlang.bare\n | nodes\n in Erlang.value \"cluster_nodes\" value\n\n(* View: cluster_partition_handling\n Can be single value or\n `{pause_if_all_down, [nodes], ignore | autoheal}` *)\nlet cluster_partition_handling =\n let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let value = Erlang.tuple3 Erlang.bare nodes Erlang.bare\n | Erlang.bare\n in Erlang.value \"cluster_partition_handling\" value\n\n(* View: tcp_listen_options *)\nlet tcp_listen_options =\n let value = Erlang.make_value Erlang.bare\n | Erlang.tuple Erlang.bare Erlang.bare\n in Erlang.list \"tcp_listen_options\" value\n\n(* View: parameters\n Top-level parameters for the lens *)\nlet parameters = listeners\n | ssl_options\n | disk_free_limit\n | log_levels\n | Erlang.value \"vm_memory_high_watermark\" Erlang.decimal\n | Erlang.value \"frame_max\" Erlang.integer\n | Erlang.value \"heartbeat\" Erlang.integer\n | Erlang.value \/default_(vhost|user|pass)\/ Erlang.glob\n | Erlang.value_list \"default_user_tags\" Erlang.bare\n | Erlang.value_list \"default_permissions\" Erlang.glob\n | cluster_nodes\n | Erlang.value_list \"server_properties\" Erlang.bare\n | Erlang.value \"collect_statistics\" Erlang.bare\n | Erlang.value \"collect_statistics_interval\" Erlang.integer\n | Erlang.value_list \"auth_mechanisms\" Erlang.quoted\n | Erlang.value_list \"auth_backends\" Erlang.bare\n | Erlang.value \"delegate_count\" Erlang.integer\n | Erlang.value_list \"trace_vhosts\" Erlang.bare\n | tcp_listen_options\n | Erlang.value \"hipe_compile\" Erlang.boolean\n | Erlang.value \"msg_store_index_module\" Erlang.bare\n | Erlang.value \"backing_queue_module\" Erlang.bare\n | Erlang.value \"msg_store_file_size_limit\" Erlang.integer\n | Erlang.value \"queue_index_max_journal_entries\" Erlang.integer\n | cluster_partition_handling\n\n(* View: rabbit\n The rabbit <Erlang.application> config *)\nlet rabbit = Erlang.application \"rabbit\" parameters\n\n(* View: lns\n A top-level <Erlang.config> *)\nlet lns = Erlang.config rabbit\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/rabbitmq\/rabbitmq.config\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"95515f45adf192ab10e6c6ffbd69b5977a9f78b2","subject":"Shellvars: add BSD's \/etc\/rc.conf","message":"Shellvars: add BSD's \/etc\/rc.conf\n\nFixes ticket #255\n","repos":"jasperla\/augeas,kumy\/augeas,dafugg\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,hercules-team\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jtopjian\/augeas,domcleal\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,lutter\/augeas,manandbytes\/augeas,kunkku\/augeas,kunkku\/augeas,mchf\/augeas,jasperla\/augeas,jjlin\/augeas,lutter\/augeas,kumy\/augeas,domcleal\/augeas,jjlin\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,jjlin\/augeas,pevalme\/augeas,mlichvar\/augeas,dafugg\/augeas,mlichvar\/augeas,raphink\/augeas,kumy\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,hercules-team\/augeas,ptoscano\/augeas,ptoscano\/augeas,mchf\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_sysconfig_suse =\n sc_incl \"abuild\" .\n sc_incl \"add-on-creator\" .\n sc_incl \"amavis\" .\n sc_incl \"amazon\" .\n sc_incl \"apache2\" .\n sc_incl \"argus\" .\n sc_incl \"arpwatch\" .\n sc_incl \"auditd\" .\n sc_incl \"autoinstall\" .\n sc_incl \"autoupdate\" .\n sc_incl \"backup\" .\n sc_incl \"bigsister\" .\n sc_incl \"bluetooth\" .\n sc_incl \"boot\" .\n sc_incl \"bootloader\" .\n sc_incl \"bootsplash\" .\n sc_incl \"cgred\" .\n sc_incl \"console\" .\n sc_incl \"cron\" .\n sc_incl \"ctdb\" .\n sc_incl \"cups\" .\n sc_incl \"ddclient\" .\n sc_incl \"dhcpd\" .\n sc_incl \"dhcrelay\" .\n sc_incl \"displaymanager\" .\n sc_incl \"dmraid\" .\n sc_incl \"dracd\" .\n sc_incl \"esound\" .\n sc_incl \"fam\" .\n sc_incl \"festival\" .\n sc_incl \"fetchmail\" .\n sc_incl \"fonts-config\" .\n sc_incl \"git-daemon\" .\n sc_incl \"gpsd\" .\n sc_incl \"hardware\" .\n sc_incl \"hardware\/*\" .\n sc_incl \"icecream\" .\n sc_incl \"ide\" .\n sc_incl \"infiniband\" .\n sc_incl \"inputattach\" .\n sc_incl \"ipmi\" .\n sc_incl \"ipvsadm\" .\n sc_incl \"ispell\" .\n sc_incl \"joystick\" .\n sc_incl \"kernel-tunables\" .\n sc_incl \"language\" .\n sc_incl \"ldap\" .\n sc_incl \"lighttpd\" .\n sc_incl \"lirc\" .\n sc_incl \"locate\" .\n sc_incl \"lvm\" .\n sc_incl \"mail\" .\n sc_incl \"mailman\" .\n sc_incl \"mdadm\" .\n sc_incl \"media-changer\" .\n sc_incl \"memcached\" .\n sc_incl \"mouse\" .\n sc_incl \"mpi-selector\" .\n sc_incl \"mysql\" .\n sc_incl \"nagios\" .\n sc_incl \"named\" .\n sc_incl \"ncpfs\" .\n sc_incl \"net-snmp\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"news\" .\n sc_incl \"ntp\" .\n sc_incl \"obs-server\" .\n sc_incl \"obs-worker\" .\n sc_incl \"openldap\" .\n sc_incl \"opensm\" .\n sc_incl \"osa-dispatcher\" .\n sc_incl \"pm-profiler\" .\n sc_incl \"portmap\" .\n sc_incl \"postfix\" .\n sc_incl \"postgresql\" .\n sc_incl \"product-creator\" .\n sc_incl \"proxy\" .\n sc_incl \"ptpd\" .\n sc_incl \"radvd\" .\n sc_incl \"readonlyroot\" .\n sc_incl \"rpcbind\" .\n sc_incl \"sapconf\" .\n sc_incl \"scpm\" .\n sc_incl \"seccheck\" .\n sc_incl \"security\" .\n sc_incl \"services\" .\n sc_incl \"shutdown\" .\n sc_incl \"smt-client\" .\n sc_incl \"sound\" .\n sc_incl \"spamd\" .\n sc_incl \"squid\" .\n sc_incl \"ssh\" .\n sc_incl \"storage\" .\n sc_incl \"SuSEfirewall2\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_incl \"susehelp\" .\n sc_incl \"suse_register\" .\n sc_incl \"sysctl\" .\n sc_incl \"syslog\" .\n sc_incl \"texlive\" .\n sc_incl \"ulimit\" .\n sc_incl \"websphere-as_ce-2.1\" .\n sc_incl \"windowmanager\" .\n sc_incl \"wondershaper\" .\n sc_incl \"words\" .\n sc_incl \"yast2\" .\n sc_incl \"ypbind\" .\n sc_incl \"ypserv\"\n\n let filter_sysconfig_rhn =\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/clientCaps.d\/*\" .\n sc_incl \"rhn\/osad-auth.conf\" .\n sc_incl \"rhn\/osad.conf\" .\n sc_incl \"rhn\/rhncfg-client.conf\" .\n sc_incl \"rhn\/rhncfg-manager.conf\" .\n sc_incl \"rhn\/rhnpushrc\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"rhn\/up2date\" .\n sc_incl \"rhn\/virt\" .\n sc_incl \"rhn\/virt\/auto\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/updatedb.conf\"\n\n let filter = filter_sysconfig\n . filter_sysconfig_suse\n . filter_sysconfig_rhn\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_sysconfig_suse =\n sc_incl \"abuild\" .\n sc_incl \"add-on-creator\" .\n sc_incl \"amavis\" .\n sc_incl \"amazon\" .\n sc_incl \"apache2\" .\n sc_incl \"argus\" .\n sc_incl \"arpwatch\" .\n sc_incl \"auditd\" .\n sc_incl \"autoinstall\" .\n sc_incl \"autoupdate\" .\n sc_incl \"backup\" .\n sc_incl \"bigsister\" .\n sc_incl \"bluetooth\" .\n sc_incl \"boot\" .\n sc_incl \"bootloader\" .\n sc_incl \"bootsplash\" .\n sc_incl \"cgred\" .\n sc_incl \"console\" .\n sc_incl \"cron\" .\n sc_incl \"ctdb\" .\n sc_incl \"cups\" .\n sc_incl \"ddclient\" .\n sc_incl \"dhcpd\" .\n sc_incl \"dhcrelay\" .\n sc_incl \"displaymanager\" .\n sc_incl \"dmraid\" .\n sc_incl \"dracd\" .\n sc_incl \"esound\" .\n sc_incl \"fam\" .\n sc_incl \"festival\" .\n sc_incl \"fetchmail\" .\n sc_incl \"fonts-config\" .\n sc_incl \"git-daemon\" .\n sc_incl \"gpsd\" .\n sc_incl \"hardware\" .\n sc_incl \"hardware\/*\" .\n sc_incl \"icecream\" .\n sc_incl \"ide\" .\n sc_incl \"infiniband\" .\n sc_incl \"inputattach\" .\n sc_incl \"ipmi\" .\n sc_incl \"ipvsadm\" .\n sc_incl \"ispell\" .\n sc_incl \"joystick\" .\n sc_incl \"kernel-tunables\" .\n sc_incl \"language\" .\n sc_incl \"ldap\" .\n sc_incl \"lighttpd\" .\n sc_incl \"lirc\" .\n sc_incl \"locate\" .\n sc_incl \"lvm\" .\n sc_incl \"mail\" .\n sc_incl \"mailman\" .\n sc_incl \"mdadm\" .\n sc_incl \"media-changer\" .\n sc_incl \"memcached\" .\n sc_incl \"mouse\" .\n sc_incl \"mpi-selector\" .\n sc_incl \"mysql\" .\n sc_incl \"nagios\" .\n sc_incl \"named\" .\n sc_incl \"ncpfs\" .\n sc_incl \"net-snmp\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"news\" .\n sc_incl \"ntp\" .\n sc_incl \"obs-server\" .\n sc_incl \"obs-worker\" .\n sc_incl \"openldap\" .\n sc_incl \"opensm\" .\n sc_incl \"osa-dispatcher\" .\n sc_incl \"pm-profiler\" .\n sc_incl \"portmap\" .\n sc_incl \"postfix\" .\n sc_incl \"postgresql\" .\n sc_incl \"product-creator\" .\n sc_incl \"proxy\" .\n sc_incl \"ptpd\" .\n sc_incl \"radvd\" .\n sc_incl \"readonlyroot\" .\n sc_incl \"rpcbind\" .\n sc_incl \"sapconf\" .\n sc_incl \"scpm\" .\n sc_incl \"seccheck\" .\n sc_incl \"security\" .\n sc_incl \"services\" .\n sc_incl \"shutdown\" .\n sc_incl \"smt-client\" .\n sc_incl \"sound\" .\n sc_incl \"spamd\" .\n sc_incl \"squid\" .\n sc_incl \"ssh\" .\n sc_incl \"storage\" .\n sc_incl \"SuSEfirewall2\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_incl \"susehelp\" .\n sc_incl \"suse_register\" .\n sc_incl \"sysctl\" .\n sc_incl \"syslog\" .\n sc_incl \"texlive\" .\n sc_incl \"ulimit\" .\n sc_incl \"websphere-as_ce-2.1\" .\n sc_incl \"windowmanager\" .\n sc_incl \"wondershaper\" .\n sc_incl \"words\" .\n sc_incl \"yast2\" .\n sc_incl \"ypbind\" .\n sc_incl \"ypserv\"\n\n let filter_sysconfig_rhn =\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/clientCaps.d\/*\" .\n sc_incl \"rhn\/osad-auth.conf\" .\n sc_incl \"rhn\/osad.conf\" .\n sc_incl \"rhn\/rhncfg-client.conf\" .\n sc_incl \"rhn\/rhncfg-manager.conf\" .\n sc_incl \"rhn\/rhnpushrc\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"rhn\/up2date\" .\n sc_incl \"rhn\/virt\" .\n sc_incl \"rhn\/virt\/auto\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/updatedb.conf\"\n\n let filter = filter_sysconfig\n . filter_sysconfig_suse\n . filter_sysconfig_rhn\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"578504d835d37d15a0c86f84d2936a5e0b9547e8","subject":"Shellvars: include \/etc\/{default,sysconfig}\/* and list exceptions instead","message":"Shellvars: include \/etc\/{default,sysconfig}\/* and list exceptions instead\n","repos":"jtopjian\/augeas,kumy\/augeas,ptoscano\/augeas,jjlin\/augeas,raphink\/augeas,jasperla\/augeas,hercules-team\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,mchf\/augeas,mchf\/augeas,kumy\/augeas,pevalme\/augeas,pevalme\/augeas,ptoscano\/augeas,domcleal\/augeas,jasperla\/augeas,dafugg\/augeas,raphink\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,jjlin\/augeas,lutter\/augeas,manandbytes\/augeas,kunkku\/augeas,MikaelSmith\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,dafugg\/augeas,kumy\/augeas,mlichvar\/augeas,lutter\/augeas,manandbytes\/augeas,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas,pevalme\/augeas,dafugg\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,domcleal\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"kernel\" .\n sc_excl \"ip*tables\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_sysconfig_suse =\n sc_incl \"abuild\" .\n sc_incl \"add-on-creator\" .\n sc_incl \"amavis\" .\n sc_incl \"amazon\" .\n sc_incl \"apache2\" .\n sc_incl \"argus\" .\n sc_incl \"arpwatch\" .\n sc_incl \"auditd\" .\n sc_incl \"autoinstall\" .\n sc_incl \"autoupdate\" .\n sc_incl \"backup\" .\n sc_incl \"bigsister\" .\n sc_incl \"bluetooth\" .\n sc_incl \"boot\" .\n sc_incl \"bootloader\" .\n sc_incl \"bootsplash\" .\n sc_incl \"cgred\" .\n sc_incl \"console\" .\n sc_incl \"cron\" .\n sc_incl \"ctdb\" .\n sc_incl \"cups\" .\n sc_incl \"ddclient\" .\n sc_incl \"dhcpd\" .\n sc_incl \"dhcrelay\" .\n sc_incl \"displaymanager\" .\n sc_incl \"dmraid\" .\n sc_incl \"dracd\" .\n sc_incl \"esound\" .\n sc_incl \"fam\" .\n sc_incl \"festival\" .\n sc_incl \"fetchmail\" .\n sc_incl \"fonts-config\" .\n sc_incl \"git-daemon\" .\n sc_incl \"gpsd\" .\n sc_incl \"hardware\" .\n sc_incl \"hardware\/*\" .\n sc_incl \"icecream\" .\n sc_incl \"ide\" .\n sc_incl \"infiniband\" .\n sc_incl \"inputattach\" .\n sc_incl \"ipmi\" .\n sc_incl \"ipvsadm\" .\n sc_incl \"ispell\" .\n sc_incl \"joystick\" .\n sc_incl \"kernel-tunables\" .\n sc_incl \"language\" .\n sc_incl \"ldap\" .\n sc_incl \"lighttpd\" .\n sc_incl \"lirc\" .\n sc_incl \"locate\" .\n sc_incl \"lvm\" .\n sc_incl \"mail\" .\n sc_incl \"mailman\" .\n sc_incl \"mdadm\" .\n sc_incl \"media-changer\" .\n sc_incl \"memcached\" .\n sc_incl \"mouse\" .\n sc_incl \"mpi-selector\" .\n sc_incl \"mysql\" .\n sc_incl \"nagios\" .\n sc_incl \"named\" .\n sc_incl \"ncpfs\" .\n sc_incl \"net-snmp\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"news\" .\n sc_incl \"ntp\" .\n sc_incl \"obs-server\" .\n sc_incl \"obs-worker\" .\n sc_incl \"openldap\" .\n sc_incl \"opensm\" .\n sc_incl \"osa-dispatcher\" .\n sc_incl \"pm-profiler\" .\n sc_incl \"portmap\" .\n sc_incl \"postfix\" .\n sc_incl \"postgresql\" .\n sc_incl \"product-creator\" .\n sc_incl \"proxy\" .\n sc_incl \"ptpd\" .\n sc_incl \"radvd\" .\n sc_incl \"readonlyroot\" .\n sc_incl \"rpcbind\" .\n sc_incl \"sapconf\" .\n sc_incl \"scpm\" .\n sc_incl \"seccheck\" .\n sc_incl \"security\" .\n sc_incl \"services\" .\n sc_incl \"shutdown\" .\n sc_incl \"smt-client\" .\n sc_incl \"sound\" .\n sc_incl \"spamd\" .\n sc_incl \"squid\" .\n sc_incl \"ssh\" .\n sc_incl \"storage\" .\n sc_incl \"SuSEfirewall2\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_incl \"susehelp\" .\n sc_incl \"suse_register\" .\n sc_incl \"sysctl\" .\n sc_incl \"syslog\" .\n sc_incl \"texlive\" .\n sc_incl \"ulimit\" .\n sc_incl \"websphere-as_ce-2.1\" .\n sc_incl \"windowmanager\" .\n sc_incl \"wondershaper\" .\n sc_incl \"words\" .\n sc_incl \"yast2\" .\n sc_incl \"ypbind\" .\n sc_incl \"ypserv\"\n\n let filter_sysconfig_rhn =\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_sysconfig_suse\n . filter_sysconfig_rhn\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"fcac272631d44149a75a52f2e6e6ce1017dcefe3","subject":"Interfaces: add \/etc\/network\/interfaces.d\/* as another commonly used location","message":"Interfaces: add \/etc\/network\/interfaces.d\/* as another commonly used location\n","repos":"jjlin\/augeas,mchf\/augeas,ptoscano\/augeas,ptoscano\/augeas,pevalme\/augeas,lutter\/augeas,raphink\/augeas,MikaelSmith\/augeas,jjlin\/augeas,ptoscano\/augeas,mlichvar\/augeas,jtopjian\/augeas,mlichvar\/augeas,pevalme\/augeas,kunkku\/augeas,jjlin\/augeas,dafugg\/augeas,dafugg\/augeas,hercules-team\/augeas,jasperla\/augeas,hercules-team\/augeas,jasperla\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,raphink\/augeas,kunkku\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,manandbytes\/augeas,kunkku\/augeas,lutter\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,mchf\/augeas,lutter\/augeas,manandbytes\/augeas","old_file":"lenses\/interfaces.aug","new_file":"lenses\/interfaces.aug","new_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man interfaces\n\n*)\n\nmodule Interfaces =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\n\n(* Define separators *)\n\n(* a line can be extended across multiple lines by making the last *)\n(* character a backslash *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Define fields *)\nlet sto_to_eol = store \/([^\\\\ \\t\\n].*[^\\\\ \\t\\n]|[^\\\\ \\t\\n])\/ . eol\nlet sto_to_spc = store \/[^\\\\ \\t\\n]+\/\n\n(* Define comments and empty lines *)\n\n(* note that the comment definition from Util does not support *)\n(* splitting lines with a backlash *)\nlet comment = Util.comment\n\nlet empty = Util.empty\n\n(* Define tree stanza_ids *)\nlet stanza_id (t:string) = key t . sep_spc . sto_to_spc\nlet stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ]\n\n(* Define reseverved words *)\nlet stanza_word = \/(source|iface|auto|allow-[a-z-]+|mapping)\/\n\n(* Define additional lines for multi-line stanzas *)\nlet stanza_option = [ del \/[ \\t]*\/ \" \"\n . key ( \/[a-z_-]+\/ - stanza_word )\n . sep_spc\n . sto_to_eol ]\n\n(************************************************************************\n * AUTO\n *************************************************************************)\n\nlet array (r:regexp) (t:string) = del r t . label t . counter t\n . [ sep_spc . seq t . sto_to_spc ]+\nlet auto = [ array \/(allow-)?auto\/ \"auto\" . eol ]\n\n(************************************************************************\n * GENERIC ALLOW\n *************************************************************************)\n\nlet allow = [ key ( \/allow-[a-z-]+\/ - \"allow-auto\" )\n . counter \"allow_seq\"\n . [ sep_spc . seq \"allow_seq\" . sto_to_spc ]+\n . eol ]\n\n(************************************************************************\n * MAPPING\n *************************************************************************)\n\nlet mapping = [ stanza_id \"mapping\"\n . eol\n . (stanza_option|comment|empty)+ ]\n\n(************************************************************************\n * IFACE\n *************************************************************************)\n\nlet iface = [ Util.indent\n . stanza_id \"iface\"\n . stanza_param \"family\"\n . stanza_param \"method\"\n . eol\n . (stanza_option|comment|empty)* ]\n\n(************************************************************************\n * SOURCE\n *************************************************************************)\n\nlet source = [ key \"source\" . sep_spc . sto_to_eol ]\n\n(************************************************************************\n * STANZAS\n *************************************************************************)\n\n(* The auto and hotplug stanzas always consist of one line only, while\n iface and mapping can spand along more lines. Comment nodes are\n inserted in the tree as direct children of the root node only when they\n come after an auto or hotplug stanza, otherwise they are considered part\n of a iface or mapping block *)\n\nlet stanza_single = (auto|allow|source) . (comment|empty)*\nlet stanza_multi = iface|mapping\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\n let lns = (comment|empty)* . (stanza_multi | stanza_single)*\n\n let filter = (incl \"\/etc\/network\/interfaces\")\n . (incl \"\/etc\/network\/interfaces.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man interfaces\n\n*)\n\nmodule Interfaces =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\n\n(* Define separators *)\n\n(* a line can be extended across multiple lines by making the last *)\n(* character a backslash *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Define fields *)\nlet sto_to_eol = store \/([^\\\\ \\t\\n].*[^\\\\ \\t\\n]|[^\\\\ \\t\\n])\/ . eol\nlet sto_to_spc = store \/[^\\\\ \\t\\n]+\/\n\n(* Define comments and empty lines *)\n\n(* note that the comment definition from Util does not support *)\n(* splitting lines with a backlash *)\nlet comment = Util.comment\n\nlet empty = Util.empty\n\n(* Define tree stanza_ids *)\nlet stanza_id (t:string) = key t . sep_spc . sto_to_spc\nlet stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ]\n\n(* Define reseverved words *)\nlet stanza_word = \/(source|iface|auto|allow-[a-z-]+|mapping)\/\n\n(* Define additional lines for multi-line stanzas *)\nlet stanza_option = [ del \/[ \\t]*\/ \" \"\n . key ( \/[a-z_-]+\/ - stanza_word )\n . sep_spc\n . sto_to_eol ]\n\n(************************************************************************\n * AUTO\n *************************************************************************)\n\nlet array (r:regexp) (t:string) = del r t . label t . counter t\n . [ sep_spc . seq t . sto_to_spc ]+\nlet auto = [ array \/(allow-)?auto\/ \"auto\" . eol ]\n\n(************************************************************************\n * GENERIC ALLOW\n *************************************************************************)\n\nlet allow = [ key ( \/allow-[a-z-]+\/ - \"allow-auto\" )\n . counter \"allow_seq\"\n . [ sep_spc . seq \"allow_seq\" . sto_to_spc ]+\n . eol ]\n\n(************************************************************************\n * MAPPING\n *************************************************************************)\n\nlet mapping = [ stanza_id \"mapping\"\n . eol\n . (stanza_option|comment|empty)+ ]\n\n(************************************************************************\n * IFACE\n *************************************************************************)\n\nlet iface = [ Util.indent\n . stanza_id \"iface\"\n . stanza_param \"family\"\n . stanza_param \"method\"\n . eol\n . (stanza_option|comment|empty)* ]\n\n(************************************************************************\n * SOURCE\n *************************************************************************)\n\nlet source = [ key \"source\" . sep_spc . sto_to_eol ]\n\n(************************************************************************\n * STANZAS\n *************************************************************************)\n\n(* The auto and hotplug stanzas always consist of one line only, while\n iface and mapping can spand along more lines. Comment nodes are\n inserted in the tree as direct children of the root node only when they\n come after an auto or hotplug stanza, otherwise they are considered part\n of a iface or mapping block *)\n\nlet stanza_single = (auto|allow|source) . (comment|empty)*\nlet stanza_multi = iface|mapping\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\n let lns = (comment|empty)* . (stanza_multi | stanza_single)*\n\n let filter = incl \"\/etc\/network\/interfaces\"\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"bb1fce44e4e547e89d5e40c2367e04cdb232ca7c","subject":"Test_Nginx: no functional change, reformatted","message":"Test_Nginx: no functional change, reformatted\n","repos":"kunkku\/augeas,lutter\/augeas,jjlin\/augeas,ptoscano\/augeas,dafugg\/augeas,jtopjian\/augeas,kunkku\/augeas,manandbytes\/augeas,manandbytes\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,kunkku\/augeas,jjlin\/augeas,dafugg\/augeas,pevalme\/augeas,mchf\/augeas,hercules-team\/augeas,mlichvar\/augeas,pevalme\/augeas,jasperla\/augeas,hercules-team\/augeas,lutter\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,pevalme\/augeas,ptoscano\/augeas,jasperla\/augeas,dafugg\/augeas,jtopjian\/augeas,mchf\/augeas,lutter\/augeas,jjlin\/augeas","old_file":"lenses\/tests\/test_nginx.aug","new_file":"lenses\/tests\/test_nginx.aug","new_contents":"(*\nModule: Test_Nginx\n Provides unit tests and examples for the <Nginx> lens.\n*)\nmodule Test_nginx =\n\nlet lns = Nginx.lns\n\nlet conf =\"user nginx nginx;\nworker_processes 1;\nerror_log \/var\/log\/nginx\/error_log info;\n\nevents {\n worker_connections 1024;\n use epoll;\n}\n\n# comment1\n# comment2\n\nhttp {\n\t# comment3\n include \/etc\/nginx\/mime.types;\n default_type application\/octet-stream;\n log_format main\n '$remote_addr - $remote_user [$time_local] '\n '\\\"$request\\\" $status $bytes_sent '\n '\\\"$http_referer\\\" \\\"$http_user_agent\\\" '\n '\\\"$gzip_ratio\\\"';\n client_header_timeout 10m;\n client_body_timeout 10m;\n send_timeout 10m;\n connection_pool_size 256;\n client_header_buffer_size 2k;\n large_client_header_buffers 4 8k;\n request_pool_size 4k;\n gzip on;\n\tgzip_min_length 1000;\n gzip_buffers 4 8k;\n gzip_types text\/plain application\/json;\n output_buffers 1 32k;\n postpone_output 1460;\n sendfile on;\n tcp_nopush on;\n tcp_nodelay on;\n keepalive_timeout 75 20;\n ignore_invalid_headers on;\n index index.html index.php;\n include vhosts\/*.conf;\n}\n\"\n\ntest lns get conf =\n { \"user\" = \"nginx nginx\" }\n { \"worker_processes\" = \"1\" }\n { \"error_log\" = \"\/var\/log\/nginx\/error_log info\" }\n {}\n { \"events\"\n { \"worker_connections\" = \"1024\" }\n { \"use\" = \"epoll\" } }\n {}\n { \"#comment\" = \"comment1\" }\n { \"#comment\" = \"comment2\" }\n {}\n { \"http\"\n \t { \"#comment\" = \"comment3\" }\n { \"include\" = \"\/etc\/nginx\/mime.types\" }\n { \"default_type\" = \"application\/octet-stream\" }\n { \"log_format\" = \"main\n '$remote_addr - $remote_user [$time_local] '\n '\\\"$request\\\" $status $bytes_sent '\n '\\\"$http_referer\\\" \\\"$http_user_agent\\\" '\n '\\\"$gzip_ratio\\\"'\" }\n { \"client_header_timeout\" = \"10m\" }\n { \"client_body_timeout\" = \"10m\" }\n { \"send_timeout\" = \"10m\" }\n { \"connection_pool_size\" = \"256\" }\n { \"client_header_buffer_size\" = \"2k\" }\n { \"large_client_header_buffers\" = \"4 8k\" }\n { \"request_pool_size\" = \"4k\" }\n { \"gzip\" = \"on\" }\n { \"gzip_min_length\" = \"1000\" }\n { \"gzip_buffers\" = \"4 8k\" }\n { \"gzip_types\" = \"text\/plain application\/json\" }\n { \"output_buffers\" = \"1 32k\" }\n { \"postpone_output\" = \"1460\" }\n { \"sendfile\" = \"on\" }\n { \"tcp_nopush\" = \"on\" }\n { \"tcp_nodelay\" = \"on\" }\n { \"keepalive_timeout\" = \"75 20\" }\n { \"ignore_invalid_headers\" = \"on\" }\n { \"index\" = \"index.html index.php\" }\n { \"include\" = \"vhosts\/*.conf\" } }\n","old_contents":"(*\nModule: Test_Nginx\n Provides unit tests and examples for the <Nginx> lens.\n*)\nmodule Test_nginx = \n\n let conf =\"user nginx nginx;\nworker_processes 1;\nerror_log \/var\/log\/nginx\/error_log info;\n\nevents {\n worker_connections 1024;\n use epoll;\n}\n\n# comment1\n# comment2\n\nhttp {\n\t# comment3\n include \/etc\/nginx\/mime.types;\n default_type application\/octet-stream;\n log_format main\n '$remote_addr - $remote_user [$time_local] '\n '\\\"$request\\\" $status $bytes_sent '\n '\\\"$http_referer\\\" \\\"$http_user_agent\\\" '\n '\\\"$gzip_ratio\\\"';\n client_header_timeout 10m;\n client_body_timeout 10m;\n send_timeout 10m;\n connection_pool_size 256;\n client_header_buffer_size 2k;\n large_client_header_buffers 4 8k;\n request_pool_size 4k;\n gzip on;\n\tgzip_min_length 1000;\n gzip_buffers 4 8k;\n gzip_types text\/plain application\/json;\n output_buffers 1 32k;\n postpone_output 1460;\n sendfile on;\n tcp_nopush on;\n tcp_nodelay on;\n keepalive_timeout 75 20;\n ignore_invalid_headers on;\n index index.html index.php;\n include vhosts\/*.conf;\n}\n\"\n\n test Nginx.lns get conf =\n { \"user\" = \"nginx nginx\" }\n { \"worker_processes\" = \"1\" }\n { \"error_log\" = \"\/var\/log\/nginx\/error_log info\" }\n {}\n { \"events\"\n { \"worker_connections\" = \"1024\" }\n { \"use\" = \"epoll\" } }\n {}\n { \"#comment\" = \"comment1\" }\n { \"#comment\" = \"comment2\" }\n {}\n { \"http\"\n \t { \"#comment\" = \"comment3\" }\n { \"include\" = \"\/etc\/nginx\/mime.types\" }\n { \"default_type\" = \"application\/octet-stream\" }\n { \"log_format\" = \"main\n '$remote_addr - $remote_user [$time_local] '\n '\\\"$request\\\" $status $bytes_sent '\n '\\\"$http_referer\\\" \\\"$http_user_agent\\\" '\n '\\\"$gzip_ratio\\\"'\" }\n { \"client_header_timeout\" = \"10m\" }\n { \"client_body_timeout\" = \"10m\" }\n { \"send_timeout\" = \"10m\" } \n { \"connection_pool_size\" = \"256\" } \n { \"client_header_buffer_size\" = \"2k\" } \n { \"large_client_header_buffers\" = \"4 8k\" } \n { \"request_pool_size\" = \"4k\" } \n { \"gzip\" = \"on\" } \n { \"gzip_min_length\" = \"1000\" } \n { \"gzip_buffers\" = \"4 8k\" } \n { \"gzip_types\" = \"text\/plain application\/json\" } \n { \"output_buffers\" = \"1 32k\" } \n { \"postpone_output\" = \"1460\" } \n { \"sendfile\" = \"on\" } \n { \"tcp_nopush\" = \"on\" } \n { \"tcp_nodelay\" = \"on\" } \n { \"keepalive_timeout\" = \"75 20\" } \n { \"ignore_invalid_headers\" = \"on\" } \n { \"index\" = \"index.html index.php\" } \n { \"include\" = \"vhosts\/*.conf\" } }\n \n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"207624d6cd30b244d85ddd3260454ead8be05d6b","subject":"Support debug flag in keepalived.aug","message":"Support debug flag in keepalived.aug\n","repos":"hercules-team\/augeas-do-not-use,ptoscano\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,MikaelSmith\/augeas,domcleal\/augeas,hercules-team\/augeas,mchf\/augeas,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,kumy\/augeas,jjlin\/augeas,ptoscano\/augeas,domcleal\/augeas,pevalme\/augeas,kunkku\/augeas,kunkku\/augeas,jtopjian\/augeas,dafugg\/augeas,kumy\/augeas,raphink\/augeas,dafugg\/augeas,mchf\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,jasperla\/augeas,pevalme\/augeas,jjlin\/augeas,domcleal\/augeas,ptoscano\/augeas,jjlin\/augeas,hercules-team\/augeas,jasperla\/augeas,lutter\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kumy\/augeas,mlichvar\/augeas,lutter\/augeas,dafugg\/augeas","old_file":"lenses\/keepalived.aug","new_file":"lenses\/keepalived.aug","new_contents":"(*\nModule: Keepalived\n Parses \/etc\/keepalived\/keepalived.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 keepalived.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/keepalived\/keepalived.conf. See <filter>.\n*)\n\n\nmodule Keepalived =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Comments and empty lines *)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: opt_eol *)\nlet opt_eol = del \/[ \\t]*\\n?\/ \" \"\n\n(* View: sep_spc *)\nlet sep_spc = Sep.space\n\n(* View: sep_opt_spc *)\nlet sep_opt_spc = Sep.opt_space\n\n(* View: sep_dquot *)\nlet sep_dquot = Util.del_str \"\\\"\"\n\n(* View: lbracket *)\nlet lbracket = Util.del_str \"{\"\n\n(* View: rbracket *)\nlet rbracket = Util.del_str \"}\"\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment = Util.comment_generic \/[ \\t]*[#!][ \\t]*\/ \"# \"\n\n(* View: comment_eol\nMap comments at eol *)\nlet comment_eol = Util.comment_generic \/[ \\t]*[#!][ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/[ \\t]*[#!]?\\n\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = Util.empty\n\n(* View: sto_email_addr *)\nlet sto_email_addr = store Rx.email_addr\n\n(* Variable: word *)\nlet word = Rx.word\n\n(* Variable: word_slash *)\nlet word_slash = word | \"\/\"\n\n(* View: sto_word *)\nlet sto_word = store word\n\n(* View: sto_num *)\nlet sto_num = store Rx.relinteger\n\n(* View: sto_to_eol *)\nlet sto_to_eol = store \/[^#! \\t\\n][^#!\\n]*[^#! \\t\\n]|[^#! \\t\\n]\/\n\n(* View: field *)\nlet field (kw:string) (sto:lens) = indent . Build.key_value_line_comment kw sep_spc sto comment_eol\n\n(* View: flag\nA single word *)\nlet flag (kw:regexp) = [ indent . key kw . comment_or_eol ]\n\n(* View: lens_block \nA generic block with a title lens *)\nlet lens_block (title:lens) (sto:lens) = [ indent . title . opt_eol . lbracket\n . (sto | empty | comment)+\n . indent . rbracket . eol ]\n\n(* View: block\nA simple block with just a block title *)\nlet block (kw:string) (sto:lens) = lens_block (key kw) sto\n\n(* View: named_block \nA block with a block title and name *)\nlet named_block (kw:string) (sto:lens) = lens_block (key kw . sep_spc . sto_word) sto\n\n(* View: named_block_arg_title\nA title lens for named_block_arg *)\nlet named_block_arg_title (kw:string) (name:string) (arg:string) = \n key kw . sep_spc\n . [ label name . sto_word ]\n . sep_spc\n . [ label arg . sto_word ]\n\n(* View: named_block_arg\nA block with a block title, a name and an argument *)\nlet named_block_arg (kw:string) (name:string) (arg:string) (sto:lens) = \n lens_block (named_block_arg_title kw name arg) sto\n\n\n(************************************************************************\n * Group: GLOBAL CONFIGURATION\n *************************************************************************)\n\n(* View: email\nA simple email address entry *)\nlet email = [ indent . label \"email\" . sto_email_addr . comment_or_eol ]\n\n(* View: global_defs_field\nPossible fields in the global_defs block *)\nlet global_defs_field = block \"notification_email\" email\n | field \"notification_email_from\" sto_email_addr\n | field \"smtp_server\" sto_word\n | field \"smtp_connect_timeout\" sto_num\n | field \"lvs_id\" sto_word\n | field \"router_id\" sto_word\n\n(* View: global_defs\nA global_defs block *)\nlet global_defs = block \"global_defs\" global_defs_field\n\n(* View: prefixlen\nA prefix for IP addresses *)\nlet prefixlen = [ label \"prefixlen\" . Util.del_str \"\/\" . sto_num ]\n\n(* View: ipaddr\nAn IP address or range with an optional mask *)\nlet ipaddr = label \"ipaddr\" . store \/[0-9.-]+\/ . prefixlen?\n\n(* View: ipdev\nA device for IP addresses *)\nlet ipdev = [ key \"dev\" . sep_spc . sto_word ]\n\n(* View: static_ipaddress_field\nThe whole string is fed to ip addr add.\nYou can truncate the string anywhere you like and let ip addr add use defaults for the rest of the string.\nTo be refined with fields according to `ip addr help`.\n*)\nlet static_ipaddress_field = [ indent . ipaddr\n . (sep_spc . ipdev)?\n . comment_or_eol ]\n\n(* View: static_routes_field\nsrc $SRC_IP to $DST_IP dev $SRC_DEVICE\n*)\nlet static_routes_field = [ indent . label \"route\"\n . [ key \"src\" . sto_word ] . sep_spc\n . [ key \"to\" . sto_word ] . sep_spc\n . [ key \"dev\" . sto_word ] . comment_or_eol ]\n\n(* View: static_routes *)\nlet static_routes = block \"static_ipaddress\" static_ipaddress_field\n | block \"static_routes\" static_routes_field\n\n\n(* View: global_conf \nA global configuration entry *)\nlet global_conf = global_defs | static_routes\n\n\n(************************************************************************\n * Group: VRRP CONFIGURATION\n *************************************************************************)\n\n(*View: vrrp_sync_group_field *)\nlet vrrp_sync_group_field = block \"group\" [ indent . key word . comment_or_eol ]\n\n(* View: vrrp_sync_group *)\nlet vrrp_sync_group = named_block \"vrrp_sync_group\" vrrp_sync_group_field\n\n(* View: vrrp_instance_field *)\nlet vrrp_instance_field = field \"state\" sto_word\n | field \"interface\" sto_word\n | field \"lvs_sync_daemon_interface\" sto_word\n | field \"virtual_router_id\" sto_num\n | field \"priority\" sto_num\n | field \"advert_int\" sto_num\n | field \"garp_master_delay\" sto_num\n | field \"notify_master\" sto_to_eol\n | field \"notify_backup\" sto_to_eol\n | field \"notify_fault\" sto_to_eol\n | flag \"smtp_alert\"\n | flag \"nopreempt\"\n | flag \"ha_suspend\"\n | flag \"debug\"\n | block \"authentication\" (\n field \"auth_type\" sto_word\n | field \"auth_pass\" sto_word\n )\n | block \"virtual_ipaddress\" static_ipaddress_field\n | block \"track_interface\" ( flag word )\n | block \"track_script\" ( flag word )\n\n(* View: vrrp_instance *)\nlet vrrp_instance = named_block \"vrrp_instance\" vrrp_instance_field\n\n(* View: vrrp_script_field *)\nlet vrrp_script_field = field \"script\" sto_to_eol\n | field \"interval\" sto_num\n | field \"weight\" sto_num\n\n(* View: vrrp_script *)\nlet vrrp_script = named_block \"vrrp_script\" vrrp_script_field\n\n\n(* View: vrrpd_conf\ncontains subblocks of VRRP synchronization group(s) and VRRP instance(s) *)\nlet vrrpd_conf = vrrp_sync_group | vrrp_instance | vrrp_script\n\n\n(************************************************************************\n * Group: LVS CONFIGURATION\n *************************************************************************)\n\n(* View: tcp_check_field *)\nlet tcp_check_field = field \"connect_timeout\" sto_num\n | field \"connect_port\" sto_num\n\n(* View: real_server_field *)\nlet real_server_field = field \"weight\" sto_num\n | block \"TCP_CHECK\" tcp_check_field\n\n(* View: virtual_server_field *)\nlet virtual_server_field = field \"delay_loop\" sto_num\n | field \"lb_algo\" sto_word\n | field \"lb_kind\" sto_word\n | field \"nat_mask\" sto_word\n | field \"protocol\" sto_word\n | named_block_arg \"real_server\" \"ip\" \"port\" real_server_field\n\n(* View: virtual_server *)\nlet virtual_server = named_block_arg \"virtual_server\" \"ip\" \"port\" virtual_server_field\n\n(* View: virtual_server_group_field *)\nlet virtual_server_group_field = [ indent . label \"vip\"\n . [ ipaddr ]\n\t\t\t . sep_spc\n\t\t\t . [ label \"port\" . sto_num ]\n\t\t\t . comment_or_eol ]\n\n(* View: virtual_server_group *)\nlet virtual_server_group = named_block \"virtual_server_group\" virtual_server_group_field\n\n(* View: lvs_conf\ncontains subblocks of Virtual server group(s) and Virtual server(s) *)\nlet lvs_conf = virtual_server | virtual_server_group\n\n\n(* View: lns\n The keepalived lens\n*)\nlet lns = ( empty | comment | global_conf | vrrpd_conf | lvs_conf )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/keepalived\/keepalived.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(*\nModule: Keepalived\n Parses \/etc\/keepalived\/keepalived.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 keepalived.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/keepalived\/keepalived.conf. See <filter>.\n*)\n\n\nmodule Keepalived =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Comments and empty lines *)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: opt_eol *)\nlet opt_eol = del \/[ \\t]*\\n?\/ \" \"\n\n(* View: sep_spc *)\nlet sep_spc = Sep.space\n\n(* View: sep_opt_spc *)\nlet sep_opt_spc = Sep.opt_space\n\n(* View: sep_dquot *)\nlet sep_dquot = Util.del_str \"\\\"\"\n\n(* View: lbracket *)\nlet lbracket = Util.del_str \"{\"\n\n(* View: rbracket *)\nlet rbracket = Util.del_str \"}\"\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment = Util.comment_generic \/[ \\t]*[#!][ \\t]*\/ \"# \"\n\n(* View: comment_eol\nMap comments at eol *)\nlet comment_eol = Util.comment_generic \/[ \\t]*[#!][ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/[ \\t]*[#!]?\\n\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = Util.empty\n\n(* View: sto_email_addr *)\nlet sto_email_addr = store Rx.email_addr\n\n(* Variable: word *)\nlet word = Rx.word\n\n(* Variable: word_slash *)\nlet word_slash = word | \"\/\"\n\n(* View: sto_word *)\nlet sto_word = store word\n\n(* View: sto_num *)\nlet sto_num = store Rx.relinteger\n\n(* View: sto_to_eol *)\nlet sto_to_eol = store \/[^#! \\t\\n][^#!\\n]*[^#! \\t\\n]|[^#! \\t\\n]\/\n\n(* View: field *)\nlet field (kw:string) (sto:lens) = indent . Build.key_value_line_comment kw sep_spc sto comment_eol\n\n(* View: flag\nA single word *)\nlet flag (kw:regexp) = [ indent . key kw . comment_or_eol ]\n\n(* View: lens_block \nA generic block with a title lens *)\nlet lens_block (title:lens) (sto:lens) = [ indent . title . opt_eol . lbracket\n . (sto | empty | comment)+\n . indent . rbracket . eol ]\n\n(* View: block\nA simple block with just a block title *)\nlet block (kw:string) (sto:lens) = lens_block (key kw) sto\n\n(* View: named_block \nA block with a block title and name *)\nlet named_block (kw:string) (sto:lens) = lens_block (key kw . sep_spc . sto_word) sto\n\n(* View: named_block_arg_title\nA title lens for named_block_arg *)\nlet named_block_arg_title (kw:string) (name:string) (arg:string) = \n key kw . sep_spc\n . [ label name . sto_word ]\n . sep_spc\n . [ label arg . sto_word ]\n\n(* View: named_block_arg\nA block with a block title, a name and an argument *)\nlet named_block_arg (kw:string) (name:string) (arg:string) (sto:lens) = \n lens_block (named_block_arg_title kw name arg) sto\n\n\n(************************************************************************\n * Group: GLOBAL CONFIGURATION\n *************************************************************************)\n\n(* View: email\nA simple email address entry *)\nlet email = [ indent . label \"email\" . sto_email_addr . comment_or_eol ]\n\n(* View: global_defs_field\nPossible fields in the global_defs block *)\nlet global_defs_field = block \"notification_email\" email\n | field \"notification_email_from\" sto_email_addr\n | field \"smtp_server\" sto_word\n | field \"smtp_connect_timeout\" sto_num\n | field \"lvs_id\" sto_word\n | field \"router_id\" sto_word\n\n(* View: global_defs\nA global_defs block *)\nlet global_defs = block \"global_defs\" global_defs_field\n\n(* View: prefixlen\nA prefix for IP addresses *)\nlet prefixlen = [ label \"prefixlen\" . Util.del_str \"\/\" . sto_num ]\n\n(* View: ipaddr\nAn IP address or range with an optional mask *)\nlet ipaddr = label \"ipaddr\" . store \/[0-9.-]+\/ . prefixlen?\n\n(* View: ipdev\nA device for IP addresses *)\nlet ipdev = [ key \"dev\" . sep_spc . sto_word ]\n\n(* View: static_ipaddress_field\nThe whole string is fed to ip addr add.\nYou can truncate the string anywhere you like and let ip addr add use defaults for the rest of the string.\nTo be refined with fields according to `ip addr help`.\n*)\nlet static_ipaddress_field = [ indent . ipaddr\n . (sep_spc . ipdev)?\n . comment_or_eol ]\n\n(* View: static_routes_field\nsrc $SRC_IP to $DST_IP dev $SRC_DEVICE\n*)\nlet static_routes_field = [ indent . label \"route\"\n . [ key \"src\" . sto_word ] . sep_spc\n . [ key \"to\" . sto_word ] . sep_spc\n . [ key \"dev\" . sto_word ] . comment_or_eol ]\n\n(* View: static_routes *)\nlet static_routes = block \"static_ipaddress\" static_ipaddress_field\n | block \"static_routes\" static_routes_field\n\n\n(* View: global_conf \nA global configuration entry *)\nlet global_conf = global_defs | static_routes\n\n\n(************************************************************************\n * Group: VRRP CONFIGURATION\n *************************************************************************)\n\n(*View: vrrp_sync_group_field *)\nlet vrrp_sync_group_field = block \"group\" [ indent . key word . comment_or_eol ]\n\n(* View: vrrp_sync_group *)\nlet vrrp_sync_group = named_block \"vrrp_sync_group\" vrrp_sync_group_field\n\n(* View: vrrp_instance_field *)\nlet vrrp_instance_field = field \"state\" sto_word\n | field \"interface\" sto_word\n | field \"lvs_sync_daemon_interface\" sto_word\n | field \"virtual_router_id\" sto_num\n | field \"priority\" sto_num\n | field \"advert_int\" sto_num\n | field \"garp_master_delay\" sto_num\n | field \"notify_master\" sto_to_eol\n | field \"notify_backup\" sto_to_eol\n | field \"notify_fault\" sto_to_eol\n | flag \"smtp_alert\"\n | flag \"nopreempt\"\n | flag \"ha_suspend\"\n | block \"authentication\" (\n field \"auth_type\" sto_word\n | field \"auth_pass\" sto_word\n )\n | block \"virtual_ipaddress\" static_ipaddress_field\n | block \"track_interface\" ( flag word )\n | block \"track_script\" ( flag word )\n\n(* View: vrrp_instance *)\nlet vrrp_instance = named_block \"vrrp_instance\" vrrp_instance_field\n\n(* View: vrrp_script_field *)\nlet vrrp_script_field = field \"script\" sto_to_eol\n | field \"interval\" sto_num\n | field \"weight\" sto_num\n\n(* View: vrrp_script *)\nlet vrrp_script = named_block \"vrrp_script\" vrrp_script_field\n\n\n(* View: vrrpd_conf\ncontains subblocks of VRRP synchronization group(s) and VRRP instance(s) *)\nlet vrrpd_conf = vrrp_sync_group | vrrp_instance | vrrp_script\n\n\n(************************************************************************\n * Group: LVS CONFIGURATION\n *************************************************************************)\n\n(* View: tcp_check_field *)\nlet tcp_check_field = field \"connect_timeout\" sto_num\n | field \"connect_port\" sto_num\n\n(* View: real_server_field *)\nlet real_server_field = field \"weight\" sto_num\n | block \"TCP_CHECK\" tcp_check_field\n\n(* View: virtual_server_field *)\nlet virtual_server_field = field \"delay_loop\" sto_num\n | field \"lb_algo\" sto_word\n | field \"lb_kind\" sto_word\n | field \"nat_mask\" sto_word\n | field \"protocol\" sto_word\n | named_block_arg \"real_server\" \"ip\" \"port\" real_server_field\n\n(* View: virtual_server *)\nlet virtual_server = named_block_arg \"virtual_server\" \"ip\" \"port\" virtual_server_field\n\n(* View: virtual_server_group_field *)\nlet virtual_server_group_field = [ indent . label \"vip\"\n . [ ipaddr ]\n\t\t\t . sep_spc\n\t\t\t . [ label \"port\" . sto_num ]\n\t\t\t . comment_or_eol ]\n\n(* View: virtual_server_group *)\nlet virtual_server_group = named_block \"virtual_server_group\" virtual_server_group_field\n\n(* View: lvs_conf\ncontains subblocks of Virtual server group(s) and Virtual server(s) *)\nlet lvs_conf = virtual_server | virtual_server_group\n\n\n(* View: lns\n The keepalived lens\n*)\nlet lns = ( empty | comment | global_conf | vrrpd_conf | lvs_conf )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/keepalived\/keepalived.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cbfeb0667315e65ee23be8174da55468c0fdd4ea","subject":"Fix up auditd lens.","message":"Fix up auditd lens.\n","repos":"tomhurd\/clip,ykhodorkovskiy\/clip,ykhodorkovskiy\/clip,quark-pat\/CLIP,tomhurd\/clip,quark-pat\/CLIP,quark-pat\/CLIP,quark-pat\/CLIP,rprevette\/clip,rprevette\/clip,tomhurd\/clip,tomhurd\/clip,tomhurd\/clip,quark-pat\/CLIP,rprevette\/clip,quark-pat\/CLIP,rprevette\/clip,ykhodorkovskiy\/clip,ykhodorkovskiy\/clip,quark-pat\/CLIP,tomhurd\/clip","old_file":"packages\/clip-puppet\/clip-puppet\/modules\/auditd\/lib\/augeas\/lenses\/auditd.aug","new_file":"packages\/clip-puppet\/clip-puppet\/modules\/auditd\/lib\/augeas\/lenses\/auditd.aug","new_contents":"(* Audit Module lens\nCreated by Michael Palmiotto *)\nmodule Audit =\n autoload xfm\n\n(* Define commonly used expressions *) \n let equals = del \/=[ \\t]*\/ \"= \"\n let space = Util.del_ws_spc \n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let comment = Util.comment\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(* Define empty *)\n let empty = [ del \/[ \\t]*\\n\/ \"\" ]\n\n let control_entry (kw:string) = [ key kw . space . equals . space . value_to_eol . eol ]\n let controls = control_entry \"log_file\"\n | control_entry \"log_format\"\n | control_entry \"priority_boost\"\n | control_entry \"flush\"\n | control_entry \"freq\"\n | control_entry \"num_logs\"\n | control_entry \"max_log_file\"\n | control_entry \"max_log_file_action\"\n | control_entry \"action_mail_acct\"\n | control_entry \"space_left\"\n | control_entry \"space_left_action\"\n | control_entry \"admin_space_left\"\n | control_entry \"admin_space_left_action\"\n | control_entry \"disk_full_action\"\n | control_entry \"disk_error_action\"\n\n \n let lns = (comment|empty|control_entry)*\n let filter = incl \"\/etc\/audit\/auditd.conf\" . excl \"#*#\" . excl \".*\" . Util.stdexcl\n let xfm = transform lns filter\n\n (* Local Variables: *)\n (* mode: caml *)\n (* End: *)\n","old_contents":"(* Audit Module lens\nCreated by Michael Palmiotto *)\nmodule Audit =\n autoload xfm\n\n(* Define commonly used expressions *) \n let equals = del \/=[ \\t]*\/ \"= \"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let comment = Util.comment\n let value_to_eol = store ( \/[^\\n]*\/ - \/([ \\t][^\\n]*|[^\\n]*[ \\t])\/\n\n(* Define empty *)\n let empty = [ del \/[ \\t]*\\n\/ \"\" ]\n\n let control_entry (kw:string) = [ key kw . equals . value_to_eol . eol ]\n let controls = control_entry \"log_file\"\n | control_entry \"log_format\"\n | control_entry \"priority_boost\n | control_entry \"flush\"\n | control_entry \"freq\"\n | control_entry \"num_logs\n | control_entry \"max_log_file\"\n | control_entry \"max_log_file_action\"\n | control_entry \"action_mail_acct\"\n | control_entry \"space_left\"\n | control_entry \"space_left_action\"\n | control_entry \"admin_space_left\"\n | control_entry \"admin_space_left_action\"\n | control_entry \"disk_full_action\"\n | control_entry \"disk_error_action\"\n\n let record = [ seq \"record\" . controls+ ]\n\n let lns = empty* . ( record . empty )* . record?\n let filter = incl \"\/etc\/audit\/auditd.conf\" . \"Util.stdexcl\n let xfm = transform lns filter\n\n (* Local Variables: *)\n (* mode: caml *)\n (* End: *)\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"38527b6ff0bb9cf99fb95bc9cf657361676de428","subject":"Xorg: \"position\" in \"screen\" section is optional; allow \"Extensions\" section","message":"Xorg: \"position\" in \"screen\" section is optional; allow \"Extensions\" section\n\nPatch by omzzk\n\nFixes bug #175\n","repos":"mlichvar\/augeas,hercules-team\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,jjlin\/augeas,lutter\/augeas,kunkku\/augeas,kumy\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,mlichvar\/augeas,mchf\/augeas,GeoffWilliams\/augeas,raphink\/augeas,dafugg\/augeas,kunkku\/augeas,dafugg\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,pevalme\/augeas,raphink\/augeas,kumy\/augeas,mchf\/augeas,kumy\/augeas,jasperla\/augeas,mlichvar\/augeas,lutter\/augeas,ptoscano\/augeas,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,ptoscano\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,pevalme\/augeas,kunkku\/augeas","old_file":"lenses\/xorg.aug","new_file":"lenses\/xorg.aug","new_contents":"(*\nModule: Xorg\n Parses \/etc\/X11\/xorg.conf\n\nAuthors: Raphael Pinson <raphink@gmail.com>\n Matthew Booth <mbooth@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man xorg.conf` where\n possible.\n\nThe definitions from `man xorg.conf` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Configuration files\n This lens applies to \/etc\/X11\/xorg.conf. See <filter>.\n*)\n\nmodule Xorg =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: to_eol\n * Match everything from here to eol, cropping whitespace at both ends\n *)\nlet to_eol = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Fields and values *)\n\n(* Variable: entries_re\n * This is a list of all patterns which have specific handlers, and should\n * therefore not be matched by the generic handler\n *)\nlet entries_re = \/([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth|[dD]evice)\/\n\n(* Variable: generic_entry_re *)\nlet generic_entry_re = \/[^# \\t\\n\\\/]+\/ - entries_re\n\n(* Variable: quoted_string_val *)\nlet quoted_string_val = del \"\\\"\" \"\\\"\" . store \/[^\"\\n]+\/ . del \"\\\"\" \"\\\"\"\n (* \" relax, emacs *)\n\n(* Variable: int *)\nlet int = \/[0-9]+\/\n\n\n(************************************************************************\n * Group: ENTRIES AND OPTIONS\n *************************************************************************)\n\n\n(* View: entry_int\n * This matches an entry which takes a single integer for an argument\n *)\nlet entry_int (canon:string) (re:regexp) =\n [ indent . del re canon . label canon . sep_spc . store int . eol ]\n\n(* View: entry_rgb\n * This matches an entry which takes 3 integers as arguments representing red,\n * green and blue components\n *)\nlet entry_rgb (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"red\" . sep_spc . store int ]\n . [ label \"green\" . sep_spc . store int ]\n . [ label \"blue\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_xy\n * This matches an entry which takes 2 integers as arguments representing X and\n * Y coordinates\n *)\nlet entry_xy (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"x\" . sep_spc . store int ]\n . [ label \"y\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_str\n * This matches an entry which takes a single quoted string\n *)\nlet entry_str (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . sep_spc . quoted_string_val . eol ]\n\n(* View: entry_generic\n * An entry without a specific handler. Store everything after the keyword,\n * cropping whitespace at both ends.\n *)\nlet entry_generic = [ indent . key generic_entry_re\n . sep_spc . store to_eol . eol ]\n\n(* View: option *)\nlet option = [ indent . del \/[oO]ption\/ \"Option\" . label \"Option\" . sep_spc\n . quoted_string_val\n . [ label \"value\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: screen\n * The Screen entry of ServerLayout\n *)\nlet screen = [ indent . del \/[sS]creen\/ \"Screen\" . label \"Screen\" . sep_spc\n . [ label \"num\" . store int . sep_spc ]?\n . quoted_string_val\n . [ sep_spc . label \"position\" . store to_eol ]?\n . eol ]\n\n(* View: input_device *)\nlet input_device = [ indent . del \/[iI]nput[dD]evice\/ \"InputDevice\"\n . label \"InputDevice\" . sep_spc . quoted_string_val\n . [ label \"option\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: driver *)\nlet driver = entry_str \"Driver\" \/[dD]river\/\n\n(* View: identifier *)\nlet identifier = entry_str \"Identifier\" \/[iI]dentifier\/\n\n(* View: videoram *)\nlet videoram = entry_int \"VideoRam\" \/[vV]ideo[rR]am\/\n\n(* View: default_depth *)\nlet default_depth = entry_int \"DefaultDepth\" \/[dD]efault[dD]epth\/\n\n(* View: device *)\nlet device = entry_str \"Device\" \/[dD]evice\/\n\n(************************************************************************\n * Group: DISPLAY SUBSECTION\n *************************************************************************)\n\n\n(* View: display_modes *)\nlet display_modes = [ indent . del \/[mM]odes\/ \"Modes\" . label \"Modes\"\n . [ label \"mode\" . sep_spc . quoted_string_val ]+\n . eol ]\n\n(*************************************************************************\n * View: display_entry\n * Known values for entries in the Display subsection\n *\n * Definition:\n * > Depth depth\n * > FbBpp bpp\n * > Weight red-weight green-weight blue-weight\n * > Virtual xdim ydim\n * > ViewPort x0 y0\n * > Modes \"mode-name\" ...\n * > Visual \"visual-name\"\n * > Black red green blue\n * > White red green blue\n * > Options\n *)\n\nlet display_entry = entry_int \"Depth\" \/[dD]epth\/ |\n entry_int \"FbBpp\" \/[fF]b[bB]pp\/ |\n entry_rgb \"Weight\" \/[wW]eight\/ |\n entry_xy \"Virtual\" \/[vV]irtual\/ |\n entry_xy \"ViewPort\" \/[vV]iew[pP]ort\/ |\n display_modes |\n entry_str \"Visual\" \/[vV]isual\/ |\n entry_rgb \"Black\" \/[bB]lack\/ |\n entry_rgb \"White\" \/[wW]hite\/ |\n entry_str \"Options\" \/[oO]ptions\/ |\n empty |\n comment\n\n(* View: display *)\nlet display = [ indent . del \"SubSection\" \"SubSection\" . sep_spc\n . sep_dquote . key \"Display\" . sep_dquote\n . eol\n . display_entry*\n . indent . del \"EndSubSection\" \"EndSubSection\" . eol ]\n\n\n(************************************************************************\n * Group: SECTIONS\n *************************************************************************)\n\n\n(************************************************************************\n * Variable: section_re\n * Known values for Section names\n *\n * Definition:\n * > The section names are:\n * >\n * > Files File pathnames\n * > ServerFlags Server flags\n * > Module Dynamic module loading\n * > InputDevice Input device description\n * > Device Graphics device description\n * > VideoAdaptor Xv video adaptor description\n * > Monitor Monitor description\n * > Modes Video modes descriptions\n * > Screen Screen configuration\n * > ServerLayout Overall layout\n * > DRI DRI-specific configuration\n * > Vendor Vendor-specific configuration\n *************************************************************************)\nlet section_re = \/(Extensions|Files|ServerFlags|Module|InputDevice|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor)\/\n\n\n(************************************************************************\n * Variable: secton_re_obsolete\n * The following obsolete section names are still recognised for\n * compatibility purposes. In new config files, the InputDevice\n * section should be used instead.\n *\n * Definition:\n * > Keyboard Keyboard configuration\n * > Pointer Pointer\/mouse configuration\n *************************************************************************)\nlet section_re_obsolete = \/(Keyboard|Pointer)\/\n\n(* View: section_entry *)\nlet section_entry = option |\n screen |\n display |\n input_device |\n driver |\n identifier |\n videoram |\n default_depth |\n device |\n entry_generic |\n empty | comment\n\n(************************************************************************\n * View: section\n * A section in xorg.conf\n *\n * Definition:\n * > Section \"SectionName\"\n * > SectionEntry\n * > ...\n * > EndSection\n *************************************************************************)\nlet section = [ indent . del \"Section\" \"Section\"\n . sep_spc . sep_dquote\n . key (section_re|section_re_obsolete) . sep_dquote\n . eol\n . section_entry*\n . indent . del \"EndSection\" \"EndSection\" . eol ]\n\n(*\n * View: lns\n * The xorg.conf lens\n *)\nlet lns = ( empty | comment | section )*\n\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/X11\/xorg.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Xorg\n Parses \/etc\/X11\/xorg.conf\n\nAuthors: Raphael Pinson <raphink@gmail.com>\n Matthew Booth <mbooth@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man xorg.conf` where\n possible.\n\nThe definitions from `man xorg.conf` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Configuration files\n This lens applies to \/etc\/X11\/xorg.conf. See <filter>.\n*)\n\nmodule Xorg =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: to_eol\n * Match everything from here to eol, cropping whitespace at both ends\n *)\nlet to_eol = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Fields and values *)\n\n(* Variable: entries_re\n * This is a list of all patterns which have specific handlers, and should\n * therefore not be matched by the generic handler\n *)\nlet entries_re = \/([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth|[dD]evice)\/\n\n(* Variable: generic_entry_re *)\nlet generic_entry_re = \/[^# \\t\\n\\\/]+\/ - entries_re\n\n(* Variable: quoted_string_val *)\nlet quoted_string_val = del \"\\\"\" \"\\\"\" . store \/[^\"\\n]+\/ . del \"\\\"\" \"\\\"\"\n (* \" relax, emacs *)\n\n(* Variable: int *)\nlet int = \/[0-9]+\/\n\n\n(************************************************************************\n * Group: ENTRIES AND OPTIONS\n *************************************************************************)\n\n\n(* View: entry_int\n * This matches an entry which takes a single integer for an argument\n *)\nlet entry_int (canon:string) (re:regexp) =\n [ indent . del re canon . label canon . sep_spc . store int . eol ]\n\n(* View: entry_rgb\n * This matches an entry which takes 3 integers as arguments representing red,\n * green and blue components\n *)\nlet entry_rgb (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"red\" . sep_spc . store int ]\n . [ label \"green\" . sep_spc . store int ]\n . [ label \"blue\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_xy\n * This matches an entry which takes 2 integers as arguments representing X and\n * Y coordinates\n *)\nlet entry_xy (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"x\" . sep_spc . store int ]\n . [ label \"y\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_str\n * This matches an entry which takes a single quoted string\n *)\nlet entry_str (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . sep_spc . quoted_string_val . eol ]\n\n(* View: entry_generic\n * An entry without a specific handler. Store everything after the keyword,\n * cropping whitespace at both ends.\n *)\nlet entry_generic = [ indent . key generic_entry_re\n . sep_spc . store to_eol . eol ]\n\n(* View: option *)\nlet option = [ indent . del \/[oO]ption\/ \"Option\" . label \"Option\" . sep_spc\n . quoted_string_val\n . [ label \"value\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: screen\n * The Screen entry of ServerLayout\n *)\nlet screen = [ indent . del \/[sS]creen\/ \"Screen\" . label \"Screen\" . sep_spc\n . [ label \"num\" . store int . sep_spc ]?\n . quoted_string_val . sep_spc\n . [ label \"position\" . store to_eol ]\n . eol ]\n\n(* View: input_device *)\nlet input_device = [ indent . del \/[iI]nput[dD]evice\/ \"InputDevice\"\n . label \"InputDevice\" . sep_spc . quoted_string_val\n . [ label \"option\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: driver *)\nlet driver = entry_str \"Driver\" \/[dD]river\/\n\n(* View: identifier *)\nlet identifier = entry_str \"Identifier\" \/[iI]dentifier\/\n\n(* View: videoram *)\nlet videoram = entry_int \"VideoRam\" \/[vV]ideo[rR]am\/\n\n(* View: default_depth *)\nlet default_depth = entry_int \"DefaultDepth\" \/[dD]efault[dD]epth\/\n\n(* View: device *)\nlet device = entry_str \"Device\" \/[dD]evice\/\n\n(************************************************************************\n * Group: DISPLAY SUBSECTION\n *************************************************************************)\n\n\n(* View: display_modes *)\nlet display_modes = [ indent . del \/[mM]odes\/ \"Modes\" . label \"Modes\"\n . [ label \"mode\" . sep_spc . quoted_string_val ]+\n . eol ]\n\n(*************************************************************************\n * View: display_entry\n * Known values for entries in the Display subsection\n *\n * Definition:\n * > Depth depth\n * > FbBpp bpp\n * > Weight red-weight green-weight blue-weight\n * > Virtual xdim ydim\n * > ViewPort x0 y0\n * > Modes \"mode-name\" ...\n * > Visual \"visual-name\"\n * > Black red green blue\n * > White red green blue\n * > Options\n *)\n\nlet display_entry = entry_int \"Depth\" \/[dD]epth\/ |\n entry_int \"FbBpp\" \/[fF]b[bB]pp\/ |\n entry_rgb \"Weight\" \/[wW]eight\/ |\n entry_xy \"Virtual\" \/[vV]irtual\/ |\n entry_xy \"ViewPort\" \/[vV]iew[pP]ort\/ |\n display_modes |\n entry_str \"Visual\" \/[vV]isual\/ |\n entry_rgb \"Black\" \/[bB]lack\/ |\n entry_rgb \"White\" \/[wW]hite\/ |\n entry_str \"Options\" \/[oO]ptions\/ |\n empty |\n comment\n\n(* View: display *)\nlet display = [ indent . del \"SubSection\" \"SubSection\" . sep_spc\n . sep_dquote . key \"Display\" . sep_dquote\n . eol\n . display_entry*\n . indent . del \"EndSubSection\" \"EndSubSection\" . eol ]\n\n\n(************************************************************************\n * Group: SECTIONS\n *************************************************************************)\n\n\n(************************************************************************\n * Variable: section_re\n * Known values for Section names\n *\n * Definition:\n * > The section names are:\n * >\n * > Files File pathnames\n * > ServerFlags Server flags\n * > Module Dynamic module loading\n * > InputDevice Input device description\n * > Device Graphics device description\n * > VideoAdaptor Xv video adaptor description\n * > Monitor Monitor description\n * > Modes Video modes descriptions\n * > Screen Screen configuration\n * > ServerLayout Overall layout\n * > DRI DRI-specific configuration\n * > Vendor Vendor-specific configuration\n *************************************************************************)\nlet section_re = \/(Files|ServerFlags|Module|InputDevice|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor)\/\n\n\n(************************************************************************\n * Variable: secton_re_obsolete\n * The following obsolete section names are still recognised for\n * compatibility purposes. In new config files, the InputDevice\n * section should be used instead.\n *\n * Definition:\n * > Keyboard Keyboard configuration\n * > Pointer Pointer\/mouse configuration\n *************************************************************************)\nlet section_re_obsolete = \/(Keyboard|Pointer)\/\n\n(* View: section_entry *)\nlet section_entry = option |\n screen |\n display |\n input_device |\n driver |\n identifier |\n videoram |\n default_depth |\n device |\n entry_generic |\n empty | comment\n\n(************************************************************************\n * View: section\n * A section in xorg.conf\n *\n * Definition:\n * > Section \"SectionName\"\n * > SectionEntry\n * > ...\n * > EndSection\n *************************************************************************)\nlet section = [ indent . del \"Section\" \"Section\"\n . sep_spc . sep_dquote\n . key (section_re|section_re_obsolete) . sep_dquote\n . eol\n . section_entry*\n . indent . del \"EndSection\" \"EndSection\" . eol ]\n\n(*\n * View: lns\n * The xorg.conf lens\n *)\nlet lns = ( empty | comment | section )*\n\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/X11\/xorg.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"07a70960f0ab86021f96923e357ad7bead12bc6d","subject":"Authorized_Keys: add more tests","message":"Authorized_Keys: add more tests\n","repos":"mlichvar\/augeas,kunkku\/augeas,jtopjian\/augeas,jjlin\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,manandbytes\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,ptoscano\/augeas,hercules-team\/augeas,lutter\/augeas,kunkku\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,kumy\/augeas,lutter\/augeas,ptoscano\/augeas,jtopjian\/augeas,dafugg\/augeas,jjlin\/augeas,kumy\/augeas,mchf\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,MikaelSmith\/augeas,kumy\/augeas,jjlin\/augeas,raphink\/augeas,kumy\/augeas,kunkku\/augeas,mlichvar\/augeas,manandbytes\/augeas,raphink\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,ptoscano\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_authorized_keys.aug","new_file":"lenses\/tests\/test_authorized_keys.aug","new_contents":"(*\nModule: Test_Authorized_Keys\n Provides unit tests and examples for the <Authorized_Keys> lens.\n*)\n\nmodule Test_Authorized_Keys =\n\n(* Test: Authorized_Keys *)\ntest Authorized_Keys.lns get \"tunnel=\\\"0\\\",no-agent-forwarding,command=\\\"sh \/etc\/netstart tun0\\\",permitopen=\\\"192.0.2.1:80\\\",permitopen=\\\"192.0.2.2:25\\\" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3RC8whKGFx+b7BMTFtnIWl6t\/qyvOvnuqIrMNI9J8+1sEYv8Y\/pJRh0vAe2RaSKAgB2hyzXwSJ1Fh+ooraUAJ+q7P2gg2kQF1nCFeGVjtV9m4ZrV5kZARcQMhp0Bp67tPo2TCtnthPYZS\/YQG6u\/6Aco1XZjPvuKujAQMGSgqNskhKBO9zfhhkAMIcKVryjKYHDfqbDUCCSNzlwFLts3nJ0Hfno6Hz+XxuBIfKOGjHfbzFyUQ7smYnzF23jFs4XhvnjmIGQJcZT4kQAsRwQubyuyDuqmQXqa+2SuQfkKTaPOlVqyuEWJdG2weIF8g3YP12czsBgNppz3jsnhEgstnQ== rpinson on rpinson\\n\" =\n { \"key\" = \"AAAAB3NzaC1yc2EAAAABIwAAAQEA3RC8whKGFx+b7BMTFtnIWl6t\/qyvOvnuqIrMNI9J8+1sEYv8Y\/pJRh0vAe2RaSKAgB2hyzXwSJ1Fh+ooraUAJ+q7P2gg2kQF1nCFeGVjtV9m4ZrV5kZARcQMhp0Bp67tPo2TCtnthPYZS\/YQG6u\/6Aco1XZjPvuKujAQMGSgqNskhKBO9zfhhkAMIcKVryjKYHDfqbDUCCSNzlwFLts3nJ0Hfno6Hz+XxuBIfKOGjHfbzFyUQ7smYnzF23jFs4XhvnjmIGQJcZT4kQAsRwQubyuyDuqmQXqa+2SuQfkKTaPOlVqyuEWJdG2weIF8g3YP12czsBgNppz3jsnhEgstnQ==\"\n { \"options\"\n { \"tunnel\" = \"0\" }\n { \"no-agent-forwarding\" }\n { \"command\" = \"sh \/etc\/netstart tun0\" }\n { \"permitopen\" = \"192.0.2.1:80\" }\n { \"permitopen\" = \"192.0.2.2:25\" }\n }\n { \"type\" = \"ssh-rsa\" }\n { \"comment\" = \"rpinson on rpinson\" } } \n\n(* Variable: keys *)\nlet keys = \"# Example keys, one of each type\n#\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpWrKYsEsVUyuwMN4ReBN\/TMGsaUWzDKDz\/uQr6MlNNM95MDK\/BPyJ+DiBiNMFVLpRt3gH3eCJBLJKMuUDaTNy5uym2zNgAaAIVct6M2GHI68W3iY3Ja8\/MaRPbyTpMh1O74S+McpAW1SGL2YzFchYMjTnu\/kOD3lxiWNiDLvdLFZu0wPOi7CYG37VXR4Thb0cC92zqnCjaP1TwfhpEYUZoowElYkoV2vG+19O6cRm\/zduYcf8hmegZKB4GFUJTtZ2gZ18XJDSQd0ykK3KPt\/+bKskdrtfiOwSZAmUZmd2YuAlY6+CBn1T3UBdQntueukd0z1xhd6SX7Bl8+qyqLQ3 user@example\nssh-dsa AAAA user@example\necdsa-sha2-nistp256 AAAA user@example\n\n# Example comments\nssh-dsa AAAA\nssh-dsa AAAA user@example\n\"\n\n(* Test: Authorized_Keys.lns *)\ntest Authorized_Keys.lns get keys =\n { \"#comment\" = \"Example keys, one of each type\" }\n { }\n { \"key\" =\n\"AAAAB3NzaC1yc2EAAAADAQABAAABAQDpWrKYsEsVUyuwMN4ReBN\/TMGsaUWzDKDz\/uQr6MlNNM95MDK\/BPyJ+DiBiNMFVLpRt3gH3eCJBLJKMuUDaTNy5uym2zNgAaAIVct6M2GHI68W3iY3Ja8\/MaRPbyTpMh1O74S+McpAW1SGL2YzFchYMjTnu\/kOD3lxiWNiDLvdLFZu0wPOi7CYG37VXR4Thb0cC92zqnCjaP1TwfhpEYUZoowElYkoV2vG+19O6cRm\/zduYcf8hmegZKB4GFUJTtZ2gZ18XJDSQd0ykK3KPt\/+bKskdrtfiOwSZAmUZmd2YuAlY6+CBn1T3UBdQntueukd0z1xhd6SX7Bl8+qyqLQ3\"\n { \"type\" = \"ssh-rsa\" }\n { \"comment\" = \"user@example\" }\n }\n { \"key\" = \"AAAA\"\n { \"type\" = \"ssh-dsa\" }\n { \"comment\" = \"user@example\" }\n }\n { \"key\" = \"AAAA\"\n { \"type\" = \"ecdsa-sha2-nistp256\" }\n { \"comment\" = \"user@example\" }\n }\n { }\n { \"#comment\" = \"Example comments\" }\n { \"key\" = \"AAAA\"\n { \"type\" = \"ssh-dsa\" }\n }\n { \"key\" = \"AAAA\"\n { \"type\" = \"ssh-dsa\" }\n { \"comment\" = \"user@example\" }\n }\n\n(* Variable: options *)\nlet options = \"# Example options\nno-pty ssh-dsa AAAA\nno-pty,command=\\\"foo\\\" ssh-dsa AAAA\nno-pty,command=\\\"foo bar\\\" ssh-dsa AAAA\nno-pty,from=\\\"example.com,10.1.1.0\/16\\\" ssh-dsa AAAA\nno-pty,environment=\\\"LANG=en_GB.UTF8\\\" ssh-dsa AAAA\n\"\n\n(* Test: Authorized_Keys.lns *)\ntest Authorized_Keys.lns get options =\n { \"#comment\" = \"Example options\" }\n { \"key\" = \"AAAA\"\n { \"options\"\n { \"no-pty\" }\n }\n { \"type\" = \"ssh-dsa\" }\n }\n { \"key\" = \"AAAA\"\n { \"options\"\n { \"no-pty\" }\n { \"command\" = \"foo\" }\n }\n { \"type\" = \"ssh-dsa\" }\n }\n { \"key\" = \"AAAA\"\n { \"options\"\n { \"no-pty\" }\n { \"command\" = \"foo bar\" }\n }\n { \"type\" = \"ssh-dsa\" }\n }\n { \"key\" = \"AAAA\"\n { \"options\"\n { \"no-pty\" }\n { \"from\" = \"example.com,10.1.1.0\/16\" }\n }\n { \"type\" = \"ssh-dsa\" }\n }\n { \"key\" = \"AAAA\"\n { \"options\"\n { \"no-pty\" }\n { \"environment\" = \"LANG=en_GB.UTF8\" }\n }\n { \"type\" = \"ssh-dsa\" }\n }\n","old_contents":"(*\nModule: Test_Authorized_Keys\n Provides unit tests and examples for the <Authorized_Keys> lens.\n*)\n\nmodule Test_Authorized_Keys =\n\n(* Test: Authorized_Keys *)\ntest Authorized_Keys.lns get \"tunnel=\\\"0\\\",no-agent-forwarding,command=\\\"sh \/etc\/netstart tun0\\\",permitopen=\\\"192.0.2.1:80\\\",permitopen=\\\"192.0.2.2:25\\\" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3RC8whKGFx+b7BMTFtnIWl6t\/qyvOvnuqIrMNI9J8+1sEYv8Y\/pJRh0vAe2RaSKAgB2hyzXwSJ1Fh+ooraUAJ+q7P2gg2kQF1nCFeGVjtV9m4ZrV5kZARcQMhp0Bp67tPo2TCtnthPYZS\/YQG6u\/6Aco1XZjPvuKujAQMGSgqNskhKBO9zfhhkAMIcKVryjKYHDfqbDUCCSNzlwFLts3nJ0Hfno6Hz+XxuBIfKOGjHfbzFyUQ7smYnzF23jFs4XhvnjmIGQJcZT4kQAsRwQubyuyDuqmQXqa+2SuQfkKTaPOlVqyuEWJdG2weIF8g3YP12czsBgNppz3jsnhEgstnQ== rpinson on rpinson\\n\" =\n { \"key\" = \"AAAAB3NzaC1yc2EAAAABIwAAAQEA3RC8whKGFx+b7BMTFtnIWl6t\/qyvOvnuqIrMNI9J8+1sEYv8Y\/pJRh0vAe2RaSKAgB2hyzXwSJ1Fh+ooraUAJ+q7P2gg2kQF1nCFeGVjtV9m4ZrV5kZARcQMhp0Bp67tPo2TCtnthPYZS\/YQG6u\/6Aco1XZjPvuKujAQMGSgqNskhKBO9zfhhkAMIcKVryjKYHDfqbDUCCSNzlwFLts3nJ0Hfno6Hz+XxuBIfKOGjHfbzFyUQ7smYnzF23jFs4XhvnjmIGQJcZT4kQAsRwQubyuyDuqmQXqa+2SuQfkKTaPOlVqyuEWJdG2weIF8g3YP12czsBgNppz3jsnhEgstnQ==\"\n { \"options\"\n { \"tunnel\" = \"0\" }\n { \"no-agent-forwarding\" }\n { \"command\" = \"sh \/etc\/netstart tun0\" }\n { \"permitopen\" = \"192.0.2.1:80\" }\n { \"permitopen\" = \"192.0.2.2:25\" }\n }\n { \"type\" = \"ssh-rsa\" }\n { \"comment\" = \"rpinson on rpinson\" } } \n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6e9d2b0c87bb2f0f24e8746e8e039384e44ade30","subject":"Add failing test for issue #626","message":"Add failing test for issue #626\n","repos":"hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,ptoscano\/augeas,mlichvar\/augeas,ptoscano\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\"\n { \"1\" = \"ONBOOT\" }\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\"\n { \"1\" = \"FOO\" } }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Allow wrapping builtin arguments to multiple lines *)\n test Shellvars.lns get \"ulimit -c \\\\\\nunlimited\\nulimit \\\\\\n -x 123\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c \\\\\\nunlimited\" } }\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-x 123\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file1\" }\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file2\" }\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"@unset\"\n { \"1\" = \"f\" } } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"foo() (\n . \/tmp\/bar\n )\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"b\" }\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\"\n { \"@pattern\" = \"eth0\" }\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\"\n { \"1\" = \"f\" } } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" { \"@pattern\" = \"*\" } } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\"\n { \"@pattern\" = \"*debug*\" }\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* Partial quoting is allowed *)\n test Shellvars.lns get \"FOO=\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\\n\" =\n { \"FOO\" = \"\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\"\n { \"1\" = \"${!LC_*}\" } }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n #\n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\ntest \\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\ntest \\\\\\ntest2\\\"\" }\n\n (* Export of multiple variables, RHBZ#1033795 *)\n test lns get \"export TestVar1 TestVar2\\n\" =\n { \"@export\"\n { \"1\" = \"TestVar1\" }\n { \"2\" = \"TestVar2\" } }\n\n (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)\n test lns get \"case $ARG in\n 0) TestVar=\\\"test0\\\" ;;\n 1) TestVar=\\\"test1\\\" ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"TestVar\" = \"\\\"test0\\\"\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"TestVar\" = \"\\\"test1\\\"\" } } }\n\n (* case: support ;; on the same line with multiple commands *)\n test lns get \"case $ARG in\n 0) Foo=0; Bar=1;;\n 1)\n\t Foo=2\n\t Bar=3; Baz=4;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"Foo\" = \"0\" }\n { \"Bar\" = \"1\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"Foo\" = \"2\" }\n { \"Bar\" = \"3\" }\n { \"Baz\" = \"4\" }\n }\n }\n\n(* Test: Shellvars.lns\n Support `##` bashism in conditions (GH issue #118) *)\ntest Shellvars.lns get \"if [ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ] ; then\n SUFFIX=\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\nelse\n SUFFIX=\nfi\\n\" =\n { \"@if\" = \"[ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ]\"\n { \"SUFFIX\" = \"\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\" }\n { \"@else\"\n { \"SUFFIX\" = \"\" }\n }\n }\n\n (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)\n test lns get \"export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\\n\" =\n { \"MALLOC_PERTURB_\" = \"$(($RANDOM % 255 + 1))\"\n { \"export\" } }\n\n (*\n * Github issue 202\n *)\n let starts_with_blank = \"\\n \\nVAR=value\\n\"\n\n test lns get starts_with_blank = { \"VAR\" = \"value\" }\n\n (* It is now possible to insert at the beginning of a file\n * that starts with blank lines *)\n test lns put starts_with_blank after\n insb \"#comment\" \"\/*[1]\";\n set \"\/#comment[1]\" \"a comment\" =\n \" # a comment\\nVAR=value\\n\"\n\n (* Modifications of the file lose the blank lines though *)\n test lns put starts_with_blank after\n set \"\/VAR2\" \"abc\" = \"VAR=value\\nVAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\";\n set \"\/VAR2\" \"abc\" = \"VAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\" = \"\"\n\n (* Support associative arrays *)\n test lns get \"var[alpha_beta,gamma]=something\\n\" =\n { \"var[alpha_beta,gamma]\" = \"something\" }\n\n (* GH #188: support more conditions *)\n test Shellvars.lns get \"[ -f $FILENAME ]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" } }\n\n test Shellvars.lns get \"[[ -f $FILENAME ]]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[[\" } }\n\n (* Allow wrapping loop condition to multiple lines *)\n test Shellvars.lns get \"for x in foo \\\\\\nbar\\\\\\nbaz; do y=$x; done\\n\" =\n { \"@for\" = \"x in foo \\\\\\nbar\\\\\\nbaz\" { \"y\" = \"$x\" } }\n\n (* Allow quotes in loop conditions *)\n test Shellvars.lns get \"for x in \\\"$@\\\"; do y=$x; done\\n\" =\n { \"@for\" = \"x in \\\"$@\\\"\" { \"y\" = \"$x\" } }\n\n (* case: support quotes and spaces in pattern lists *)\n test lns get \"case $ARG in\n \\\"foo bar\\\")\n Foo=0\n ;;\n baz | quux)\n Foo=1\n ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"\\\"foo bar\\\"\" }\n { \"Foo\" = \"0\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"baz\" }\n { \"@pattern\" = \"quux\" }\n { \"Foo\" = \"1\" }\n }\n }\n\n (* eval *)\n test lns get \"eval `dircolors`\\n\" =\n { \"@eval\" = \"`dircolors`\" }\n\n (* alias *)\n test lns get \"alias ls='ls $LS_OPTIONS'\\n\" =\n { \"@alias\" = \"ls\" { \"value\" = \"'ls $LS_OPTIONS'\" } }\n\n test lns get \"alias ls-options='ls $LS_OPTIONS'\\n\" =\n { \"@alias\" = \"ls-options\" { \"value\" = \"'ls $LS_OPTIONS'\" } }\n\n (* Allow && and || constructs after condition *)\n test Shellvars.lns get \"[ -f $FILENAME ] && do this || or that\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" }\n { \"@and\" = \"do this\" }\n { \"@or\" = \"or that\" } }\n\n(* Test: Shellvars.lns\n Parse (almost) any command *)\ntest Shellvars.lns get \"echo foobar 'and this is baz'\n\/usr\/local\/bin\/myscript-with-dash_and_underscore.sh with args\necho foo \\\nbar\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foobar 'and this is baz'\" }\n }\n { \"@command\" = \"\/usr\/local\/bin\/myscript-with-dash_and_underscore.sh\"\n { \"@arg\" = \"with args\" }\n }\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foo \\\\\\nbar\" }\n }\n\n(* Test: Shellvars.lns\n Support pipes in commands *)\ntest Shellvars.lns get \"echo \\\"$STRING\\\" | grep foo\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"\\\"$STRING\\\"\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"foo\" } } } }\n\n(* Test: Shellvars.lns\n Support && and || after command\n GH #215 *)\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && echo moo\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue || echo baa\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && DEBIAN=1\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"DEBIAN\" = \"1\" } } }\n\ntest Shellvars.lns get \"cat \/etc\/issue | grep -q \\\"Debian\\\" && echo moo || echo baa\\n\" =\n { \"@command\" = \"cat\"\n { \"@arg\" = \"\/etc\/issue\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\"\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } } } } } }\n\n(* Command-specific environment variables *)\ntest Shellvars.lns get \"abc=def \\\\\\n ghi=\\\"jkl mno\\\" command arg1 arg2\\n\" =\n { \"@command\" = \"command\"\n { \"abc\" = \"def\" }\n { \"ghi\" = \"\\\"jkl mno\\\"\" }\n { \"@arg\" = \"arg1 arg2\" }\n }\n\n(* Wrapped command sequences *)\n\ntest Shellvars.lns get \"foo && \\\\\\nbar baz \\\\\\n|| qux \\\\\\n quux\\\\\\ncorge grault\\n\" =\n { \"@command\" = \"foo\"\n { \"@and\"\n { \"@command\" = \"bar\"\n { \"@arg\" = \"baz\" }\n\t{ \"@or\" { \"@command\" = \"qux\" { \"@arg\" = \"quux\\\\\\ncorge grault\" } } }\n }\n }\n }\n\n(* Comment after function definition (Issue #339) *)\ntest Shellvars.lns get \"SetDir() # hello\n{\n echo\n}\\n\" =\n { \"@function\" = \"SetDir\"\n { \"#comment\" = \"hello\" }\n { \"@command\" = \"echo\" }\n }\n\n(* Function with new lines *)\ntest Shellvars.lns get \"MyFunc()\n{\n echo\n}\\n\" =\n { \"@function\" = \"MyFunc\"\n { \"@command\" = \"echo\" }\n }\n\n(* Pipe and newline without cl (Issue #339) *)\ntest Shellvars.lns get \"echo |\ntr\\n\" =\n { \"@command\" = \"echo\"\n { \"@pipe\"\n { \"@command\" = \"tr\" } } }\n\n\n(* Subshell (Issue #339) *)\ntest Shellvars.lns get \"{ echo\n}\\n\" =\n { \"@subshell\"\n { \"@command\" = \"echo\" }\n }\n\n(* One-liner function *)\ntest Shellvars.lns get \"MyFunc() { echo; }\\n\" =\n { \"@function\" = \"MyFunc\"\n { \"@command\" = \"echo\" }\n }\n\n(* Support and\/or in if conditions *)\ntest Shellvars.lns get \"if [ -f \/tmp\/file1 ] && [ -f \/tmp\/file2 ] || [ -f \/tmp\/file3 ]; then\n echo foo\nfi\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@and\" = \"[ -f \/tmp\/file2 ]\" }\n { \"@or\" = \"[ -f \/tmp\/file3 ]\" }\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foo\" }\n }\n }\n\n(* Support variable as command *)\ntest Shellvars.lns get \"$FOO bar\\n\" =\n { \"@command\" = \"$FOO\"\n { \"@arg\" = \"bar\" }\n }\n\n\n(*********************************************************\n * Group: Unsupported syntax *\n * *\n * The following tests are known to be failing currently *\n *********************************************************)\n\n(* Any piping (Issue #343) *)\ntest Shellvars.lns get \"FOO=bar && BAR=foo\necho foo || { echo bar; }\necho FOO | myfunc() { echo bar; }\\n\" = *\n\n\n(* Stream redirections (Issue #626 *)\ntest Shellvars.lns get \"echo foo 2>&1 >\/dev\/null\\n\" = *\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\"\n { \"1\" = \"ONBOOT\" }\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\"\n { \"1\" = \"FOO\" } }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Allow wrapping builtin arguments to multiple lines *)\n test Shellvars.lns get \"ulimit -c \\\\\\nunlimited\\nulimit \\\\\\n -x 123\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c \\\\\\nunlimited\" } }\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-x 123\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file1\" }\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file2\" }\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"@unset\"\n { \"1\" = \"f\" } } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"foo() (\n . \/tmp\/bar\n )\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"b\" }\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\"\n { \"@pattern\" = \"eth0\" }\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\"\n { \"1\" = \"f\" } } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" { \"@pattern\" = \"*\" } } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\"\n { \"@pattern\" = \"*debug*\" }\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* Partial quoting is allowed *)\n test Shellvars.lns get \"FOO=\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\\n\" =\n { \"FOO\" = \"\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\"\n { \"1\" = \"${!LC_*}\" } }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n #\n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\ntest \\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\ntest \\\\\\ntest2\\\"\" }\n\n (* Export of multiple variables, RHBZ#1033795 *)\n test lns get \"export TestVar1 TestVar2\\n\" =\n { \"@export\"\n { \"1\" = \"TestVar1\" }\n { \"2\" = \"TestVar2\" } }\n\n (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)\n test lns get \"case $ARG in\n 0) TestVar=\\\"test0\\\" ;;\n 1) TestVar=\\\"test1\\\" ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"TestVar\" = \"\\\"test0\\\"\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"TestVar\" = \"\\\"test1\\\"\" } } }\n\n (* case: support ;; on the same line with multiple commands *)\n test lns get \"case $ARG in\n 0) Foo=0; Bar=1;;\n 1)\n\t Foo=2\n\t Bar=3; Baz=4;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"Foo\" = \"0\" }\n { \"Bar\" = \"1\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"Foo\" = \"2\" }\n { \"Bar\" = \"3\" }\n { \"Baz\" = \"4\" }\n }\n }\n\n(* Test: Shellvars.lns\n Support `##` bashism in conditions (GH issue #118) *)\ntest Shellvars.lns get \"if [ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ] ; then\n SUFFIX=\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\nelse\n SUFFIX=\nfi\\n\" =\n { \"@if\" = \"[ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ]\"\n { \"SUFFIX\" = \"\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\" }\n { \"@else\"\n { \"SUFFIX\" = \"\" }\n }\n }\n\n (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)\n test lns get \"export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\\n\" =\n { \"MALLOC_PERTURB_\" = \"$(($RANDOM % 255 + 1))\"\n { \"export\" } }\n\n (*\n * Github issue 202\n *)\n let starts_with_blank = \"\\n \\nVAR=value\\n\"\n\n test lns get starts_with_blank = { \"VAR\" = \"value\" }\n\n (* It is now possible to insert at the beginning of a file\n * that starts with blank lines *)\n test lns put starts_with_blank after\n insb \"#comment\" \"\/*[1]\";\n set \"\/#comment[1]\" \"a comment\" =\n \" # a comment\\nVAR=value\\n\"\n\n (* Modifications of the file lose the blank lines though *)\n test lns put starts_with_blank after\n set \"\/VAR2\" \"abc\" = \"VAR=value\\nVAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\";\n set \"\/VAR2\" \"abc\" = \"VAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\" = \"\"\n\n (* Support associative arrays *)\n test lns get \"var[alpha_beta,gamma]=something\\n\" =\n { \"var[alpha_beta,gamma]\" = \"something\" }\n\n (* GH #188: support more conditions *)\n test Shellvars.lns get \"[ -f $FILENAME ]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" } }\n\n test Shellvars.lns get \"[[ -f $FILENAME ]]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[[\" } }\n\n (* Allow wrapping loop condition to multiple lines *)\n test Shellvars.lns get \"for x in foo \\\\\\nbar\\\\\\nbaz; do y=$x; done\\n\" =\n { \"@for\" = \"x in foo \\\\\\nbar\\\\\\nbaz\" { \"y\" = \"$x\" } }\n\n (* Allow quotes in loop conditions *)\n test Shellvars.lns get \"for x in \\\"$@\\\"; do y=$x; done\\n\" =\n { \"@for\" = \"x in \\\"$@\\\"\" { \"y\" = \"$x\" } }\n\n (* case: support quotes and spaces in pattern lists *)\n test lns get \"case $ARG in\n \\\"foo bar\\\")\n Foo=0\n ;;\n baz | quux)\n Foo=1\n ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"\\\"foo bar\\\"\" }\n { \"Foo\" = \"0\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"baz\" }\n { \"@pattern\" = \"quux\" }\n { \"Foo\" = \"1\" }\n }\n }\n\n (* eval *)\n test lns get \"eval `dircolors`\\n\" =\n { \"@eval\" = \"`dircolors`\" }\n\n (* alias *)\n test lns get \"alias ls='ls $LS_OPTIONS'\\n\" =\n { \"@alias\" = \"ls\" { \"value\" = \"'ls $LS_OPTIONS'\" } }\n\n test lns get \"alias ls-options='ls $LS_OPTIONS'\\n\" =\n { \"@alias\" = \"ls-options\" { \"value\" = \"'ls $LS_OPTIONS'\" } }\n\n (* Allow && and || constructs after condition *)\n test Shellvars.lns get \"[ -f $FILENAME ] && do this || or that\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" }\n { \"@and\" = \"do this\" }\n { \"@or\" = \"or that\" } }\n\n(* Test: Shellvars.lns\n Parse (almost) any command *)\ntest Shellvars.lns get \"echo foobar 'and this is baz'\n\/usr\/local\/bin\/myscript-with-dash_and_underscore.sh with args\necho foo \\\nbar\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foobar 'and this is baz'\" }\n }\n { \"@command\" = \"\/usr\/local\/bin\/myscript-with-dash_and_underscore.sh\"\n { \"@arg\" = \"with args\" }\n }\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foo \\\\\\nbar\" }\n }\n\n(* Test: Shellvars.lns\n Support pipes in commands *)\ntest Shellvars.lns get \"echo \\\"$STRING\\\" | grep foo\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"\\\"$STRING\\\"\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"foo\" } } } }\n\n(* Test: Shellvars.lns\n Support && and || after command\n GH #215 *)\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && echo moo\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue || echo baa\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && DEBIAN=1\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"DEBIAN\" = \"1\" } } }\n\ntest Shellvars.lns get \"cat \/etc\/issue | grep -q \\\"Debian\\\" && echo moo || echo baa\\n\" =\n { \"@command\" = \"cat\"\n { \"@arg\" = \"\/etc\/issue\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\"\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } } } } } }\n\n(* Command-specific environment variables *)\ntest Shellvars.lns get \"abc=def \\\\\\n ghi=\\\"jkl mno\\\" command arg1 arg2\\n\" =\n { \"@command\" = \"command\"\n { \"abc\" = \"def\" }\n { \"ghi\" = \"\\\"jkl mno\\\"\" }\n { \"@arg\" = \"arg1 arg2\" }\n }\n\n(* Wrapped command sequences *)\n\ntest Shellvars.lns get \"foo && \\\\\\nbar baz \\\\\\n|| qux \\\\\\n quux\\\\\\ncorge grault\\n\" =\n { \"@command\" = \"foo\"\n { \"@and\"\n { \"@command\" = \"bar\"\n { \"@arg\" = \"baz\" }\n\t{ \"@or\" { \"@command\" = \"qux\" { \"@arg\" = \"quux\\\\\\ncorge grault\" } } }\n }\n }\n }\n\n(* Comment after function definition (Issue #339) *)\ntest Shellvars.lns get \"SetDir() # hello\n{\n echo\n}\\n\" =\n { \"@function\" = \"SetDir\"\n { \"#comment\" = \"hello\" }\n { \"@command\" = \"echo\" }\n }\n\n(* Function with new lines *)\ntest Shellvars.lns get \"MyFunc()\n{\n echo\n}\\n\" =\n { \"@function\" = \"MyFunc\"\n { \"@command\" = \"echo\" }\n }\n\n(* Pipe and newline without cl (Issue #339) *)\ntest Shellvars.lns get \"echo |\ntr\\n\" =\n { \"@command\" = \"echo\"\n { \"@pipe\"\n { \"@command\" = \"tr\" } } }\n\n\n(* Subshell (Issue #339) *)\ntest Shellvars.lns get \"{ echo\n}\\n\" =\n { \"@subshell\"\n { \"@command\" = \"echo\" }\n }\n\n(* One-liner function *)\ntest Shellvars.lns get \"MyFunc() { echo; }\\n\" =\n { \"@function\" = \"MyFunc\"\n { \"@command\" = \"echo\" }\n }\n\n(* Support and\/or in if conditions *)\ntest Shellvars.lns get \"if [ -f \/tmp\/file1 ] && [ -f \/tmp\/file2 ] || [ -f \/tmp\/file3 ]; then\n echo foo\nfi\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@and\" = \"[ -f \/tmp\/file2 ]\" }\n { \"@or\" = \"[ -f \/tmp\/file3 ]\" }\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foo\" }\n }\n }\n\n(* Support variable as command *)\ntest Shellvars.lns get \"$FOO bar\\n\" =\n { \"@command\" = \"$FOO\"\n { \"@arg\" = \"bar\" }\n }\n\n\n(*********************************************************\n * Group: Unsupported syntax *\n * *\n * The following tests are known to be failing currently *\n *********************************************************)\n\n(* Any piping (Issue #343) *)\ntest Shellvars.lns get \"FOO=bar && BAR=foo\necho foo || { echo bar; }\necho FOO | myfunc() { echo bar; }\\n\" = *\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6867edda1b70e6dd494080ad71ecac8c4f2eac11","subject":"Fix unpriviliged into unpriviliged in test_postfix_master.aug, too.","message":"Fix unpriviliged into unpriviliged in test_postfix_master.aug, too.\n","repos":"dafugg\/augeas,domcleal\/augeas,MikaelSmith\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,mlichvar\/augeas,pevalme\/augeas,jasperla\/augeas,pevalme\/augeas,raphink\/augeas,jjlin\/augeas,ptoscano\/augeas,kunkku\/augeas,manandbytes\/augeas,kumy\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,domcleal\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,mlichvar\/augeas,mchf\/augeas,domcleal\/augeas,kunkku\/augeas,raphink\/augeas,mchf\/augeas,lutter\/augeas,lutter\/augeas,lutter\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,jtopjian\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas,mlichvar\/augeas,dafugg\/augeas","old_file":"lenses\/tests\/test_postfix_master.aug","new_file":"lenses\/tests\/test_postfix_master.aug","new_contents":"module Test_postfix_master =\n\nlet conf = \"# master.cf\nsmtp inet n - - 10? - smtpd\nmaildrop unix - n n - - pipe\n flags=DRhu user=vmail argv=\/usr\/bin\/maildrop -d ${recipient}\n\"\n\ntest Postfix_Master.lns get conf =\n { \"#comment\" = \"master.cf\" }\n { \"smtp\"\n { \"type\" = \"inet\" }\n { \"private\" = \"n\" }\n { \"unprivileged\" = \"-\" }\n { \"chroot\" = \"-\" }\n { \"wakeup\" = \"10?\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"smtpd\" } }\n { \"maildrop\"\n { \"type\" = \"unix\" }\n { \"private\" = \"-\" }\n { \"unprivileged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"pipe\\n flags=DRhu user=vmail argv=\/usr\/bin\/maildrop -d ${recipient}\" } }\n\n(* fixes bug #69 : accept double quotes in arguments *)\nlet conf2 = \"# The Cyrus deliver program has changed incompatibly, multiple times.\ncyrus unix - n n - - pipe\n flags=R user=cyrus argv=\/usr\/sbin\/cyrdeliver -e -m \\\"${extension}\\\" ${user}\n\"\n\ntest Postfix_Master.lns get conf2 = \n { \"#comment\" = \"The Cyrus deliver program has changed incompatibly, multiple times.\" }\n { \"cyrus\"\n { \"type\" = \"unix\" }\n { \"private\" = \"-\" }\n { \"unprivileged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"pipe\\n flags=R user=cyrus argv=\/usr\/sbin\/cyrdeliver -e -m \\\"${extension}\\\" ${user}\" }\n }\n\n(* accept commas in arguments *)\nlet conf3 = \"# master.cf\nsubmission inet n - n - - smtpd\n -o smtpd_client_restrictions=permit_sasl_authenticated,reject\n\"\n\ntest Postfix_Master.lns get conf3 =\n { \"#comment\" = \"master.cf\" }\n { \"submission\"\n { \"type\" = \"inet\" }\n { \"private\" = \"n\" }\n { \"unprivileged\" = \"-\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"smtpd\\n -o smtpd_client_restrictions=permit_sasl_authenticated,reject\" } }\n\n(* : is allowed *)\nlet conf4 = \"127.0.0.1:10060 inet n n n - 0 spawn\n user=nobody argv=\/usr\/sbin\/hapolicy -l --default=DEFER\n\"\n\ntest Postfix_Master.lns get conf4 =\n { \"127.0.0.1:10060\"\n { \"type\" = \"inet\" }\n { \"private\" = \"n\" }\n { \"unprivileged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"0\" }\n { \"command\" = \"spawn\n user=nobody argv=\/usr\/sbin\/hapolicy -l --default=DEFER\" }\n }\n\n\n(* Spaces are allowed after the first word of the command *)\nlet conf5 = \"sympa unix - n n - - pipe \\n\tflags=R user=sympa argv=\/home\/sympa\/bin\/queue ${recipient}\n\"\n\ntest Postfix_Master.lns get conf5 =\n { \"sympa\"\n { \"type\" = \"unix\" }\n { \"private\" = \"-\" }\n { \"unprivileged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"pipe \\n\tflags=R user=sympa argv=\/home\/sympa\/bin\/queue ${recipient}\" }\n }\n\n(* Arobase is allowed in command *)\nlet conf6 = \"sympafamilypfs unix - n n - - pipe\n\tflags=R user=sympa argv=\/home\/sympa\/bin\/familyqueue ${user}@domain.net pfs\n\"\ntest Postfix_Master.lns get conf6 =\n { \"sympafamilypfs\"\n { \"type\" = \"unix\" }\n { \"private\" = \"-\" }\n { \"unprivileged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"pipe\n\tflags=R user=sympa argv=\/home\/sympa\/bin\/familyqueue ${user}@domain.net pfs\" }\n }\n","old_contents":"module Test_postfix_master =\n\nlet conf = \"# master.cf\nsmtp inet n - - 10? - smtpd\nmaildrop unix - n n - - pipe\n flags=DRhu user=vmail argv=\/usr\/bin\/maildrop -d ${recipient}\n\"\n\ntest Postfix_Master.lns get conf =\n { \"#comment\" = \"master.cf\" }\n { \"smtp\"\n { \"type\" = \"inet\" }\n { \"private\" = \"n\" }\n { \"unpriviliged\" = \"-\" }\n { \"chroot\" = \"-\" }\n { \"wakeup\" = \"10?\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"smtpd\" } }\n { \"maildrop\"\n { \"type\" = \"unix\" }\n { \"private\" = \"-\" }\n { \"unpriviliged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"pipe\\n flags=DRhu user=vmail argv=\/usr\/bin\/maildrop -d ${recipient}\" } }\n\n(* fixes bug #69 : accept double quotes in arguments *)\nlet conf2 = \"# The Cyrus deliver program has changed incompatibly, multiple times.\ncyrus unix - n n - - pipe\n flags=R user=cyrus argv=\/usr\/sbin\/cyrdeliver -e -m \\\"${extension}\\\" ${user}\n\"\n\ntest Postfix_Master.lns get conf2 = \n { \"#comment\" = \"The Cyrus deliver program has changed incompatibly, multiple times.\" }\n { \"cyrus\"\n { \"type\" = \"unix\" }\n { \"private\" = \"-\" }\n { \"unpriviliged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"pipe\\n flags=R user=cyrus argv=\/usr\/sbin\/cyrdeliver -e -m \\\"${extension}\\\" ${user}\" }\n }\n\n(* accept commas in arguments *)\nlet conf3 = \"# master.cf\nsubmission inet n - n - - smtpd\n -o smtpd_client_restrictions=permit_sasl_authenticated,reject\n\"\n\ntest Postfix_Master.lns get conf3 =\n { \"#comment\" = \"master.cf\" }\n { \"submission\"\n { \"type\" = \"inet\" }\n { \"private\" = \"n\" }\n { \"unpriviliged\" = \"-\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"smtpd\\n -o smtpd_client_restrictions=permit_sasl_authenticated,reject\" } }\n\n(* : is allowed *)\nlet conf4 = \"127.0.0.1:10060 inet n n n - 0 spawn\n user=nobody argv=\/usr\/sbin\/hapolicy -l --default=DEFER\n\"\n\ntest Postfix_Master.lns get conf4 =\n { \"127.0.0.1:10060\"\n { \"type\" = \"inet\" }\n { \"private\" = \"n\" }\n { \"unpriviliged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"0\" }\n { \"command\" = \"spawn\n user=nobody argv=\/usr\/sbin\/hapolicy -l --default=DEFER\" }\n }\n\n\n(* Spaces are allowed after the first word of the command *)\nlet conf5 = \"sympa unix - n n - - pipe \\n\tflags=R user=sympa argv=\/home\/sympa\/bin\/queue ${recipient}\n\"\n\ntest Postfix_Master.lns get conf5 =\n { \"sympa\"\n { \"type\" = \"unix\" }\n { \"private\" = \"-\" }\n { \"unpriviliged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"pipe \\n\tflags=R user=sympa argv=\/home\/sympa\/bin\/queue ${recipient}\" }\n }\n\n(* Arobase is allowed in command *)\nlet conf6 = \"sympafamilypfs unix - n n - - pipe\n\tflags=R user=sympa argv=\/home\/sympa\/bin\/familyqueue ${user}@domain.net pfs\n\"\ntest Postfix_Master.lns get conf6 =\n { \"sympafamilypfs\"\n { \"type\" = \"unix\" }\n { \"private\" = \"-\" }\n { \"unpriviliged\" = \"n\" }\n { \"chroot\" = \"n\" }\n { \"wakeup\" = \"-\" }\n { \"limit\" = \"-\" }\n { \"command\" = \"pipe\n\tflags=R user=sympa argv=\/home\/sympa\/bin\/familyqueue ${user}@domain.net pfs\" }\n }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"869a483f80880c0e9401ad50765e5cbec496b440","subject":"Use Quote.quote_spaces in pg_hba.aug","message":"Use Quote.quote_spaces in pg_hba.aug\n","repos":"jasperla\/augeas,raphink\/augeas,kumy\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,dafugg\/augeas,lutter\/augeas,lutter\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,kumy\/augeas,mchf\/augeas,jjlin\/augeas,pevalme\/augeas,jasperla\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,ptoscano\/augeas,mlichvar\/augeas,jjlin\/augeas,kunkku\/augeas,lutter\/augeas,raphink\/augeas,pevalme\/augeas,mlichvar\/augeas,mchf\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,dafugg\/augeas,jtopjian\/augeas,hercules-team\/augeas,manandbytes\/augeas,kunkku\/augeas,ptoscano\/augeas,manandbytes\/augeas,MikaelSmith\/augeas","old_file":"lenses\/pg_hba.aug","new_file":"lenses\/pg_hba.aug","new_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:.]+(\\\/[0-9]+|[ \\t]+[0-9.]+)\/\n (* Variable: hostname\n Hostname, FQDN or part of an FQDN possibly \n starting with a dot. Taken from the syslog lens. *)\n let hostname = \/\\.?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: ipaddr_or_hostname *)\n let ipaddr_or_hostname = ipaddr | hostname\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr_or_hostname ]\n (* View: option\n part of <method> *)\n let option =\n let value_start = label \"value\" . Sep.equal\n in [ label \"option\" . store Rx.word\n . (Quote.quote_spaces value_start)? ]\n\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store \/[A-Za-z][A-Za-z0-9]+\/\n . ( Sep.tab . option )* ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:.]+(\\\/[0-9]+|[ \\t]+[0-9.]+)\/\n (* Variable: hostname\n Hostname, FQDN or part of an FQDN possibly \n starting with a dot. Taken from the syslog lens. *)\n let hostname = \/\\.?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: ipaddr_or_hostname *)\n let ipaddr_or_hostname = ipaddr | hostname\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr_or_hostname ]\n (* View: option\n part of <method> *)\n let option =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_quote_opt (store \/[^\"' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_quote (store \/[^\"' \\t\\n]*[ \\t][^\"' \\t\\n]*\/)\n in [ label \"option\" . store Rx.word\n . ( [ label \"value\" . Sep.equal . bare ]\n | [ label \"value\" . Sep.equal . quoted ])?\n ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store \/[A-Za-z][A-Za-z0-9]+\/\n . ( Sep.tab . option )* ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5c2fa611519dd609b36123a36aca60ef00a03c79","subject":"Remove trailing white spaces from puppet test","message":"Remove trailing white spaces from puppet test\n\nTrailing white lines are valid in a puppet file, but the test is rejected when\npushing to master git repository.\n\nremote: lenses\/tests\/test_puppetfileserver.aug:20: trailing whitespace.\nremote: +allow *\nremote: error: hook declined to update refs\/heads\/master\n ! [remote rejected] master -> master (hook declined)\n\nRemoving white space for now.\n","repos":"ptoscano\/augeas,lutter\/augeas,jasperla\/augeas,domcleal\/augeas,kunkku\/augeas,lutter\/augeas,jjlin\/augeas,dafugg\/augeas,manandbytes\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,pevalme\/augeas,raphink\/augeas,dafugg\/augeas,jtopjian\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,pevalme\/augeas,MikaelSmith\/augeas,kumy\/augeas,lutter\/augeas,jasperla\/augeas,kumy\/augeas,kunkku\/augeas,manandbytes\/augeas,jjlin\/augeas,mlichvar\/augeas,kumy\/augeas,mchf\/augeas,mlichvar\/augeas,kunkku\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas,domcleal\/augeas,raphink\/augeas","old_file":"lenses\/tests\/test_puppetfileserver.aug","new_file":"lenses\/tests\/test_puppetfileserver.aug","new_contents":"(* Tests for the PuppetFileserver module *)\n\nmodule Test_puppetfileserver =\n\nlet fileserver = \"# This a comment\n\n[mount1]\n # Mount1 options\n path \/etc\/puppet\/files\/%h\n allow host.domain1.com\n allow *.domain2.com\n deny badhost.domain2.com\n[mount2]\n allow *\n deny *.evil.example.com\n deny badhost.domain2.com\n[mount3]\nallow * # Puppet #6026: same line comment\n# And trailing whitespace\nallow *\n\"\n\ntest PuppetFileserver.lns get fileserver =\n\t{ \"#comment\" = \"This a comment\" }\n\t{ }\n\t{ \"mount1\"\n\t\t{ \"#comment\" = \"Mount1 options\" }\n\t\t{ \"path\" = \"\/etc\/puppet\/files\/%h\" }\n\t\t{ \"allow\" = \"host.domain1.com\" }\n\t\t{ \"allow\" = \"*.domain2.com\" }\n\t\t{ \"deny\" = \"badhost.domain2.com\" }\n\t}\n\t{ \"mount2\"\n\t\t{ \"allow\" = \"*\" }\n\t\t{ \"deny\" = \"*.evil.example.com\" }\n\t\t{ \"deny\" = \"badhost.domain2.com\" }\n\t}\n\t{ \"mount3\"\n\t\t{ \"allow\" = \"*\"\n\t\t\t{ \"#comment\" = \"Puppet #6026: same line comment\" } }\n\t\t{ \"#comment\" = \"And trailing whitespace\" }\n\t\t{ \"allow\" = \"*\" }\n\t}\n","old_contents":"(* Tests for the PuppetFileserver module *)\n\nmodule Test_puppetfileserver =\n\nlet fileserver = \"# This a comment\n\n[mount1]\n # Mount1 options\n path \/etc\/puppet\/files\/%h\n allow host.domain1.com\n allow *.domain2.com\n deny badhost.domain2.com\n[mount2]\n allow *\n deny *.evil.example.com\n deny badhost.domain2.com\n[mount3]\nallow * # Puppet #6026: same line comment\n# And trailing whitespace\nallow * \t\n\"\n\ntest PuppetFileserver.lns get fileserver =\n\t{ \"#comment\" = \"This a comment\" }\n\t{ }\n\t{ \"mount1\"\n\t\t{ \"#comment\" = \"Mount1 options\" }\n\t\t{ \"path\" = \"\/etc\/puppet\/files\/%h\" }\n\t\t{ \"allow\" = \"host.domain1.com\" }\n\t\t{ \"allow\" = \"*.domain2.com\" }\n\t\t{ \"deny\" = \"badhost.domain2.com\" }\n\t}\n\t{ \"mount2\"\n\t\t{ \"allow\" = \"*\" }\n\t\t{ \"deny\" = \"*.evil.example.com\" }\n\t\t{ \"deny\" = \"badhost.domain2.com\" }\n\t}\n\t{ \"mount3\"\n\t\t{ \"allow\" = \"*\"\n\t\t\t{ \"#comment\" = \"Puppet #6026: same line comment\" } }\n\t\t{ \"#comment\" = \"And trailing whitespace\" }\n\t\t{ \"allow\" = \"*\" }\n\t}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"dc80208efcc59c2fa3b207318e99da65b4ea61bb","subject":"UpdateDB: Update tests to ensure spaces around = are OK","message":"UpdateDB: Update tests to ensure spaces around = are OK\n","repos":"raphink\/augeas,jjlin\/augeas,ptoscano\/augeas,jtopjian\/augeas,mchf\/augeas,kunkku\/augeas,MikaelSmith\/augeas,lutter\/augeas,dafugg\/augeas,mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,jasperla\/augeas,ptoscano\/augeas,jjlin\/augeas,mlichvar\/augeas,hercules-team\/augeas,mchf\/augeas,pevalme\/augeas,dafugg\/augeas,pevalme\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,lutter\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,jasperla\/augeas,hercules-team\/augeas,dafugg\/augeas,jtopjian\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas,raphink\/augeas","old_file":"lenses\/tests\/test_updatedb.aug","new_file":"lenses\/tests\/test_updatedb.aug","new_contents":"(*\nModule: Test_UpdateDB\n Provides unit tests and examples for the <UpdateDB> lens.\n*)\nmodule Test_UpdateDB =\n\n(* Test: UpdateDB.lns\n Simple get test *)\ntest UpdateDB.lns get \"# A comment\nPRUNEPATHS=\\\"\/tmp \/var\/spool \/media \/home\/.ecryptfs\\\"\nPRUNEFS= \\\"NFS nfs nfs4 rpc_pipefs\\\"\nPRUNE_BIND_MOUNTS = \\\"yes\\\"\\n\" =\n { \"#comment\" = \"A comment\" }\n { \"PRUNEPATHS\"\n { \"entry\" = \"\/tmp\" }\n { \"entry\" = \"\/var\/spool\" }\n { \"entry\" = \"\/media\" }\n { \"entry\" = \"\/home\/.ecryptfs\" }\n }\n { \"PRUNEFS\"\n { \"entry\" = \"NFS\" }\n { \"entry\" = \"nfs\" }\n { \"entry\" = \"nfs4\" }\n { \"entry\" = \"rpc_pipefs\" }\n }\n { \"PRUNE_BIND_MOUNTS\" = \"yes\" }\n\n(* Test: UpdateDB.lns\n Adding to a list *)\ntest UpdateDB.lns put \"PRUNEFS=\\\"NFS nfs nfs4 rpc_pipefs\\\"\\n\"\n after set \"\/PRUNEFS\/entry[last()+1]\" \"ecryptfs\" =\n\"PRUNEFS=\\\"NFS nfs nfs4 rpc_pipefs ecryptfs\\\"\\n\"\n","old_contents":"(*\nModule: Test_UpdateDB\n Provides unit tests and examples for the <UpdateDB> lens.\n*)\nmodule Test_UpdateDB =\n\n(* Test: UpdateDB.lns\n Simple get test *)\ntest UpdateDB.lns get \"# A comment\nPRUNEPATHS=\\\"\/tmp \/var\/spool \/media \/home\/.ecryptfs\\\"\nPRUNEFS=\\\"NFS nfs nfs4 rpc_pipefs\\\"\nPRUNE_BIND_MOUNTS=\\\"yes\\\"\\n\" =\n { \"#comment\" = \"A comment\" }\n { \"PRUNEPATHS\"\n { \"entry\" = \"\/tmp\" }\n { \"entry\" = \"\/var\/spool\" }\n { \"entry\" = \"\/media\" }\n { \"entry\" = \"\/home\/.ecryptfs\" }\n }\n { \"PRUNEFS\"\n { \"entry\" = \"NFS\" }\n { \"entry\" = \"nfs\" }\n { \"entry\" = \"nfs4\" }\n { \"entry\" = \"rpc_pipefs\" }\n }\n { \"PRUNE_BIND_MOUNTS\" = \"yes\" }\n\n(* Test: UpdateDB.lns\n Adding to a list *)\ntest UpdateDB.lns put \"PRUNEFS=\\\"NFS nfs nfs4 rpc_pipefs\\\"\\n\"\n after set \"\/PRUNEFS\/entry[last()+1]\" \"ecryptfs\" =\n\"PRUNEFS=\\\"NFS nfs nfs4 rpc_pipefs ecryptfs\\\"\\n\"\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"544a86c4691182bd267ef1f17d99a27d83c035f6","subject":"Test the Debian Lenny sample squid.conf","message":"Test the Debian Lenny sample squid.conf\n","repos":"hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,jjlin\/augeas,lutter\/augeas,jasperla\/augeas,jtopjian\/augeas,kumy\/augeas,camptocamp\/augeas,kumy\/augeas,jtopjian\/augeas,manandbytes\/augeas,hercules-team\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,raphink\/augeas,bkearney\/augeas,kumy\/augeas,MikaelSmith\/augeas,bkearney\/augeas,bkearney\/augeas,camptocamp\/augeas,MikaelSmith\/augeas,kunkku\/augeas,domcleal\/augeas,ptoscano\/augeas,jasperla\/augeas,camptocamp\/augeas,bkearney\/augeas,mchf\/augeas,dafugg\/augeas,pevalme\/augeas,ptoscano\/augeas,kumy\/augeas,mlichvar\/augeas,mlichvar\/augeas,dafugg\/augeas,manandbytes\/augeas,hercules-team\/augeas,camptocamp\/augeas,pevalme\/augeas,jjlin\/augeas,raphink\/augeas,dafugg\/augeas,lutter\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,domcleal\/augeas,domcleal\/augeas,mchf\/augeas,kunkku\/augeas,ptoscano\/augeas","old_file":"lenses\/tests\/test_squid.aug","new_file":"lenses\/tests\/test_squid.aug","new_contents":"module Test_squid =\n\nlet conf = \"# comment at the beginning of the file\n\nauth_param negotiate children 5\nacl many_spaces rep_header Content-Disposition -i [[:space:]]{3,}\nacl CONNECT method CONNECT\n# comment in the middle\nacl local_network src 192.168.1.0\/24\n\nhttp_access allow manager localhost\nhttp_access allow local_network\n\"\n\ntest Squid.lns get conf =\n { \"#comment\" = \"comment at the beginning of the file\" }\n {}\n { \"auth_param\"\n { \"scheme\" = \"negotiate\" }\n { \"parameter\" = \"children\" }\n { \"setting\" = \"5\" } }\n { \"acl\"\n { \"many_spaces\"\n { \"type\" = \"rep_header\" }\n { \"setting\" = \"Content-Disposition\" }\n { \"parameters\"\n { \"1\" = \"-i\" }\n\t { \"2\" = \"[[:space:]]{3,}\" } } } }\n { \"acl\"\n { \"CONNECT\"\n { \"type\" = \"method\" }\n { \"setting\" = \"CONNECT\" } } }\n { \"#comment\" = \"comment in the middle\" }\n { \"acl\"\n { \"local_network\"\n { \"type\" = \"src\" }\n { \"setting\" = \"192.168.1.0\/24\" } } }\n {}\n { \"http_access\"\n { \"allow\" = \"manager\"\n { \"parameters\"\n \t { \"1\" = \"localhost\" } } } }\n { \"http_access\"\n { \"allow\" = \"local_network\" } }\n\n(* \n This tests the Debian lenny default squid.conf\n Comments were stripped out\n*)\n\nlet debian_lenny_default = \"acl all src all\nacl manager proto cache_object\nacl localhost src 127.0.0.1\/32\nacl to_localhost dst 127.0.0.0\/8\nacl purge method PURGE\nacl CONNECT method CONNECT\nhttp_access allow manager localhost\nhttp_access deny manager\nhttp_access allow purge localhost\nhttp_access deny purge\nhttp_access deny !Safe_ports\nhttp_access deny CONNECT !SSL_ports\nhttp_access allow localhost\nhttp_access deny all\nicp_access allow localnet\nicp_access deny all\nhttp_port 3128\nhierarchy_stoplist cgi-bin ?\naccess_log \/var\/log\/squid\/access.log squid\nrefresh_pattern ^ftp: 1440 20% 10080\nrefresh_pattern ^gopher: 1440 0% 1440\nrefresh_pattern -i (\/cgi-bin\/|\\?) 0 0% 0\nrefresh_pattern (Release|Package(.gz)*)$ 0 20% 2880\nrefresh_pattern . 0 20% 4320\nacl shoutcast rep_header X-HTTP09-First-Line ^ICY\\s[0-9]\nupgrade_http0.9 deny shoutcast\nacl apache rep_header Server ^Apache\nbroken_vary_encoding allow apache\nextension_methods REPORT MERGE MKACTIVITY CHECKOUT\nhosts_file \/etc\/hosts\ncoredump_dir \/var\/spool\/squid\n\"\n\ntest Squid.lns get debian_lenny_default = \n { \"acl\"\n { \"all\"\n { \"type\" = \"src\" }\n { \"setting\" = \"all\" }\n }\n }\n { \"acl\"\n { \"manager\"\n { \"type\" = \"proto\" }\n { \"setting\" = \"cache_object\" }\n }\n }\n { \"acl\"\n { \"localhost\"\n { \"type\" = \"src\" }\n { \"setting\" = \"127.0.0.1\/32\" }\n }\n }\n { \"acl\"\n { \"to_localhost\"\n { \"type\" = \"dst\" }\n { \"setting\" = \"127.0.0.0\/8\" }\n }\n }\n { \"acl\"\n { \"purge\"\n { \"type\" = \"method\" }\n { \"setting\" = \"PURGE\" }\n }\n }\n { \"acl\"\n { \"CONNECT\"\n { \"type\" = \"method\" }\n { \"setting\" = \"CONNECT\" }\n }\n }\n { \"http_access\"\n { \"allow\" = \"manager\"\n { \"parameters\"\n { \"1\" = \"localhost\" }\n }\n }\n }\n { \"http_access\"\n { \"deny\" = \"manager\" }\n }\n { \"http_access\"\n { \"allow\" = \"purge\"\n { \"parameters\"\n { \"1\" = \"localhost\" }\n }\n }\n }\n { \"http_access\"\n { \"deny\" = \"purge\" }\n }\n { \"http_access\"\n { \"deny\" = \"!Safe_ports\" }\n }\n { \"http_access\"\n { \"deny\" = \"CONNECT\"\n { \"parameters\"\n { \"1\" = \"!SSL_ports\" }\n }\n }\n }\n { \"http_access\"\n { \"allow\" = \"localhost\" }\n }\n { \"http_access\"\n { \"deny\" = \"all\" }\n }\n { \"icp_access\" = \"allow localnet\" }\n { \"icp_access\" = \"deny all\" }\n { \"http_port\" = \"3128\" }\n { \"hierarchy_stoplist\" = \"cgi-bin ?\" }\n { \"access_log\" = \"\/var\/log\/squid\/access.log squid\" }\n { \"refresh_pattern\" = \"^ftp: 1440 20% 10080\" }\n { \"refresh_pattern\" = \"^gopher: 1440 0% 1440\" }\n { \"refresh_pattern\" = \"-i (\/cgi-bin\/|\\?) 0 0% 0\" }\n { \"refresh_pattern\" = \"(Release|Package(.gz)*)$ 0 20% 2880\" }\n { \"refresh_pattern\" = \". 0 20% 4320\" }\n { \"acl\"\n { \"shoutcast\"\n { \"type\" = \"rep_header\" }\n { \"setting\" = \"X-HTTP09-First-Line\" }\n { \"parameters\"\n { \"1\" = \"^ICY\\s[0-9]\" }\n }\n }\n }\n { \"upgrade_http0.9\" = \"deny shoutcast\" }\n { \"acl\"\n { \"apache\"\n { \"type\" = \"rep_header\" }\n { \"setting\" = \"Server\" }\n { \"parameters\"\n { \"1\" = \"^Apache\" }\n }\n }\n }\n { \"broken_vary_encoding\" = \"allow apache\" }\n { \"extension_methods\" = \"REPORT MERGE MKACTIVITY CHECKOUT\" }\n { \"hosts_file\" = \"\/etc\/hosts\" }\n { \"coredump_dir\" = \"\/var\/spool\/squid\" }\n","old_contents":"module Test_squid =\n\nlet conf = \"# comment at the beginning of the file\n\nauth_param negotiate children 5\nacl many_spaces rep_header Content-Disposition -i [[:space:]]{3,}\nacl CONNECT method CONNECT\n# comment in the middle\nacl local_network src 192.168.1.0\/24\n\nhttp_access allow manager localhost\nhttp_access allow local_network\n\"\n\ntest Squid.lns get conf =\n { \"#comment\" = \"comment at the beginning of the file\" }\n {}\n { \"auth_param\"\n { \"scheme\" = \"negotiate\" }\n { \"parameter\" = \"children\" }\n { \"setting\" = \"5\" } }\n { \"acl\"\n { \"many_spaces\"\n { \"type\" = \"rep_header\" }\n { \"setting\" = \"Content-Disposition\" }\n { \"parameters\"\n { \"1\" = \"-i\" }\n\t { \"2\" = \"[[:space:]]{3,}\" } } } }\n { \"acl\"\n { \"CONNECT\"\n { \"type\" = \"method\" }\n { \"setting\" = \"CONNECT\" } } }\n { \"#comment\" = \"comment in the middle\" }\n { \"acl\"\n { \"local_network\"\n { \"type\" = \"src\" }\n { \"setting\" = \"192.168.1.0\/24\" } } }\n {}\n { \"http_access\"\n { \"allow\" = \"manager\"\n { \"parameters\"\n \t { \"1\" = \"localhost\" } } } }\n { \"http_access\"\n { \"allow\" = \"local_network\" } }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e3288cd196781abc6aac2e7ddfabc04d2d3392ab","subject":"Fix single quotes support in httpd.aug.","message":"Fix single quotes support in httpd.aug.\n","repos":"jjlin\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,domcleal\/augeas,mchf\/augeas,raphink\/augeas,dafugg\/augeas,ptoscano\/augeas,kumy\/augeas,jjlin\/augeas,pevalme\/augeas,ptoscano\/augeas,mchf\/augeas,pevalme\/augeas,mlichvar\/augeas,hercules-team\/augeas,jasperla\/augeas,kumy\/augeas,lutter\/augeas,jjlin\/augeas,mlichvar\/augeas,kumy\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,kunkku\/augeas,kumy\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,MikaelSmith\/augeas,dafugg\/augeas,jtopjian\/augeas,manandbytes\/augeas,raphink\/augeas,domcleal\/augeas,lutter\/augeas","old_file":"lenses\/httpd.aug","new_file":"lenses\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPLv2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\nlet sep_spc = Sep.space\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_\\.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9\\._\\-]*\/\n\nlet comment = Util.comment\nlet eol = Util.eol\nlet empty = Util.empty\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let h = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n [ indent . dels \"<\" . square word h . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPLv2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\nlet sep_spc = Sep.space\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_\\.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9\\._\\-]*\/\n\nlet comment = Util.comment\nlet eol = Util.eol\nlet empty = Util.empty\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\n]|\\\\\\\\\"'\/\nlet char_arg_sec = \/[^ '\"\\t\\n>]|\\\\\\\\\"'\/\nlet dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let h = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n [ indent . dels \"<\" . square word h . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2e7b8d4ebfea867992d4bafde3e3e2e10360f314","subject":"update pg_hba.aug from https:\/\/github.com\/lutter\/augeas\/blob\/master\/lenses\/pg_hba.aug","message":"update pg_hba.aug from https:\/\/github.com\/lutter\/augeas\/blob\/master\/lenses\/pg_hba.aug\n","repos":"felixhummel\/puppet-postgresql,jneight\/puppet-postgresql,felixhummel\/puppet-postgresql,rradonic\/puppet-postgresql,OSBI\/puppet-postgresql,omarqureshi\/puppet-postgresql,phinze\/puppet-postgresql,vjt\/puppet-postgresql-abandoned,vjt\/puppet-postgresql-abandoned,omarqureshi\/puppet-postgresql,rradonic\/puppet-postgresql,kujilabs\/puppet-postgresql,OSBI\/puppet-postgresql,jmchilton\/puppet-postgresql,mbornoz\/puppet-postgresql,donalmacanri\/puppet-postgresql,dbroeglin\/puppet-postgresql,donalmacanri\/puppet-postgresql,ssidorenko\/puppet-postgresql,kujilabs\/puppet-postgresql,ssidorenko\/puppet-postgresql,ashwoods\/puppet-postgresql,jmchilton\/puppet-postgresql,phinze\/puppet-postgresql,ashwoods\/puppet-postgresql,mbornoz\/puppet-postgresql","old_file":"files\/pg_hba.aug","new_file":"files\/pg_hba.aug","new_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:\\.]+(\\\/[0-9]+|[ \\t]+[0-9\\.]+)\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Pg_Hba\n Parses \/var\/lib\/pgsql\/data\/pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Configuration files\n This lens applies to \/var\/lib\/pgsql\/data\/pg_hba.conf. See <filter>.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:\\.]+(\\\/[0-9]+|[ \\t]+[0-9\\.]+)\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"isc","lang":"Augeas"} {"commit":"978c80129cdb1d9d87ff11589f5cc69e4d897cf7","subject":"Phpvars: allow whitespaces before the \\n in the <?php head line","message":"Phpvars: allow whitespaces before the \\n in the <?php head line\n","repos":"GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,jtopjian\/augeas,camptocamp\/augeas,lutter\/augeas,kunkku\/augeas,kumy\/augeas,mchf\/augeas,mlichvar\/augeas,manandbytes\/augeas,lutter\/augeas,kumy\/augeas,MikaelSmith\/augeas,jjlin\/augeas,hercules-team\/augeas,pevalme\/augeas,mlichvar\/augeas,mlichvar\/augeas,manandbytes\/augeas,camptocamp\/augeas,bkearney\/augeas,jasperla\/augeas,domcleal\/augeas,jtopjian\/augeas,mchf\/augeas,domcleal\/augeas,kumy\/augeas,dafugg\/augeas,pevalme\/augeas,pevalme\/augeas,ptoscano\/augeas,camptocamp\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,kunkku\/augeas,dafugg\/augeas,bkearney\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,ptoscano\/augeas,jjlin\/augeas,bkearney\/augeas,lutter\/augeas,camptocamp\/augeas,domcleal\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,raphink\/augeas,ptoscano\/augeas,jjlin\/augeas,kunkku\/augeas,raphink\/augeas","old_file":"lenses\/phpvars.aug","new_file":"lenses\/phpvars.aug","new_contents":"(* Phpvars module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: PHP syntax\n\n*)\n\nmodule Phpvars =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet indent = Util.indent\nlet empty = Util.empty\n\nlet sep_php = del \/<\\?php[ \\t]*\\n\/ \"<?php\\n\"\nlet sep_eq = del \/[ \\n]*=\/ \" =\"\nlet sep_spc = del \/[ \\n]+\/ \" \"\nlet sep_dollar = del \/\\$\/ \"$\"\nlet sep_scl = del \/[ \\t]*;\/ \";\"\n\nlet chr_blank = \/[ \\t]\/\nlet chr_nblank = \/[^ \\t\\n]\/\nlet chr_any = \/.\/\nlet chr_star = \/\\*\/\nlet chr_nstar = \/[^\\* \\t\\n]\/\nlet chr_slash = \/\\\/\/\nlet chr_nslash = \/[^\\\/ \\t\\n]\/\n\nlet sto_to_scl = store \/([^ \\t\\n].*[^ \\t\\n;]|[^ \\t\\n;])\/\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * COMMENTS\n *************************************************************************)\n\nlet comment_re = chr_nblank\n | ( chr_nblank . chr_any*\n . ( chr_star . chr_nslash\n | chr_nstar . chr_slash\n | chr_nstar . chr_nslash\n | chr_blank . chr_nblank ) )\n\nlet comment_first_line\n = [ indent\n . seq \"#comment\"\n . store comment_re\n ]\nlet comment_other_line\n = [ del \/[ \\t]*\\n[ \\t\\n]*\/ \"\\n\"\n . seq \"#comment\"\n . store comment_re\n ]\nlet comment_end\n = del \/[ \\t\\n]*\/ \"\" . del (chr_star . chr_slash) \"*\/\"\n\nlet comment_extended\n = [ indent\n . del (chr_slash . chr_star) \"\/*\"\n . label \"#comment\"\n . counter \"#comment\"\n . ( (comment_first_line . comment_other_line+)\n | comment_first_line?)\n . comment_end\n . eol ]\n\nlet comment_inline\n = [ indent\n . del (chr_slash . chr_slash) \"\/\/\"\n . label \"#inline\"\n . indent\n . sto_to_eol\n . eol ]\n\nlet comment = comment_extended | comment_inline\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet global = [ key \"global\"\n . sep_spc\n . sep_dollar\n . sto_to_scl\n . sep_scl\n . eol ]\n\nlet variable_re\n = \/\\$[][A-Za-z0-9'_-]+\/\nlet variable = [ key variable_re\n . sep_eq\n . sep_spc\n . sto_to_scl\n . sep_scl\n . eol ]\n\nlet include = [ key \"@include\"\n . sep_spc\n . sto_to_scl\n . sep_scl\n . eol ]\n\nlet entry = global|variable|include\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = sep_php . (empty|comment|entry)*\n\nlet filter = incl \"\/etc\/squirrelmail\/config.php\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Phpvars module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: PHP syntax\n\n*)\n\nmodule Phpvars =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet indent = Util.indent\nlet empty = Util.empty\n\nlet sep_php = del \/<\\?php\\n\/ \"<?php\\n\"\nlet sep_eq = del \/[ \\n]*=\/ \" =\"\nlet sep_spc = del \/[ \\n]+\/ \" \"\nlet sep_dollar = del \/\\$\/ \"$\"\nlet sep_scl = del \/[ \\t]*;\/ \";\"\n\nlet chr_blank = \/[ \\t]\/\nlet chr_nblank = \/[^ \\t\\n]\/\nlet chr_any = \/.\/\nlet chr_star = \/\\*\/\nlet chr_nstar = \/[^\\* \\t\\n]\/\nlet chr_slash = \/\\\/\/\nlet chr_nslash = \/[^\\\/ \\t\\n]\/\n\nlet sto_to_scl = store \/([^ \\t\\n].*[^ \\t\\n;]|[^ \\t\\n;])\/\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * COMMENTS\n *************************************************************************)\n\nlet comment_re = chr_nblank\n | ( chr_nblank . chr_any*\n . ( chr_star . chr_nslash\n | chr_nstar . chr_slash\n | chr_nstar . chr_nslash\n | chr_blank . chr_nblank ) )\n\nlet comment_first_line\n = [ indent\n . seq \"#comment\"\n . store comment_re\n ]\nlet comment_other_line\n = [ del \/[ \\t]*\\n[ \\t\\n]*\/ \"\\n\"\n . seq \"#comment\"\n . store comment_re\n ]\nlet comment_end\n = del \/[ \\t\\n]*\/ \"\" . del (chr_star . chr_slash) \"*\/\"\n\nlet comment_extended\n = [ indent\n . del (chr_slash . chr_star) \"\/*\"\n . label \"#comment\"\n . counter \"#comment\"\n . ( (comment_first_line . comment_other_line+)\n | comment_first_line?)\n . comment_end\n . eol ]\n\nlet comment_inline\n = [ indent\n . del (chr_slash . chr_slash) \"\/\/\"\n . label \"#inline\"\n . indent\n . sto_to_eol\n . eol ]\n\nlet comment = comment_extended | comment_inline\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet global = [ key \"global\"\n . sep_spc\n . sep_dollar\n . sto_to_scl\n . sep_scl\n . eol ]\n\nlet variable_re\n = \/\\$[][A-Za-z0-9'_-]+\/\nlet variable = [ key variable_re\n . sep_eq\n . sep_spc\n . sto_to_scl\n . sep_scl\n . eol ]\n\nlet include = [ key \"@include\"\n . sep_spc\n . sto_to_scl\n . sep_scl\n . eol ]\n\nlet entry = global|variable|include\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = sep_php . (empty|comment|entry)*\n\nlet filter = incl \"\/etc\/squirrelmail\/config.php\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ff2b9b466f97311a38dc6621555ef3a379be3805","subject":"Cron: records can be prefixed by '-'.","message":"Cron: records can be prefixed by '-'.\n","repos":"hercules-team\/augeas,kunkku\/augeas,kumy\/augeas,mchf\/augeas,dafugg\/augeas,dafugg\/augeas,manandbytes\/augeas,jasperla\/augeas,kumy\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,MikaelSmith\/augeas,kunkku\/augeas,jjlin\/augeas,jjlin\/augeas,mlichvar\/augeas,mlichvar\/augeas,mlichvar\/augeas,jtopjian\/augeas,lutter\/augeas,raphink\/augeas,ptoscano\/augeas,kunkku\/augeas,kumy\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,pevalme\/augeas,kumy\/augeas,jtopjian\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,hercules-team\/augeas,MikaelSmith\/augeas,raphink\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas","old_file":"lenses\/cron.aug","new_file":"lenses\/cron.aug","new_contents":"(*\nModule: Cron\n Parses \/etc\/cron.d\/*, \/etc\/crontab\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 crontab` where\n possible.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the entry that launches '\/usr\/bin\/ls'\n > match '\/files\/etc\/crontab\/entry[. = \"\/usr\/bin\/ls\"]'\n\nAbout: Configuration files\n This lens applies to \/etc\/cron.d\/* and \/etc\/crontab. See <filter>.\n*)\n\nmodule Cron =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: num *)\nlet num = \/[0-9*][0-9\\\/,*-]*\/\n\n(* Variable: alpha *)\nlet alpha = \/[A-Za-z]{3}\/\n\n(* Variable: alphanum *)\nlet alphanum = (num|alpha) . (\"-\" . (num|alpha))?\n\n(* Variable: entry_prefix *)\nlet entry_prefix = \/-\/\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_eq *)\nlet sep_eq = Util.del_str \"=\"\n\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = \/[A-Za-z-1-9_]+(\\[[0-9]+\\])?\/ - \"entry\" in\n let sto_to_eol = store \/[^\\n]*[^ \\t\\n]\/ in\n [ key key_re . sep_eq . sto_to_eol . eol ]\n\n(* View: - prefix of an entry *)\nlet prefix = [ label \"prefix\" . store entry_prefix ]\n\n(* View: minute *)\nlet minute = [ label \"minute\" . store num ]\n\n(* View: hour *)\nlet hour = [ label \"hour\" . store num ]\n\n(* View: dayofmonth *)\nlet dayofmonth = [ label \"dayofmonth\" . store num ]\n\n(* View: month *)\nlet month = [ label \"month\" . store alphanum ]\n\n(* View: dayofweek *)\nlet dayofweek = [ label \"dayofweek\" . store alphanum ]\n\n\n(* View: user *)\nlet user = [ label \"user\" . store Rx.word ]\n\n\n(************************************************************************\n * View: time\n * Time in the format \"minute hour dayofmonth month dayofweek\"\n *************************************************************************)\nlet time = [ label \"time\" .\n minute . sep_spc . hour . sep_spc . dayofmonth\n . sep_spc . month . sep_spc . dayofweek ]\n\n(* Variable: the valid values for schedules *)\nlet schedule_re = \"reboot\" | \"yearly\" | \"annually\" | \"monthly\"\n | \"weekly\" | \"daily\" | \"midnight\" | \"hourly\"\n\n(************************************************************************\n * View: schedule\n * Time in the format \"@keyword\"\n *************************************************************************)\nlet schedule = [ label \"schedule\" . Util.del_str \"@\"\n . store schedule_re ]\n\n\n(************************************************************************\n * View: entry\n * A crontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . indent\n . prefix?\n . ( time | schedule )\n . sep_spc . user\n . sep_spc . store Rx.space_in . eol ]\n\n\n(*\n * View: lns\n * The cron lens\n *)\nlet lns = ( empty | comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/cron.d\/*\" .\n incl \"\/etc\/crontab\" .\n excl \"\/etc\/cron.d\/at.allow\" .\n excl \"\/etc\/cron.d\/at.deny\" .\n excl \"\/etc\/cron.d\/cron.allow\" .\n excl \"\/etc\/cron.d\/cron.deny\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Cron\n Parses \/etc\/cron.d\/*, \/etc\/crontab\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 crontab` where\n possible.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the entry that launches '\/usr\/bin\/ls'\n > match '\/files\/etc\/crontab\/entry[. = \"\/usr\/bin\/ls\"]'\n\nAbout: Configuration files\n This lens applies to \/etc\/cron.d\/* and \/etc\/crontab. See <filter>.\n*)\n\nmodule Cron =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: num *)\nlet num = \/[0-9*][0-9\\\/,*-]*\/\n\n(* Variable: alpha *)\nlet alpha = \/[A-Za-z]{3}\/\n\n(* Variable: alphanum *)\nlet alphanum = (num|alpha) . (\"-\" . (num|alpha))?\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_eq *)\nlet sep_eq = Util.del_str \"=\"\n\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = \/[A-Za-z-1-9_]+(\\[[0-9]+\\])?\/ - \"entry\" in\n let sto_to_eol = store \/[^\\n]*[^ \\t\\n]\/ in\n [ key key_re . sep_eq . sto_to_eol . eol ]\n\n\n(* View: minute *)\nlet minute = [ label \"minute\" . store num ]\n\n(* View: hour *)\nlet hour = [ label \"hour\" . store num ]\n\n(* View: dayofmonth *)\nlet dayofmonth = [ label \"dayofmonth\" . store num ]\n\n(* View: month *)\nlet month = [ label \"month\" . store alphanum ]\n\n(* View: dayofweek *)\nlet dayofweek = [ label \"dayofweek\" . store alphanum ]\n\n\n(* View: user *)\nlet user = [ label \"user\" . store Rx.word ]\n\n\n(************************************************************************\n * View: time\n * Time in the format \"minute hour dayofmonth month dayofweek\"\n *************************************************************************)\nlet time = [ label \"time\" .\n minute . sep_spc . hour . sep_spc . dayofmonth\n . sep_spc . month . sep_spc . dayofweek ]\n\n(* Variable: the valid values for schedules *)\nlet schedule_re = \"reboot\" | \"yearly\" | \"annually\" | \"monthly\"\n | \"weekly\" | \"daily\" | \"midnight\" | \"hourly\"\n\n(************************************************************************\n * View: schedule\n * Time in the format \"@keyword\"\n *************************************************************************)\nlet schedule = [ label \"schedule\" . Util.del_str \"@\"\n . store schedule_re ]\n\n\n(************************************************************************\n * View: entry\n * A crontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . indent\n . ( time | schedule )\n . sep_spc . user\n . sep_spc . store Rx.space_in . eol ]\n\n\n(*\n * View: lns\n * The cron lens\n *)\nlet lns = ( empty | comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/cron.d\/*\" .\n incl \"\/etc\/crontab\" .\n excl \"\/etc\/cron.d\/at.allow\" .\n excl \"\/etc\/cron.d\/at.deny\" .\n excl \"\/etc\/cron.d\/cron.allow\" .\n excl \"\/etc\/cron.d\/cron.deny\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f966ad54e3d989efe9cf4f4671de49779ba4e191","subject":"sync another comment with ND definition","message":"sync another comment with ND definition\n","repos":"hercules-team\/augeas-do-not-use,jjlin\/augeas,jasperla\/augeas,kunkku\/augeas,kunkku\/augeas,raphink\/augeas,lutter\/augeas,jjlin\/augeas,ptoscano\/augeas,pevalme\/augeas,kumy\/augeas,pevalme\/augeas,ptoscano\/augeas,jjlin\/augeas,mlichvar\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,lutter\/augeas,hercules-team\/augeas,pevalme\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,dafugg\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,raphink\/augeas,kunkku\/augeas,mchf\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,dafugg\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,mchf\/augeas,jasperla\/augeas,hercules-team\/augeas,lutter\/augeas,manandbytes\/augeas,kumy\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Sep.space\n\n(* Variable: sep_cont *)\nlet sep_cont = Sep.cl_or_space\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = Sep.cl_or_opt_space\n\n(* Variable: sep_cont_opt_build *)\nlet sep_cont_opt_build (sep:string) =\n del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (\" \" . sep . \" \")\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt_build \",\"\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt_build \"=\"\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt_build \":\"\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd =\n let alias = Rx.word - \/(NO)?(PASSWD|EXEC|SETENV)\/\n in let non_alias = \/(!?[\\\/a-z]([^,:#()\\n\\\\]|\\\\\\\\[=:,\\\\])*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n in store (alias | non_alias)\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces and NIS domains and allowed*)\nlet sto_to_com_user =\n let nis_re = \/([A-Z]([-A-Z0-9]|(\\\\\\\\[ \\t]))*+\\\\\\\\\\\\\\\\)\/\n in let user_re = \/[%+@a-z]([-a-z0-9]|(\\\\\\\\[ \\t]))*\/\n in let alias_re = \/[A-Z_]+\/\n in store ((nis_re? . user_re) | alias_re)\n\n(* Variable: to_com_chars *)\nlet to_com_chars = \/[^\",=#() \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: to_com_dquot *)\nlet to_com_dquot = \/\"[^\",=#()\\n\\\\]+\"\/ (* \" relax emacs *)\n\n(* Variable: sto_to_com_dquot *)\nlet sto_to_com_dquot = store (to_com_chars|to_com_dquot)\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store to_com_chars\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\]+|\"[^\", \\t\\n\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n Build.opt_list (alias_field kw sto) sep_com\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '!' Cmnd_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:!>][^ \\t\\n\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\" | \"closefrom_override\"\n | \"closefrom_override\" | \"compress_io\" | \"fast_glob\"\n | \"log_input\" | \"log_output\" | \"pwfeedback\"\n | \"umask_override\" | \"use_pty\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . sto_to_com_dquot ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list> for listing\n * users and\/or groups used to run a command\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')' |\n * > '(:' Runas_List ')' |\n * > '(' Runas_List ':' Runas_List ')'\n *************************************************************************)\nlet runas_spec_user = alias_list \"runas_user\" sto_to_com\nlet runas_spec_group = Util.del_str \":\" . indent\n . alias_list \"runas_group\" sto_to_com\n\nlet runas_spec_usergroup = runas_spec_user . indent . runas_spec_group\n\nlet runas_spec = Util.del_str \"(\"\n . (runas_spec_user\n | runas_spec_group\n | runas_spec_usergroup )\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = Build.opt_list cmnd_spec sep_com\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . Build.opt_list spec_list sep_col\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Sep.space\n\n(* Variable: sep_cont *)\nlet sep_cont = Sep.cl_or_space\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = Sep.cl_or_opt_space\n\n(* Variable: sep_cont_opt_build *)\nlet sep_cont_opt_build (sep:string) =\n del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (\" \" . sep . \" \")\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt_build \",\"\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt_build \"=\"\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt_build \":\"\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd =\n let alias = Rx.word - \/(NO)?(PASSWD|EXEC|SETENV)\/\n in let non_alias = \/(!?[\\\/a-z]([^,:#()\\n\\\\]|\\\\\\\\[=:,\\\\])*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n in store (alias | non_alias)\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces and NIS domains and allowed*)\nlet sto_to_com_user =\n let nis_re = \/([A-Z]([-A-Z0-9]|(\\\\\\\\[ \\t]))*+\\\\\\\\\\\\\\\\)\/\n in let user_re = \/[%+@a-z]([-a-z0-9]|(\\\\\\\\[ \\t]))*\/\n in let alias_re = \/[A-Z_]+\/\n in store ((nis_re? . user_re) | alias_re)\n\n(* Variable: to_com_dquot *)\nlet to_com_chars = \/[^\",=#() \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: to_com_dquot *)\nlet to_com_dquot = \/\"[^\",=#()\\n\\\\]+\"\/ (* \" relax emacs *)\n\n(* Variable: sto_to_com_dquot *)\nlet sto_to_com_dquot = store (to_com_chars|to_com_dquot)\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store to_com_chars\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\]+|\"[^\", \\t\\n\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n Build.opt_list (alias_field kw sto) sep_com\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '!' Cmnd_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:!>][^ \\t\\n\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\" | \"closefrom_override\"\n | \"closefrom_override\" | \"compress_io\" | \"fast_glob\"\n | \"log_input\" | \"log_output\" | \"pwfeedback\"\n | \"umask_override\" | \"use_pty\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . sto_to_com_dquot ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list> for listing\n * users and\/or groups used to run a command\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')' |\n * > '(:' Runas_List ')' |\n * > '(' Runas_List ':' Runas_List ')'\n *************************************************************************)\nlet runas_spec_user = alias_list \"runas_user\" sto_to_com\nlet runas_spec_group = Util.del_str \":\" . indent\n . alias_list \"runas_group\" sto_to_com\n\nlet runas_spec_usergroup = runas_spec_user . indent . runas_spec_group\n\nlet runas_spec = Util.del_str \"(\"\n . (runas_spec_user\n | runas_spec_group\n | runas_spec_usergroup )\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = Build.opt_list cmnd_spec sep_com\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . Build.opt_list spec_list sep_col\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b78bbb61282208288f0182ec1a9b3045c1f61e2a","subject":"Shellvars: do not handle csh\/tcsh profile scripts","message":"Shellvars: do not handle csh\/tcsh profile scripts\n\nThey are specific scripts for csh\/tcsh, which are not POSIX compliant.\nAs Shellvars cannot handle them (it is de-facto for POSIX compliant\nshells), exclude them directly.\n","repos":"mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,ptoscano\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas,kunkku\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_][-A-Za-z0-9_]*(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) (start_kw:string) (end_kw:string) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str start_kw . brace_eol\n . entry+\n . Util.indent . Util.del_str end_kw . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry \"{\" \"}\"\n | function entry \"(\" \")\"\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"anaconda\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n . excl \"\/etc\/profile.d\/*.csh\"\n . excl \"\/etc\/profile.d\/csh.local\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lbu\/lbu.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.d\/*\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_][-A-Za-z0-9_]*(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) (start_kw:string) (end_kw:string) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str start_kw . brace_eol\n . entry+\n . Util.indent . Util.del_str end_kw . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry \"{\" \"}\"\n | function entry \"(\" \")\"\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"anaconda\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lbu\/lbu.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.d\/*\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f5189cd4b6b8f323200996b953b7331b24a60ffc","subject":"YAML: Documentation","message":"YAML: Documentation\n","repos":"lutter\/augeas,kunkku\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,pevalme\/augeas,kunkku\/augeas,kunkku\/augeas,lutter\/augeas,hercules-team\/augeas,manandbytes\/augeas,mlichvar\/augeas,mchf\/augeas,pevalme\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,pevalme\/augeas,manandbytes\/augeas,ptoscano\/augeas,mchf\/augeas","old_file":"lenses\/yaml.aug","new_file":"lenses\/yaml.aug","new_contents":"(*\nModule: Yaml\n Only valid for the following subset:\n\n> defaults: &anchor\n> repo1: master\n>\n> host:\n> # Inheritance\n> <<: *anchor\n> repo2: branch\n\nAuthor: Dimitar Dimitrov <mitkofr@yahoo.fr>\n*)\nmodule YAML =\n\n(* Group: helpers *)\nlet colon = Sep.colon\nlet space = Sep.space\nlet val = store Rx.word\nlet eol = Util.eol\nlet empty = Util.empty\nlet comment = Util.comment_noindent\n\n(*\nView: indent\n the imposed indent is 2 spaces\n*)\nlet indent = Util.del_str \" \"\n\n(*\nView: inherit\n> <<: *anchor\n*)\nlet _inherit = [ key \"<<\" . colon . space . Util.del_str \"*\" . val . eol ]\nlet inherit = indent . _inherit . (indent . comment)*\n\n(*\nView: repo\n> { \"repo\" = \"branch\" }\n*)\nlet _repo = [ key Rx.word . colon . space . val . eol ]\nlet repo = indent . _repo . (indent . comment)*\n\n(*\nView: anchor\n> &anchor\n*)\nlet anchor = Util.del_str \"&\" . val\n\n(*\nView: entry\n> host:\n> # Inheritance\n> <<: *anchor\n> repo2: branch\n*)\nlet entry = [ key Rx.word . colon . (space . anchor)? . eol\n . (indent . comment)*\n . ((inherit . (repo+)?) | repo+)\n ]\n\n(* View: header *)\nlet header = [ label \"@yaml\" . Util.del_str \"---\"\n . (Sep.space . store Rx.space_in)? . eol ]\n\n(*\nView: lns\n The yaml lens\n*)\nlet lns = ((empty|comment)* . header)? . (entry | comment | empty)*\n","old_contents":"(*\nModule: Yaml\n Only valid for the following subset:\n\n> defaults: &anchor\n> repo1: master\n>\n> host:\n> # Inheritance\n> <<: *anchor\n> repo2: branch\n\nAuthor: Dimitar Dimitrov <mitkofr@yahoo.fr>\n*)\nmodule YAML =\n\n(* Group: helpers *)\nlet colon = Sep.colon\nlet space = Sep.space\nlet val = store Rx.word\nlet eol = Util.eol\nlet empty = Util.empty\nlet comment = Util.comment_noindent\n\n(*\nView: indent\n the imposed indent is 2 spaces\n*)\nlet indent = Util.del_str \" \"\n\n(*\nView: inherit\n> <<: *anchor\n*)\nlet _inherit = [ key \"<<\" . colon . space . Util.del_str \"*\" . val . eol ]\nlet inherit = indent . _inherit . (indent . comment)*\n\n(*\nView: repo\n> { \"repo\" = \"branch\" }\n*)\nlet _repo = [ key Rx.word . colon . space . val . eol ]\nlet repo = indent . _repo . (indent . comment)*\n\n(*\nView: anchor\n> &anchor\n*)\nlet anchor = Util.del_str \"&\" . val\n\n(*\nView: entry\n> host:\n> # Inheritance\n> <<: *anchor\n> repo2: branch\n*)\nlet entry = [ key Rx.word . colon . (space . anchor)? . eol\n . (indent . comment)*\n . ((inherit . (repo+)?) | repo+)\n ]\n\nlet header = [ label \"@yaml\" . Util.del_str \"---\"\n . (Sep.space . store Rx.space_in)? . eol ]\n\n(*\nView: lns\n The yaml lens\n*)\nlet lns = ((empty|comment)* . header)? . (entry | comment | empty)*\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"49bcfbeba1f4a2992a21720e97ac6e882064eea8","subject":"Exclude network\/if-up.d\/SuSEfirewall2 in shellvars lens","message":"Exclude network\/if-up.d\/SuSEfirewall2 in shellvars lens\n\nopenSUSE has \/etc\/sysconfig\/network\/if-up.d\/SuSEfirewall2 that is not a\nshell variable script, exclude it to avoid errors.\n","repos":"mchf\/augeas,hercules-team\/augeas,mlichvar\/augeas,lutter\/augeas,mchf\/augeas,lutter\/augeas,manandbytes\/augeas,pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,pevalme\/augeas,manandbytes\/augeas,kunkku\/augeas,lutter\/augeas,mlichvar\/augeas,hercules-team\/augeas,kunkku\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/[A-Za-z0-9_.-\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"01bf31ccd991a1b66c78bc9db6f029e7020b29ea","subject":"Improve doc on services.aug","message":"Improve doc on services.aug\n","repos":"hercules-team\/augeas-do-not-use,lutter\/augeas,mlichvar\/augeas,mlichvar\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,lutter\/augeas,jtopjian\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,kumy\/augeas,dafugg\/augeas,dafugg\/augeas,jjlin\/augeas,MikaelSmith\/augeas,mchf\/augeas,jasperla\/augeas,kumy\/augeas,mlichvar\/augeas,kunkku\/augeas,kumy\/augeas,pevalme\/augeas,jtopjian\/augeas,hercules-team\/augeas,manandbytes\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,raphink\/augeas,jjlin\/augeas,domcleal\/augeas,pevalme\/augeas,jjlin\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,kumy\/augeas,domcleal\/augeas,pevalme\/augeas,dafugg\/augeas,kunkku\/augeas","old_file":"lenses\/services.aug","new_file":"lenses\/services.aug","new_contents":"(*\nModule: Services\n Parses \/etc\/services\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to 'man services' where possible.\n\nThe definitions from 'man services' are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the name of the service running on port 22 with protocol tcp\n > match \"\/files\/etc\/services\/service-name[port = '22'][protocol = 'tcp']\"\n * Remove the tcp entry for \"domain\" service\n > rm \"\/files\/etc\/services\/service-name[. = 'domain'][protocol = 'tcp']\"\n * Add a tcp service named \"myservice\" on port 55234\n > ins service-name after \/files\/etc\/services\/service-name[last()]\n > set \/files\/etc\/services\/service-name[last()] \"myservice\"\n > set \"\/files\/etc\/services\/service-name[. = 'myservice']\/port\" \"55234\"\n > set \"\/files\/etc\/services\/service-name[. = 'myservice']\/protocol\" \"tcp\"\n\nAbout: Configuration files\n This lens applies to \/etc\/services. See <filter>.\n*)\n\nmodule Services =\n autoload xfm\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = del \/[ \\t]*(#)?[ \\t]*\\n\/ \"\\n\"\nlet indent = Util.indent\nlet comment = Util.comment\nlet empty = Util.empty\nlet protocol_re = \/[a-zA-Z]+\/\nlet word_re = \/[a-zA-Z0-9_.+*\\\/-]+\/\nlet num_re = \/[0-9]+\/\n\n(* Group: Separators *)\nlet sep_spc = Util.del_ws_spc\n\n\n(************************************************************************\n * Group: LENSES\n *************************************************************************)\n\n(* View: port *)\nlet port = [ label \"port\" . store num_re ]\n\n(* View: protocol *)\nlet protocol = [ label \"protocol\" . store protocol_re ]\n\n(* View: alias *)\nlet alias = [ label \"alias\" . store word_re ]\n\n(*\n * View: record\n * A standard \/etc\/services record\n * TODO: make sure a space is added before a comment on new nodes\n *)\nlet record = [ label \"service-name\" . store word_re . sep_spc . port\n . del \"\/\" \"\/\" . protocol . ( sep_spc . alias )*\n . (comment|eol) ]\n\n(* View: lns\n The services lens is either <empty>, <comment> or <record> *)\nlet lns = ( empty | comment | record )*\n\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/services\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Services\n Parses \/etc\/services\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to 'man services' where possible.\n\nThe definitions from 'man services' are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the name of the service running on port 22 with protocol tcp\n > match \"\/files\/etc\/services\/service-name[port = '22'][protocol = 'tcp']\"\n * Remove the tcp entry for \"domain\" service\n > rm \"\/files\/etc\/services\/service-name[. = 'domain'][protocol = 'tcp']\"\n * Add a tcp service named \"myservice\" on port 55234\n > ins service-name after \/files\/etc\/services\/service-name[last()]\n > set \/files\/etc\/services\/service-name[last()] \"myservice\"\n > set \"\/files\/etc\/services\/service-name[. = 'myservice']\/port\" \"55234\"\n > set \"\/files\/etc\/services\/service-name[. = 'myservice']\/protocol\" \"tcp\"\n\nAbout: Configuration files\n This lens applies to \/etc\/services. See <filter>.\n*)\n\nmodule Services =\n autoload xfm\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = del \/[ \\t]*(#)?[ \\t]*\\n\/ \"\\n\"\nlet indent = Util.indent\nlet comment = Util.comment\nlet empty = Util.empty\nlet protocol_re = \/[a-zA-Z]+\/\nlet word_re = \/[a-zA-Z0-9_.+*\\\/-]+\/\nlet num_re = \/[0-9]+\/\n\n(* Group: Separators *)\nlet sep_spc = Util.del_ws_spc\n\n\n(************************************************************************\n * Group: LENSES\n *************************************************************************)\n\n(* View: port *)\nlet port = [ label \"port\" . store num_re ]\n\n(* View: protocol *)\nlet protocol = [ label \"protocol\" . store protocol_re ]\n\n(* View: alias *)\nlet alias = [ label \"alias\" . store word_re ]\n\n(*\n * View: record\n * A standard \/etc\/services record\n * TODO: make sure a space is added before a comment on new nodes\n *)\nlet record = [ label \"service-name\" . store word_re . sep_spc . port\n . del \"\/\" \"\/\" . protocol . ( sep_spc . alias )*\n . (comment|eol) ]\n\n(* View: lns *)\nlet lns = ( empty | comment | record )*\n\n\n(*Variable: filter *)\nlet filter = (incl \"\/etc\/services\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1207eba823c727316dad80159acfbc0f1eb3dc17","subject":"Add an Examples section to reprepro_uploaders.aug's header","message":"Add an Examples section to reprepro_uploaders.aug's header\n","repos":"pevalme\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,dafugg\/augeas,jtopjian\/augeas,lutter\/augeas,raphink\/augeas,mlichvar\/augeas,domcleal\/augeas,dafugg\/augeas,kunkku\/augeas,mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,jjlin\/augeas,jasperla\/augeas,kumy\/augeas,kumy\/augeas,dafugg\/augeas,hercules-team\/augeas,mchf\/augeas,mchf\/augeas,kumy\/augeas,manandbytes\/augeas,ptoscano\/augeas,jjlin\/augeas,ptoscano\/augeas,kunkku\/augeas,raphink\/augeas,domcleal\/augeas,kumy\/augeas,pevalme\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,lutter\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas","old_file":"lenses\/reprepro_uploaders.aug","new_file":"lenses\/reprepro_uploaders.aug","new_contents":"(*\nModule: Reprepro_Uploaders\n Parses reprepro's uploaders files\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 1 reprepro` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n See <lns>.\n\nAbout: Configuration files\n This lens applies to reprepro's uploaders files.\n\nAbout: Examples\n The <Test_Reprepro_Uploaders> file contains various examples and tests.\n*)\n\nmodule Reprepro_Uploaders =\n\n(* View: logic_construct_condition\n A logical construction for <condition> and <condition_list> *)\nlet logic_construct_condition (kw:string) (lns:lens) =\n [ label kw . lns ]\n . [ Sep.space . key kw . Sep.space . lns ]*\n\n(* View: logic_construct_field\n A generic definition for <condition_field> *)\nlet logic_construct_field (kw:string) (sep:string) (lns:lens) =\n [ label kw . lns ]\n . [ Build.xchgs sep kw . lns ]*\n\n(* View: condition_re\n A condition can be of several types:\n\n - source\n - byhand\n - sections\n - sections contain\n - binaries\n - binaries contain\n - architectures\n - architectures contain\n\n While the lens technically also accepts \"source contain\"\n and \"byhand contain\", these are not understood by reprepro.\n\n The \"contain\" types are built by adding a \"contain\" subnode.\n See the <condition_field> definition.\n\n *)\nlet condition_re =\n \"source\"\n | \"byhand\"\n | \"sections\"\n | \"binaries\"\n | \"architectures\"\n\n(* View: condition_field\n A single condition field is an 'or' node.\n It may contain several values, listed in 'or' subnodes:\n\n > $reprepro\/allow[1]\/and\/or = \"architectures\"\n > $reprepro\/allow[1]\/and\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and\/or\/or[3] = \"all\"\n\n *)\nlet condition_field =\n let sto_condition = Util.del_str \"'\" . store \/[^'\\n]+\/ . Util.del_str \"'\" in\n [ key \"not\" . Sep.space ]? .\n store condition_re\n . [ Sep.space . key \"contain\" ]?\n . Sep.space\n . logic_construct_field \"or\" \"|\" sto_condition\n\n(* View: condition\n A condition is an 'and' node,\n representing a union of <condition_fields>,\n listed under 'or' subnodes:\n\n > $reprepro\/allow[1]\/and\n > $reprepro\/allow[1]\/and\/or = \"architectures\"\n > $reprepro\/allow[1]\/and\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and\/or\/or[3] = \"all\"\n\n *)\nlet condition =\n logic_construct_condition \"or\" condition_field\n\n(* View: condition_list\n A list of <conditions>, inspired by Debctrl.dependency_list\n An upload condition list is either the wildcard '*', stored verbatim,\n or an intersection of conditions listed under 'and' subnodes:\n\n > $reprepro\/allow[1]\/and[1]\n > $reprepro\/allow[1]\/and[1]\/or = \"architectures\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[3] = \"all\"\n > $reprepro\/allow[1]\/and[2]\n > $reprepro\/allow[1]\/and[2]\/or = \"sections\"\n > $reprepro\/allow[1]\/and[2]\/or\/contain\n > $reprepro\/allow[1]\/and[2]\/or\/or = \"main\"\n\n *)\nlet condition_list =\n store \"*\"\n | logic_construct_condition \"and\" condition\n\n(* View: by_key\n When a key is used to authenticate packages,\n the value can either be a key ID or \"any\":\n\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n > $reprepro\/allow[2]\/by\/key = \"any\"\n\n *)\nlet by_key =\n let any_key = [ store \"any\" . Sep.space\n . key \"key\" ] in\n let named_key = [ key \"key\" . Sep.space\n . store (Rx.word - \"any\") ] in\n value \"key\" . (any_key | named_key)\n\n(* View: by\n <by> statements define who is allowed to upload.\n It can be simple keywords, like \"anybody\" or \"unsigned\",\n or a key ID, in which case a \"key\" subnode is added:\n\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n > $reprepro\/allow[2]\/by\/key = \"any\"\n > $reprepro\/allow[3]\/by = \"anybody\"\n > $reprepro\/allow[4]\/by = \"unsigned\"\n\n *)\nlet by =\n [ key \"by\" . Sep.space\n . ( store (\"anybody\"|\"unsigned\")\n | by_key ) ]\n\n(* View: entry\n An entry is an allow statement, e.g.:\n\n > $reprepro\/allow[1]\n > $reprepro\/allow[1]\/and[1]\n > $reprepro\/allow[1]\/and[1]\/or = \"architectures\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[3] = \"all\"\n > $reprepro\/allow[1]\/and[2]\n > $reprepro\/allow[1]\/and[2]\/or = \"sections\"\n > $reprepro\/allow[1]\/and[2]\/or\/contain\n > $reprepro\/allow[1]\/and[2]\/or\/or = \"main\"\n > $reprepro\/allow[1]\/by = \"key\"\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n\n *)\nlet entry =\n [ key \"allow\" . Sep.space\n . condition_list . Sep.space\n . by . Util.eol ]\n\n(* View: lns\n The lens is made of <Util.empty>, <Util.comment> and <entry> lines *)\nlet lns = (Util.empty|Util.comment|entry)*\n","old_contents":"(*\nModule: Reprepro_Uploaders\n Parses reprepro's uploaders files\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 1 reprepro` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n See <lns>.\n\nAbout: Configuration files\n This lens applies to reprepro's uploaders files.\n*)\n\nmodule Reprepro_Uploaders =\n\n(* View: logic_construct_condition\n A logical construction for <condition> and <condition_list> *)\nlet logic_construct_condition (kw:string) (lns:lens) =\n [ label kw . lns ]\n . [ Sep.space . key kw . Sep.space . lns ]*\n\n(* View: logic_construct_field\n A generic definition for <condition_field> *)\nlet logic_construct_field (kw:string) (sep:string) (lns:lens) =\n [ label kw . lns ]\n . [ Build.xchgs sep kw . lns ]*\n\n(* View: condition_re\n A condition can be of several types:\n\n - source\n - byhand\n - sections\n - sections contain\n - binaries\n - binaries contain\n - architectures\n - architectures contain\n\n While the lens technically also accepts \"source contain\"\n and \"byhand contain\", these are not understood by reprepro.\n\n The \"contain\" types are built by adding a \"contain\" subnode.\n See the <condition_field> definition.\n\n *)\nlet condition_re =\n \"source\"\n | \"byhand\"\n | \"sections\"\n | \"binaries\"\n | \"architectures\"\n\n(* View: condition_field\n A single condition field is an 'or' node.\n It may contain several values, listed in 'or' subnodes:\n\n > $reprepro\/allow[1]\/and\/or = \"architectures\"\n > $reprepro\/allow[1]\/and\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and\/or\/or[3] = \"all\"\n\n *)\nlet condition_field =\n let sto_condition = Util.del_str \"'\" . store \/[^'\\n]+\/ . Util.del_str \"'\" in\n [ key \"not\" . Sep.space ]? .\n store condition_re\n . [ Sep.space . key \"contain\" ]?\n . Sep.space\n . logic_construct_field \"or\" \"|\" sto_condition\n\n(* View: condition\n A condition is an 'and' node,\n representing a union of <condition_fields>,\n listed under 'or' subnodes:\n\n > $reprepro\/allow[1]\/and\n > $reprepro\/allow[1]\/and\/or = \"architectures\"\n > $reprepro\/allow[1]\/and\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and\/or\/or[3] = \"all\"\n\n *)\nlet condition =\n logic_construct_condition \"or\" condition_field\n\n(* View: condition_list\n A list of <conditions>, inspired by Debctrl.dependency_list\n An upload condition list is either the wildcard '*', stored verbatim,\n or an intersection of conditions listed under 'and' subnodes:\n\n > $reprepro\/allow[1]\/and[1]\n > $reprepro\/allow[1]\/and[1]\/or = \"architectures\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[3] = \"all\"\n > $reprepro\/allow[1]\/and[2]\n > $reprepro\/allow[1]\/and[2]\/or = \"sections\"\n > $reprepro\/allow[1]\/and[2]\/or\/contain\n > $reprepro\/allow[1]\/and[2]\/or\/or = \"main\"\n\n *)\nlet condition_list =\n store \"*\"\n | logic_construct_condition \"and\" condition\n\n(* View: by_key\n When a key is used to authenticate packages,\n the value can either be a key ID or \"any\":\n\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n > $reprepro\/allow[2]\/by\/key = \"any\"\n\n *)\nlet by_key =\n let any_key = [ store \"any\" . Sep.space\n . key \"key\" ] in\n let named_key = [ key \"key\" . Sep.space\n . store (Rx.word - \"any\") ] in\n value \"key\" . (any_key | named_key)\n\n(* View: by\n <by> statements define who is allowed to upload.\n It can be simple keywords, like \"anybody\" or \"unsigned\",\n or a key ID, in which case a \"key\" subnode is added:\n\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n > $reprepro\/allow[2]\/by\/key = \"any\"\n > $reprepro\/allow[3]\/by = \"anybody\"\n > $reprepro\/allow[4]\/by = \"unsigned\"\n\n *)\nlet by =\n [ key \"by\" . Sep.space\n . ( store (\"anybody\"|\"unsigned\")\n | by_key ) ]\n\n(* View: entry\n An entry is an allow statement, e.g.:\n\n > $reprepro\/allow[1]\n > $reprepro\/allow[1]\/and[1]\n > $reprepro\/allow[1]\/and[1]\/or = \"architectures\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[3] = \"all\"\n > $reprepro\/allow[1]\/and[2]\n > $reprepro\/allow[1]\/and[2]\/or = \"sections\"\n > $reprepro\/allow[1]\/and[2]\/or\/contain\n > $reprepro\/allow[1]\/and[2]\/or\/or = \"main\"\n > $reprepro\/allow[1]\/by = \"key\"\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n\n *)\nlet entry =\n [ key \"allow\" . Sep.space\n . condition_list . Sep.space\n . by . Util.eol ]\n\n(* View: lns\n The lens is made of <Util.empty>, <Util.comment> and <entry> lines *)\nlet lns = (Util.empty|Util.comment|entry)*\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8bc024eab9b1fd1944d0064140d36321eaa5fb09","subject":"Fix syntax error; we want to test that missing defaults are noticed","message":"Fix syntax error; we want to test that missing defaults are noticed\n","repos":"pevalme\/augeas,lutter\/augeas,raphink\/augeas,jasperla\/augeas,jjlin\/augeas,kunkku\/augeas,bkearney\/augeas,dafugg\/augeas,lutter\/augeas,bkearney\/augeas,kunkku\/augeas,kunkku\/augeas,dafugg\/augeas,domcleal\/augeas,jjlin\/augeas,kumy\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,jtopjian\/augeas,hercules-team\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,ptoscano\/augeas,mlichvar\/augeas,bkearney\/augeas,bkearney\/augeas,lutter\/augeas,domcleal\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,kumy\/augeas,raphink\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,jjlin\/augeas,jtopjian\/augeas,dafugg\/augeas,kumy\/augeas,pevalme\/augeas,camptocamp\/augeas,hercules-team\/augeas","old_file":"tests\/grammars\/reject\/missing-token-default.aug","new_file":"tests\/grammars\/reject\/missing-token-default.aug","new_contents":"grammar missing-token-default {\n token FOO \/#.*\\n\/\n}\n","old_contents":"grammar missing-token-default {\n token \/#.*\\n\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d720a83d9329cd1433a2100db0d418a1ec487a2f","subject":"Proper test for eolwhite space handling","message":"Proper test for eolwhite space handling\n\nBy reformating eol of pupperfileserver test, it's possible to make both git and\nunit test working.\n","repos":"jtopjian\/augeas,ptoscano\/augeas,hercules-team\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,raphink\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kunkku\/augeas,jtopjian\/augeas,jjlin\/augeas,domcleal\/augeas,dafugg\/augeas,kumy\/augeas,ptoscano\/augeas,dafugg\/augeas,kumy\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jasperla\/augeas,kumy\/augeas,MikaelSmith\/augeas,domcleal\/augeas,mlichvar\/augeas,manandbytes\/augeas,mchf\/augeas,kunkku\/augeas,kumy\/augeas,lutter\/augeas,pevalme\/augeas,raphink\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,jjlin\/augeas,kunkku\/augeas,hercules-team\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,mlichvar\/augeas,pevalme\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_puppetfileserver.aug","new_file":"lenses\/tests\/test_puppetfileserver.aug","new_contents":"(* Tests for the PuppetFileserver module *)\n\nmodule Test_puppetfileserver =\n\nlet fileserver = \"# This a comment\n\n[mount1]\n # Mount1 options\n path \/etc\/puppet\/files\/%h\n allow host.domain1.com\n allow *.domain2.com\n deny badhost.domain2.com\n[mount2]\n allow *\n deny *.evil.example.com\n deny badhost.domain2.com\n[mount3]\nallow * # Puppet #6026: same line comment\n# And trailing whitespace\nallow * \t\\n\"\n\ntest PuppetFileserver.lns get fileserver =\n\t{ \"#comment\" = \"This a comment\" }\n\t{ }\n\t{ \"mount1\"\n\t\t{ \"#comment\" = \"Mount1 options\" }\n\t\t{ \"path\" = \"\/etc\/puppet\/files\/%h\" }\n\t\t{ \"allow\" = \"host.domain1.com\" }\n\t\t{ \"allow\" = \"*.domain2.com\" }\n\t\t{ \"deny\" = \"badhost.domain2.com\" }\n\t}\n\t{ \"mount2\"\n\t\t{ \"allow\" = \"*\" }\n\t\t{ \"deny\" = \"*.evil.example.com\" }\n\t\t{ \"deny\" = \"badhost.domain2.com\" }\n\t}\n\t{ \"mount3\"\n\t\t{ \"allow\" = \"*\"\n\t\t\t{ \"#comment\" = \"Puppet #6026: same line comment\" } }\n\t\t{ \"#comment\" = \"And trailing whitespace\" }\n\t\t{ \"allow\" = \"*\" }\n\t}\n","old_contents":"(* Tests for the PuppetFileserver module *)\n\nmodule Test_puppetfileserver =\n\nlet fileserver = \"# This a comment\n\n[mount1]\n # Mount1 options\n path \/etc\/puppet\/files\/%h\n allow host.domain1.com\n allow *.domain2.com\n deny badhost.domain2.com\n[mount2]\n allow *\n deny *.evil.example.com\n deny badhost.domain2.com\n[mount3]\nallow * # Puppet #6026: same line comment\n# And trailing whitespace\nallow *\n\"\n\ntest PuppetFileserver.lns get fileserver =\n\t{ \"#comment\" = \"This a comment\" }\n\t{ }\n\t{ \"mount1\"\n\t\t{ \"#comment\" = \"Mount1 options\" }\n\t\t{ \"path\" = \"\/etc\/puppet\/files\/%h\" }\n\t\t{ \"allow\" = \"host.domain1.com\" }\n\t\t{ \"allow\" = \"*.domain2.com\" }\n\t\t{ \"deny\" = \"badhost.domain2.com\" }\n\t}\n\t{ \"mount2\"\n\t\t{ \"allow\" = \"*\" }\n\t\t{ \"deny\" = \"*.evil.example.com\" }\n\t\t{ \"deny\" = \"badhost.domain2.com\" }\n\t}\n\t{ \"mount3\"\n\t\t{ \"allow\" = \"*\"\n\t\t\t{ \"#comment\" = \"Puppet #6026: same line comment\" } }\n\t\t{ \"#comment\" = \"And trailing whitespace\" }\n\t\t{ \"allow\" = \"*\" }\n\t}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"406bc151959b408b936814170055bae47b40c310","subject":"Fix test_inifile.aug's typo","message":"Fix test_inifile.aug's typo\n","repos":"kunkku\/augeas,raphink\/augeas,mchf\/augeas,ptoscano\/augeas,jjlin\/augeas,kumy\/augeas,jjlin\/augeas,pevalme\/augeas,raphink\/augeas,mlichvar\/augeas,mchf\/augeas,hercules-team\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,MikaelSmith\/augeas,jjlin\/augeas,kunkku\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,ptoscano\/augeas,jasperla\/augeas,jtopjian\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,kumy\/augeas,pevalme\/augeas,lutter\/augeas,domcleal\/augeas,kumy\/augeas,dafugg\/augeas,kumy\/augeas,manandbytes\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,domcleal\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas,lutter\/augeas","old_file":"lenses\/tests\/test_inifile.aug","new_file":"lenses\/tests\/test_inifile.aug","new_contents":"(*\nModule: Test_IniFile\n Provides unit tests and examples for the <IniFile> module.\n\nAbout: Tests to run\n\n The tests are run with all combinations of the following\n three parameters:\n\n > separator : (a) default (\/[:=]\/ \"=\") ; (b) \"=\" \"=\"\n > comment : (c) default (\/[;#]\/ \";\") ; (d) \";\" \";\"\n > empty lines : (e) default ; (f) noempty\n\n*)\n\nmodule Test_IniFile =\n\n (* ALL TESTS TO RUN *)\n\n\n (* Group: TEST a\/c\/e *)\n (* Variable: comment_ace *)\n let comment_ace = IniFile.comment IniFile.comment_re IniFile.comment_default\n (* Variable: sep_ace *)\n let sep_ace = IniFile.sep IniFile.sep_re IniFile.sep_default\n (* Variable: entry_ace *)\n let entry_ace = IniFile.entry IniFile.entry_re sep_ace comment_ace\n (* Variable: title_ace *)\n let title_ace = IniFile.title IniFile.record_re\n (* Variable: record_ace *)\n let record_ace = IniFile.record title_ace entry_ace\n (* Variable: lns_ace *)\n let lns_ace = IniFile.lns record_ace comment_ace\n (* Variable: conf_ace *)\n let conf_ace = \"# comment with sharp\n\n[section1]\ntest_ace = value # end of line comment\ntest_ace =\n; comment with colon\n\n\"\n (* Test: lns_ace\n Testing the a\/c\/e combination *)\n test lns_ace get conf_ace =\n { \"#comment\" = \"comment with sharp\" }\n {}\n { \"section1\"\n { \"test_ace\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"test_ace\" }\n\t { \"#comment\" = \"comment with colon\" }\n\t {} }\n\n\n (* Group: TEST a\/c\/f *)\n (* Variable: comment_acf *)\n let comment_acf = IniFile.comment IniFile.comment_re IniFile.comment_default\n (* Variable: sep_acf *)\n let sep_acf = IniFile.sep IniFile.sep_re IniFile.sep_default\n (* Variable: entry_acf *)\n let entry_acf = IniFile.entry IniFile.entry_re sep_acf comment_acf\n (* Variable: title_acf *)\n let title_acf = IniFile.title IniFile.record_re\n (* Variable: record_acf *)\n let record_acf = IniFile.record_noempty title_acf entry_acf\n (* Variable: lns_acf *)\n let lns_acf = IniFile.lns_noempty record_acf comment_acf\n (* Variable: conf_acf *)\n let conf_acf = \"# comment with sharp\n[section1]\ntest_acf = value\ntest_acf =\ntest_acf : value2 # end of line comment\n; comment with colon\n\"\n (* Test: lns_acf\n Testing the a\/c\/f combination *)\n test lns_acf get conf_acf =\n { \"#comment\" = \"comment with sharp\" }\n { \"section1\"\n { \"test_acf\" = \"value\" }\n\t { \"test_acf\" }\n { \"test_acf\" = \"value2\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" } }\n\n\n (* Group: TEST a\/d\/e *)\n (* Variable: comment_ade *)\n let comment_ade = IniFile.comment \";\" \";\"\n (* Variable: sep_ade *)\n let sep_ade = IniFile.sep IniFile.sep_re IniFile.sep_default\n (* Variable: entry_ade *)\n let entry_ade = IniFile.entry IniFile.entry_re sep_ade comment_ade\n (* Variable: title_ade *)\n let title_ade = IniFile.title IniFile.record_re\n (* Variable: record_ade *)\n let record_ade = IniFile.record title_ade entry_ade\n (* Variable: lns_ade *)\n let lns_ade = IniFile.lns record_ade comment_ade\n (* Variable: conf_ade *)\n let conf_ade = \"; a first comment with colon\n[section1]\ntest_ade = value\ntest_ade : value2 ; end of line comment\n; comment with colon\n\ntest_ade =\n\"\n (* Test: lns_ade\n Testing the a\/d\/e combination *)\n test lns_ade get conf_ade =\n { \"#comment\" = \"a first comment with colon\" }\n { \"section1\"\n { \"test_ade\" = \"value\" }\n { \"test_ade\" = \"value2\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t {}\n\t { \"test_ade\" } }\n\n\n (* Group: TEST a\/d\/f *)\n (* Variable: comment_adf *)\n let comment_adf = IniFile.comment \";\" \";\"\n (* Variable: sep_adf *)\n let sep_adf = IniFile.sep IniFile.sep_re IniFile.sep_default\n (* Variable: entry_adf *)\n let entry_adf = IniFile.entry IniFile.entry_re sep_adf comment_adf\n (* Variable: title_adf *)\n let title_adf = IniFile.title IniFile.record_re\n (* Variable: record_adf *)\n let record_adf = IniFile.record_noempty title_adf entry_adf\n (* Variable: lns_adf *)\n let lns_adf = IniFile.lns_noempty record_adf comment_adf\n (* Variable: conf_adf *)\n let conf_adf = \"; a first comment with colon\n[section1]\ntest_adf = value\ntest_adf : value2 ; end of line comment\n; comment with colon\ntest_adf =\n\"\n (* Test: lns_adf\n Testing the a\/d\/f combination *)\n test lns_adf get conf_adf =\n { \"#comment\" = \"a first comment with colon\" }\n { \"section1\"\n { \"test_adf\" = \"value\" }\n { \"test_adf\" = \"value2\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t { \"test_adf\" } }\n\n\n (* Group: TEST b\/c\/e *)\n (* Variable: comment_bce *)\n let comment_bce = IniFile.comment IniFile.comment_re IniFile.comment_default\n (* Variable: sep_bce *)\n let sep_bce = IniFile.sep \"=\" \"=\"\n (* Variable: entry_bce *)\n let entry_bce = IniFile.entry IniFile.entry_re sep_bce comment_bce\n (* Variable: title_bce *)\n let title_bce = IniFile.title IniFile.record_re\n (* Variable: record_bce *)\n let record_bce = IniFile.record title_bce entry_bce\n (* Variable: lns_bce *)\n let lns_bce = IniFile.lns record_bce comment_bce\n (* Variable: conf_bce *)\n let conf_bce = \"# comment with sharp\n\n[section1]\ntest_bce = value # end of line comment\n; comment with colon\n\ntest_bce =\n\"\n (* Test: lns_bce\n Testing the b\/c\/e combination *)\n test lns_bce get conf_bce =\n { \"#comment\" = \"comment with sharp\" }\n {}\n { \"section1\"\n { \"test_bce\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t {}\n\t { \"test_bce\" } }\n\n\n (* Group: TEST b\/c\/f *)\n (* Variable: comment_bcf *)\n let comment_bcf = IniFile.comment IniFile.comment_re IniFile.comment_default\n (* Variable: sep_bcf *)\n let sep_bcf = IniFile.sep \"=\" \"=\"\n (* Variable: entry_bcf *)\n let entry_bcf = IniFile.entry IniFile.entry_re sep_bcf comment_bcf\n (* Variable: title_bcf *)\n let title_bcf = IniFile.title IniFile.record_re\n (* Variable: record_bcf *)\n let record_bcf = IniFile.record_noempty title_bce entry_bcf\n (* Variable: lns_bcf *)\n let lns_bcf = IniFile.lns_noempty record_bce comment_bcf\n (* Variable: conf_bcf *)\n let conf_bcf = \"# conf with sharp\n[section1]\ntest_bcf = value # end of line comment\n; comment with colon\ntest_bcf =\n\"\n (* Test: lns_bcf\n Testing the b\/c\/f combination *)\n test lns_bcf get conf_bcf =\n { \"#comment\" = \"conf with sharp\" }\n { \"section1\"\n { \"test_bcf\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t { \"test_bcf\" } }\n\n\n (* Group: TEST b\/d\/e *)\n (* Variable: comment_bde *)\n let comment_bde = IniFile.comment \";\" \";\"\n (* Variable: sep_bde *)\n let sep_bde = IniFile.sep \"=\" \"=\"\n (* Variable: entry_bde *)\n let entry_bde = IniFile.entry IniFile.entry_re sep_bde comment_bde\n (* Variable: title_bde *)\n let title_bde = IniFile.title IniFile.record_re\n (* Variable: record_bde *)\n let record_bde = IniFile.record title_bde entry_bde\n (* Variable: lns_bde *)\n let lns_bde = IniFile.lns record_bde comment_bde\n (* Variable: conf_bde *)\n let conf_bde = \"; first comment with colon\n\n[section1]\ntest_bde = value ; end of line comment\n; comment with colon\n\ntest_bde =\n\"\n (* Test: lns_bde\n Testing the b\/d\/e combination *)\n test lns_bde get conf_bde =\n { \"#comment\" = \"first comment with colon\" }\n {}\n { \"section1\"\n { \"test_bde\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t {}\n\t { \"test_bde\" } }\n\n\n (* Group: TEST b\/d\/f *)\n (* Variable: comment_bdf *)\n let comment_bdf = IniFile.comment \";\" \";\"\n (* Variable: sep_bdf *)\n let sep_bdf = IniFile.sep \"=\" \"=\"\n (* Variable: entry_bdf *)\n let entry_bdf = IniFile.entry IniFile.entry_re sep_bdf comment_bdf\n (* Variable: title_bdf *)\n let title_bdf = IniFile.title IniFile.record_re\n (* Variable: record_bdf *)\n let record_bdf = IniFile.record_noempty title_bdf entry_bdf\n (* Variable: lns_bdf *)\n let lns_bdf = IniFile.lns_noempty record_bdf comment_bdf\n (* Variable: conf_bdf *)\n let conf_bdf = \"; first comment with colon\n[section1]\ntest_bdf = value ; end of line comment\n; comment with colon\ntest_bdf =\n\"\n (* Test: lns_bdf\n Testing the b\/d\/f combination *)\n test lns_bdf get conf_bdf =\n { \"#comment\" = \"first comment with colon\" }\n { \"section1\"\n { \"test_bdf\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t { \"test_bdf\" } }\n\n\n (* Group: TEST multiline values *)\n (* Variable: multiline_test *)\n let multiline_test = \"test_ace = val1\\n val2\\n val3\\n\"\n (* Variable: multiline_ace *)\n let multiline_ace = IniFile.entry_multiline IniFile.entry_re sep_ace comment_ace\n (* Test: multiline_ace\n Testing the a\/c\/e combination with a multiline entry *)\n test multiline_ace get multiline_test =\n { \"test_ace\" = \"val1\\n val2\\n val3\" }\n\n","old_contents":"(*\nModule: Test_IniFile\n Provides unit tests and examples for the <IniFile> module.\n\nAbout: Tests to run\n\n The tests are run with all combinations of the following\n three parameters:\n\n > separator : (a) default (\/[:=]\/ \"=\") ; (b) \"=\" \"=\"\n > comment : (c) default (\/[;#]\/ \";\") ; (d) \";\" \";\"\n > empty lines : (e) default ; (f) noempty\n\n*)\n\nmodule Test_IniFile =\n\n (* ALL TESTS TO RUN *)\n\n\n (* Group: TEST a\/c\/e *)\n (* Variable: comment_ace *)\n let comment_ace = IniFile.comment IniFile.comment_re IniFile.comment_default\n (* Variable: sep_ace *)\n let sep_ace = IniFile.sep IniFile.sep_re IniFile.sep_default\n (* Variable: entry_ace *)\n let entry_ace = IniFile.entry IniFile.entry_re sep_ace comment_ace\n (* Variable: title_ace *)\n let title_ace = IniFile.title IniFile.record_re\n (* Variable: record_ace *)\n let record_ace = IniFile.record title_ace entry_ace\n (* Variable: lns_ace *)\n let lns_ace = IniFile.lns record_ace comment_ace\n (* Variable: conf_ace *)\n let conf_ace = \"# comment with sharp\n\n[section1]\ntest_ace = value # end of line comment\ntest_ace =\n; comment with colon\n\n\"\n (* Test: lns_ace\n Testing the a\/c\/e combination *)\n test lns_ace get conf_ace =\n { \"#comment\" = \"comment with sharp\" }\n {}\n { \"section1\"\n { \"test_ace\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"test_ace\" }\n\t { \"#comment\" = \"comment with colon\" }\n\t {} }\n\n\n (* Group: TEST a\/c\/f *)\n (* Variable: comment_acf *)\n let comment_acf = IniFile.comment IniFile.comment_re IniFile.comment_default\n (* Variable: sep_acf *)\n let sep_acf = IniFile.sep IniFile.sep_re IniFile.sep_default\n (* Variable: entry_acf *)\n let entry_acf = IniFile.entry IniFile.entry_re sep_acf comment_acf\n (* Variable: title_acf *)\n let title_acf = IniFile.title IniFile.record_re\n (* Variable: record_acf *)\n let record_acf = IniFile.record_noempty title_acf entry_acf\n (* Variable: lns_acf *)\n let lns_acf = IniFile.lns_noempty record_acf comment_acf\n (* Variable: conf_acf *)\n let conf_acf = \"# comment with sharp\n[section1]\ntest_acf = value\ntest_acf =\ntest_acf : value2 # end of line comment\n; comment with colon\n\"\n (* Test: lns_acf\n Testing the a\/c\/f combination *)\n test lns_acf get conf_acf =\n { \"#comment\" = \"comment with sharp\" }\n { \"section1\"\n { \"test_acf\" = \"value\" }\n\t { \"test_acf\" }\n { \"test_acf\" = \"value2\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" } }\n\n\n (* Group: TEST a\/d\/e *)\n (* Variable: comment_ade *)\n let comment_ade = IniFile.comment \";\" \";\"\n (* Variable: sep_ade *)\n let sep_ade = IniFile.sep IniFile.sep_re IniFile.sep_default\n (* Variable: entry_ade *)\n let entry_ade = IniFile.entry IniFile.entry_re sep_ade comment_ade\n (* Variable: title_ade *)\n let title_ade = IniFile.title IniFile.record_re\n (* Variable: record_ade *)\n let record_ade = IniFile.record title_ade entry_ade\n (* Variable: lns_ade *)\n let lns_ade = IniFile.lns record_ade comment_ade\n (* Variable: conf_ade *)\n let conf_ade = \"; a first comment with colon\n[section1]\ntest_ade = value\ntest_ade : value2 ; end of line comment\n; comment with colon\n\ntest_ade =\n\"\n (* Test: lns_ade\n Testing the a\/d\/e combination *)\n test lns_ade get conf_ade =\n { \"#comment\" = \"a first comment with colon\" }\n { \"section1\"\n { \"test_ade\" = \"value\" }\n { \"test_ade\" = \"value2\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t {}\n\t { \"test_ade\" } }\n\n\n (* Group: TEST a\/d\/f *)\n (* Variable: comment_adf *)\n let comment_adf = IniFile.comment \";\" \";\"\n (* Variable: sep_adf *)\n let sep_adf = IniFile.sep IniFile.sep_re IniFile.sep_default\n (* Variable: entry_adf *)\n let entry_adf = IniFile.entry IniFile.entry_re sep_adf comment_adf\n (* Variable: title_adf *)\n let title_adf = IniFile.title IniFile.record_re\n (* Variable: record_adf *)\n let record_adf = IniFile.record_noempty title_adf entry_adf\n (* Variable: lns_adf *)\n let lns_adf = IniFile.lns_noempty record_adf comment_adf\n (* Variable: conf_adf *)\n let conf_adf = \"; a first comment with colon\n[section1]\ntest_adf = value\ntest_adf : value2 ; end of line comment\n; comment with colon\ntest_adf =\n\"\n (* Test: lns_adf\n Testing the a\/d\/f combination *)\n test lns_adf get conf_adf =\n { \"#comment\" = \"a first comment with colon\" }\n { \"section1\"\n { \"test_adf\" = \"value\" }\n { \"test_adf\" = \"value2\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t { \"test_adf\" } }\n\n\n (* Group: TEST b\/c\/e *)\n (* Variable: comment_bce *)\n let comment_bce = IniFile.comment IniFile.comment_re IniFile.comment_default\n (* Variable: sep_bce *)\n let sep_bce = IniFile.sep \"=\" \"=\"\n (* Variable: entry_bce *)\n let entry_bce = IniFile.entry IniFile.entry_re sep_bce comment_bce\n (* Variable: title_bce *)\n let title_bce = IniFile.title IniFile.record_re\n (* Variable: record_bce *)\n let record_bce = IniFile.record title_bce entry_bce\n (* Variable: lns_bce *)\n let lns_bce = IniFile.lns record_bce comment_bce\n (* Variable: conf_bce *)\n let conf_bce = \"# comment with sharp\n\n[section1]\ntest_bce = value # end of line comment\n; comment with colon\n\ntest_bce =\n\"\n (* Test: lns_bce\n Testing the b\/c\/e combination *)\n test lns_bce get conf_bce =\n { \"#comment\" = \"comment with sharp\" }\n {}\n { \"section1\"\n { \"test_bce\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t {}\n\t { \"test_bce\" } }\n\n\n (* Group: TEST b\/c\/f *)\n (* Variable: comment_bcf *)\n let comment_bcf = IniFile.comment IniFile.comment_re IniFile.comment_default\n (* Variable: sep_bcf *)\n let sep_bcf = IniFile.sep \"=\" \"=\"\n (* Variable: entry_bcf *)\n let entry_bcf = IniFile.entry IniFile.entry_re sep_bcf comment_bcf\n (* Variable: title_bcf *)\n let title_bcf = IniFile.title IniFile.record_re\n (* Variable: record_bcf *)\n let record_bcf = IniFile.record_noempty title_bce entry_bcf\n (* Variable: lns_bcf *)\n let lns_bcf = IniFile.lns_noempty record_bce comment_bcf\n (* Variable: conf_bcf *)\n let conf_bcf = \"# conf with sharp\n[section1]\ntest_bcf = value # end of line comment\n; comment with colon\ntest_bcf =\n\"\n (* Test: lns_bcf\n Testing the b\/c\/f combination *)\n test lns_bcf get conf_bcf =\n { \"#comment\" = \"comment with sharp\" }\n { \"section1\"\n { \"test_bcf\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t { \"test_bcf\" } }\n\n\n (* Group: TEST b\/d\/e *)\n (* Variable: comment_bde *)\n let comment_bde = IniFile.comment \";\" \";\"\n (* Variable: sep_bde *)\n let sep_bde = IniFile.sep \"=\" \"=\"\n (* Variable: entry_bde *)\n let entry_bde = IniFile.entry IniFile.entry_re sep_bde comment_bde\n (* Variable: title_bde *)\n let title_bde = IniFile.title IniFile.record_re\n (* Variable: record_bde *)\n let record_bde = IniFile.record title_bde entry_bde\n (* Variable: lns_bde *)\n let lns_bde = IniFile.lns record_bde comment_bde\n (* Variable: conf_bde *)\n let conf_bde = \"; first comment with colon\n\n[section1]\ntest_bde = value ; end of line comment\n; comment with colon\n\ntest_bde =\n\"\n (* Test: lns_bde\n Testing the b\/d\/e combination *)\n test lns_bde get conf_bde =\n { \"#comment\" = \"first comment with colon\" }\n {}\n { \"section1\"\n { \"test_bde\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t {}\n\t { \"test_bde\" } }\n\n\n (* Group: TEST b\/d\/f *)\n (* Variable: comment_bdf *)\n let comment_bdf = IniFile.comment \";\" \";\"\n (* Variable: sep_bdf *)\n let sep_bdf = IniFile.sep \"=\" \"=\"\n (* Variable: entry_bdf *)\n let entry_bdf = IniFile.entry IniFile.entry_re sep_bdf comment_bdf\n (* Variable: title_bdf *)\n let title_bdf = IniFile.title IniFile.record_re\n (* Variable: record_bdf *)\n let record_bdf = IniFile.record_noempty title_bdf entry_bdf\n (* Variable: lns_bdf *)\n let lns_bdf = IniFile.lns_noempty record_bdf comment_bdf\n (* Variable: conf_bdf *)\n let conf_bdf = \"; first comment with colon\n[section1]\ntest_bdf = value ; end of line comment\n; comment with colon\ntest_bdf =\n\"\n (* Test: lns_bdf\n Testing the b\/d\/f combination *)\n test lns_bdf get conf_bdf =\n { \"#comment\" = \"first comment with colon\" }\n { \"section1\"\n { \"test_bdf\" = \"value\"\n\t { \"#comment\" = \"end of line comment\" } }\n\t { \"#comment\" = \"comment with colon\" }\n\t { \"test_bdf\" } }\n\n\n (* Group: TEST multiline values *)\n (* Variable: multiline_test *)\n let multiline_test = \"test_ace = val1\\n val2\\n val3\\n\"\n (* Variable: multiline_ace *)\n let multiline_ace = IniFile.entry_multiline IniFile.entry_re sep_ace comment_ace\n (* Test: multiline_ace\n Testing the a\/c\/e combination with a multiline entry *)\n test multiline_ace get multiline_test =\n { \"test_ace\" = \"val1\\n val2\\n val3\" }\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5209ae9c316bfd8d2d6d788215c5739c0e4c0727","subject":"pg_hba.aug: fix method to avoid clashing with hostname","message":"pg_hba.aug: fix method to avoid clashing with hostname\n","repos":"kunkku\/augeas,kumy\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,mchf\/augeas,jjlin\/augeas,mchf\/augeas,raphink\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,jasperla\/augeas,kumy\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,ptoscano\/augeas,pevalme\/augeas,jasperla\/augeas,manandbytes\/augeas,jjlin\/augeas,jtopjian\/augeas,dafugg\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,kunkku\/augeas,jjlin\/augeas,mlichvar\/augeas,dafugg\/augeas,raphink\/augeas,hercules-team\/augeas,kumy\/augeas,kunkku\/augeas,pevalme\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas","old_file":"lenses\/pg_hba.aug","new_file":"lenses\/pg_hba.aug","new_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:.]+(\\\/[0-9]+|[ \\t]+[0-9.]+)\/\n (* Variable: hostname\n Hostname, FQDN or part of an FQDN possibly \n starting with a dot. Taken from the syslog lens. *)\n let hostname = \/\\.?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: ipaddr_or_hostname *)\n let ipaddr_or_hostname = ipaddr | hostname\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr_or_hostname ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store \/[A-Za-z][A-Za-z0-9]+\/ . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:.]+(\\\/[0-9]+|[ \\t]+[0-9.]+)\/\n (* Variable: hostname\n Hostname, FQDN or part of an FQDN possibly \n starting with a dot. Taken from the syslog lens. *)\n let hostname = \/\\.?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: ipaddr_or_hostname *)\n let ipaddr_or_hostname = ipaddr | hostname\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr_or_hostname ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d6defcdd21090434fdc2b52088834102217f7e1b","subject":"Add Sep.equal, used in nrpe.aug","message":"Add Sep.equal, used in nrpe.aug\n","repos":"hercules-team\/augeas-do-not-use,mchf\/augeas,lutter\/augeas,dafugg\/augeas,ptoscano\/augeas,jjlin\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,hercules-team\/augeas,kumy\/augeas,jtopjian\/augeas,kumy\/augeas,hercules-team\/augeas,domcleal\/augeas,MikaelSmith\/augeas,kunkku\/augeas,manandbytes\/augeas,raphink\/augeas,kunkku\/augeas,lutter\/augeas,dafugg\/augeas,kunkku\/augeas,mlichvar\/augeas,domcleal\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,raphink\/augeas,pevalme\/augeas,jasperla\/augeas,mchf\/augeas,lutter\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,kumy\/augeas,domcleal\/augeas,pevalme\/augeas,pevalme\/augeas,manandbytes\/augeas,mlichvar\/augeas,jjlin\/augeas,ptoscano\/augeas","old_file":"lenses\/sep.aug","new_file":"lenses\/sep.aug","new_contents":"(*\nModule: Sep\n Generic separators to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Sep =\n\nlet colon = Util.del_str \":\"\nlet comma = Util.del_str \",\"\nlet equal = Util.del_str \"=\"\nlet space = del Rx.space \" \"\nlet tab = del Rx.space \"\\t\"\nlet opt_space = del Rx.opt_space \"\"\nlet opt_tab = del Rx.opt_space \"\\t\"\n\n","old_contents":"(*\nModule: Sep\n Generic separators to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Sep =\n\nlet colon = Util.del_str \":\"\nlet comma = Util.del_str \",\"\nlet space = del Rx.space \" \"\nlet tab = del Rx.space \"\\t\"\nlet opt_space = del Rx.opt_space \"\"\nlet opt_tab = del Rx.opt_space \"\\t\"\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cf693544c66445c1aa4d62c0371f0ee8b2dbf61d","subject":"Httpd: remove duplicate inclusion of \/etc\/httpd\/conf\/httpd.conf","message":"Httpd: remove duplicate inclusion of \/etc\/httpd\/conf\/httpd.conf\n","repos":"MikaelSmith\/augeas,lutter\/augeas,pevalme\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jasperla\/augeas,dafugg\/augeas,ptoscano\/augeas,raphink\/augeas,pevalme\/augeas,domcleal\/augeas,mlichvar\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,kumy\/augeas,hercules-team\/augeas,jtopjian\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,mchf\/augeas,dafugg\/augeas,kumy\/augeas,jjlin\/augeas,jjlin\/augeas,pevalme\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,kumy\/augeas,hercules-team\/augeas,manandbytes\/augeas,raphink\/augeas,domcleal\/augeas,lutter\/augeas,mchf\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,kumy\/augeas,domcleal\/augeas,mlichvar\/augeas,ptoscano\/augeas,dafugg\/augeas","old_file":"lenses\/httpd.aug","new_file":"lenses\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPLv2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_\\.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9\\._\\-]*\/\n\nlet comment = Util.comment\nlet eol = Util.eol\nlet empty = Util.empty\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let h = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n [ indent . dels \"<\" . square word h . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPLv2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_\\.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9\\._\\-]*\/\n\nlet comment = Util.comment\nlet eol = Util.eol\nlet empty = Util.empty\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let h = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n [ indent . dels \"<\" . square word h . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n\t (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"927ce3a64e65d00184b8d64e0e56014a136c86fb","subject":"Systemd: Don't use multiple negates in regexps","message":"Systemd: Don't use multiple negates in regexps\n","repos":"ptoscano\/augeas,kumy\/augeas,manandbytes\/augeas,lutter\/augeas,pevalme\/augeas,kumy\/augeas,dafugg\/augeas,mlichvar\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,kumy\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,jjlin\/augeas,mlichvar\/augeas,raphink\/augeas,ptoscano\/augeas,dafugg\/augeas,kunkku\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,MikaelSmith\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas,kunkku\/augeas,kumy\/augeas,jjlin\/augeas,dafugg\/augeas,raphink\/augeas,jjlin\/augeas,pevalme\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,mchf\/augeas,jtopjian\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/systemd.aug","new_file":"lenses\/systemd.aug","new_contents":"(*\nModule: Systemd\n Parses systemd unit files.\n\nAuthor: Dominic Cleal <dcleal@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to systemd.unit(5) and\n systemd.service(5) etc where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/lib\/systemd\/system\/* and \/etc\/systemd\/system\/*.\n See <filter>.\n*)\n\nmodule Systemd =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: comment\n An <IniFile.comment> entry *)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\n(* View: sep\n An <IniFile.sep> entry *)\nlet sep = IniFile.sep \"=\" \"=\"\n\n(* Variable: entry_single_kw *)\nlet entry_single_kw = \"Description\"\n\n(* Variable: entry_command_kw *)\nlet entry_command_kw = \/Exec[A-Za-z][A-Za-z0-9._-]+\/\n\n(* Variable: entry_env_kw *)\nlet entry_env_kw = \"Environment\"\n\n(* Variable: entry_multi_kw *)\nlet entry_multi_kw =\n let forbidden = entry_single_kw | entry_command_kw | entry_env_kw\n in \/[A-Za-z][A-Za-z0-9._-]+\/ - forbidden\n\n(* Variable: value_single_re *)\nlet value_single_re = \/[^;# \\t\\n\\\\][^;#\\n\\\\]*[^;# \\t\\n\\\\]|[^;# \\t\\n\\\\]\/\n\n(* View: sto_value_single\n Support multiline values with a backslash *)\nlet sto_value_single = Util.del_opt_ws \"\"\n . store (value_single_re\n . (\/\\\\\\\\\\n\/ . value_single_re)*)\n\n(* View: sto_value *)\nlet sto_value = store \/[^;# \\t\\n\\\\]+\/\n\n(* Variable: value_sep\n Multi-value entries separated by whitespace or backslash and newline *)\nlet value_sep = del \/[ \\t]+|[ \\t]*\\\\\\\\[ \\t]*\\n[ \\t]*\/ \" \"\n\n(* Variable: value_cmd_re\n Don't parse @ and - prefix flags *)\nlet value_cmd_re = \/[^;#@ \\t\\n\\\\-][^;#@ \\t\\n\\\\-][^;# \\t\\n\\\\]*\/\n\n(* Variable: env_key *)\nlet env_key = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n(*\nSupported entry features, selected by key names:\n * multi-value space separated attrs (the default)\n * single-value attrs (Description)\n * systemd.service: Exec* attrs with flags, command and arguments\n * systemd.service: Environment NAME=arg\n*)\n\n(* View: entry_fn\n Prototype for our various key=value lines, with optional comment *)\nlet entry_fn (kw:regexp) (val:lens) =\n [ key kw . sep . val . (comment|eol) ]\n\n(* View: entry_value\n Store a value that doesn't contain spaces *)\nlet entry_value = [ label \"value\" . sto_value ]\n\n(* View: entry_single\n Entry that takes a single value containing spaces *)\nlet entry_single = entry_fn entry_single_kw\n [ label \"value\" . sto_value_single ]?\n\n(* View: entry_command\n Entry that takes a space separated set of values (the default) *)\nlet entry_multi = entry_fn entry_multi_kw\n ( Util.del_opt_ws \"\"\n . Build.opt_list entry_value value_sep )?\n\n(* View: entry_command_flags\n Exec* flags \"@\" and \"-\". Order is important, see systemd.service(8) *)\nlet entry_command_flags =\n let exit = [ label \"ignoreexit\" . Util.del_str \"-\" ]\n in let arg0 = [ label \"arg0\" . Util.del_str \"@\" ]\n in exit? . arg0?\n\n(* View: entry_command\n Entry that takes a command, arguments and the optional prefix flags *)\nlet entry_command =\n let cmd = [ label \"command\" . store value_cmd_re ]\n in let arg = [ seq \"args\" . sto_value ]\n in let args = [ counter \"args\" . label \"arguments\" . value_sep\n . ( arg . value_sep )* . arg ]\n in entry_fn entry_command_kw ( entry_command_flags . cmd . args? )?\n\n(* View: entry_env\n Entry that takes a space separated set of ENV=value key\/value pairs *)\nlet entry_env =\n let envkv = [ key env_key . Util.del_str \"=\" . ( sto_value )? ]\n in entry_fn entry_env_kw ( Build.opt_list envkv value_sep )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n(* View: entry\n An <IniFile.entry> *)\nlet entry = entry_single | entry_multi | entry_command | entry_env | comment\n\n(* View: include\n Includes another file at this position *)\nlet include = [ key \".include\" . Util.del_ws_spc . sto_value\n . (comment|eol) ]\n\n(* View: title\n An <IniFile.title> *)\nlet title = IniFile.title IniFile.record_re\n\n(* View: record\n An <IniFile.record> *)\nlet record = IniFile.record title (entry|include)\n\n(* View: lns\n An <IniFile.lns> *)\nlet lns = IniFile.lns record (comment|include)\n\n(* View: filter *)\nlet filter = incl \"\/lib\/systemd\/system\/*\"\n . incl \"\/lib\/systemd\/system\/*\/*\"\n . incl \"\/etc\/systemd\/system\/*\"\n . incl \"\/etc\/systemd\/system\/*\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Systemd\n Parses systemd unit files.\n\nAuthor: Dominic Cleal <dcleal@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to systemd.unit(5) and\n systemd.service(5) etc where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/lib\/systemd\/system\/* and \/etc\/systemd\/system\/*.\n See <filter>.\n*)\n\nmodule Systemd =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: comment\n An <IniFile.comment> entry *)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\n(* View: sep\n An <IniFile.sep> entry *)\nlet sep = IniFile.sep \"=\" \"=\"\n\n(* Variable: entry_single_kw *)\nlet entry_single_kw = \"Description\"\n\n(* Variable: entry_command_kw *)\nlet entry_command_kw = \/Exec[A-Za-z][A-Za-z0-9._-]+\/\n\n(* Variable: entry_env_kw *)\nlet entry_env_kw = \"Environment\"\n\n(* Variable: entry_multi_kw *)\nlet entry_multi_kw = \/[A-Za-z][A-Za-z0-9._-]+\/\n - entry_single_kw\n - entry_command_kw\n - entry_env_kw\n\n(* Variable: value_single_re *)\nlet value_single_re = \/[^;# \\t\\n\\\\][^;#\\n\\\\]*[^;# \\t\\n\\\\]|[^;# \\t\\n\\\\]\/\n\n(* View: sto_value_single\n Support multiline values with a backslash *)\nlet sto_value_single = Util.del_opt_ws \"\"\n . store (value_single_re\n . (\/\\\\\\\\\\n\/ . value_single_re)*)\n\n(* View: sto_value *)\nlet sto_value = store \/[^;# \\t\\n\\\\]+\/\n\n(* Variable: value_sep\n Multi-value entries separated by whitespace or backslash and newline *)\nlet value_sep = del \/[ \\t]+|[ \\t]*\\\\\\\\[ \\t]*\\n[ \\t]*\/ \" \"\n\n(* Variable: value_cmd_re\n Don't parse @ and - prefix flags *)\nlet value_cmd_re = \/[^;#@ \\t\\n\\\\-][^;#@ \\t\\n\\\\-][^;# \\t\\n\\\\]*\/\n\n(* Variable: env_key *)\nlet env_key = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n(*\nSupported entry features, selected by key names:\n * multi-value space separated attrs (the default)\n * single-value attrs (Description)\n * systemd.service: Exec* attrs with flags, command and arguments\n * systemd.service: Environment NAME=arg\n*)\n\n(* View: entry_fn\n Prototype for our various key=value lines, with optional comment *)\nlet entry_fn (kw:regexp) (val:lens) =\n [ key kw . sep . val . (comment|eol) ]\n\n(* View: entry_value\n Store a value that doesn't contain spaces *)\nlet entry_value = [ label \"value\" . sto_value ]\n\n(* View: entry_single\n Entry that takes a single value containing spaces *)\nlet entry_single = entry_fn entry_single_kw\n [ label \"value\" . sto_value_single ]?\n\n(* View: entry_command\n Entry that takes a space separated set of values (the default) *)\nlet entry_multi = entry_fn entry_multi_kw\n ( Util.del_opt_ws \"\"\n . Build.opt_list entry_value value_sep )?\n\n(* View: entry_command_flags\n Exec* flags \"@\" and \"-\". Order is important, see systemd.service(8) *)\nlet entry_command_flags =\n let exit = [ label \"ignoreexit\" . Util.del_str \"-\" ]\n in let arg0 = [ label \"arg0\" . Util.del_str \"@\" ]\n in exit? . arg0?\n\n(* View: entry_command\n Entry that takes a command, arguments and the optional prefix flags *)\nlet entry_command =\n let cmd = [ label \"command\" . store value_cmd_re ]\n in let arg = [ seq \"args\" . sto_value ]\n in let args = [ counter \"args\" . label \"arguments\" . value_sep\n . ( arg . value_sep )* . arg ]\n in entry_fn entry_command_kw ( entry_command_flags . cmd . args? )?\n\n(* View: entry_env\n Entry that takes a space separated set of ENV=value key\/value pairs *)\nlet entry_env =\n let envkv = [ key env_key . Util.del_str \"=\" . ( sto_value )? ]\n in entry_fn entry_env_kw ( Build.opt_list envkv value_sep )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n(* View: entry\n An <IniFile.entry> *)\nlet entry = entry_single | entry_multi | entry_command | entry_env | comment\n\n(* View: include\n Includes another file at this position *)\nlet include = [ key \".include\" . Util.del_ws_spc . sto_value\n . (comment|eol) ]\n\n(* View: title\n An <IniFile.title> *)\nlet title = IniFile.title IniFile.record_re\n\n(* View: record\n An <IniFile.record> *)\nlet record = IniFile.record title (entry|include)\n\n(* View: lns\n An <IniFile.lns> *)\nlet lns = IniFile.lns record (comment|include)\n\n(* View: filter *)\nlet filter = incl \"\/lib\/systemd\/system\/*\"\n . incl \"\/lib\/systemd\/system\/*\/*\"\n . incl \"\/etc\/systemd\/system\/*\"\n . incl \"\/etc\/systemd\/system\/*\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8a3235796c0bdc40cb643bfb0d3142af07e4181b","subject":"Fix ambiguity in shellvars.aug by making semi-colons illegal in bquot and arrays.","message":"Fix ambiguity in shellvars.aug by making semi-colons illegal in bquot\nand arrays.\n","repos":"jasperla\/augeas,hercules-team\/augeas,kunkku\/augeas,hercules-team\/augeas,raphink\/augeas,kumy\/augeas,jjlin\/augeas,jtopjian\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,jjlin\/augeas,manandbytes\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,kumy\/augeas,kumy\/augeas,mchf\/augeas,lutter\/augeas,jtopjian\/augeas,mlichvar\/augeas,ptoscano\/augeas,dafugg\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,lutter\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,lutter\/augeas,dafugg\/augeas,mlichvar\/augeas,mlichvar\/augeas,mchf\/augeas,manandbytes\/augeas,pevalme\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kumy\/augeas,raphink\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n;]*`\/\n let dollar_assign = \/\\$\\([^#`\\n;]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+ | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . ((empty|comment)* . case_entry)*\n . (empty|comment)*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+ | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . ((empty|comment)* . case_entry)*\n . (empty|comment)*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"17370c276efab4b4208f422345dc5367d5f3aea9","subject":"Fix php.aug now that inifile.aug supports spaces in values","message":"Fix php.aug now that inifile.aug supports spaces in values\n","repos":"camptocamp\/augeas,kumy\/augeas,kunkku\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,ptoscano\/augeas,bkearney\/augeas,hercules-team\/augeas,camptocamp\/augeas,jjlin\/augeas,jtopjian\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,lutter\/augeas,camptocamp\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,raphink\/augeas,dafugg\/augeas,domcleal\/augeas,bkearney\/augeas,manandbytes\/augeas,kumy\/augeas,kumy\/augeas,kunkku\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas,jjlin\/augeas,pevalme\/augeas,lutter\/augeas,MikaelSmith\/augeas,mchf\/augeas,domcleal\/augeas,domcleal\/augeas,lutter\/augeas,pevalme\/augeas,kumy\/augeas,jasperla\/augeas,bkearney\/augeas,pevalme\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,bkearney\/augeas,jtopjian\/augeas,kunkku\/augeas,mlichvar\/augeas","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n\n autoload xfm\n\n (* PHP is a standard INI file *)\n let setting = IniFile.entry \"always_populate_raw_post_data\"\n | IniFile.entry \"asp_tags\"\n | IniFile.entry \"browscap\"\n | IniFile.entry \"child_terminate\"\n | IniFile.entry \"define_syslog_variables\"\n | IniFile.entry \"doc_root\"\n | IniFile.entry \"enable_dl\"\n | IniFile.entry \"engine\"\n | IniFile.entry \"expose_php\"\n | IniFile.entry \"extension_dir\"\n | IniFile.entry \"file_uploads\"\n\t\t| IniFile.entry \"gpc_order\"\n | IniFile.entry \"html_errors\"\n | IniFile.entry \"implicit_flush\"\n | IniFile.entry \"include_path\"\n | IniFile.entry \"last_modified\"\n | IniFile.entry \"memory_limit\"\n | IniFile.entry \"open_basedir\"\n | IniFile.entry \"post_max_size\"\n | IniFile.entry \"precision\"\n | IniFile.entry \"serialize_precision\"\n | IniFile.entry \"short_open_tag\"\n | IniFile.entry \"SMTP\"\n | IniFile.entry \"smtp_port\"\n | IniFile.entry \"track_errors\"\n | IniFile.entry \"unserialize_callback_func\"\n | IniFile.entry \"variables_order\"\n | IniFile.entry \"xbithack\"\n | IniFile.entry \"y2k_compliance\"\n | IniFile.entry \/apc\\.(cache_by_default|enabled|filters|gc_ttl|mmap_file_mask|num_files_hint|optimization|shm_segments|shm_size|slam_defense|ttl|user_entries_hint|user_ttl)\/\n | IniFile.entry \/apd\\.(dumpdir|statement_tracing)\/\n | IniFile.entry \/arg_separator\\.(input|output)\/\n | IniFile.entry \/assert\\.(active|bail|callback|quiet_eval|warning)\/\n | IniFile.entry \/bcmath\\.(scale)\/\n | IniFile.entry \/blenc\\.(key_file)\/\n | IniFile.entry \/com\\.(allow_dcom|autoregister_casesensitive|autoregister_typelib|autoregister_verbose|code_page|typelib_file)\/\n | IniFile.entry \/crack\\.(default_dictionary)\/\n | IniFile.entry \/daffodildb\\.(default_host|default_password|default_socket|default_user|port)\/\n | IniFile.entry \/date\\.(default_latitude|default_longitude|sunrise_zenith|sunset_zenith)\/\n | IniFile.entry \/dba\\.(default_handler)\/\n | IniFile.entry \/dbx\\.(colnames_case)\/\n | IniFile.entry \/exif\\.(decode_jis_intel|decode_jis_motorola|decode_unicode_intel|decode_unicode_motorola|encode_jis|encode_unicode)\/\n | IniFile.entry \/fbsql\\.(allow_persistent|autocommit|batchsize|default_database|default_database_password|default_host|default_password|default_user|generate_warnings|max_connections|max_links|max_persistent|max_results)\/\n | IniFile.entry \/highlight\\.(bg|comment|default|html|keyword|string)\/\n | IniFile.entry \/hyperwave\\.(allow_persistent|default_port)\/\n | IniFile.entry \/ibase\\.(allow_persistent|dateformat|default_charset|default_db|default_password|default_user|max_links|max_persistent|timeformat|timestampformat)\/\n | IniFile.entry \/iconv\\.(input_encoding|internal_encoding|output_encoding)\/\n | IniFile.entry \/ifx\\.(allow_persistent|blobinfile|byteasvarchar|charasvarchar|default_host|default_password|default_user|max_links|max_persistent|nullformat|textasvarchar)\/\n | IniFile.entry \/ingres\\.(allow_persistent|default_database|default_password|default_user|max_links|max_persistent)\/\n | IniFile.entry \/ircg\\.(control_user|keep_alive_interval|max_format_message_sets|shared_mem_size|work_dir)\/\n | IniFile.entry \/ldap\\.(max_links)\/\n | IniFile.entry \/mail\\.(force_extra_parameters)\/\n | IniFile.entry \/mailparse\\.(def_charset)\/\n | IniFile.entry \/maxdb\\.(default_db|default_host|default_pw|default_user|long_readlen)\/\n | IniFile.entry \/mbstring\\.(detect_order|encoding_translation|func_overload|http_input|http_output|internal_encoding|language|script_encoding|substitute_character)\/\n | IniFile.entry \/mcrypt\\.(algorithms_dir|modes_dir)\/\n | IniFile.entry \/mime_magic\\.(debug|magicfile)\/\n | IniFile.entry \/mssql\\.(allow_persistent|batchsize|compatability_mode|connect_timeout|datetimeconvert|max_links|max_persistent|max_procs|min_error_severity|min_message_severity|secure_connection|textlimit|textsize|timeout)\/\n | IniFile.entry \/msql\\.(allow_persistent|max_links|max_persistent)\/\n | IniFile.entry \/mysql\\.(allow_persistent|connect_timeout|default_host|default_password|default_port|default_socket|default_user|max_links|max_persistent|trace_mode)\/\n | IniFile.entry \/mysqli\\.(default_host|default_port|default_pw|default_socket|default_user|max_links|reconnect)\/\n | IniFile.entry \/namazu\\.(debugmode|lang|loggingmode|sortmethod|sortorder)\/\n | IniFile.entry \/nsapi\\.(read_timeout)\/\n | IniFile.entry \/odbc\\.(allow_persistent|check_persistent|defaultbinmode|defaultlrl|default_db|default_pw|default_user|max_links|max_persistent)\/\n | IniFile.entry \/opendirectory\\.(max_refs|separator)\/\n | IniFile.entry \/pdo\\.(global_value)\/\n | IniFile.entry \/pfpro\\.(defaulthost|defaultport|defaulttimeout|proxyaddress|proxylogon|proxypassword|proxyport)\/\n | IniFile.entry \/pgsql\\.(allow_persistent|auto_reset_persistent|ignore_notice|log_notice|max_links|max_persistent)\/\n | IniFile.entry \/printer\\.(default_printer)\/\n | IniFile.entry \/session\\.(auto_start|bug_compat_42|bug_compat_warn|cache_expire|cache_limiter|cookie_(domain|httponly|lifetime|path|secure)|entropy_file|entropy_length|gc_divisor|gc_maxlifetime|gc_probability|hash_bits_per_character|hash_function|name|referer_check|save_handler|save_path|serialize_handler|use_cookies|use_only_cookies|use_trans_sid)\/\n | IniFile.entry \/session_pgsql\\.(create_table|db|disable|failover_mode|gc_interval|keep_expired|sem_file_name|serializable|short_circuit|use_app_vars|vacuum_interval)\/\n | IniFile.entry \/simple_cvs\\.(authMethod|compressionLevel|cvsRoot|host|moduleName|userName|workingDir)\/\n | IniFile.entry \/soap\\.(wsdl_cache_dir|wsdl_cache_enabled|wsdl_cache_ttl)\/\n | IniFile.entry \/sql\\.(safe_mode)\/\n | IniFile.entry \/sqlite\\.(assoc_case)\/\n\t\t| IniFile.entry \/sybase\\.(allow_persistent|max_(persistent|links)|interface_file|min_(error|message)_severity|compatability_mode)\/\n | IniFile.entry \/sybct\\.(allow_persistent|deadlock_retry_count|hostname|login_timeout|max_links|max_persistent|min_client_severity|min_server_severity)\/\n | IniFile.entry \/tidy\\.(clean_output|default_config)\/\n | IniFile.entry \/url_rewriter\\.(tags)\/\n | IniFile.entry \/valkyrie\\.(auto_validate|config_path)\/\n | IniFile.entry \/xmms\\.(path|session)\/\n | IniFile.entry \/yaz\\.(keepalive|log_file|max_links)\/\n | IniFile.entry \/zend\\.(ze1_compatibility_mode)\/\n | IniFile.entry \/zlib\\.(output_compression|output_compression_level|output_handler)\/\n | IniFile.entry \/allow_(call_time_pass_reference|url_fopen|url_include)\/\n | IniFile.entry \/auto_(append_file|detect_line_endings|globals_jit|prepend_file)\/\n | IniFile.entry \/default_(charset|mimetype|socket_timeout)\/\n\t\t| IniFile.entry \/display(_startup)?_errors\/\n | IniFile.entry \/disable_(classes|functions)\/\n | IniFile.entry \/docref_(ext|root)\/\n | IniFile.entry \/error_(append_string|log|prepend_string|reporting)\/\n | IniFile.entry \/ignore_(repeated_errors|repeated_source|user_abort)\/\n | IniFile.entry \/log_errors(_max_len)?\/\n | IniFile.entry \/magic_quotes_(gpc|runtime|sybase)\/\n | IniFile.entry \/max_(execution_time|input_time)\/\n | IniFile.entry \/output_(buffering|handler)\/\n | IniFile.entry \/realpath_(cache_size|cache_ttl)\/\n | IniFile.entry \/register_(argc_argv|globals|long_arrays)\/\n | IniFile.entry \/report_(memleaks|zend_debug)\/\n | IniFile.entry \/safe_mode(_(allowed_env_vars|exec_dir|gid|include_dir|protected_env_vars))?\/\n | IniFile.entry \/sendmail_(from|path)\/\n | IniFile.entry \/upload_(max_filesize|tmp_dir)\/\n | IniFile.entry \/user_(agent|dir)\/\n | IniFile.entry \/xmlrpc_error(s|_number)\/\n\n\tlet record = IniFile.record \"section\" setting\n\tlet lns = IniFile.lns record\n\n\tlet filter = (incl \"\/etc\/php*\/*\/php.ini\")\n\t . Util.stdexcl\n\n\tlet xfm = transform lns filter\n\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n\n autoload xfm\n\n (* Define a special entry when spaces are allowed in values *)\n (* This is the case for error_reporting for example *)\n let comment_nospace = IniFile.comment_generic \/(#|;)\/\n let value_allowspace = del \/[ \\t]*\/ \" \" . store \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n let entry_allowspace (kw:regexp) = [ key kw . IniFile.value_sepwithcolon . value_allowspace? . (comment_nospace|IniFile.eol) ]\n\n (* PHP is a standard INI file *)\n let setting = IniFile.entry \"always_populate_raw_post_data\"\n | IniFile.entry \"asp_tags\"\n | IniFile.entry \"browscap\"\n | IniFile.entry \"child_terminate\"\n | IniFile.entry \"define_syslog_variables\"\n | IniFile.entry \"doc_root\"\n | IniFile.entry \"enable_dl\"\n | IniFile.entry \"engine\"\n | IniFile.entry \"expose_php\"\n | IniFile.entry \"extension_dir\"\n | IniFile.entry \"file_uploads\"\n\t\t| IniFile.entry \"gpc_order\"\n | IniFile.entry \"html_errors\"\n | IniFile.entry \"implicit_flush\"\n | IniFile.entry \"include_path\"\n | IniFile.entry \"last_modified\"\n | IniFile.entry \"memory_limit\"\n | IniFile.entry \"open_basedir\"\n | IniFile.entry \"post_max_size\"\n | IniFile.entry \"precision\"\n | IniFile.entry \"serialize_precision\"\n | IniFile.entry \"short_open_tag\"\n | IniFile.entry \"SMTP\"\n | IniFile.entry \"smtp_port\"\n | IniFile.entry \"track_errors\"\n | IniFile.entry \"unserialize_callback_func\"\n | IniFile.entry \"variables_order\"\n | IniFile.entry \"xbithack\"\n | IniFile.entry \"y2k_compliance\"\n | IniFile.entry \/apc\\.(cache_by_default|enabled|filters|gc_ttl|mmap_file_mask|num_files_hint|optimization|shm_segments|shm_size|slam_defense|ttl|user_entries_hint|user_ttl)\/\n | IniFile.entry \/apd\\.(dumpdir|statement_tracing)\/\n | IniFile.entry \/arg_separator\\.(input|output)\/\n | IniFile.entry \/assert\\.(active|bail|callback|quiet_eval|warning)\/\n | IniFile.entry \/bcmath\\.(scale)\/\n | IniFile.entry \/blenc\\.(key_file)\/\n | IniFile.entry \/com\\.(allow_dcom|autoregister_casesensitive|autoregister_typelib|autoregister_verbose|code_page|typelib_file)\/\n | IniFile.entry \/crack\\.(default_dictionary)\/\n | IniFile.entry \/daffodildb\\.(default_host|default_password|default_socket|default_user|port)\/\n | IniFile.entry \/date\\.(default_latitude|default_longitude|sunrise_zenith|sunset_zenith)\/\n | IniFile.entry \/dba\\.(default_handler)\/\n | IniFile.entry \/dbx\\.(colnames_case)\/\n | IniFile.entry \/exif\\.(decode_jis_intel|decode_jis_motorola|decode_unicode_intel|decode_unicode_motorola|encode_jis|encode_unicode)\/\n | IniFile.entry \/fbsql\\.(allow_persistent|autocommit|batchsize|default_database|default_database_password|default_host|default_password|default_user|generate_warnings|max_connections|max_links|max_persistent|max_results)\/\n | IniFile.entry \/highlight\\.(bg|comment|default|html|keyword|string)\/\n | IniFile.entry \/hyperwave\\.(allow_persistent|default_port)\/\n | IniFile.entry \/ibase\\.(allow_persistent|dateformat|default_charset|default_db|default_password|default_user|max_links|max_persistent|timeformat|timestampformat)\/\n | IniFile.entry \/iconv\\.(input_encoding|internal_encoding|output_encoding)\/\n | IniFile.entry \/ifx\\.(allow_persistent|blobinfile|byteasvarchar|charasvarchar|default_host|default_password|default_user|max_links|max_persistent|nullformat|textasvarchar)\/\n | IniFile.entry \/ingres\\.(allow_persistent|default_database|default_password|default_user|max_links|max_persistent)\/\n | IniFile.entry \/ircg\\.(control_user|keep_alive_interval|max_format_message_sets|shared_mem_size|work_dir)\/\n | IniFile.entry \/ldap\\.(max_links)\/\n | IniFile.entry \/mail\\.(force_extra_parameters)\/\n | IniFile.entry \/mailparse\\.(def_charset)\/\n | IniFile.entry \/maxdb\\.(default_db|default_host|default_pw|default_user|long_readlen)\/\n | IniFile.entry \/mbstring\\.(detect_order|encoding_translation|func_overload|http_input|http_output|internal_encoding|language|script_encoding|substitute_character)\/\n | IniFile.entry \/mcrypt\\.(algorithms_dir|modes_dir)\/\n | IniFile.entry \/mime_magic\\.(debug|magicfile)\/\n | IniFile.entry \/mssql\\.(allow_persistent|batchsize|compatability_mode|connect_timeout|datetimeconvert|max_links|max_persistent|max_procs|min_error_severity|min_message_severity|secure_connection|textlimit|textsize|timeout)\/\n | IniFile.entry \/msql\\.(allow_persistent|max_links|max_persistent)\/\n | IniFile.entry \/mysql\\.(allow_persistent|connect_timeout|default_host|default_password|default_port|default_socket|default_user|max_links|max_persistent|trace_mode)\/\n | IniFile.entry \/mysqli\\.(default_host|default_port|default_pw|default_socket|default_user|max_links|reconnect)\/\n | IniFile.entry \/namazu\\.(debugmode|lang|loggingmode|sortmethod|sortorder)\/\n | IniFile.entry \/nsapi\\.(read_timeout)\/\n | IniFile.entry \/odbc\\.(allow_persistent|check_persistent|defaultbinmode|defaultlrl|default_db|default_pw|default_user|max_links|max_persistent)\/\n | IniFile.entry \/opendirectory\\.(max_refs|separator)\/\n | IniFile.entry \/pdo\\.(global_value)\/\n | IniFile.entry \/pfpro\\.(defaulthost|defaultport|defaulttimeout|proxyaddress|proxylogon|proxypassword|proxyport)\/\n | IniFile.entry \/pgsql\\.(allow_persistent|auto_reset_persistent|ignore_notice|log_notice|max_links|max_persistent)\/\n | IniFile.entry \/printer\\.(default_printer)\/\n | IniFile.entry \/session\\.(auto_start|bug_compat_42|bug_compat_warn|cache_expire|cache_limiter|cookie_(domain|httponly|lifetime|path|secure)|entropy_file|entropy_length|gc_divisor|gc_maxlifetime|gc_probability|hash_bits_per_character|hash_function|name|referer_check|save_handler|save_path|serialize_handler|use_cookies|use_only_cookies|use_trans_sid)\/\n | IniFile.entry \/session_pgsql\\.(create_table|db|disable|failover_mode|gc_interval|keep_expired|sem_file_name|serializable|short_circuit|use_app_vars|vacuum_interval)\/\n | IniFile.entry \/simple_cvs\\.(authMethod|compressionLevel|cvsRoot|host|moduleName|userName|workingDir)\/\n | IniFile.entry \/soap\\.(wsdl_cache_dir|wsdl_cache_enabled|wsdl_cache_ttl)\/\n | IniFile.entry \/sql\\.(safe_mode)\/\n | IniFile.entry \/sqlite\\.(assoc_case)\/\n\t\t| IniFile.entry \/sybase\\.(allow_persistent|max_(persistent|links)|interface_file|min_(error|message)_severity|compatability_mode)\/\n | IniFile.entry \/sybct\\.(allow_persistent|deadlock_retry_count|hostname|login_timeout|max_links|max_persistent|min_client_severity|min_server_severity)\/\n | IniFile.entry \/tidy\\.(clean_output|default_config)\/\n | IniFile.entry \/url_rewriter\\.(tags)\/\n | IniFile.entry \/valkyrie\\.(auto_validate|config_path)\/\n | IniFile.entry \/xmms\\.(path|session)\/\n | IniFile.entry \/yaz\\.(keepalive|log_file|max_links)\/\n | IniFile.entry \/zend\\.(ze1_compatibility_mode)\/\n | IniFile.entry \/zlib\\.(output_compression|output_compression_level|output_handler)\/\n | IniFile.entry \/allow_(call_time_pass_reference|url_fopen|url_include)\/\n | IniFile.entry \/auto_(append_file|detect_line_endings|globals_jit|prepend_file)\/\n | IniFile.entry \/default_(charset|mimetype|socket_timeout)\/\n\t\t| IniFile.entry \/display(_startup)?_errors\/\n | IniFile.entry \/disable_(classes|functions)\/\n | IniFile.entry \/docref_(ext|root)\/\n | IniFile.entry \/error_(append_string|log|prepend_string)\/\n | IniFile.entry \/ignore_(repeated_errors|repeated_source|user_abort)\/\n | IniFile.entry \/log_errors(_max_len)?\/\n | IniFile.entry \/magic_quotes_(gpc|runtime|sybase)\/\n | IniFile.entry \/max_(execution_time|input_time)\/\n | IniFile.entry \/output_(buffering|handler)\/\n | IniFile.entry \/realpath_(cache_size|cache_ttl)\/\n | IniFile.entry \/register_(argc_argv|globals|long_arrays)\/\n | IniFile.entry \/report_(memleaks|zend_debug)\/\n | IniFile.entry \/safe_mode(_(allowed_env_vars|exec_dir|gid|include_dir|protected_env_vars))?\/\n | IniFile.entry \/sendmail_(from|path)\/\n | IniFile.entry \/upload_(max_filesize|tmp_dir)\/\n | IniFile.entry \/user_(agent|dir)\/\n | IniFile.entry \/xmlrpc_error(s|_number)\/\n\t\t| entry_allowspace \"error_reporting\"\n\n\tlet record = IniFile.record \"section\" setting\n\tlet lns = IniFile.lns record\n\n\tlet filter = (incl \"\/etc\/php*\/*\/php.ini\")\n\t . Util.stdexcl\n\n\tlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"42dd02d12597b7598692936cb61ea56b840cad27","subject":"Add variables for default delimiters and regexps in build.aug","message":"Add variables for default delimiters and regexps in build.aug\n","repos":"pevalme\/augeas,mchf\/augeas,hercules-team\/augeas,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,pevalme\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,jasperla\/augeas,MikaelSmith\/augeas,lutter\/augeas,pevalme\/augeas,dafugg\/augeas,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas,jtopjian\/augeas,jjlin\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jjlin\/augeas,kumy\/augeas,dafugg\/augeas,kunkku\/augeas,domcleal\/augeas,ptoscano\/augeas,manandbytes\/augeas,kunkku\/augeas,manandbytes\/augeas,raphink\/augeas,MikaelSmith\/augeas,raphink\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,mchf\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,lutter\/augeas,jtopjian\/augeas,ptoscano\/augeas","old_file":"lenses\/build.aug","new_file":"lenses\/build.aug","new_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n\n(************************************************************************\n * Group: BLOCK CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: block_generic\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>\n * entry_noindent:lens - the entry to be stored inside the block,\n * without indentation.\n * This entry should not include <Util.empty>\n * entry_noeol:lens - the entry to be stored inside the block,\n * without eol.\n * This entry should not include <Util.empty>\n * entry_noindent_noeol:lens - the entry to be stored inside the block,\n * without indentation or eol.\n * This entry should not include <Util.empty>\n * comment:lens - the comment lens used in the block\n * comment_noindent:lens - the comment lens used in the block,\n * without indentation.\n * ldelim_re:regexp - regexp for the left delimiter\n * rdelim_re:regexp - regexp for the right delimiter\n * ldelim_default:string - default value for the left delimiter\n * rdelim_default:string - default value for the right delimiter\n ************************************************************************)\nlet block_generic\n (entry:lens) (entry_noindent:lens)\n (entry_noeol:lens) (entry_noindent_noeol:lens)\n (comment:lens) (comment_noindent:lens)\n (ldelim_re:regexp) (rdelim_re:regexp)\n (ldelim_default:string) (rdelim_default:string) =\n let block_single = entry_noindent_noeol | comment_noindent\n in let block_start = entry_noindent | comment_noindent\n in let block_middle = (Util.empty | entry | comment)*\n in let block_end = entry_noeol | comment\n in del ldelim_re ldelim_default\n . ( ( block_start . block_middle . block_end )\n | block_single )\n . del rdelim_re rdelim_default\n\n(************************************************************************\n * View: block_setdefault\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n * ldelim_re:regexp - regexp for the left delimiter\n * rdelim_re:regexp - regexp for the left delimiter\n * ldelim_default:string - default value for the left delimiter\n * rdelim_default:string - default value for the right delimiter\n ************************************************************************)\nlet block_setdelim (entry:lens)\n (ldelim_re:regexp)\n (rdelim_re:regexp)\n (ldelim_default:string)\n (rdelim_default:string) =\n block_generic (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n ldelim_re rdelim_re\n ldelim_default rdelim_default\n\n(* Variable: block_ldelim_re *)\nlet block_ldelim_re = \/[ \\t\\n]+\\{[ \\t\\n]*\/\n\n(* Variable: block_rdelim_re *)\nlet block_rdelim_re = \/[ \\t\\n]*\\}\/\n\n(* Variable: block_ldelim_default *)\nlet block_ldelim_default = \" {\\n\"\n\n(* Variable: block_rdelim_default *)\nlet block_rdelim_default = \"}\"\n\n(************************************************************************\n * View: block\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block (entry:lens) = block_setdelim entry\n block_ldelim_re block_rdelim_re\n block_ldelim_default block_rdelim_default\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{[ \\t]*\\n\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in let full_entry = indent . entry . eol\n in let comment = indent . Util.comment_noindent\n in block_generic full_entry full_entry (* ignore noindent and noeol *)\n full_entry full_entry (* ignore noindent and noeol *)\n comment comment (* ignore noindent and noeol *)\n block_ldelim_newlines_re block_rdelim_newlines_re (* force newlines *)\n block_ldelim_newlines_default block_rdelim_newlines_default (* force newlines *)\n\n(************************************************************************\n * View: named_block\n * A named <block> enclosed in brackets\n *\n * Parameters:\n * kw:regexp - the regexp for the block name\n * entry:lens - the entry to be stored inside the block\n * this entry should not include <Util.empty>\n ************************************************************************)\nlet named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]\n\n","old_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n\n(************************************************************************\n * Group: BLOCK CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: block_generic\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>\n * entry_noindent:lens - the entry to be stored inside the block,\n * without indentation.\n * This entry should not include <Util.empty>\n * entry_noeol:lens - the entry to be stored inside the block,\n * without eol.\n * This entry should not include <Util.empty>\n * entry_noindent_noeol:lens - the entry to be stored inside the block,\n * without indentation or eol.\n * This entry should not include <Util.empty>\n * comment:lens - the comment lens used in the block\n * comment_noindent:lens - the comment lens used in the block,\n * without indentation.\n * ldelim_re:regexp - regexp for the left delimiter\n * rdelim_re:regexp - regexp for the right delimiter\n * ldelim_default:string - default value for the left delimiter\n * rdelim_default:string - default value for the right delimiter\n ************************************************************************)\nlet block_generic\n (entry:lens) (entry_noindent:lens)\n (entry_noeol:lens) (entry_noindent_noeol:lens)\n (comment:lens) (comment_noindent:lens)\n (ldelim_re:regexp) (rdelim_re:regexp)\n (ldelim_default:string) (rdelim_default:string) =\n let block_single = entry_noindent_noeol | comment_noindent\n in let block_start = entry_noindent | comment_noindent\n in let block_middle = (Util.empty | entry | comment)*\n in let block_end = entry_noeol | comment\n in del ldelim_re ldelim_default\n . ( ( block_start . block_middle . block_end )\n | block_single )\n . del rdelim_re rdelim_default\n\n(************************************************************************\n * View: block_setdefault\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n * ldelim_re:regexp - regexp for the left delimiter\n * rdelim_re:regexp - regexp for the left delimiter\n * ldelim_default:string - default value for the left delimiter\n * rdelim_default:string - default value for the right delimiter\n ************************************************************************)\nlet block_setdelim (entry:lens)\n (ldelim_re:regexp)\n (rdelim_re:regexp)\n (ldelim_default:string)\n (rdelim_default:string) =\n block_generic (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n ldelim_re rdelim_re\n ldelim_default rdelim_default\n\n(************************************************************************\n * View: block\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block (entry:lens) = block_setdelim entry\n \/[ \\t\\n]+\\{[ \\t\\n]*\/ \/[ \\t\\n]*\\}\/ \" {\\n\" \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in let full_entry = indent . entry . eol\n in let comment = indent . Util.comment_noindent\n in block_generic full_entry full_entry (* ignore noindent and noeol *)\n full_entry full_entry (* ignore noindent and noeol *)\n comment comment (* ignore noindent and noeol *)\n \/[ \\t\\n]+\\{[ \\t]*\\n\/ \/[ \\t]*\\}\/ (* force newlines *)\n \"\\n{\\n\" \"}\" (* force newlines *)\n\n(************************************************************************\n * View: named_block\n * A named <block> enclosed in brackets\n *\n * Parameters:\n * kw:regexp - the regexp for the block name\n * entry:lens - the entry to be stored inside the block\n * this entry should not include <Util.empty>\n ************************************************************************)\nlet named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0e3887866835c29b2044291d9526eddad3e98436","subject":"Shellvars.aug: Add bquot and dollar-assigned tests","message":"Shellvars.aug: Add bquot and dollar-assigned tests\n","repos":"jjlin\/augeas,dafugg\/augeas,jjlin\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas,manandbytes\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,kumy\/augeas,pevalme\/augeas,mchf\/augeas,MikaelSmith\/augeas,dafugg\/augeas,pevalme\/augeas,kumy\/augeas,jtopjian\/augeas,pevalme\/augeas,mlichvar\/augeas,jasperla\/augeas,MikaelSmith\/augeas,raphink\/augeas,kunkku\/augeas,jasperla\/augeas,jtopjian\/augeas,lutter\/augeas,kunkku\/augeas,lutter\/augeas,manandbytes\/augeas,ptoscano\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,raphink\/augeas,lutter\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,mlichvar\/augeas,kumy\/augeas,kumy\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test Shellvars.lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test Shellvars.lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test Shellvars.lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test Shellvars.lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test Shellvars.lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test Shellvars.lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test Shellvars.lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test Shellvars.lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test Shellvars.lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test Shellvars.lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test Shellvars.lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test Shellvars.lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test Shellvars.lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test Shellvars.lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test Shellvars.lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test Shellvars.lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test Shellvars.lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test Shellvars.lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test Shellvars.lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test Shellvars.lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test Shellvars.lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test Shellvars.lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test Shellvars.lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test Shellvars.lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n\n (* Test semicolons *)\n test Shellvars.lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test Shellvars.lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test Shellvars.lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test Shellvars.lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test Shellvars.lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\" = \"f\" } } }\n\n (* Select *)\n test Shellvars.lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test Shellvars.lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\" = \"f\" } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test Shellvars.lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test Shellvars.lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test Shellvars.lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Shellvars.lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test Shellvars.lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test Shellvars.lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test Shellvars.lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test Shellvars.lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test Shellvars.lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test Shellvars.lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test Shellvars.lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test Shellvars.lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test Shellvars.lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test Shellvars.lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test Shellvars.lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test Shellvars.lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test Shellvars.lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test Shellvars.lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test Shellvars.lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test Shellvars.lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test Shellvars.lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test Shellvars.lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test Shellvars.lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test Shellvars.lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test Shellvars.lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test Shellvars.lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n\n (* Test semicolons *)\n test Shellvars.lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test Shellvars.lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test Shellvars.lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test Shellvars.lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test Shellvars.lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\" = \"f\" } } }\n\n (* Select *)\n test Shellvars.lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test Shellvars.lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\" = \"f\" } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7dbc835be5fb9e7bff3020764f09d94de7c96c56","subject":"* lenses\/util.aug: do not set caml mode for Emacs","message":"* lenses\/util.aug: do not set caml mode for Emacs\n","repos":"kumy\/augeas,lutter\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,jjlin\/augeas,jjlin\/augeas,jasperla\/augeas,ptoscano\/augeas,lutter\/augeas,MikaelSmith\/augeas,pevalme\/augeas,domcleal\/augeas,mchf\/augeas,hercules-team\/augeas,kunkku\/augeas,kumy\/augeas,jtopjian\/augeas,pevalme\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,raphink\/augeas,dafugg\/augeas,lutter\/augeas,mlichvar\/augeas,kumy\/augeas,manandbytes\/augeas,raphink\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,domcleal\/augeas,dafugg\/augeas,kunkku\/augeas,ptoscano\/augeas,domcleal\/augeas,hercules-team\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*[ \\t\\n]*\/ \"\/*\\n\"\n . counter \"mline\"\n . (mline . (eol . mline)*)\n . del \/[ \\t\\n]*\\*\\\/[ \\t]*\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*[ \\t\\n]*\/ \"\/*\\n\"\n . counter \"mline\"\n . (mline . (eol . mline)*)\n . del \/[ \\t\\n]*\\*\\\/[ \\t]*\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"428e3c7961657f211e3427b22ad72119068ae2ca","subject":"php.aug - Fix php7 FPM support ","message":"php.aug - Fix php7 FPM support \n\nUpdate path to reflect the transition from:\r\n\/etc\/php5\/ to \/etc\/php\/7.0\/","repos":"kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,pevalme\/augeas,manandbytes\/augeas,mchf\/augeas,manandbytes\/augeas,lutter\/augeas,mlichvar\/augeas,mlichvar\/augeas,hercules-team\/augeas,mchf\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas,ptoscano\/augeas,pevalme\/augeas,ptoscano\/augeas","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry =\n let word = IniFile.entry_re\n in let entry_re = word . ( \"[\" . word . \"]\" )? \n in IniFile.indented_entry entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php\/*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n (* PHPFPM Support *)\n . (incl \"\/etc\/php*\/fpm\/pool.d\/*.conf\")\n . (incl \"\/etc\/php\/*\/fpm\/pool.d\/*.conf\") \n (* Zend Community edition *)\n . (incl \"\/usr\/local\/zend\/etc\/php.ini\")\n . (incl \"\/usr\/local\/zend\/etc\/conf.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry =\n let word = IniFile.entry_re\n in let entry_re = word . ( \"[\" . word . \"]\" )? \n in IniFile.indented_entry entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php\/*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n (* PHPFPM Support *)\n . (incl \"\/etc\/php*\/fpm\/pool.d\/*.conf\")\n (* Zend Community edition *)\n . (incl \"\/usr\/local\/zend\/etc\/php.ini\")\n . (incl \"\/usr\/local\/zend\/etc\/conf.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6b6af57db10aac1ed89d4ebf35e0191711a98f08","subject":"Clean wrong lines in modprobe.aug's header","message":"Clean wrong lines in modprobe.aug's header\n","repos":"kunkku\/augeas,pevalme\/augeas,dafugg\/augeas,lutter\/augeas,ptoscano\/augeas,ptoscano\/augeas,mlichvar\/augeas,jjlin\/augeas,mchf\/augeas,jasperla\/augeas,raphink\/augeas,dafugg\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,lutter\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,lutter\/augeas,kunkku\/augeas,jjlin\/augeas,pevalme\/augeas,mchf\/augeas,domcleal\/augeas,jtopjian\/augeas,jasperla\/augeas,manandbytes\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,raphink\/augeas,dafugg\/augeas,kumy\/augeas,mlichvar\/augeas,manandbytes\/augeas,hercules-team\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,kumy\/augeas,domcleal\/augeas,ptoscano\/augeas","old_file":"lenses\/modprobe.aug","new_file":"lenses\/modprobe.aug","new_contents":"(*\nModule: Modprobe\n Parses \/etc\/modprobe.conf and \/etc\/modprobe.d\/*\n\nOriginal Author: David Lutterkort <lutter@redhat.com>\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 modprobe.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/modprobe.conf and \/etc\/modprobe.d\/*. See <filter>.\n*)\n\nmodule Modprobe =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_space *)\nlet sep_space = del \/([ \\t]|(\\\\\\\\\\n))+\/ \" \"\n\n(* View: sto_no_spaces *)\nlet sto_no_spaces = store \/[^# \\t\\n\\\\\\\\]+\/\n\n(* View: sto_to_eol *)\nlet sto_to_eol = store \/[^# \\t\\n\\\\\\\\][^#\\n\\\\\\\\]*[^# \\t\\n\\\\\\\\]|[^# \\t\\n\\\\\\\\]\/\n\n(* View: alias *)\nlet alias =\n let modulename = [ label \"modulename\" . sto_no_spaces ] in\n Build.key_value_line_comment \"alias\" sep_space\n (sto_no_spaces . sep_space . modulename)\n comment\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n(* View: options *)\nlet options =\n let opt_value = \/[^#\" \\t\\n\\\\\\\\]+|\"[^#\"\\n\\\\\\\\]*\"\/ in\n let option = [ key Rx.word . (Util.del_str \"=\" . store opt_value)? ] in\n [ key \"options\" . sep_space . sto_no_spaces\n . (sep_space . option)* . Util.comment_or_eol ]\n\n(* View: install_remove *)\nlet kv_line_command (kw:regexp) =\n let command = [ label \"command\" . sto_to_eol ] in\n [ key kw . sep_space . sto_no_spaces\n . sep_space . command . Util.comment_or_eol ]\n\n(* View: blacklist *)\nlet blacklist = Build.key_value_line_comment \"blacklist\" sep_space\n sto_no_spaces\n comment\n\n(* View: config *)\nlet config = Build.key_value_line_comment \"config\" sep_space\n (store \/binary_indexes|yes|no\/)\n comment\n\n(* View: entry *)\nlet entry = alias\n | options\n | kv_line_command \/install|remove\/\n | blacklist\n | config\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (comment|empty|entry)*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/modprobe.conf\") .\n (incl \"\/etc\/modprobe.d\/*\").\n (incl \"\/etc\/modprobe.conf.local\").\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Modprobe\n Parses \/etc\/modprobe.conf and \/etc\/modprobe.d\/*\n*)\n(*\nModule: Keepalived\n Parses \/etc\/modprobe.conf and \/etc\/modprobe.d\/*\n\nOriginal Author: David Lutterkort <lutter@redhat.com>\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 modprobe.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/modprobe.conf and \/etc\/modprobe.d\/*. See <filter>.\n*)\n\nmodule Modprobe =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_space *)\nlet sep_space = del \/([ \\t]|(\\\\\\\\\\n))+\/ \" \"\n\n(* View: sto_no_spaces *)\nlet sto_no_spaces = store \/[^# \\t\\n\\\\\\\\]+\/\n\n(* View: sto_to_eol *)\nlet sto_to_eol = store \/[^# \\t\\n\\\\\\\\][^#\\n\\\\\\\\]*[^# \\t\\n\\\\\\\\]|[^# \\t\\n\\\\\\\\]\/\n\n(* View: alias *)\nlet alias =\n let modulename = [ label \"modulename\" . sto_no_spaces ] in\n Build.key_value_line_comment \"alias\" sep_space\n (sto_no_spaces . sep_space . modulename)\n comment\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n(* View: options *)\nlet options =\n let opt_value = \/[^#\" \\t\\n\\\\\\\\]+|\"[^#\"\\n\\\\\\\\]*\"\/ in\n let option = [ key Rx.word . (Util.del_str \"=\" . store opt_value)? ] in\n [ key \"options\" . sep_space . sto_no_spaces\n . (sep_space . option)* . Util.comment_or_eol ]\n\n(* View: install_remove *)\nlet kv_line_command (kw:regexp) =\n let command = [ label \"command\" . sto_to_eol ] in\n [ key kw . sep_space . sto_no_spaces\n . sep_space . command . Util.comment_or_eol ]\n\n(* View: blacklist *)\nlet blacklist = Build.key_value_line_comment \"blacklist\" sep_space\n sto_no_spaces\n comment\n\n(* View: config *)\nlet config = Build.key_value_line_comment \"config\" sep_space\n (store \/binary_indexes|yes|no\/)\n comment\n\n(* View: entry *)\nlet entry = alias\n | options\n | kv_line_command \/install|remove\/\n | blacklist\n | config\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (comment|empty|entry)*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/modprobe.conf\") .\n (incl \"\/etc\/modprobe.d\/*\").\n (incl \"\/etc\/modprobe.conf.local\").\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"64e411ec7320d4e6fa641afe2e0f4a591ac27720","subject":"Php: simplified and based on Inifile","message":"Php: simplified and based on Inifile\n\n\"Slightly\" simplify php.aug now that the comment issue is fixed in\ninifile.aug\n","repos":"hercules-team\/augeas-do-not-use,mchf\/augeas,dafugg\/augeas,bkearney\/augeas,jtopjian\/augeas,kumy\/augeas,dafugg\/augeas,ptoscano\/augeas,bkearney\/augeas,ptoscano\/augeas,bkearney\/augeas,bkearney\/augeas,manandbytes\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,jasperla\/augeas,camptocamp\/augeas,pevalme\/augeas,jtopjian\/augeas,hercules-team\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,lutter\/augeas,jjlin\/augeas,pevalme\/augeas,camptocamp\/augeas,MikaelSmith\/augeas,raphink\/augeas,mchf\/augeas,raphink\/augeas,mlichvar\/augeas,domcleal\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,jjlin\/augeas,jjlin\/augeas,jasperla\/augeas,kunkku\/augeas,ptoscano\/augeas,kunkku\/augeas,domcleal\/augeas,camptocamp\/augeas,lutter\/augeas,manandbytes\/augeas,kunkku\/augeas,kumy\/augeas,kumy\/augeas,dafugg\/augeas","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(* PHP is a standard INI file *)\n\nlet entry = IniFile.entry \/[a-z][a-z0-9\\._-]+\/\n\nlet record = IniFile.record \"section\" entry\nlet lns = IniFile.lns record\n\nlet filter = (incl \"\/etc\/php*\/*\/php.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n\n autoload xfm\n\n (* PHP is a standard INI file *)\n let setting = \"always_populate_raw_post_data\"\n | \"asp_tags\"\n | \"browscap\"\n | \"child_terminate\"\n | \"define_syslog_variables\"\n | \"doc_root\"\n | \"enable_dl\"\n | \"engine\"\n | \"expose_php\"\n | \"extension_dir\"\n | \"file_uploads\"\n\t\t| \"gpc_order\"\n | \"html_errors\"\n | \"implicit_flush\"\n | \"include_path\"\n | \"last_modified\"\n | \"memory_limit\"\n | \"open_basedir\"\n | \"post_max_size\"\n | \"precision\"\n | \"serialize_precision\"\n | \"short_open_tag\"\n | \"SMTP\"\n | \"smtp_port\"\n | \"track_errors\"\n | \"unserialize_callback_func\"\n | \"variables_order\"\n | \"xbithack\"\n | \"y2k_compliance\"\n | \/apc\\.(cache_by_default|enabled|filters|gc_ttl|mmap_file_mask|num_files_hint|optimization|shm_segments|shm_size|slam_defense|ttl|user_entries_hint|user_ttl)\/\n | \/apd\\.(dumpdir|statement_tracing)\/\n | \/arg_separator\\.(input|output)\/\n | \/assert\\.(active|bail|callback|quiet_eval|warning)\/\n | \/bcmath\\.(scale)\/\n | \/blenc\\.(key_file)\/\n | \/com\\.(allow_dcom|autoregister_casesensitive|autoregister_typelib|autoregister_verbose|code_page|typelib_file)\/\n | \/crack\\.(default_dictionary)\/\n | \/daffodildb\\.(default_host|default_password|default_socket|default_user|port)\/\n | \/date\\.(default_latitude|default_longitude|sunrise_zenith|sunset_zenith)\/\n | \/dba\\.(default_handler)\/\n | \/dbx\\.(colnames_case)\/\n | \/exif\\.(decode_jis_intel|decode_jis_motorola|decode_unicode_intel|decode_unicode_motorola|encode_jis|encode_unicode)\/\n | \/fbsql\\.(allow_persistent|autocommit|batchsize|default_database|default_database_password|default_host|default_password|default_user|generate_warnings|max_connections|max_links|max_persistent|max_results)\/\n | \/highlight\\.(bg|comment|default|html|keyword|string)\/\n | \/hyperwave\\.(allow_persistent|default_port)\/\n | \/ibase\\.(allow_persistent|dateformat|default_charset|default_db|default_password|default_user|max_links|max_persistent|timeformat|timestampformat)\/\n | \/iconv\\.(input_encoding|internal_encoding|output_encoding)\/\n | \/ifx\\.(allow_persistent|blobinfile|byteasvarchar|charasvarchar|default_host|default_password|default_user|max_links|max_persistent|nullformat|textasvarchar)\/\n | \/ingres\\.(allow_persistent|default_database|default_password|default_user|max_links|max_persistent)\/\n | \/ircg\\.(control_user|keep_alive_interval|max_format_message_sets|shared_mem_size|work_dir)\/\n | \/ldap\\.(max_links)\/\n | \/mail\\.(force_extra_parameters)\/\n | \/mailparse\\.(def_charset)\/\n | \/maxdb\\.(default_db|default_host|default_pw|default_user|long_readlen)\/\n | \/mbstring\\.(detect_order|encoding_translation|func_overload|http_input|http_output|internal_encoding|language|script_encoding|substitute_character)\/\n | \/mcrypt\\.(algorithms_dir|modes_dir)\/\n | \/mime_magic\\.(debug|magicfile)\/\n | \/mssql\\.(allow_persistent|batchsize|compatability_mode|connect_timeout|datetimeconvert|max_links|max_persistent|max_procs|min_error_severity|min_message_severity|secure_connection|textlimit|textsize|timeout)\/\n | \/msql\\.(allow_persistent|max_links|max_persistent)\/\n | \/mysql\\.(allow_persistent|connect_timeout|default_host|default_password|default_port|default_socket|default_user|max_links|max_persistent|trace_mode)\/\n | \/mysqli\\.(default_host|default_port|default_pw|default_socket|default_user|max_links|reconnect)\/\n | \/namazu\\.(debugmode|lang|loggingmode|sortmethod|sortorder)\/\n | \/nsapi\\.(read_timeout)\/\n | \/odbc\\.(allow_persistent|check_persistent|defaultbinmode|defaultlrl|default_db|default_pw|default_user|max_links|max_persistent)\/\n | \/opendirectory\\.(max_refs|separator)\/\n | \/pdo\\.(global_value)\/\n | \/pfpro\\.(defaulthost|defaultport|defaulttimeout|proxyaddress|proxylogon|proxypassword|proxyport)\/\n | \/pgsql\\.(allow_persistent|auto_reset_persistent|ignore_notice|log_notice|max_links|max_persistent)\/\n | \/printer\\.(default_printer)\/\n | \/session\\.(auto_start|bug_compat_42|bug_compat_warn|cache_expire|cache_limiter|cookie_(domain|httponly|lifetime|path|secure)|entropy_file|entropy_length|gc_divisor|gc_maxlifetime|gc_probability|hash_bits_per_character|hash_function|name|referer_check|save_handler|save_path|serialize_handler|use_cookies|use_only_cookies|use_trans_sid)\/\n | \/session_pgsql\\.(create_table|db|disable|failover_mode|gc_interval|keep_expired|sem_file_name|serializable|short_circuit|use_app_vars|vacuum_interval)\/\n | \/simple_cvs\\.(authMethod|compressionLevel|cvsRoot|host|moduleName|userName|workingDir)\/\n | \/soap\\.(wsdl_cache_dir|wsdl_cache_enabled|wsdl_cache_ttl)\/\n | \/sql\\.(safe_mode)\/\n | \/sqlite\\.(assoc_case)\/\n\t\t| \/sybase\\.(allow_persistent|max_(persistent|links)|interface_file|min_(error|message)_severity|compatability_mode)\/\n | \/sybct\\.(allow_persistent|deadlock_retry_count|hostname|login_timeout|max_links|max_persistent|min_client_severity|min_server_severity)\/\n | \/tidy\\.(clean_output|default_config)\/\n | \/url_rewriter\\.(tags)\/\n | \/valkyrie\\.(auto_validate|config_path)\/\n | \/xmms\\.(path|session)\/\n | \/yaz\\.(keepalive|log_file|max_links)\/\n | \/zend\\.(ze1_compatibility_mode)\/\n | \/zlib\\.(output_compression|output_compression_level|output_handler)\/\n | \/allow_(call_time_pass_reference|url_fopen|url_include)\/\n | \/auto_(append_file|detect_line_endings|globals_jit|prepend_file)\/\n | \/default_(charset|mimetype|socket_timeout)\/\n\t\t| \/display(_startup)?_errors\/\n | \/disable_(classes|functions)\/\n | \/docref_(ext|root)\/\n | \/error_(append_string|log|prepend_string|reporting)\/\n | \/ignore_(repeated_errors|repeated_source|user_abort)\/\n | \/log_errors(_max_len)?\/\n | \/magic_quotes_(gpc|runtime|sybase)\/\n | \/max_(execution_time|input_time)\/\n | \/output_(buffering|handler)\/\n | \/realpath_(cache_size|cache_ttl)\/\n | \/register_(argc_argv|globals|long_arrays)\/\n | \/report_(memleaks|zend_debug)\/\n | \/safe_mode(_(allowed_env_vars|exec_dir|gid|include_dir|protected_env_vars))?\/\n | \/sendmail_(from|path)\/\n | \/upload_(max_filesize|tmp_dir)\/\n | \/user_(agent|dir)\/\n | \/xmlrpc_error(s|_number)\/\n\n\n\tlet entry = IniFile.entry setting\n\n\tlet record = IniFile.record \"section\" entry\n\tlet lns = IniFile.lns record\n\n\tlet filter = (incl \"\/etc\/php*\/*\/php.ini\")\n\t . Util.stdexcl\n\n\tlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c3b98a03088572b4a1c38379abd02477c0968b50","subject":"Update the lens to work with the logging format","message":"Update the lens to work with the logging format\n","repos":"rharrison10\/puppet-holland,rharrison10\/puppet-holland","old_file":"files\/augeas\/holland.aug","new_file":"files\/augeas\/holland.aug","new_contents":"(* Holland module for Augeas\n Author: Russell Harrison <rharrison@fedoraproject.org>\n\n holland.conf is almost a standard INI File.\n*)\n\nmodule Holland =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *\n * holland.conf only supports \"# as comment and \"=\" as separator\n * some values may be comma separated lists\n *************************************************************************)\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet comma = del \/[ \\t]*,[ \\t]*\/ \", \"\n\n(************************************************************************\n * LISTS\n * Setup the comma seperated lists\n *************************************************************************)\nlet set_list = Build.opt_list ([ label \"set\" . store Rx.word ]) comma\nlet path_list = Build.opt_list ([ label \"path\" . store Rx.neg1 ]) comma\n\n(************************************************************************\n * ENTRY\n * holland.conf uses standard INI File entries and comma separated lists\n *************************************************************************)\nlet backupsets_entry =\n Build.key_value_line_comment \"backupsets\" sep ( Sep.opt_space\n . set_list\n ) comment\nlet plugindirs_entry =\n Build.key_value_line_comment \"plugin_dirs\" sep ( Sep.opt_space\n . path_list\n ) comment\nlet common_entry = IniFile.indented_entry ( \"backup_directory\"\n | \"umask\"\n | \"path\"\n | \"filename\"\n | \"level\"\n | \"format\"\n ) sep comment\n\n(************************************************************************\n * RECORD\n *************************************************************************)\nlet title = IniFile.indented_title IniFile.record_re\nlet record = IniFile.record title ( common_entry\n | backupsets_entry\n | plugindirs_entry\n )\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = IniFile.lns record comment\nlet filter = (incl \"\/etc\/holland\/holland.conf\")\nlet xfm = transform lns filter\n","old_contents":"(* Holland module for Augeas\n Author: Russell Harrison <rharrison@fedoraproject.org>\n\n holland.conf is almost a standard INI File.\n*)\n\nmodule Holland =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *\n * holland.conf only supports \"# as comment and \"=\" as separator\n * some values may be comma separated lists\n *************************************************************************)\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet comma = del \/[ \\t]*,[ \\t]*\/ \", \"\n\n(************************************************************************\n * LISTS\n * Setup the comma seperated lists\n *************************************************************************)\nlet set_list = Build.opt_list ([ label \"set\" . store Rx.word ]) comma\nlet path_list = Build.opt_list ([ label \"path\" . store Rx.neg1 ]) comma\n\n(************************************************************************\n * ENTRY\n * holland.conf uses standard INI File entries and comma separated lists\n *************************************************************************)\nlet backupsets_entry =\n Build.key_value_line_comment \"backupsets\" sep ( Sep.opt_space\n . set_list\n ) comment\nlet plugindirs_entry =\n Build.key_value_line_comment \"plugin_dirs\" sep ( Sep.opt_space\n . path_list\n ) comment\nlet common_entry = IniFile.indented_entry ( \"backup_directory\"\n | \"umask\"\n | \"path\"\n | \"filename\"\n | \"level\"\n ) sep comment\n\n(************************************************************************\n * RECORD\n *************************************************************************)\nlet title = IniFile.indented_title IniFile.record_re\nlet record = IniFile.record title ( common_entry\n | backupsets_entry\n | plugindirs_entry\n )\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = IniFile.lns record comment\nlet filter = (incl \"\/etc\/holland\/holland.conf\")\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"d15ca0a5e12ead2c5dfea38e4c1bee871b995e3e","subject":"Add email_addr to rx.aug","message":"Add email_addr to rx.aug\n","repos":"lutter\/augeas,jtopjian\/augeas,kumy\/augeas,pevalme\/augeas,mchf\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,dafugg\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,domcleal\/augeas,mchf\/augeas,dafugg\/augeas,kunkku\/augeas,kumy\/augeas,dafugg\/augeas,domcleal\/augeas,jjlin\/augeas,hercules-team\/augeas,jasperla\/augeas,manandbytes\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas,jtopjian\/augeas,mlichvar\/augeas,lutter\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,kunkku\/augeas,jjlin\/augeas,jasperla\/augeas,manandbytes\/augeas,pevalme\/augeas,MikaelSmith\/augeas,raphink\/augeas,domcleal\/augeas,lutter\/augeas,kumy\/augeas","old_file":"lenses\/rx.aug","new_file":"lenses\/rx.aug","new_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Spaces *)\nlet space = \/[ \\t]+\/\nlet opt_space = \/[ \\t]*\/\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\nlet no_spaces = \/[^ \\t\\n]+\/\n\n(* Generic fields *)\nlet word = \/[A-Za-z0-9_.-]+\/\nlet integer = \/[0-9]+\/\nlet decimal = \/[0-9]+([.,][0-9]+)?\/\n\n(* A filesystem path *)\nlet fspath = \/[^ \\t\\n]+\/\n\n(* All but... *)\n(* Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n\n(*\n * IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\nlet ipv4 =\n let dot = \".\" in\n let digits = \/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/ in\n digits . dot . digits . dot . digits . dot . digits\n\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\nlet ip = ipv4 | ipv6\n\n(*\n * A Linux device name like eth0 or i2c-0. Might still be too restrictive\n *)\n\nlet device_name = \/[a-zA-Z0-9_?.+:!-]+\/\n\n(*\n * Variable: email_addr\n * To be refined\n *)\nlet email_addr = \/[A-Za-z0-9_\\+\\.-]+@[A-Za-z0-9_\\.-]+\/\n\n","old_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Spaces *)\nlet space = \/[ \\t]+\/\nlet opt_space = \/[ \\t]*\/\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\nlet no_spaces = \/[^ \\t\\n]+\/\n\n(* Generic fields *)\nlet word = \/[A-Za-z0-9_.-]+\/\nlet integer = \/[0-9]+\/\nlet decimal = \/[0-9]+([.,][0-9]+)?\/\n\n(* A filesystem path *)\nlet fspath = \/[^ \\t\\n]+\/\n\n(* All but... *)\n(* Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n\n(*\n * IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\nlet ipv4 =\n let dot = \".\" in\n let digits = \/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/ in\n digits . dot . digits . dot . digits . dot . digits\n\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\nlet ip = ipv4 | ipv6\n\n(*\n * A Linux device name like eth0 or i2c-0. Might still be too restrictive\n *)\n\nlet device_name = \/[a-zA-Z0-9_?.+:!-]+\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"bcb0677352591228b7ed5be8d5f78cc558f85811","subject":"Improve build.aug","message":"Improve build.aug\n","repos":"MikaelSmith\/augeas,jjlin\/augeas,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,raphink\/augeas,dafugg\/augeas,manandbytes\/augeas,lutter\/augeas,kunkku\/augeas,mchf\/augeas,dafugg\/augeas,pevalme\/augeas,hercules-team\/augeas,mlichvar\/augeas,dafugg\/augeas,domcleal\/augeas,jasperla\/augeas,pevalme\/augeas,jtopjian\/augeas,raphink\/augeas,kunkku\/augeas,domcleal\/augeas,kumy\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,lutter\/augeas,kunkku\/augeas,MikaelSmith\/augeas,lutter\/augeas,mchf\/augeas,jtopjian\/augeas,hercules-team\/augeas,manandbytes\/augeas,jjlin\/augeas,domcleal\/augeas,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,kumy\/augeas,kumy\/augeas","old_file":"lenses\/build.aug","new_file":"lenses\/build.aug","new_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n","old_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABELS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: KEYS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8251eb3e182fb5c196fdeac896e7a06b9bb7a819","subject":"Simplelines: parse OpenBSD's hostname.if(5) files","message":"Simplelines: parse OpenBSD's hostname.if(5) files\n","repos":"pevalme\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,lutter\/augeas,manandbytes\/augeas,lutter\/augeas,dafugg\/augeas,dafugg\/augeas,ptoscano\/augeas,mchf\/augeas,kunkku\/augeas,lutter\/augeas,manandbytes\/augeas,dafugg\/augeas,hercules-team\/augeas,mlichvar\/augeas,mchf\/augeas,mlichvar\/augeas,jtopjian\/augeas,kunkku\/augeas,mlichvar\/augeas,jtopjian\/augeas,jjlin\/augeas,ptoscano\/augeas,pevalme\/augeas,hercules-team\/augeas,kunkku\/augeas","old_file":"lenses\/simplelines.aug","new_file":"lenses\/simplelines.aug","new_contents":"(*\nModule: Simplelines\n Parses simple lines conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n See <filter>.\n\nAbout: Examples\n The <Test_Simplelines> file contains various examples and tests.\n*)\n\nmodule Simplelines =\n\nautoload xfm\n\n(* View: line\n A simple, uncommented, line *)\nlet line =\n let line_re = \/[^# \\t\\n].*[^ \\t\\n]|[^# \\t\\n]\/\n in [ seq \"line\" . Util.indent\n . store line_re . Util.eol ]\n\n(* View: lns\n The simplelines lens *)\nlet lns = (Util.empty | Util.comment | line)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/at.allow\"\n . incl \"\/etc\/at.deny\"\n . incl \"\/etc\/cron.allow\"\n . incl \"\/etc\/cron.deny\"\n . incl \"\/etc\/cron.d\/at.allow\"\n . incl \"\/etc\/cron.d\/at.deny\"\n . incl \"\/etc\/cron.d\/cron.allow\"\n . incl \"\/etc\/cron.d\/cron.deny\"\n . incl \"\/etc\/default\/grub_installdevice\"\n . incl \"\/etc\/pam.d\/allow.pamlist\"\n . incl \"\/etc\/hostname.*\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Simplelines\n Parses simple lines conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n See <filter>.\n\nAbout: Examples\n The <Test_Simplelines> file contains various examples and tests.\n*)\n\nmodule Simplelines =\n\nautoload xfm\n\n(* View: line\n A simple, uncommented, line *)\nlet line =\n let line_re = \/[^# \\t\\n].*[^ \\t\\n]|[^# \\t\\n]\/\n in [ seq \"line\" . Util.indent\n . store line_re . Util.eol ]\n\n(* View: lns\n The simplelines lens *)\nlet lns = (Util.empty | Util.comment | line)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/at.allow\"\n . incl \"\/etc\/at.deny\"\n . incl \"\/etc\/cron.allow\"\n . incl \"\/etc\/cron.deny\"\n . incl \"\/etc\/cron.d\/at.allow\"\n . incl \"\/etc\/cron.d\/at.deny\"\n . incl \"\/etc\/cron.d\/cron.allow\"\n . incl \"\/etc\/cron.d\/cron.deny\"\n . incl \"\/etc\/default\/grub_installdevice\"\n . incl \"\/etc\/pam.d\/allow.pamlist\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9046ef550214c7f32af9204d980f04bccdf5b992","subject":"Fix typo in postfix_master.aug (Fix ticket 234)","message":"Fix typo in postfix_master.aug (Fix ticket 234)\n","repos":"lutter\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,jjlin\/augeas,kumy\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,ptoscano\/augeas,hercules-team\/augeas,kumy\/augeas,pevalme\/augeas,mchf\/augeas,raphink\/augeas,manandbytes\/augeas,kumy\/augeas,kunkku\/augeas,pevalme\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,dafugg\/augeas,dafugg\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas,kunkku\/augeas,manandbytes\/augeas,jjlin\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,jjlin\/augeas,lutter\/augeas,jtopjian\/augeas,raphink\/augeas,domcleal\/augeas,kumy\/augeas,jasperla\/augeas,MikaelSmith\/augeas,ptoscano\/augeas","old_file":"lenses\/postfix_master.aug","new_file":"lenses\/postfix_master.aug","new_contents":"(* Postfix_Master module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference:\n\n*)\n\nmodule Postfix_Master =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet ws = del \/[ \\t\\n]+\/ \" \"\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet word = \/[A-Za-z0-9_.:-]+\/\nlet words = \/[A-Za-z0-9$(){}=!_.,:@-][A-Za-z0-9$!(){} =\"\\\/_.,:@-]*[A-Za-z0-9$!(){}=\"\\\/_.,:@-]\/\n\nlet bool = \/y|n|-\/\nlet integer = \/([0-9]+|-)\\??\/\nlet command = words . (\/[ \\t]*\\n[ \\t]+\/ . words)*\n\nlet field (l:string) (r:regexp)\n = [ label l . store r ]\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet entry = [ key word . ws\n . field \"type\" \/inet|unix|fifo|pass\/ . ws\n . field \"private\" bool . ws\n . field \"unprivileged\" bool . ws\n . field \"chroot\" bool . ws\n . field \"wakeup\" integer . ws\n . field \"limit\" integer . ws\n . field \"command\" command\n . eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/postfix\/master.cf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Postfix_Master module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference:\n\n*)\n\nmodule Postfix_Master =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet ws = del \/[ \\t\\n]+\/ \" \"\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet word = \/[A-Za-z0-9_.:-]+\/\nlet words = \/[A-Za-z0-9$(){}=!_.,:@-][A-Za-z0-9$!(){} =\"\\\/_.,:@-]*[A-Za-z0-9$!(){}=\"\\\/_.,:@-]\/\n\nlet bool = \/y|n|-\/\nlet integer = \/([0-9]+|-)\\??\/\nlet command = words . (\/[ \\t]*\\n[ \\t]+\/ . words)*\n\nlet field (l:string) (r:regexp)\n = [ label l . store r ]\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet entry = [ key word . ws\n . field \"type\" \/inet|unix|fifo|pass\/ . ws\n . field \"private\" bool . ws\n . field \"unpriviliged\" bool . ws\n . field \"chroot\" bool . ws\n . field \"wakeup\" integer . ws\n . field \"limit\" integer . ws\n . field \"command\" command\n . eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/postfix\/master.cf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"31475d640067ca4ec02ab967e027bff1581669c8","subject":"Make aliases work","message":"Make aliases work\n","repos":"domcleal\/augeas,kumy\/augeas,jjlin\/augeas,kumy\/augeas,bkearney\/augeas,lutter\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,bkearney\/augeas,lutter\/augeas,pevalme\/augeas,raphink\/augeas,mchf\/augeas,mlichvar\/augeas,lutter\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,MikaelSmith\/augeas,kumy\/augeas,mlichvar\/augeas,camptocamp\/augeas,kunkku\/augeas,domcleal\/augeas,jtopjian\/augeas,jtopjian\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,camptocamp\/augeas,manandbytes\/augeas,pevalme\/augeas,ptoscano\/augeas,jasperla\/augeas,ptoscano\/augeas,hercules-team\/augeas,mchf\/augeas,camptocamp\/augeas,ptoscano\/augeas,kumy\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,jjlin\/augeas,pevalme\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,kunkku\/augeas,jjlin\/augeas,bkearney\/augeas,jasperla\/augeas,raphink\/augeas,dafugg\/augeas","old_file":"spec\/aliases.aug","new_file":"spec\/aliases.aug","new_contents":"# Parse mail aliases in \/etc\/aliases\n\nmap\n grammar aliases\n include '\/etc\/aliases' '\/system\/config\/aliases'\nend\n\ngrammar aliases\n token COMMENT \/^[ \\t]*(#.*?)?\\n\/ = '#\\n'\n token COMMA \/,[ \\t]+(\\n[ \\t]+)?\/ = ', '\n token NAME \/([^ \\t\\n#:@]+|\"[^\"]*\")\/ = 'missing' # \"\n token COLON \/:[ \\t]+\/ = ': '\n token EOL \/[ \\t]*\\n\/ = '\\n'\n\n file: (comment | alias)*\n\n comment: [ COMMENT ]\n\n alias: [ seq 'alias' .\n [ label 'name' . store NAME ] .\n COLON .\n counter 'values' .\n [ label 'values' .\n [ seq 'values' . store ... ] .\n ([COMMA . seq 'values' . store ...])*\n ]\n ] . EOL\nend\n","old_contents":"# Parse mail aliases in \/etc\/aliases\n\n#map\n# grammar aliases\n# include '\/etc\/aliases' '\/system\/config\/aliases'\n#end\n\ngrammar aliases\n token COMMENT \/^[ \\t]*(#.*?)?\\n\/ = '#\\n'\n token COMMA \/,[ \\t]+(\\n[ \\t]+)?\/ = ', '\n token NAME \/([^ \\t\\n#:@]+|\"[^\"]*\")\/ = 'missing' # \"\n token COLON \/:[ \\t]+\/ = ':'\n token EOL \/[ \\t]*\\n\/ = '\\n'\n\n file: (comment | alias)*\n\n comment: COMMENT\n\n alias: [ seq 'alias' .\n [ label 'name' . store NAME ] .\n COLON .\n counter 'values' .\n [ label 'values' .\n [ seq 'values' . store ... ] .\n ([COMMA . seq 'values' . store ...])*\n ]\n ] . EOL\nend\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c360a3ed24c6f440c689743c88654f8c7637d609","subject":"Add some doc to pg_hba.aug","message":"Add some doc to pg_hba.aug\n","repos":"manandbytes\/augeas,raphink\/augeas,mlichvar\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jjlin\/augeas,ptoscano\/augeas,lutter\/augeas,hercules-team\/augeas,jtopjian\/augeas,ptoscano\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,kunkku\/augeas,jtopjian\/augeas,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,jjlin\/augeas,domcleal\/augeas,hercules-team\/augeas,kunkku\/augeas,jasperla\/augeas,pevalme\/augeas,manandbytes\/augeas,kumy\/augeas,pevalme\/augeas,lutter\/augeas,domcleal\/augeas,lutter\/augeas,kunkku\/augeas,pevalme\/augeas,dafugg\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,mlichvar\/augeas,dafugg\/augeas,mchf\/augeas,raphink\/augeas,MikaelSmith\/augeas,kumy\/augeas","old_file":"lenses\/pg_hba.aug","new_file":"lenses\/pg_hba.aug","new_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:\\.]+(\\\/[0-9]+|[ \\t]+[0-9\\.]+)\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:\\.]+(\\\/[0-9]+|[ \\t]+[0-9\\.]+)\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6b91669c38fc5159767e21acc325e9b45598d4f5","subject":"Add hourly schedule to logrotate lens. (#655)","message":"Add hourly schedule to logrotate lens. (#655)\n\nHourly is a valid logrotate schedule value.","repos":"ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,hercules-team\/augeas,mlichvar\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas","old_file":"lenses\/logrotate.aug","new_file":"lenses\/logrotate.aug","new_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Sep.space\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = Rx.relinteger\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = Quote.do_quote_opt (store \/\\\/[^\"',#= \\n\\t{}]+\/)\n let size = num . \/[kMG]?\/\n\n let indent = del Rx.opt_space \"\\t\"\n\n (* define omments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) = [ label kw . store select ]\n let value_to_eol (kw:string) (value:regexp) = Build.key_value kw sep_val (store value)\n let flag_to_eol (kw:string) = Build.flag kw\n let list_to_eol (kw:string) = [ key kw . list_item+ ]\n\n\n (* Defaults *)\n\n let create =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"create\" .\n ( mode | mode . owner | mode . owner . group )? ]\n\n let su =\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"su\" .\n ( owner | owner . group )? ]\n\n let tabooext = [ key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ ]\n\n let attrs = select_to_eol \"schedule\" \/(hourly|daily|weekly|monthly|yearly)\/\n | value_to_eol \"rotate\" num\n | create\n | flag_to_eol \"nocreate\"\n | su\n | value_to_eol \"include\" word\n | select_to_eol \"missingok\" \/(no)?missingok\/\n | select_to_eol \"compress\" \/(no)?compress\/\n | select_to_eol \"delaycompress\" \/(no)?delaycompress\/\n | select_to_eol \"ifempty\" \/(not)?ifempty\/\n | select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/\n | value_to_eol \"size\" size\n | tabooext\n | value_to_eol \"olddir\" word\n | flag_to_eol \"noolddir\"\n | value_to_eol \"mail\" word\n | flag_to_eol \"mailfirst\"\n | flag_to_eol \"maillast\"\n | flag_to_eol \"nomail\"\n | value_to_eol \"errors\" word\n | value_to_eol \"extension\" word\n | select_to_eol \"dateext\" \/(no)?dateext\/\n | value_to_eol \"dateformat\" word\n | flag_to_eol \"dateyesterday\"\n | value_to_eol \"compresscmd\" word\n | value_to_eol \"uncompresscmd\" word\n | value_to_eol \"compressext\" word\n | list_to_eol \"compressoptions\"\n | select_to_eol \"copy\" \/(no)?copy\/\n | select_to_eol \"copytruncate\" \/(no)?copytruncate\/\n | value_to_eol \"maxage\" num\n | value_to_eol \"minsize\" size\n | value_to_eol \"maxsize\" size\n | select_to_eol \"shred\" \/(no)?shred\/\n | value_to_eol \"shredcycles\" num\n | value_to_eol \"start\" num\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . Util.del_str \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ key hook_names . eol .\n hook_lines? .\n del \/[ \\t]*endscript\/ \"\\tendscript\" ]\n\n (* Define rule *)\n\n let body = Build.block_newlines\n (indent . (attrs | hooks) . eol)\n Util.comment\n\n let rule =\n let filename_entry = [ label \"file\" . filename ] in\n let filename_sep = del \/[ \\t\\n]+\/ \" \" in\n let filenames = Build.opt_list filename_entry filename_sep in\n [ label \"rule\" . Util.indent . filenames . body . eol ]\n\n let lns = ( comment | empty | (attrs . eol) | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Sep.space\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = Rx.relinteger\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = Quote.do_quote_opt (store \/\\\/[^\"',#= \\n\\t{}]+\/)\n let size = num . \/[kMG]?\/\n\n let indent = del Rx.opt_space \"\\t\"\n\n (* define omments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) = [ label kw . store select ]\n let value_to_eol (kw:string) (value:regexp) = Build.key_value kw sep_val (store value)\n let flag_to_eol (kw:string) = Build.flag kw\n let list_to_eol (kw:string) = [ key kw . list_item+ ]\n\n\n (* Defaults *)\n\n let create =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"create\" .\n ( mode | mode . owner | mode . owner . group )? ]\n\n let su =\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"su\" .\n ( owner | owner . group )? ]\n\n let tabooext = [ key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ ]\n\n let attrs = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/\n | value_to_eol \"rotate\" num\n | create\n | flag_to_eol \"nocreate\"\n | su\n | value_to_eol \"include\" word\n | select_to_eol \"missingok\" \/(no)?missingok\/\n | select_to_eol \"compress\" \/(no)?compress\/\n | select_to_eol \"delaycompress\" \/(no)?delaycompress\/\n | select_to_eol \"ifempty\" \/(not)?ifempty\/\n | select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/\n | value_to_eol \"size\" size\n | tabooext\n | value_to_eol \"olddir\" word\n | flag_to_eol \"noolddir\"\n | value_to_eol \"mail\" word\n | flag_to_eol \"mailfirst\"\n | flag_to_eol \"maillast\"\n | flag_to_eol \"nomail\"\n | value_to_eol \"errors\" word\n | value_to_eol \"extension\" word\n | select_to_eol \"dateext\" \/(no)?dateext\/\n | value_to_eol \"dateformat\" word\n | flag_to_eol \"dateyesterday\"\n | value_to_eol \"compresscmd\" word\n | value_to_eol \"uncompresscmd\" word\n | value_to_eol \"compressext\" word\n | list_to_eol \"compressoptions\"\n | select_to_eol \"copy\" \/(no)?copy\/\n | select_to_eol \"copytruncate\" \/(no)?copytruncate\/\n | value_to_eol \"maxage\" num\n | value_to_eol \"minsize\" size\n | value_to_eol \"maxsize\" size\n | select_to_eol \"shred\" \/(no)?shred\/\n | value_to_eol \"shredcycles\" num\n | value_to_eol \"start\" num\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . Util.del_str \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ key hook_names . eol .\n hook_lines? .\n del \/[ \\t]*endscript\/ \"\\tendscript\" ]\n\n (* Define rule *)\n\n let body = Build.block_newlines\n (indent . (attrs | hooks) . eol)\n Util.comment\n\n let rule =\n let filename_entry = [ label \"file\" . filename ] in\n let filename_sep = del \/[ \\t\\n]+\/ \" \" in\n let filenames = Build.opt_list filename_entry filename_sep in\n [ label \"rule\" . Util.indent . filenames . body . eol ]\n\n let lns = ( comment | empty | (attrs . eol) | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5ed8632c4b98bd734f8927d36b6ca0821d3147e1","subject":"Add flag_line to build.aug","message":"Add flag_line to build.aug\n","repos":"kunkku\/augeas,lutter\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas,kunkku\/augeas,domcleal\/augeas,lutter\/augeas,ptoscano\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,manandbytes\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,jjlin\/augeas,pevalme\/augeas,jjlin\/augeas,dafugg\/augeas,mlichvar\/augeas,mchf\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,hercules-team\/augeas,ptoscano\/augeas,mchf\/augeas,raphink\/augeas,pevalme\/augeas,jasperla\/augeas,raphink\/augeas,kumy\/augeas,kumy\/augeas,kumy\/augeas,jtopjian\/augeas,pevalme\/augeas,dafugg\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,domcleal\/augeas,jjlin\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/build.aug","new_file":"lenses\/build.aug","new_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n","old_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4d2c62c3528ec9c524ed941acadd7e232422b56d","subject":"Cleanup unused code in lens","message":"Cleanup unused code in lens\n","repos":"camptocamp\/puppet-puppetserver,roman-mueller\/puppet-puppetserver,olivierHa\/puppet-puppetserver,camptocamp\/puppet-puppetserver,olivierHa\/puppet-puppetserver,roman-mueller\/puppet-puppetserver","old_file":"files\/lenses\/trapperkeeper.aug","new_file":"files\/lenses\/trapperkeeper.aug","new_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\nlet opt_dquot (lns:lens) = del \/\"?\/ \"\" . lns . del \/\"?\/ \"\"\n\n(* View: simple *)\nlet simple = [ Util.indent . label \"@simple\" . opt_dquot (store \/[A-Za-z0-9_.\\\/-]+\/) . sep_with_spc\n . [ label \"@value\" . opt_dquot (store \/[^,\"\\[ \\t\\n]+\/) ]\n . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . opt_dquot (store \/[^,\"\\[ \\t\\n]+\/) ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . label \"@array\" . store Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . label \"@hash\" . store Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\"\n . incl \"\/etc\/puppetlabs\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del \/[ \\t]*\/ \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\nlet opt_dquot (lns:lens) = del \/\"?\/ \"\" . lns . del \/\"?\/ \"\"\n\n(* View: simple *)\nlet simple = [ Util.indent . label \"@simple\" . opt_dquot (store \/[A-Za-z0-9_.\\\/-]+\/) . sep_with_spc\n . [ label \"@value\" . opt_dquot (store \/[^,\"\\[ \\t\\n]+\/) ]\n . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . opt_dquot (store \/[^,\"\\[ \\t\\n]+\/) ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . label \"@array\" . store Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . label \"@hash\" . store Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\"\n . incl \"\/etc\/puppetlabs\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"78992c5de5c6c6828fd6c857c310023f6f4e9016","subject":"Use the Quote module in openvpn.aug","message":"Use the Quote module in openvpn.aug\n","repos":"hercules-team\/augeas-do-not-use,lutter\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,mchf\/augeas,mlichvar\/augeas,mchf\/augeas,hercules-team\/augeas,jtopjian\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas,pevalme\/augeas,kumy\/augeas,ptoscano\/augeas,jtopjian\/augeas,kunkku\/augeas,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas,dafugg\/augeas,dafugg\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,raphink\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,mlichvar\/augeas,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,jasperla\/augeas,pevalme\/augeas,raphink\/augeas,MikaelSmith\/augeas,kumy\/augeas,manandbytes\/augeas,lutter\/augeas,kunkku\/augeas","old_file":"lenses\/openvpn.aug","new_file":"lenses\/openvpn.aug","new_contents":"(* OpenVPN module for Augeas\n Author: Raphael Pinson <raphink@gmail.com>\n\n Reference: http:\/\/openvpn.net\/index.php\/documentation\/howto.html\n*)\n\n\nmodule OpenVPN =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet indent = Util.indent\n\n(* Define separators *)\nlet sep = Util.del_ws_spc\n\n(* Define value regexps *)\nlet ip_re = Rx.ipv4\nlet num_re = Rx.integer\nlet fn_re = \/[^#; \\t\\n][^#;\\n]*[^#; \\t\\n]|[^#; \\t\\n]\/\nlet an_re = \/[a-z][a-z0-9_-]*\/\n\n(* Define store aliases *)\nlet ip = store ip_re\nlet num = store num_re\nlet filename = store fn_re\nlet sto_to_dquote = store \/[^\"\\n]+\/ (* \" Emacs, relax *)\n\n(* define comments and empty lines *)\nlet comment = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \"# \"\nlet comment_or_eol = eol | Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \" # \"\n\nlet empty = Util.empty\n\n\n(************************************************************************\n * SINGLE VALUES\n *\n * - local => IP\n * - port => num\n * - proto => tcp|udp\n * - dev => (tun|tap)\\d*\n * - dev-node => MyTap\n * - ca => filename\n * - cert => filename\n * - key => filename\n * - dh => filename\n * - ifconfig-pool-persist => filename\n * - learn-address => filename\n * - cipher => [A-Z0-9-]+\n * - max-clients => num\n * - user => alphanum\n * - group => alphanum\n * - status => filename\n * - log => filename\n * - log-append => filename\n * - verb => num\n * - mute => num\n * - ns-cert-type => \"server\"\n * - resolv-retry => \"infinite\"\n *************************************************************************)\n\nlet single_ip = \"local\"\nlet single_num = \"port\"\n | \"max-clients\"\n | \"verb\"\n\t | \"mute\"\nlet single_fn = \"ca\"\n | \"cert\"\n\t | \"key\"\n\t | \"dh\"\n\t | \"ifconfig-pool-persist\"\n\t | \"learn-address\"\n\t | \"status\"\n\t | \"log\"\n\t | \"log-append\"\nlet single_an = \"user\"\n | \"group\"\n\n\nlet single_entry (kw:regexp) (re:regexp)\n = [ key kw . sep . store re . comment_or_eol ]\n\nlet single = single_entry single_num num_re\n \t | single_entry single_fn fn_re\n\t | single_entry single_an an_re\n\t | single_entry \"local\" ip_re\n\t | single_entry \"proto\" \/(tcp|udp)\/\n | single_entry \"dev\" \/(tun|tap)[0-9]*\/\n\t | single_entry \"dev-node\" \"MyTap\"\n\t | single_entry \"cipher\" \/[A-Z][A-Z0-9-]*\/\n\t | single_entry \"ns-cert-type\" \"server\"\n\t | single_entry \"resolv-retry\" \"infinite\"\n\n\n(************************************************************************\n * FLAGS\n *\n * - client-to-client\n * - duplicate-cn\n * - comp-lzo\n * - persist-key\n * - persist-tun\n * - client\n * - remote-random\n * - nobind\n * - mute-replay-warnings\n * - http-proxy-retry\n *************************************************************************)\n\nlet flag_words = \"client-to-client\"\n | \"duplicate-cn\"\n\t | \"comp-lzo\"\n\t | \"persist-key\"\n\t | \"persist-tun\"\n\t | \"client\"\n\t | \"remote-random\"\n\t | \"nobind\"\n\t | \"mute-replay-warnings\"\n\t | \"http-proxy-retry\"\n\nlet flag_entry (kw:regexp)\n = [ key kw . comment_or_eol ]\n\nlet flag = flag_entry flag_words\n\n\n(************************************************************************\n * OTHER FIELDS\n *\n * - server => IP IP\n * - server-bridge => IP IP IP IP\n * - push => \"string\"\n * - keepalive => num num\n * - tls-auth => filename [01]\n * - remote => hostname\/IP num\n *************************************************************************)\n\nlet server = [ key \"server\" . sep\n . [ label \"address\" . ip ] . sep\n\t\t . [ label \"netmask\" . ip ] . comment_or_eol\n\t\t ]\n\nlet server_bridge = [ key \"server-bridge\" . sep\n . [ label \"address\" . ip ] . sep\n\t\t . [ label \"netmask\" . ip ] . sep\n\t\t . [ label \"start\" . ip ] . sep\n\t\t . [ label \"end\" . ip ] . comment_or_eol\n\t\t ]\n\nlet push = [ key \"push\" . sep\n . Quote.do_dquote sto_to_dquote\n\t\t . comment_or_eol\n ]\n\nlet keepalive = [ key \"keepalive\" . sep\n . [ label \"ping\" . num ] . sep\n\t\t . [ label \"timeout\" . num ] . comment_or_eol\n ]\n\nlet tls_auth = [ key \"tls-auth\" . sep\n . [ label \"key\" . filename ] . sep\n\t\t . [ label \"is_client\" . store \/[01]\/ ] . comment_or_eol\n ]\n\nlet remote = [ key \"remote\" . sep\n . [ label \"server\" . filename ] . sep\n\t\t . [ label \"port\" . num ] . comment_or_eol\n\t\t ]\n\nlet http_proxy = [ key \"http-proxy\" .\n ( sep . [ label \"server\" . store \/[A-Za-z0-9._-]+\/ ] .\n\t\t ( sep . [ label \"port\" . num ] )? )?\n\t\t . comment_or_eol\n\t\t ]\n\nlet other = server\n | server_bridge\n | push\n\t\t | keepalive\n\t\t | tls_auth\n\t\t | remote\n\t\t | http_proxy\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = ( comment | empty | single | flag | other )*\n\nlet filter = (incl \"\/etc\/openvpn\/client.conf\")\n . (incl \"\/etc\/openvpn\/server.conf\")\n\nlet xfm = transform lns filter\n\n\n\n","old_contents":"(* OpenVPN module for Augeas\n Author: Raphael Pinson <raphink@gmail.com>\n\n Reference: http:\/\/openvpn.net\/index.php\/documentation\/howto.html\n*)\n\n\nmodule OpenVPN =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet indent = Util.indent\n\n(* Define separators *)\nlet sep = Util.del_ws_spc\nlet sep_dquote = Util.del_str \"\\\"\"\n\n(* Define value regexps *)\nlet ip_re = Rx.ipv4\nlet num_re = Rx.integer\nlet fn_re = \/[^#; \\t\\n][^#;\\n]*[^#; \\t\\n]|[^#; \\t\\n]\/\nlet an_re = \/[a-z][a-z0-9_-]*\/\n\n(* Define store aliases *)\nlet ip = store ip_re\nlet num = store num_re\nlet filename = store fn_re\nlet sto_to_dquote = store \/[^\"\\n]+\/ (* \" Emacs, relax *)\n\n(* define comments and empty lines *)\nlet comment = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \"# \"\nlet comment_or_eol = eol | Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \" # \"\n\nlet empty = Util.empty\n\n\n(************************************************************************\n * SINGLE VALUES\n *\n * - local => IP\n * - port => num\n * - proto => tcp|udp\n * - dev => (tun|tap)\\d*\n * - dev-node => MyTap\n * - ca => filename\n * - cert => filename\n * - key => filename\n * - dh => filename\n * - ifconfig-pool-persist => filename\n * - learn-address => filename\n * - cipher => [A-Z0-9-]+\n * - max-clients => num\n * - user => alphanum\n * - group => alphanum\n * - status => filename\n * - log => filename\n * - log-append => filename\n * - verb => num\n * - mute => num\n * - ns-cert-type => \"server\"\n * - resolv-retry => \"infinite\"\n *************************************************************************)\n\nlet single_ip = \"local\"\nlet single_num = \"port\"\n | \"max-clients\"\n | \"verb\"\n\t | \"mute\"\nlet single_fn = \"ca\"\n | \"cert\"\n\t | \"key\"\n\t | \"dh\"\n\t | \"ifconfig-pool-persist\"\n\t | \"learn-address\"\n\t | \"status\"\n\t | \"log\"\n\t | \"log-append\"\nlet single_an = \"user\"\n | \"group\"\n\n\nlet single_entry (kw:regexp) (re:regexp)\n = [ key kw . sep . store re . comment_or_eol ]\n\nlet single = single_entry single_num num_re\n \t | single_entry single_fn fn_re\n\t | single_entry single_an an_re\n\t | single_entry \"local\" ip_re\n\t | single_entry \"proto\" \/(tcp|udp)\/\n | single_entry \"dev\" \/(tun|tap)[0-9]*\/\n\t | single_entry \"dev-node\" \"MyTap\"\n\t | single_entry \"cipher\" \/[A-Z][A-Z0-9-]*\/\n\t | single_entry \"ns-cert-type\" \"server\"\n\t | single_entry \"resolv-retry\" \"infinite\"\n\n\n(************************************************************************\n * FLAGS\n *\n * - client-to-client\n * - duplicate-cn\n * - comp-lzo\n * - persist-key\n * - persist-tun\n * - client\n * - remote-random\n * - nobind\n * - mute-replay-warnings\n * - http-proxy-retry\n *************************************************************************)\n\nlet flag_words = \"client-to-client\"\n | \"duplicate-cn\"\n\t | \"comp-lzo\"\n\t | \"persist-key\"\n\t | \"persist-tun\"\n\t | \"client\"\n\t | \"remote-random\"\n\t | \"nobind\"\n\t | \"mute-replay-warnings\"\n\t | \"http-proxy-retry\"\n\nlet flag_entry (kw:regexp)\n = [ key kw . comment_or_eol ]\n\nlet flag = flag_entry flag_words\n\n\n(************************************************************************\n * OTHER FIELDS\n *\n * - server => IP IP\n * - server-bridge => IP IP IP IP\n * - push => \"string\"\n * - keepalive => num num\n * - tls-auth => filename [01]\n * - remote => hostname\/IP num\n *************************************************************************)\n\nlet server = [ key \"server\" . sep\n . [ label \"address\" . ip ] . sep\n\t\t . [ label \"netmask\" . ip ] . comment_or_eol\n\t\t ]\n\nlet server_bridge = [ key \"server-bridge\" . sep\n . [ label \"address\" . ip ] . sep\n\t\t . [ label \"netmask\" . ip ] . sep\n\t\t . [ label \"start\" . ip ] . sep\n\t\t . [ label \"end\" . ip ] . comment_or_eol\n\t\t ]\n\nlet push = [ key \"push\" . sep\n . sep_dquote\n\t\t . sto_to_dquote\n\t\t . sep_dquote\n\t\t . comment_or_eol\n ]\n\nlet keepalive = [ key \"keepalive\" . sep\n . [ label \"ping\" . num ] . sep\n\t\t . [ label \"timeout\" . num ] . comment_or_eol\n ]\n\nlet tls_auth = [ key \"tls-auth\" . sep\n . [ label \"key\" . filename ] . sep\n\t\t . [ label \"is_client\" . store \/[01]\/ ] . comment_or_eol\n ]\n\nlet remote = [ key \"remote\" . sep\n . [ label \"server\" . filename ] . sep\n\t\t . [ label \"port\" . num ] . comment_or_eol\n\t\t ]\n\nlet http_proxy = [ key \"http-proxy\" .\n ( sep . [ label \"server\" . store \/[A-Za-z0-9._-]+\/ ] .\n\t\t ( sep . [ label \"port\" . num ] )? )?\n\t\t . comment_or_eol\n\t\t ]\n\nlet other = server\n | server_bridge\n | push\n\t\t | keepalive\n\t\t | tls_auth\n\t\t | remote\n\t\t | http_proxy\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = ( comment | empty | single | flag | other )*\n\nlet filter = (incl \"\/etc\/openvpn\/client.conf\")\n . (incl \"\/etc\/openvpn\/server.conf\")\n\nlet xfm = transform lns filter\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"097c6f3cf09039347f911d3c21cafd38a3bbb8ea","subject":"Shellvars.lns: add unit test for continued lines in double quoted values","message":"Shellvars.lns: add unit test for continued lines in double quoted values\n","repos":"jjlin\/augeas,raphink\/augeas,jjlin\/augeas,kunkku\/augeas,hercules-team\/augeas,lutter\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,raphink\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,manandbytes\/augeas,dafugg\/augeas,ptoscano\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,mchf\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas,pevalme\/augeas,mlichvar\/augeas,kunkku\/augeas,dafugg\/augeas,ptoscano\/augeas,jtopjian\/augeas,pevalme\/augeas,MikaelSmith\/augeas,jasperla\/augeas,jasperla\/augeas,jtopjian\/augeas,mchf\/augeas,mlichvar\/augeas,ptoscano\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\" = \"f\" } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\" = \"f\" } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\" = \"*debug*\"\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\" = \"${!LC_*}\" }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { }\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n # \n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\\\\\\\ntest \\\\\\\\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\\\\\ntest \\\\\\\\\\ntest2\\\"\" }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\" = \"f\" } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\" = \"f\" } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\" = \"*debug*\"\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\" = \"${!LC_*}\" }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { }\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n # \n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9448e84ba0965322278a40fb4a9e8a785cade331","subject":"Sshd: Also make Host entries case-insensitive","message":"Sshd: Also make Host entries case-insensitive\n","repos":"lutter\/augeas,pevalme\/augeas,MikaelSmith\/augeas,jasperla\/augeas,raphink\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,lutter\/augeas,jjlin\/augeas,dafugg\/augeas,jjlin\/augeas,jasperla\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,mchf\/augeas,hercules-team\/augeas,pevalme\/augeas,jjlin\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,hercules-team\/augeas,jtopjian\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,mlichvar\/augeas,ptoscano\/augeas,raphink\/augeas,mchf\/augeas,kunkku\/augeas,dafugg\/augeas,ptoscano\/augeas,manandbytes\/augeas","old_file":"lenses\/ssh.aug","new_file":"lenses\/ssh.aug","new_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let spc = Util.del_ws_spc\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_spc = store \/[^ \\t\\n]+\/\n let value_to_comma = store \/[^, \\t\\n]+\/\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n let array_entry (k:regexp) =\n [ indent . key k . counter \"array_entry\"\n . [ spc . seq \"array_entry\" . value_to_spc]* . eol ]\n\n let commas_entry (k:regexp) =\n\t [ key k . counter \"commas_entry\" . spc .\n\t [ seq \"commas_entry\" . value_to_comma]\n . ([ seq \"commas_entry\" . comma . value_to_comma])* . eol ]\n\n let fw_entry (k:regexp) = [ indent . key k . spc .\n\t [ key \/[^ \\t\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let send_env = array_entry \/SendEnv\/i\n\n let proxy_command = [ indent . key \/ProxyCommand\/i . spc . value_to_eol . eol ]\n\n let remote_fw = fw_entry \/RemoteForward\/i\n let local_fw = fw_entry \/LocalForward\/i\n\n let ciphers = commas_entry \/Ciphers\/i\n let macs\t= commas_entry \/MACs\/i\n\n let special_entry = send_env\n\t | proxy_command\n\t | remote_fw\n\t | local_fw\n\t | macs\n\t | ciphers\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/i\n\n\n let other_entry = [ indent . key key_re\n . spc . value_to_spc . eol ]\n\n let entry = comment | empty\n | special_entry\n\t | other_entry\n\n let host = [ key \/Host\/i . spc . value_to_eol . eol . entry* ]\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","old_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let spc = Util.del_ws_spc\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_spc = store \/[^ \\t\\n]+\/\n let value_to_comma = store \/[^, \\t\\n]+\/\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n let array_entry (k:regexp) =\n [ indent . key k . counter \"array_entry\"\n . [ spc . seq \"array_entry\" . value_to_spc]* . eol ]\n\n let commas_entry (k:regexp) =\n\t [ key k . counter \"commas_entry\" . spc .\n\t [ seq \"commas_entry\" . value_to_comma]\n . ([ seq \"commas_entry\" . comma . value_to_comma])* . eol ]\n\n let fw_entry (k:regexp) = [ indent . key k . spc .\n\t [ key \/[^ \\t\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let send_env = array_entry \/SendEnv\/i\n\n let proxy_command = [ indent . key \/ProxyCommand\/i . spc . value_to_eol . eol ]\n\n let remote_fw = fw_entry \/RemoteForward\/i\n let local_fw = fw_entry \/LocalForward\/i\n\n let ciphers = commas_entry \/Ciphers\/i\n let macs\t= commas_entry \/MACs\/i\n\n let special_entry = send_env\n\t | proxy_command\n\t | remote_fw\n\t | local_fw\n\t | macs\n\t | ciphers\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/i\n\n\n let other_entry = [ indent . key key_re\n . spc . value_to_spc . eol ]\n\n let entry = comment | empty\n | special_entry\n\t | other_entry\n\n let host = [ key \"Host\" . spc . value_to_eol . eol . entry* ]\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"94e636df15b9c1957a375aa9c92e67a6c0f21ae0","subject":"httpd: include \/etc\/httpd\/conf.modules.d","message":"httpd: include \/etc\/httpd\/conf.modules.d\n\nFedora\/RHEL uses this directory for modules config.\n","repos":"lutter\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,mlichvar\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas,hercules-team\/augeas","old_file":"lenses\/httpd.aug","new_file":"lenses\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* The continuation sequence that indicates that we should consider the\n * next line part of the current line *)\nlet cont = \/\\\\\\\\\\r?\\n\/\n\n(* Whitespace within a line: space, tab, and the continuation sequence *)\nlet ws = \/[ \\t]\/ | cont\n\n(* Any possible character - '.' does not match \\n *)\nlet any = \/(.|\\n)\/\n\n(* Any character preceded by a backslash *)\nlet esc_any = \/\\\\\\\\(.|\\n)\/\n\n(* Newline sequence - both for Unix and DOS newlines *)\nlet nl = \/\\r?\\n\/\n\n(* Whitespace at the end of a line *)\nlet eol = del (ws* . nl) \"\\n\"\n\n(* deal with continuation lines *)\nlet sep_spc = del ws+ \" \"\nlet sep_osp = del ws* \"\"\nlet sep_eq = del (ws* . \"=\" . ws*) \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-z][a-z0-9._-]*\/i\n\n(* A complete line that is either just whitespace or a comment that only\n * contains whitespace *)\nlet empty = [ del (ws* . \/#?\/ . ws* . nl) \"\\n\" ]\n\nlet indent = Util.indent\n\n(* A comment that is not just whitespace. We define it in terms of the\n * things that are not allowed as part of such a comment:\n * 1) Starts with whitespace\n * 2) Ends with whitespace, a backslash or \\r\n * 3) Unescaped newlines\n *)\nlet comment =\n let comment_start = del (ws* . \"#\" . ws* ) \"# \" in\n let unesc_eol = \/[^\\]?\/ . nl in\n let w = \/[^\\t\\n\\r \\\\]\/ in\n let r = \/[\\r\\\\]\/ in\n let s = \/[\\t\\r ]\/ in\n (*\n * we'd like to write\n * let b = \/\\\\\\\\\/ in\n * let t = \/[\\t\\n\\r ]\/ in\n * let x = b . (t? . (s|w)* ) in\n * but the definition of b depends on commit 244c0edd in 1.9.0 and\n * would make the lens unusable with versions before 1.9.0. So we write\n * x out which works in older versions, too\n *)\n let x = \/\\\\\\\\[\\t\\n\\r ]?[^\\n\\\\]*\/ in\n let line = ((r . s* . w|w|r) . (s|w)* . x*|(r.s* )?).w.(s*.w)* in\n [ label \"#comment\" . comment_start . store line . eol ]\n\n(* borrowed from shellvars.aug *)\nlet char_arg_sec = \/([^\\\\ '\"\\t\\r\\n>]|[^ '\"\\t\\r\\n>]+[^\\\\ \\t\\r\\n>])|\\\\\\\\\"|\\\\\\\\'|\\\\\\\\ \/\nlet char_arg_wl = \/([^\\\\ '\"},\\t\\r\\n]|[^ '\"},\\t\\r\\n]+[^\\\\ '\"},\\t\\r\\n])\/\n\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|esc_any)* . \/\"\/\nlet dquot_msg =\n let no_dquot = \/([^ \\t\"\\\\\\r\\n]|[^\"\\\\\\r\\n]+[^ \\t\"\\\\\\r\\n])\/\n in \/\"\/ . (no_dquot|esc_any)* . no_dquot\n\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|esc_any)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\n(* The arguments for a directive come in two flavors: quoted with single or\n * double quotes, or bare. Bare arguments may not start with a single or\n * double quote; since we also treat \"word lists\" special, i.e. lists\n * enclosed in curly braces, bare arguments may not start with those,\n * either.\n *\n * Bare arguments may not contain unescaped spaces, but we allow escaping\n * with '\\\\'. Quoted arguments can contain anything, though the quote must\n * be escaped with '\\\\'.\n *)\nlet bare = \/([^{\"' \\t\\n\\r]|\\\\\\\\.)([^ \\t\\n\\r]|\\\\\\\\.)*[^ \\t\\n\\r\\\\]|[^{\"' \\t\\n\\r\\\\]\/\n\nlet arg_quoted = [ label \"arg\" . store (dquot|squot) ]\nlet arg_bare = [ label \"arg\" . store bare ]\n\n(* message argument starts with \" but ends at EOL *)\nlet arg_dir_msg = [ label \"arg\" . store dquot_msg ]\nlet arg_wl = [ label \"arg\" . store (char_arg_wl+|dquot|squot) ]\n\n(* comma-separated wordlist as permitted in the SSLRequire directive *)\nlet arg_wordlist =\n let wl_start = dels \"{\" in\n let wl_end = dels \"}\" in\n let wl_sep = del \/[ \\t]*,[ \\t]*\/ \", \"\n in [ label \"wordlist\" . wl_start . arg_wl . (wl_sep . arg_wl)* . wl_end ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\n(* the arguments of a directive. We use this once we have parsed the name\n * of the directive, and the space right after it. When dir_args is used,\n * we also know that we have at least one argument. We need to be careful\n * with the spacing between arguments: quoted arguments and word lists do\n * not need to have space between them, but bare arguments do.\n *\n * Apache apparently is also happy if the last argument starts with a double\n * quote, but has no corresponding closing duoble quote, which is what\n * arg_dir_msg handles\n *)\nlet dir_args =\n let arg_nospc = arg_quoted|arg_wordlist in\n (arg_bare . sep_spc | arg_nospc . sep_osp)* . (arg_bare|arg_nospc|arg_dir_msg)\n\nlet directive =\n [ indent . label \"directive\" . store word . (sep_spc . dir_args)? . eol ]\n\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key (word - \/perl\/i) in\n let dword = del (word - \/perl\/i) \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \/>[ \\t\\n\\r]*\/ \">\\n\" ]\n\nlet perl_section = [ indent . label \"Perl\" . del \/<perl>\/i \"<Perl>\"\n . store \/[^<]*\/\n . del \/<\\\/perl>\/i \"<\/Perl>\" . eol ]\n\n\nlet rec content = section (content|directive)\n | perl_section\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/apache2\/vhosts.d\/*.conf\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf.modules.d\/*.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* The continuation sequence that indicates that we should consider the\n * next line part of the current line *)\nlet cont = \/\\\\\\\\\\r?\\n\/\n\n(* Whitespace within a line: space, tab, and the continuation sequence *)\nlet ws = \/[ \\t]\/ | cont\n\n(* Any possible character - '.' does not match \\n *)\nlet any = \/(.|\\n)\/\n\n(* Any character preceded by a backslash *)\nlet esc_any = \/\\\\\\\\(.|\\n)\/\n\n(* Newline sequence - both for Unix and DOS newlines *)\nlet nl = \/\\r?\\n\/\n\n(* Whitespace at the end of a line *)\nlet eol = del (ws* . nl) \"\\n\"\n\n(* deal with continuation lines *)\nlet sep_spc = del ws+ \" \"\nlet sep_osp = del ws* \"\"\nlet sep_eq = del (ws* . \"=\" . ws*) \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-z][a-z0-9._-]*\/i\n\n(* A complete line that is either just whitespace or a comment that only\n * contains whitespace *)\nlet empty = [ del (ws* . \/#?\/ . ws* . nl) \"\\n\" ]\n\nlet indent = Util.indent\n\n(* A comment that is not just whitespace. We define it in terms of the\n * things that are not allowed as part of such a comment:\n * 1) Starts with whitespace\n * 2) Ends with whitespace, a backslash or \\r\n * 3) Unescaped newlines\n *)\nlet comment =\n let comment_start = del (ws* . \"#\" . ws* ) \"# \" in\n let unesc_eol = \/[^\\]?\/ . nl in\n let w = \/[^\\t\\n\\r \\\\]\/ in\n let r = \/[\\r\\\\]\/ in\n let s = \/[\\t\\r ]\/ in\n (*\n * we'd like to write\n * let b = \/\\\\\\\\\/ in\n * let t = \/[\\t\\n\\r ]\/ in\n * let x = b . (t? . (s|w)* ) in\n * but the definition of b depends on commit 244c0edd in 1.9.0 and\n * would make the lens unusable with versions before 1.9.0. So we write\n * x out which works in older versions, too\n *)\n let x = \/\\\\\\\\[\\t\\n\\r ]?[^\\n\\\\]*\/ in\n let line = ((r . s* . w|w|r) . (s|w)* . x*|(r.s* )?).w.(s*.w)* in\n [ label \"#comment\" . comment_start . store line . eol ]\n\n(* borrowed from shellvars.aug *)\nlet char_arg_sec = \/([^\\\\ '\"\\t\\r\\n>]|[^ '\"\\t\\r\\n>]+[^\\\\ \\t\\r\\n>])|\\\\\\\\\"|\\\\\\\\'|\\\\\\\\ \/\nlet char_arg_wl = \/([^\\\\ '\"},\\t\\r\\n]|[^ '\"},\\t\\r\\n]+[^\\\\ '\"},\\t\\r\\n])\/\n\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|esc_any)* . \/\"\/\nlet dquot_msg =\n let no_dquot = \/([^ \\t\"\\\\\\r\\n]|[^\"\\\\\\r\\n]+[^ \\t\"\\\\\\r\\n])\/\n in \/\"\/ . (no_dquot|esc_any)* . no_dquot\n\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|esc_any)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\n(* The arguments for a directive come in two flavors: quoted with single or\n * double quotes, or bare. Bare arguments may not start with a single or\n * double quote; since we also treat \"word lists\" special, i.e. lists\n * enclosed in curly braces, bare arguments may not start with those,\n * either.\n *\n * Bare arguments may not contain unescaped spaces, but we allow escaping\n * with '\\\\'. Quoted arguments can contain anything, though the quote must\n * be escaped with '\\\\'.\n *)\nlet bare = \/([^{\"' \\t\\n\\r]|\\\\\\\\.)([^ \\t\\n\\r]|\\\\\\\\.)*[^ \\t\\n\\r\\\\]|[^{\"' \\t\\n\\r\\\\]\/\n\nlet arg_quoted = [ label \"arg\" . store (dquot|squot) ]\nlet arg_bare = [ label \"arg\" . store bare ]\n\n(* message argument starts with \" but ends at EOL *)\nlet arg_dir_msg = [ label \"arg\" . store dquot_msg ]\nlet arg_wl = [ label \"arg\" . store (char_arg_wl+|dquot|squot) ]\n\n(* comma-separated wordlist as permitted in the SSLRequire directive *)\nlet arg_wordlist =\n let wl_start = dels \"{\" in\n let wl_end = dels \"}\" in\n let wl_sep = del \/[ \\t]*,[ \\t]*\/ \", \"\n in [ label \"wordlist\" . wl_start . arg_wl . (wl_sep . arg_wl)* . wl_end ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\n(* the arguments of a directive. We use this once we have parsed the name\n * of the directive, and the space right after it. When dir_args is used,\n * we also know that we have at least one argument. We need to be careful\n * with the spacing between arguments: quoted arguments and word lists do\n * not need to have space between them, but bare arguments do.\n *\n * Apache apparently is also happy if the last argument starts with a double\n * quote, but has no corresponding closing duoble quote, which is what\n * arg_dir_msg handles\n *)\nlet dir_args =\n let arg_nospc = arg_quoted|arg_wordlist in\n (arg_bare . sep_spc | arg_nospc . sep_osp)* . (arg_bare|arg_nospc|arg_dir_msg)\n\nlet directive =\n [ indent . label \"directive\" . store word . (sep_spc . dir_args)? . eol ]\n\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key (word - \/perl\/i) in\n let dword = del (word - \/perl\/i) \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \/>[ \\t\\n\\r]*\/ \">\\n\" ]\n\nlet perl_section = [ indent . label \"Perl\" . del \/<perl>\/i \"<Perl>\"\n . store \/[^<]*\/\n . del \/<\\\/perl>\/i \"<\/Perl>\" . eol ]\n\n\nlet rec content = section (content|directive)\n | perl_section\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/apache2\/vhosts.d\/*.conf\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a543189524d97d980d0724529173a71ee510b1b0","subject":"Fix sudoers lens: \"always_query_group_plugin\" (#588)","message":"Fix sudoers lens: \"always_query_group_plugin\" (#588)\n\nThe option is now enabled by default in the default sudoers of\r\nRHEL 7.6 (and probably soon CentOS 7).","repos":"ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,kunkku\/augeas,hercules-team\/augeas,kunkku\/augeas,ptoscano\/augeas,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas,mlichvar\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitly to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Sep.space\n\n(* Variable: sep_cont *)\nlet sep_cont = Sep.cl_or_space\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = Sep.cl_or_opt_space\n\n(* Variable: sep_cont_opt_build *)\nlet sep_cont_opt_build (sep:string) =\n del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (\" \" . sep . \" \")\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt_build \",\"\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt_build \"=\"\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt_build \":\"\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n(* Group: Negation expressions *)\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\n(************************************************************************\n * View: negate_or_value\n * A <del_negate>, followed by either a negated key, or a key\/value pair\n *************************************************************************)\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\n\nlet sto_to_com_cmnd = del_negate . negate_node? . (\n let alias = Rx.word - \/(NO)?(PASSWD|EXEC|SETENV)\/\n in let non_alias = \/[\\\/a-z]([^,:#()\\n\\\\]|\\\\\\\\[=:,\\\\])*[^,=:#() \\t\\n\\\\]|[^,=:#() \\t\\n\\\\]\/\n in store (alias | non_alias))\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces and NIS domains and allowed*)\nlet sto_to_com_user =\n let nis_re = \/([A-Z]([-A-Z0-9]|(\\\\\\\\[ \\t]))*+\\\\\\\\\\\\\\\\)\/\n in let user_re = \/[%+@a-z]([-A-Za-z0-9._+]|(\\\\\\\\[ \\t]))*\/\n in let alias_re = \/[A-Z_]+\/\n in store ((nis_re? . user_re) | alias_re)\n\n(* Variable: to_com_chars *)\nlet to_com_chars = \/[^\",=#() \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: to_com_dquot *)\nlet to_com_dquot = \/\"[^\",=#()\\n\\\\]+\"\/ (* \" relax emacs *)\n\n(* Variable: sto_to_com_dquot *)\nlet sto_to_com_dquot = store (to_com_chars|to_com_dquot)\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store to_com_chars\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\]+|\"[^\", \\t\\n\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n Build.opt_list (alias_field kw sto) sep_com\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '!' Cmnd_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:!>][^ \\t\\n\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\" | \"closefrom_override\"\n | \"closefrom_override\" | \"compress_io\" | \"fast_glob\"\n | \"log_input\" | \"log_output\" | \"pwfeedback\"\n | \"umask_override\" | \"use_pty\" | \"match_group_by_gid\"\n | \"always_query_group_plugin\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . sto_to_com_dquot ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"mailfrom\" \n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_dquot)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list> for listing\n * users and\/or groups used to run a command\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')' |\n * > '(:' Runas_List ')' |\n * > '(' Runas_List ':' Runas_List ')'\n *************************************************************************)\nlet runas_spec_user = alias_list \"runas_user\" sto_to_com\nlet runas_spec_group = Util.del_str \":\" . indent\n . alias_list \"runas_group\" sto_to_com\n\nlet runas_spec_usergroup = runas_spec_user . indent . runas_spec_group\n\nlet runas_spec = Util.del_str \"(\"\n . (runas_spec_user\n | runas_spec_group\n | runas_spec_usergroup )\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = Build.opt_list cmnd_spec sep_com\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . Build.opt_list spec_list sep_col\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitly to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Sep.space\n\n(* Variable: sep_cont *)\nlet sep_cont = Sep.cl_or_space\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = Sep.cl_or_opt_space\n\n(* Variable: sep_cont_opt_build *)\nlet sep_cont_opt_build (sep:string) =\n del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (\" \" . sep . \" \")\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt_build \",\"\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt_build \"=\"\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt_build \":\"\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n(* Group: Negation expressions *)\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\n(************************************************************************\n * View: negate_or_value\n * A <del_negate>, followed by either a negated key, or a key\/value pair\n *************************************************************************)\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\n\nlet sto_to_com_cmnd = del_negate . negate_node? . (\n let alias = Rx.word - \/(NO)?(PASSWD|EXEC|SETENV)\/\n in let non_alias = \/[\\\/a-z]([^,:#()\\n\\\\]|\\\\\\\\[=:,\\\\])*[^,=:#() \\t\\n\\\\]|[^,=:#() \\t\\n\\\\]\/\n in store (alias | non_alias))\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces and NIS domains and allowed*)\nlet sto_to_com_user =\n let nis_re = \/([A-Z]([-A-Z0-9]|(\\\\\\\\[ \\t]))*+\\\\\\\\\\\\\\\\)\/\n in let user_re = \/[%+@a-z]([-A-Za-z0-9._+]|(\\\\\\\\[ \\t]))*\/\n in let alias_re = \/[A-Z_]+\/\n in store ((nis_re? . user_re) | alias_re)\n\n(* Variable: to_com_chars *)\nlet to_com_chars = \/[^\",=#() \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: to_com_dquot *)\nlet to_com_dquot = \/\"[^\",=#()\\n\\\\]+\"\/ (* \" relax emacs *)\n\n(* Variable: sto_to_com_dquot *)\nlet sto_to_com_dquot = store (to_com_chars|to_com_dquot)\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store to_com_chars\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\]+|\"[^\", \\t\\n\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n Build.opt_list (alias_field kw sto) sep_com\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '!' Cmnd_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:!>][^ \\t\\n\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\" | \"closefrom_override\"\n | \"closefrom_override\" | \"compress_io\" | \"fast_glob\"\n | \"log_input\" | \"log_output\" | \"pwfeedback\"\n | \"umask_override\" | \"use_pty\" | \"match_group_by_gid\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . sto_to_com_dquot ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"mailfrom\" \n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_dquot)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list> for listing\n * users and\/or groups used to run a command\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')' |\n * > '(:' Runas_List ')' |\n * > '(' Runas_List ':' Runas_List ')'\n *************************************************************************)\nlet runas_spec_user = alias_list \"runas_user\" sto_to_com\nlet runas_spec_group = Util.del_str \":\" . indent\n . alias_list \"runas_group\" sto_to_com\n\nlet runas_spec_usergroup = runas_spec_user . indent . runas_spec_group\n\nlet runas_spec = Util.del_str \"(\"\n . (runas_spec_user\n | runas_spec_group\n | runas_spec_usergroup )\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = Build.opt_list cmnd_spec sep_com\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . Build.opt_list spec_list sep_col\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b5acb7e2ad4dab8c2c2176d8d11cea0f09e2f4a0","subject":"Util: add *.bak and *.old to stdexcl, to match files in \/etc\/sysconfig","message":"Util: add *.bak and *.old to stdexcl, to match files in \/etc\/sysconfig\n","repos":"jtopjian\/augeas,pevalme\/augeas,kumy\/augeas,manandbytes\/augeas,ptoscano\/augeas,domcleal\/augeas,mlichvar\/augeas,dafugg\/augeas,lutter\/augeas,jtopjian\/augeas,kunkku\/augeas,manandbytes\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,domcleal\/augeas,kumy\/augeas,kumy\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,mchf\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kunkku\/augeas,kunkku\/augeas,jjlin\/augeas,jasperla\/augeas,jjlin\/augeas,pevalme\/augeas,pevalme\/augeas,dafugg\/augeas,raphink\/augeas,domcleal\/augeas,lutter\/augeas,raphink\/augeas,jjlin\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . doseol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n(* View: empty_dos *)\n let empty_dos =\n [ del \/[ \\t]*#?[ \\t]*\/ \"\" . del \/\\r?\\n\/ \"\\n\" ]\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\") .\n (excl \"*.bak\") .\n (excl \"*.old\")\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . doseol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n(* View: empty_dos *)\n let empty_dos =\n [ del \/[ \\t]*#?[ \\t]*\/ \"\" . del \/\\r?\\n\/ \"\\n\" ]\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"db33abe069cd3b2a5ab51fd5c4c1f79cad16089a","subject":"Fix paramater into parameter in ND comment","message":"Fix paramater into parameter in ND comment\n","repos":"pevalme\/augeas,jjlin\/augeas,jjlin\/augeas,kunkku\/augeas,dafugg\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,domcleal\/augeas,pevalme\/augeas,kumy\/augeas,kumy\/augeas,jasperla\/augeas,jasperla\/augeas,mchf\/augeas,domcleal\/augeas,kumy\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jtopjian\/augeas,lutter\/augeas,ptoscano\/augeas,lutter\/augeas,manandbytes\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,domcleal\/augeas,hercules-team\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mchf\/augeas,kumy\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,raphink\/augeas,kunkku\/augeas,lutter\/augeas,ptoscano\/augeas,ptoscano\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: paramater_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2aa1383d26f93bd2c4f99266e458bb9ca7db3fb4","subject":"Sync View comment with actual definition.","message":"Sync View comment with actual definition.\n","repos":"kumy\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,manandbytes\/augeas,kumy\/augeas,jtopjian\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,jasperla\/augeas,lutter\/augeas,jtopjian\/augeas,kunkku\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jjlin\/augeas,mchf\/augeas,kumy\/augeas,lutter\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,lutter\/augeas,ptoscano\/augeas,raphink\/augeas,raphink\/augeas,pevalme\/augeas,dafugg\/augeas,jjlin\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,ptoscano\/augeas,dafugg\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,hercules-team\/augeas,mlichvar\/augeas,pevalme\/augeas,kumy\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,mlichvar\/augeas","old_file":"lenses\/cachefilesd.aug","new_file":"lenses\/cachefilesd.aug","new_contents":"(*\nModule: Cachefilesd\n Parses \/etc\/cachefilesd.conf\n\nAuthor: Pat Riehecky <riehecky@fnal.gov>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 cachefilesd.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n See <lns>.\n\nAbout: Configuration files\n This lens applies to \/etc\/cachefilesd.conf.\n\nAbout: Examples\n The <Test_Cachefilesd> file contains various examples and tests.\n*)\n\nmodule Cachefilesd =\n autoload xfm\n\n (************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* Group: Comments and empty lines *)\n\n (* View: eol *)\n let eol = Util.eol\n (* View: comment *)\n let comment = Util.comment\n (* View: empty *)\n let empty = Util.empty\n\n (* Group: separators *)\n\n (* View: space\n * Separation between key and value\n *)\n let space = Util.del_ws_spc\n\n (* View: colon\n * Separation between selinux attributes\n *)\n let colon = Sep.colon\n\n (* Group: entries *)\n\n (* View: entry_key\n * The key for an entry in the config file\n *)\n let entry_key = Rx.word\n\n (* View: entry_value\n * The value for an entry may contain all sorts of things\n *)\n let entry_value = \/[A-Za-z0-9_.-:%]+\/\n\n (* View: nocull\n * The nocull key has different syntax than the rest\n *)\n let nocull = \/nocull\/i\n\n (* Group: config *)\n\n (* View: cacheconfig\n * This is a simple \"key value\" setup\n *)\n let cacheconfig = [ key (entry_key - nocull) . space\n . store entry_value . eol ]\n\n (* View: nocull\n * This is a either present, and therefore active or missing and\n * not active\n *)\n let nocull_entry = [ key nocull . eol ]\n\n (* View: lns *)\n let lns = (empty | comment | cacheconfig | nocull_entry)*\n\n let xfm = transform lns (incl \"\/etc\/cachefilesd.conf\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Cachefilesd\n Parses \/etc\/cachefilesd.conf\n\nAuthor: Pat Riehecky <riehecky@fnal.gov>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 cachefilesd.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n See <lns>.\n\nAbout: Configuration files\n This lens applies to \/etc\/cachefilesd.conf.\n\nAbout: Examples\n The <Test_Cachefilesd> file contains various examples and tests.\n*)\n\nmodule Cachefilesd =\n autoload xfm\n\n (************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* Group: Comments and empty lines *)\n\n (* View: eol *)\n let eol = Util.eol\n (* View: comment_or_eol *)\n let comment = Util.comment\n (* View: empty *)\n let empty = Util.empty\n\n (* Group: separators *)\n\n (* View: space\n * Separation between key and value\n *)\n let space = Util.del_ws_spc\n\n (* View: colon\n * Separation between selinux attributes\n *)\n let colon = Sep.colon\n\n (* Group: entries *)\n\n (* View: entry_key\n * The key for an entry in the config file\n *)\n let entry_key = Rx.word\n\n (* View: entry_value\n * The value for an entry may contain all sorts of things\n *)\n let entry_value = \/[A-Za-z0-9_.-:%]+\/\n\n (* View: nocull\n * The nocull key has different syntax than the rest\n *)\n let nocull = \/nocull\/i\n\n (* Group: config *)\n\n (* View: cacheconfig\n * This is a simple \"key value\" setup\n *)\n let cacheconfig = [ key (entry_key - nocull) . space\n . store entry_value . eol ]\n\n (* View: nocull\n * This is a either present, and therefore active or missing and\n * not active\n *)\n let nocull_entry = [ key nocull . eol ]\n\n (* View: lns *)\n let lns = (empty | comment | cacheconfig | nocull_entry)*\n\n let xfm = transform lns (incl \"\/etc\/cachefilesd.conf\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4bd30325dc1611fb706504b04b823db98373fcf1","subject":"Dhclient: change some defaults for del","message":"Dhclient: change some defaults for del\n\nThis is really a bug in how string literals are unescaped by the lexer, but\nwe can sidestep the problem here.\n\nThe lexer bug is https:\/\/fedorahosted.org\/augeas\/ticket\/12\n","repos":"manandbytes\/augeas,kunkku\/augeas,jjlin\/augeas,raphink\/augeas,jjlin\/augeas,jasperla\/augeas,mlichvar\/augeas,pevalme\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,mchf\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,bkearney\/augeas,ptoscano\/augeas,lutter\/augeas,kumy\/augeas,kumy\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,manandbytes\/augeas,mlichvar\/augeas,bkearney\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,jasperla\/augeas,bkearney\/augeas,hercules-team\/augeas,kumy\/augeas,bkearney\/augeas,camptocamp\/augeas,mlichvar\/augeas,jtopjian\/augeas,dafugg\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jtopjian\/augeas,raphink\/augeas,camptocamp\/augeas,ptoscano\/augeas,domcleal\/augeas,lutter\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,MikaelSmith\/augeas,lutter\/augeas,dafugg\/augeas,domcleal\/augeas","old_file":"lenses\/dhclient.aug","new_file":"lenses\/dhclient.aug","new_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man dhclient.conf\n The only difference with the reference syntax is that this lens assumes\n that statements end with a new line, while the reference syntax allows\n new statements to be started right after the trailing \";\" of the\n previous statement. This should not be a problem in real-life\n configuration files as statements get usually splitted across several\n lines, rather than merged in a single one.\n\n TODO: support the \"default\", \"supersede\", \"append\" and \"prepend\"\n statements\n*)\n\nmodule Dhclient =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t\\n]+\/ \" \"\nlet sep_scl = del \/[ \\t]*;\/ \";\"\nlet sep_obr = del \/[ \\t\\n]*\\{\\n]*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t\\n]*\\}\/ \" }\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \",\"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\n\n(* Define fields *)\n\n(* TODO: there could be a \" \" in the middle of a value ... *)\nlet sto_to_spc = store \/[^\\\\#,;\\{\\}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * SIMPLE STATEMENTS\n *************************************************************************)\n\nlet stmt_simple_re = \"timeout\"\n | \"retry\"\n | \"select-timeout\"\n | \"reboot\"\n | \"backoff-cutoff\"\n | \"initial-interval\"\n | \"do-forward-updates\"\n | \"reject\"\n\nlet stmt_simple = [ key stmt_simple_re\n . sep_spc\n . sto_to_spc\n . sep_scl\n . (eol|comment) ]\n\n\n(************************************************************************\n * ARRAY STATEMENTS\n *************************************************************************)\n\n(* TODO: the array could also be empty, like in the request statement *)\nlet stmt_array_re = \"media\"\n | \"request\"\n | \"require\"\n\nlet stmt_array = [ key stmt_array_re\n . sep_spc\n . counter \"stmt_array\"\n . [ seq \"stmt_array\" . sto_to_spc ]\n . [ sep_com . seq \"stmt_array\" . sto_to_spc ]*\n . sep_scl . (eol|comment) ]\n\n(************************************************************************\n * HASH STATEMENTS\n *************************************************************************)\n\nlet stmt_hash_re = \"send\"\n | \"option\"\n\nlet stmt_hash = [ key stmt_hash_re\n . sep_spc\n . [ key word . sep_spc . sto_to_spc ]\n . sep_scl\n . (eol|comment) ]\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n\nlet stmt_block_re = \"interface\"\n | \"lease\"\n | \"alias\"\n\nlet stmt_block_opt_re = \"interface\"\n | \"script\"\n | \"bootp\"\n | \"fixed-address\"\n | \"filename\"\n | \"server-name\"\n | \"medium\"\n | \"vendor option space\"\n\n(* TODO: some options could take no argument like bootp *)\nlet stmt_block_opt = [ key stmt_block_opt_re\n . sep_spc\n . sto_to_spc\n . sep_scl\n . (eol|comment) ]\n\nlet stmt_block_date_re\n = \"renew\"\n | \"rebind\"\n | \"expire\"\n\nlet stmt_block_date = [ key stmt_block_date_re\n . [ sep_spc . label \"weekday\" . sto_number ]\n . [ sep_spc . label \"year\" . sto_number ]\n . [ sep_slh . label \"month\" . sto_number ]\n . [ sep_slh . label \"day\" . sto_number ]\n . [ sep_spc . label \"hour\" . sto_number ]\n . [ sep_col . label \"minute\" . sto_number ]\n . [ sep_col . label \"second\" . sto_number ]\n . sep_scl\n . (eol|comment) ]\n\nlet stmt_block_arg = sep_spc . sto_to_spc\n\nlet stmt_block_entry = sep_spc \n . ( stmt_array\n | stmt_hash\n | stmt_block_opt\n | stmt_block_date )\n\nlet stmt_block = [ key stmt_block_re\n . stmt_block_arg?\n . sep_obr\n . stmt_block_entry+\n . sep_cbr\n . (eol|comment) ]\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet statement = (stmt_simple|stmt_array|stmt_hash|stmt_block)\n\nlet lns = ( empty\n | comment\n | statement )*\n\nlet filter = incl \"\/etc\/dhcp3\/dhclient.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man dhclient.conf\n The only difference with the reference syntax is that this lens assumes\n that statements end with a new line, while the reference syntax allows\n new statements to be started right after the trailing \";\" of the\n previous statement. This should not be a problem in real-life\n configuration files as statements get usually splitted across several\n lines, rather than merged in a single one.\n\n TODO: support the \"default\", \"supersede\", \"append\" and \"prepend\"\n statements\n*)\n\nmodule Dhclient =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t\\n]+\/ \" \"\nlet sep_scl = del \/[ \\t]*;\/ \";\"\nlet sep_obr = del \/[ \\t\\n]*\\{\\n]*\/\" \\{\\n\"\nlet sep_cbr = del \/[ \\t\\n]*\\}\/ \" \\}\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \",\"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\n\n(* Define fields *)\n\n(* TODO: there could be a \" \" in the middle of a value ... *)\nlet sto_to_spc = store \/[^\\\\#,;\\{\\}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * SIMPLE STATEMENTS\n *************************************************************************)\n\nlet stmt_simple_re = \"timeout\"\n | \"retry\"\n | \"select-timeout\"\n | \"reboot\"\n | \"backoff-cutoff\"\n | \"initial-interval\"\n | \"do-forward-updates\"\n | \"reject\"\n\nlet stmt_simple = [ key stmt_simple_re\n . sep_spc\n . sto_to_spc\n . sep_scl\n . (eol|comment) ]\n\n\n(************************************************************************\n * ARRAY STATEMENTS\n *************************************************************************)\n\n(* TODO: the array could also be empty, like in the request statement *)\nlet stmt_array_re = \"media\"\n | \"request\"\n | \"require\"\n\nlet stmt_array = [ key stmt_array_re\n . sep_spc\n . counter \"stmt_array\"\n . [ seq \"stmt_array\" . sto_to_spc ]\n . [ sep_com . seq \"stmt_array\" . sto_to_spc ]*\n . sep_scl . (eol|comment) ]\n\n(************************************************************************\n * HASH STATEMENTS\n *************************************************************************)\n\nlet stmt_hash_re = \"send\"\n | \"option\"\n\nlet stmt_hash = [ key stmt_hash_re\n . sep_spc\n . [ key word . sep_spc . sto_to_spc ]\n . sep_scl\n . (eol|comment) ]\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n\nlet stmt_block_re = \"interface\"\n | \"lease\"\n | \"alias\"\n\nlet stmt_block_opt_re = \"interface\"\n | \"script\"\n | \"bootp\"\n | \"fixed-address\"\n | \"filename\"\n | \"server-name\"\n | \"medium\"\n | \"vendor option space\"\n\n(* TODO: some options could take no argument like bootp *)\nlet stmt_block_opt = [ key stmt_block_opt_re\n . sep_spc\n . sto_to_spc\n . sep_scl\n . (eol|comment) ]\n\nlet stmt_block_date_re\n = \"renew\"\n | \"rebind\"\n | \"expire\"\n\nlet stmt_block_date = [ key stmt_block_date_re\n . [ sep_spc . label \"weekday\" . sto_number ]\n . [ sep_spc . label \"year\" . sto_number ]\n . [ sep_slh . label \"month\" . sto_number ]\n . [ sep_slh . label \"day\" . sto_number ]\n . [ sep_spc . label \"hour\" . sto_number ]\n . [ sep_col . label \"minute\" . sto_number ]\n . [ sep_col . label \"second\" . sto_number ]\n . sep_scl\n . (eol|comment) ]\n\nlet stmt_block_arg = sep_spc . sto_to_spc\n\nlet stmt_block_entry = sep_spc \n . ( stmt_array\n | stmt_hash\n | stmt_block_opt\n | stmt_block_date )\n\nlet stmt_block = [ key stmt_block_re\n . stmt_block_arg?\n . sep_obr\n . stmt_block_entry+\n . sep_cbr\n . (eol|comment) ]\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet statement = (stmt_simple|stmt_array|stmt_hash|stmt_block)\n\nlet lns = ( empty\n | comment\n | statement )*\n\nlet filter = incl \"\/etc\/dhcp3\/dhclient.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b7e211451520cd6c2f1739583172a4db18e9289a","subject":"* tests\/modules\/fail_shadow_union.aug: fix unintended test failure","message":"* tests\/modules\/fail_shadow_union.aug: fix unintended test failure\n","repos":"raphink\/augeas,manandbytes\/augeas,hercules-team\/augeas,mlichvar\/augeas,jtopjian\/augeas,jasperla\/augeas,lutter\/augeas,jjlin\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,ptoscano\/augeas,pevalme\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,kumy\/augeas,ptoscano\/augeas,kumy\/augeas,raphink\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,kunkku\/augeas,mchf\/augeas,pevalme\/augeas,jjlin\/augeas,dafugg\/augeas,dafugg\/augeas,kunkku\/augeas,lutter\/augeas,kumy\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,dafugg\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,mlichvar\/augeas,kumy\/augeas,MikaelSmith\/augeas,manandbytes\/augeas","old_file":"tests\/modules\/fail_shadow_union.aug","new_file":"tests\/modules\/fail_shadow_union.aug","new_contents":"module Fail_shadow_union =\n let lns = store \/[a-z]+\/ | del \/(abc|xyz)\/ \"abc\"\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"module Fail_shadow_union =\n let lns = store \/[a-z]+\/ | del \/(abc|xyz)\/ \"never used\"\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7edbc8889b46ad0191f86bd369caf25a6e3cec96","subject":"Add \/etc\/audit\/auditd.conf to simplevars.aug","message":"Add \/etc\/audit\/auditd.conf to simplevars.aug\n","repos":"pevalme\/augeas,raphink\/augeas,mlichvar\/augeas,kunkku\/augeas,raphink\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,jjlin\/augeas,mchf\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,lutter\/augeas,kumy\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,hercules-team\/augeas,kunkku\/augeas,kunkku\/augeas,dafugg\/augeas,manandbytes\/augeas,dafugg\/augeas,jtopjian\/augeas,kumy\/augeas,manandbytes\/augeas,jasperla\/augeas,MikaelSmith\/augeas,mchf\/augeas,mlichvar\/augeas,lutter\/augeas,mlichvar\/augeas,kumy\/augeas,lutter\/augeas,ptoscano\/augeas,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas","old_file":"lenses\/simplevars.aug","new_file":"lenses\/simplevars.aug","new_contents":"(*\nModule: Simplevars\n Parses simple key = value conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Simplevars> file contains various examples and tests.\n*)\n\nmodule Simplevars =\n\nautoload xfm\n\n(* Variable: to_comment_re\n The regexp to match the value *)\nlet to_comment_re =\n let to_comment_squote = \/'[^\\n']*'\/\n in let to_comment_dquote = \/\"[^\\n\"]*\"\/\n in let to_comment_noquote = \/[^\\n \\t'\"#][^\\n#]*[^\\n \\t#]|[^\\n \\t'\"#]\/\n in to_comment_squote | to_comment_dquote | to_comment_noquote\n\n(* View: entry *)\nlet entry = Build.key_value Rx.word Sep.space_equal\n (store to_comment_re . (Util.eol|Util.comment_eol))\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/kernel-img.conf\"\n . incl \"\/etc\/kerneloops.conf\"\n . incl \"\/etc\/updatedb.conf\"\n . incl \"\/etc\/wgetrc\"\n . incl \"\/etc\/zabbix\/*.conf\"\n . incl \"\/etc\/audit\/auditd.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Simplevars\n Parses simple key = value conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Simplevars> file contains various examples and tests.\n*)\n\nmodule Simplevars =\n\nautoload xfm\n\n(* Variable: to_comment_re\n The regexp to match the value *)\nlet to_comment_re =\n let to_comment_squote = \/'[^\\n']*'\/\n in let to_comment_dquote = \/\"[^\\n\"]*\"\/\n in let to_comment_noquote = \/[^\\n \\t'\"#][^\\n#]*[^\\n \\t#]|[^\\n \\t'\"#]\/\n in to_comment_squote | to_comment_dquote | to_comment_noquote\n\n(* View: entry *)\nlet entry = Build.key_value Rx.word Sep.space_equal\n (store to_comment_re . (Util.eol|Util.comment_eol))\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/kernel-img.conf\"\n . incl \"\/etc\/kerneloops.conf\"\n . incl \"\/etc\/updatedb.conf\"\n . incl \"\/etc\/wgetrc\"\n . incl \"\/etc\/zabbix\/*.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"75b14b93ef8df6cee028f549c05199b6ec65a183","subject":"Fix splitting of AcceptEnv","message":"Fix splitting of AcceptEnv\n\nThe list of env vars for AcceptEnv was not being split into individual\npieces\n","repos":"kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,jjlin\/augeas,bkearney\/augeas,raphink\/augeas,dafugg\/augeas,camptocamp\/augeas,kunkku\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,ptoscano\/augeas,jtopjian\/augeas,domcleal\/augeas,kumy\/augeas,domcleal\/augeas,manandbytes\/augeas,lutter\/augeas,raphink\/augeas,kunkku\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,ptoscano\/augeas,dafugg\/augeas,kumy\/augeas,hercules-team\/augeas,camptocamp\/augeas,lutter\/augeas,mchf\/augeas,bkearney\/augeas,dafugg\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,domcleal\/augeas,bkearney\/augeas,lutter\/augeas,pevalme\/augeas,jasperla\/augeas,camptocamp\/augeas,manandbytes\/augeas,pevalme\/augeas,mchf\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,jjlin\/augeas","old_file":"spec\/sshd.aug","new_file":"spec\/sshd.aug","new_contents":"# \/etc\/sshd\/sshd_config\n\nmap\n grammar sshd\n include '\/etc\/ssh\/sshd_config' '\/system\/config\/sshd'\nend\n\ngrammar sshd\n token EOL \/[ \\t]*\\n\/ = '\\n'\n token SEP \/[ \\t]+\/ = ' '\n token COMMENT \/(#.*|[ \\t]*)\\n\/ = '\\n'\n token KEY \/[^ \\t]+\/ = ''\n token VALUE \/([^ \\t\\n]|[ \\t][^ \\t\\n])+\/ = ''\n token LISTELT \/[^ \\t\\n]+\/ = ''\n token MAC \/([^, \\t\\n]|[ \\t][^, \\t\\n])+\/ = ''\n start: (comment | accept_env | allow_groups | allow_users \n | deny_groups | deny_users | macs | match | other_entry ) *\n\n comment: [ COMMENT ]\n\n other_entry: [ key KEY . SEP . store VALUE . EOL ]\n\n accept_env: [ key 'AcceptEnv' .\n ([ SEP . seq 'accept_env' . store LISTELT])* .\n EOL]\n\n allow_groups: [ key 'AllowGroups' .\n ([ SEP . seq 'allow_groups' . store VALUE])* .\n EOL]\n \n allow_users: [ key 'AllowUsers' .\n ([ SEP . seq 'allow_users' . store VALUE])* .\n EOL]\n \n deny_groups: [ key 'DenyGroups' .\n ([ SEP . seq 'deny_groups' . store VALUE])* .\n EOL]\n \n deny_users: [ key 'DenyUsers' .\n ([ SEP . seq 'deny_users' . store VALUE])* .\n EOL]\n\n macs: [ key 'MACs' . SEP .\n [ seq 'macs' . store MAC ] .\n ([ seq 'macs' . ',' . store MAC])* .\n EOL ]\n\n match: [ key 'Match' .\n [ seq 'match' .\n [ label 'cond' . store VALUE . EOL ] .\n (SEP . other_entry) * ] ]\n\nend\n","old_contents":"# \/etc\/sshd\/sshd_config\n\nmap\n grammar sshd\n include '\/etc\/ssh\/sshd_config' '\/system\/config\/sshd'\nend\n\ngrammar sshd\n token EOL \/[ \\t]*\\n\/ = '\\n'\n token SEP \/[ \\t]+\/ = ' '\n token COMMENT \/(#.*|[ \\t]*)\\n\/ = '\\n'\n token KEY \/[^ \\t]+\/ = ''\n token VALUE \/([^ \\t\\n]|[ \\t][^ \\t\\n])+\/ = ''\n token MAC \/([^, \\t\\n]|[ \\t][^, \\t\\n])+\/ = ''\n start: (comment | accept_env | allow_groups | allow_users \n | deny_groups | deny_users | macs | match | other_entry ) *\n\n comment: [ COMMENT ]\n\n other_entry: [ key KEY . SEP . store VALUE . EOL ]\n\n accept_env: [ key 'AcceptEnv' .\n ([ SEP . seq 'accept_env' . store VALUE])* .\n EOL]\n\n allow_groups: [ key 'AllowGroups' .\n ([ SEP . seq 'allow_groups' . store VALUE])* .\n EOL]\n \n allow_users: [ key 'AllowUsers' .\n ([ SEP . seq 'allow_users' . store VALUE])* .\n EOL]\n \n deny_groups: [ key 'DenyGroups' .\n ([ SEP . seq 'deny_groups' . store VALUE])* .\n EOL]\n \n deny_users: [ key 'DenyUsers' .\n ([ SEP . seq 'deny_users' . store VALUE])* .\n EOL]\n\n macs: [ key 'MACs' . SEP .\n [ seq 'macs' . store MAC ] .\n ([ seq 'macs' . ',' . store MAC])* .\n EOL ]\n\n match: [ key 'Match' .\n [ seq 'match' .\n [ label 'cond' . store VALUE . EOL ] .\n (SEP . other_entry) * ] ]\n\nend\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6c0b1e46d7ef18fa00defb83b14005686b27e147","subject":"Import latest upstream augeas lens","message":"Import latest upstream augeas lens\n\n* Handles perl sripts embedded in Apache conf files\n* Fixes: #2079\n","repos":"thanatos\/lets-encrypt-preview,letsencrypt\/letsencrypt,jtl999\/certbot,DavidGarciaCat\/letsencrypt,jsha\/letsencrypt,brentdax\/letsencrypt,brentdax\/letsencrypt,mitnk\/letsencrypt,stweil\/letsencrypt,TheBoegl\/letsencrypt,bsmr-misc-forks\/letsencrypt,jsha\/letsencrypt,bsmr-misc-forks\/letsencrypt,letsencrypt\/letsencrypt,dietsche\/letsencrypt,mitnk\/letsencrypt,lmcro\/letsencrypt,twstrike\/le_for_patching,stweil\/letsencrypt,twstrike\/le_for_patching,DavidGarciaCat\/letsencrypt,dietsche\/letsencrypt,TheBoegl\/letsencrypt,thanatos\/lets-encrypt-preview,wteiken\/letsencrypt,jtl999\/certbot,lmcro\/letsencrypt,wteiken\/letsencrypt","old_file":"letsencrypt-apache\/letsencrypt_apache\/augeas_lens\/httpd.aug","new_file":"letsencrypt-apache\/letsencrypt_apache\/augeas_lens\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-z][a-z0-9._-]*\/i\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/([^\\\\ '\"{\\t\\r\\n]|[^ '\"{\\t\\r\\n]+[^\\\\ \\t\\r\\n])|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_wl = \/([^\\\\ '\"},\\t\\r\\n]|[^ '\"},\\t\\r\\n]+[^\\\\ '\"},\\t\\r\\n])\/\n\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet dquot_msg =\n let no_dquot = \/([^ \\t\"\\\\\\r\\n]|[^\"\\\\\\r\\n]+[^ \\t\"\\\\\\r\\n])\/\n in \/\"\/ . (no_dquot|cdot|cl)*\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\n(* message argument starts with \" but ends at EOL *)\nlet arg_dir_msg = [ label \"arg\" . store dquot_msg ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\nlet arg_wl = [ label \"arg\" . store (char_arg_wl+|dquot|squot) ]\n\n(* comma-separated wordlist as permitted in the SSLRequire directive *)\nlet arg_wordlist =\n let wl_start = Util.del_str \"{\" in\n let wl_end = Util.del_str \"}\" in\n let wl_sep = del \/[ \\t]*,[ \\t]*\/ \", \"\n in [ label \"wordlist\" . wl_start . arg_wl . (wl_sep . arg_wl)* . wl_end ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive =\n (* arg_dir_msg may be the last or only argument *)\n let dir_args = (argv (arg_dir|arg_wordlist) . (sep_spc . arg_dir_msg)?) | arg_dir_msg\n in [ indent . label \"directive\" . store word . (sep_spc . dir_args)? . eol ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key (word - \/perl\/i) in\n let dword = del (word - \/perl\/i) \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \/>[ \\t\\n\\r]*\/ \">\\n\" ]\n\nlet perl_section = [ indent . label \"Perl\" . del \/<perl>\/i \"<Perl>\"\n . store \/[^<]*\/\n . del \/<\\\/perl>\/i \"<\/Perl>\" . eol ]\n\n\nlet rec content = section (content|directive)\n | perl_section\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/apache2\/vhosts.d\/*.conf\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-z][a-z0-9._-]*\/i\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/([^\\\\ '\"{\\t\\r\\n]|[^ '\"{\\t\\r\\n]+[^\\\\ \\t\\r\\n])|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_wl = \/([^\\\\ '\"},\\t\\r\\n]|[^ '\"},\\t\\r\\n]+[^\\\\ '\"},\\t\\r\\n])\/\n\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet dquot_msg =\n let no_dquot = \/([^ \\t\"\\\\\\r\\n]|[^\"\\\\\\r\\n]+[^ \\t\"\\\\\\r\\n])\/\n in \/\"\/ . (no_dquot|cdot|cl)*\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\n(* message argument starts with \" but ends at EOL *)\nlet arg_dir_msg = [ label \"arg\" . store dquot_msg ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\nlet arg_wl = [ label \"arg\" . store (char_arg_wl+|dquot|squot) ]\n\n(* comma-separated wordlist as permitted in the SSLRequire directive *)\nlet arg_wordlist =\n let wl_start = Util.del_str \"{\" in\n let wl_end = Util.del_str \"}\" in\n let wl_sep = del \/[ \\t]*,[ \\t]*\/ \", \"\n in [ label \"wordlist\" . wl_start . arg_wl . (wl_sep . arg_wl)* . wl_end ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive =\n (* arg_dir_msg may be the last or only argument *)\n let dir_args = (argv (arg_dir|arg_wordlist) . (sep_spc . arg_dir_msg)?) | arg_dir_msg\n in [ indent . label \"directive\" . store word . (sep_spc . dir_args)? . eol ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \/>[ \\t\\n\\r]*\/ \">\\n\" ]\n\nlet rec content = section (content|directive)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"9e7cd41c00849c85ddcc4092ccf860e5406957eb","subject":"* lenses\/rx.aug: delete trailing whitespace","message":"* lenses\/rx.aug: delete trailing whitespace\n","repos":"kumy\/augeas,ptoscano\/augeas,jasperla\/augeas,kunkku\/augeas,mchf\/augeas,jtopjian\/augeas,raphink\/augeas,ptoscano\/augeas,kumy\/augeas,manandbytes\/augeas,ptoscano\/augeas,domcleal\/augeas,dafugg\/augeas,kunkku\/augeas,mlichvar\/augeas,raphink\/augeas,hercules-team\/augeas,kumy\/augeas,pevalme\/augeas,jasperla\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,hercules-team\/augeas,pevalme\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,lutter\/augeas,jjlin\/augeas,manandbytes\/augeas,dafugg\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,lutter\/augeas,jtopjian\/augeas,domcleal\/augeas,mchf\/augeas,mlichvar\/augeas,dafugg\/augeas,lutter\/augeas,MikaelSmith\/augeas,jjlin\/augeas,pevalme\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/rx.aug","new_file":"lenses\/rx.aug","new_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Spaces *)\nlet space = \/[ \\t]+\/\nlet opt_space = \/[ \\t]*\/\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\nlet no_spaces = \/[^ \\t\\n]+\/\n\n(* Generic fields *)\nlet word = \/[A-Za-z0-9_.-]+\/\nlet integer = \/[0-9]+\/\nlet relinteger = \/-?[0-9]+\/\nlet decimal = \/[0-9]+([.,][0-9]+)?\/\n\n(* A filesystem path *)\nlet fspath = \/[^ \\t\\n]+\/\n\n(* All but... *)\n(* Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n\n(*\n * IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\nlet ipv4 =\n let dot = \".\" in\n let digits = \/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/ in\n digits . dot . digits . dot . digits . dot . digits\n\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\nlet ip = ipv4 | ipv6\n\n(*\n * A Linux device name like eth0 or i2c-0. Might still be too restrictive\n *)\n\nlet device_name = \/[a-zA-Z0-9_?.+:!-]+\/\n\n(*\n * Variable: email_addr\n * To be refined\n *)\nlet email_addr = \/[A-Za-z0-9_+.-]+@[A-Za-z0-9_.-]+\/\n","old_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Spaces *)\nlet space = \/[ \\t]+\/\nlet opt_space = \/[ \\t]*\/\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\nlet no_spaces = \/[^ \\t\\n]+\/\n\n(* Generic fields *)\nlet word = \/[A-Za-z0-9_.-]+\/\nlet integer = \/[0-9]+\/\nlet relinteger = \/-?[0-9]+\/\nlet decimal = \/[0-9]+([.,][0-9]+)?\/\n\n(* A filesystem path *)\nlet fspath = \/[^ \\t\\n]+\/\n\n(* All but... *)\n(* Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n\n(*\n * IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\nlet ipv4 =\n let dot = \".\" in\n let digits = \/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/ in\n digits . dot . digits . dot . digits . dot . digits\n\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\nlet ip = ipv4 | ipv6\n\n(*\n * A Linux device name like eth0 or i2c-0. Might still be too restrictive\n *)\n\nlet device_name = \/[a-zA-Z0-9_?.+:!-]+\/\n\n(*\n * Variable: email_addr\n * To be refined\n *)\nlet email_addr = \/[A-Za-z0-9_+.-]+@[A-Za-z0-9_.-]+\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"33ab6793193d8948d1be99187fbec12b0fbded1d","subject":"Add path for Ubuntu (#748)","message":"Add path for Ubuntu (#748)\n\nClamAV on Ubuntu uses a slightly different path.","repos":"hercules-team\/augeas,mlichvar\/augeas,mlichvar\/augeas,mlichvar\/augeas,hercules-team\/augeas","old_file":"lenses\/clamav.aug","new_file":"lenses\/clamav.aug","new_contents":"(*\nModule: ClamAV\n Parses ClamAV clamd and freshclam configuration files.\n\nAuthor: Andrew Colin Kissa <andrew@topdog.za.net>\n Baruwa Enterprise Edition http:\/\/www.baruwa.com\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Configuration files\n This lens applies to \/etc\/clamd.conf, \/etc\/freshclam.conf and files in\n \/etc\/clamd.d. See <filter>.\n*)\n\nmodule Clamav =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n ************************************************************************)\n\nlet word = \/[A-Za-z][A-Za-z0-9]+\/\n\nlet comment = Util.comment\n\nlet some_value = Sep.space . store Rx.space_in\n\n(************************************************************************\n * Group: Entry\n ************************************************************************)\n \nlet example_entry = [ key \"Example\" . Util.eol ]\n\nlet clamd_entry = [ key word . some_value . Util.eol ]\n\n(******************************************************************\n * Group: LENS AND FILTER\n ******************************************************************)\n\n(************************************************************************\n * View: Lns\n ************************************************************************)\n\nlet lns = (Util.empty | example_entry | clamd_entry | comment )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/clamd.conf\")\n . (incl \"\/etc\/freshclam.conf\")\n . (incl \"\/etc\/clamd.d\/*.conf\")\n . (incl \"\/etc\/clamav\/*.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: ClamAV\n Parses ClamAV clamd and freshclam configuration files.\n\nAuthor: Andrew Colin Kissa <andrew@topdog.za.net>\n Baruwa Enterprise Edition http:\/\/www.baruwa.com\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Configuration files\n This lens applies to \/etc\/clamd.conf, \/etc\/freshclam.conf and files in\n \/etc\/clamd.d. See <filter>.\n*)\n\nmodule Clamav =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n ************************************************************************)\n\nlet word = \/[A-Za-z][A-Za-z0-9]+\/\n\nlet comment = Util.comment\n\nlet some_value = Sep.space . store Rx.space_in\n\n(************************************************************************\n * Group: Entry\n ************************************************************************)\n \nlet example_entry = [ key \"Example\" . Util.eol ]\n\nlet clamd_entry = [ key word . some_value . Util.eol ]\n\n(******************************************************************\n * Group: LENS AND FILTER\n ******************************************************************)\n\n(************************************************************************\n * View: Lns\n ************************************************************************)\n\nlet lns = (Util.empty | example_entry | clamd_entry | comment )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/clamd.conf\")\n . (incl \"\/etc\/freshclam.conf\")\n . (incl \"\/etc\/clamd.d\/*.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"bee579099445fdcdf653a572e12060dd17e3ab1d","subject":"Shellvars: exclude directories from \/etc\/sysconfig\/* wildcard","message":"Shellvars: exclude directories from \/etc\/sysconfig\/* wildcard\n\nThis prevents a bug where Augeas maps a directory such as\n\/etc\/sysconfig\/network-scripts to a lens via a matching transform and fails\nto save if the user edits \/etc\/sysconfig\/network-scripts\/ifcfg-eth0.\n","repos":"jasperla\/augeas,lutter\/augeas,kumy\/augeas,lutter\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,dafugg\/augeas,kumy\/augeas,MikaelSmith\/augeas,jjlin\/augeas,raphink\/augeas,hercules-team\/augeas,domcleal\/augeas,ptoscano\/augeas,kumy\/augeas,kunkku\/augeas,manandbytes\/augeas,kunkku\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,pevalme\/augeas,mlichvar\/augeas,mchf\/augeas,mlichvar\/augeas,lutter\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,jtopjian\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,pevalme\/augeas,kumy\/augeas,domcleal\/augeas,jjlin\/augeas,dafugg\/augeas,hercules-team\/augeas,manandbytes\/augeas,kunkku\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,ptoscano\/augeas,mchf\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+ | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . ((empty|comment)* . case_entry)*\n . (empty|comment)*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+ | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . ((empty|comment)* . case_entry)*\n . (empty|comment)*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"51a64d32edcca34b0efd5c3b75adac5975510d9c","subject":"Shellvars: guard against comments","message":"Shellvars: guard against comments\n","repos":"mchf\/augeas,lutter\/augeas,manandbytes\/augeas,hercules-team\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,dafugg\/augeas,dafugg\/augeas,lutter\/augeas,dafugg\/augeas,manandbytes\/augeas,jjlin\/augeas,mchf\/augeas,mlichvar\/augeas,kunkku\/augeas,lutter\/augeas,kunkku\/augeas,pevalme\/augeas,pevalme\/augeas,ptoscano\/augeas,jjlin\/augeas,kunkku\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas,jjlin\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"\\n\\\\# \\t]#*|\\\\\\\\(.|\\n)\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n\n let to_semicol_re = \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n let sto_to_semicol = store to_semicol_re\n\n let sto_to_semicol_quot =\n let no_semicol_re = \/[^\"'#;\\n]\/\n in let no_semicol_spc_re = \/[^\"'#; \\t\\n]\/\n in let multi_chars = no_semicol_spc_re . (no_semicol_re|anyquot)+ . no_semicol_spc_re\n in store (no_semicol_spc_re | multi_chars)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let condition =\n let sto_cond = store \/[^[#; \\t\\n][^#;\\n]+[^]#; \\t\\n]|[^[]#; \\t\\n]+\/\n in let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_cond\n . Util.del_ws_spc . Util.del_str end\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol_quot . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let entry_eol =\n let entry_eol_item (item:lens) =\n [ item . comment_or_eol ] in\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n\n let entry_noeol =\n let entry_item (item:lens) = [ item ] in\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n\\\\]|\\\\\\\\(.|\\n)\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n\n let to_semicol_re = \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n let sto_to_semicol = store to_semicol_re\n\n let sto_to_semicol_quot =\n let no_semicol_re = \/[^\"'#;\\n]\/\n in let no_semicol_spc_re = \/[^\"'#; \\t\\n]\/\n in let multi_chars = no_semicol_spc_re . (no_semicol_re|anyquot)+ . no_semicol_spc_re\n in store (no_semicol_spc_re | multi_chars)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let condition =\n let sto_cond = store \/[^[#; \\t\\n][^#;\\n]+[^]#; \\t\\n]|[^[]#; \\t\\n]+\/\n in let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_cond\n . Util.del_ws_spc . Util.del_str end\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol_quot . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let entry_eol =\n let entry_eol_item (item:lens) =\n [ item . comment_or_eol ] in\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n\n let entry_noeol =\n let entry_item (item:lens) = [ item ] in\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"952dff49ec34d5aada5bccd8d125fbbe8a59c219","subject":"Sshd: Use Build.opt_list","message":"Sshd: Use Build.opt_list\n","repos":"mchf\/augeas,MikaelSmith\/augeas,lutter\/augeas,dafugg\/augeas,jjlin\/augeas,kunkku\/augeas,mchf\/augeas,ptoscano\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,dafugg\/augeas,mlichvar\/augeas,dafugg\/augeas,jasperla\/augeas,pevalme\/augeas,pevalme\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,raphink\/augeas,hercules-team\/augeas,ptoscano\/augeas,lutter\/augeas,ptoscano\/augeas,manandbytes\/augeas,jtopjian\/augeas,hercules-team\/augeas,jtopjian\/augeas,raphink\/augeas,MikaelSmith\/augeas,kunkku\/augeas,pevalme\/augeas,jasperla\/augeas,kunkku\/augeas,jjlin\/augeas,lutter\/augeas","old_file":"lenses\/ssh.aug","new_file":"lenses\/ssh.aug","new_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let spc = Util.del_ws_spc\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_spc = store \/[^ \\t\\n]+\/\n let value_to_comma = store \/[^, \\t\\n]+\/\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n let array_entry (k:regexp) =\n [ indent . key k . counter \"array_entry\"\n . [ spc . seq \"array_entry\" . value_to_spc]* . eol ]\n\n let commas_entry (k:regexp) =\n let value = [ seq \"commas_entry\" . value_to_comma]\n in [ key k . counter \"commas_entry\" . spc .\n Build.opt_list value comma . eol ]\n\n let fw_entry (k:regexp) = [ indent . key k . spc .\n\t [ key \/[^ \\t\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let send_env = array_entry \/SendEnv\/i\n\n let proxy_command = [ indent . key \/ProxyCommand\/i . spc . value_to_eol . eol ]\n\n let remote_fw = fw_entry \/RemoteForward\/i\n let local_fw = fw_entry \/LocalForward\/i\n\n let ciphers = commas_entry \/Ciphers\/i\n let macs\t= commas_entry \/MACs\/i\n\n let special_entry = send_env\n\t | proxy_command\n\t | remote_fw\n\t | local_fw\n\t | macs\n\t | ciphers\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/i\n\n\n let other_entry = [ indent . key key_re\n . spc . value_to_spc . eol ]\n\n let entry = comment | empty\n | special_entry\n\t | other_entry\n\n let host = [ key \/Host\/i . spc . value_to_eol . eol . entry* ]\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","old_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let spc = Util.del_ws_spc\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_spc = store \/[^ \\t\\n]+\/\n let value_to_comma = store \/[^, \\t\\n]+\/\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n let array_entry (k:regexp) =\n [ indent . key k . counter \"array_entry\"\n . [ spc . seq \"array_entry\" . value_to_spc]* . eol ]\n\n let commas_entry (k:regexp) =\n\t [ key k . counter \"commas_entry\" . spc .\n\t [ seq \"commas_entry\" . value_to_comma]\n . ([ seq \"commas_entry\" . comma . value_to_comma])* . eol ]\n\n let fw_entry (k:regexp) = [ indent . key k . spc .\n\t [ key \/[^ \\t\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let send_env = array_entry \/SendEnv\/i\n\n let proxy_command = [ indent . key \/ProxyCommand\/i . spc . value_to_eol . eol ]\n\n let remote_fw = fw_entry \/RemoteForward\/i\n let local_fw = fw_entry \/LocalForward\/i\n\n let ciphers = commas_entry \/Ciphers\/i\n let macs\t= commas_entry \/MACs\/i\n\n let special_entry = send_env\n\t | proxy_command\n\t | remote_fw\n\t | local_fw\n\t | macs\n\t | ciphers\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/i\n\n\n let other_entry = [ indent . key key_re\n . spc . value_to_spc . eol ]\n\n let entry = comment | empty\n | special_entry\n\t | other_entry\n\n let host = [ key \/Host\/i . spc . value_to_eol . eol . entry* ]\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c36c041f39205601b9bbea029da558de0da948fa","subject":"Allow empty lines at end of files in phpvars.aug","message":"Allow empty lines at end of files in phpvars.aug\n","repos":"jjlin\/augeas,kumy\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,kumy\/augeas,domcleal\/augeas,jjlin\/augeas,jtopjian\/augeas,pevalme\/augeas,raphink\/augeas,manandbytes\/augeas,raphink\/augeas,domcleal\/augeas,jtopjian\/augeas,kumy\/augeas,dafugg\/augeas,jasperla\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas,lutter\/augeas,dafugg\/augeas,ptoscano\/augeas,mchf\/augeas,mlichvar\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,manandbytes\/augeas,domcleal\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas,pevalme\/augeas,mchf\/augeas,kunkku\/augeas,lutter\/augeas,jasperla\/augeas,lutter\/augeas","old_file":"lenses\/phpvars.aug","new_file":"lenses\/phpvars.aug","new_contents":"(* Phpvars module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: PHP syntax\n\n*)\n\nmodule Phpvars =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet empty = Util.empty\n\nlet open_php = del \/<\\?(php)?[ \\t]*\\n\/ \"<?php\\n\"\nlet close_php = del \/([ \\t]*(php)?\\?>\\n[ \\t\\n]*)?\/ \"php?>\\n\"\nlet sep_eq = del \/[ \\t\\n]*=[ \\t\\n]*\/ \" = \"\nlet sep_opt_spc = Sep.opt_space\nlet sep_spc = Sep.space\nlet sep_dollar = del \/\\$\/ \"$\"\nlet sep_scl = del \/[ \\t]*;\/ \";\"\n\nlet chr_blank = \/[ \\t]\/\nlet chr_nblank = \/[^ \\t\\n]\/\nlet chr_any = \/.\/\nlet chr_star = \/\\*\/\nlet chr_nstar = \/[^* \\t\\n]\/\nlet chr_slash = \/\\\/\/\nlet chr_nslash = \/[^\\\/ \\t\\n]\/\n\nlet sto_to_scl = store (\/([^ \\t\\n].*[^ \\t\\n;]|[^ \\t\\n;])\/ - \/.*;[ \\t]*(\\\/\\\/|#).*\/)\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * COMMENTS\n *************************************************************************)\n\n(* Both c-style and shell-style comments are valid\n Default to c-style *)\nlet comment_one_line = Util.comment_generic \/[ \\t]*(\\\/\\\/|#)[ \\t]*\/ \"\/\/ \"\n\nlet comment = Util.comment_multiline | comment_one_line\n\nlet eol_or_comment = eol | comment_one_line\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet global = [ key \"global\"\n . sep_opt_spc\n . sep_dollar\n . sto_to_scl\n . sep_scl\n . eol_or_comment ]\n\nlet variable =\n let variable_re = \/\\$[][A-Za-z0-9'_-]+\/ in\n [ key variable_re\n . sep_eq\n . sto_to_scl\n . sep_scl\n . eol_or_comment ]\n\nlet include = [ key \"@include\"\n . sep_opt_spc\n . sto_to_scl\n . sep_scl\n . eol_or_comment ]\n\nlet define =\n let variable_re = \/[A-Za-z0-9'_-]+\/ in\n let lbracket = del \/[ \\t]*\\([ \\t]*[\"']\/ \"('\" in\n let rbracket = del \/[ \\t]*\\)\/ \")\" in\n let sep_comma = del \/[\"'][ \\t]*,[ \\t]*\/ \"', \" in\n let sto_to_rbracket = store (\/[^ \\t\\n][^\\n]*[^ \\t\\n\\)]|[^ \\t\\n\\)]\/ - \/.*;[ \\t]*(\\\/\\\/|#).*\/) in\n [ key \"define\"\n . lbracket\n . store variable_re\n . sep_comma\n . [ label \"value\" . sto_to_rbracket ]\n . rbracket\n . sep_scl\n . eol_or_comment ]\n\nlet entry = Util.indent . (global|variable|include|define)\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = open_php . (empty|comment|entry)* . close_php\n\nlet filter = incl \"\/etc\/squirrelmail\/config.php\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Phpvars module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: PHP syntax\n\n*)\n\nmodule Phpvars =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet empty = Util.empty\n\nlet open_php = del \/<\\?(php)?[ \\t]*\\n\/ \"<?php\\n\"\nlet close_php = del \/([ \\t]*(php)?\\?>\\n)?\/ \"php?>\\n\"\nlet sep_eq = del \/[ \\t\\n]*=[ \\t\\n]*\/ \" = \"\nlet sep_opt_spc = Sep.opt_space\nlet sep_spc = Sep.space\nlet sep_dollar = del \/\\$\/ \"$\"\nlet sep_scl = del \/[ \\t]*;\/ \";\"\n\nlet chr_blank = \/[ \\t]\/\nlet chr_nblank = \/[^ \\t\\n]\/\nlet chr_any = \/.\/\nlet chr_star = \/\\*\/\nlet chr_nstar = \/[^* \\t\\n]\/\nlet chr_slash = \/\\\/\/\nlet chr_nslash = \/[^\\\/ \\t\\n]\/\n\nlet sto_to_scl = store (\/([^ \\t\\n].*[^ \\t\\n;]|[^ \\t\\n;])\/ - \/.*;[ \\t]*(\\\/\\\/|#).*\/)\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * COMMENTS\n *************************************************************************)\n\n(* Both c-style and shell-style comments are valid\n Default to c-style *)\nlet comment_one_line = Util.comment_generic \/[ \\t]*(\\\/\\\/|#)[ \\t]*\/ \"\/\/ \"\n\nlet comment = Util.comment_multiline | comment_one_line\n\nlet eol_or_comment = eol | comment_one_line\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet global = [ key \"global\"\n . sep_opt_spc\n . sep_dollar\n . sto_to_scl\n . sep_scl\n . eol_or_comment ]\n\nlet variable =\n let variable_re = \/\\$[][A-Za-z0-9'_-]+\/ in\n [ key variable_re\n . sep_eq\n . sto_to_scl\n . sep_scl\n . eol_or_comment ]\n\nlet include = [ key \"@include\"\n . sep_opt_spc\n . sto_to_scl\n . sep_scl\n . eol_or_comment ]\n\nlet define =\n let variable_re = \/[A-Za-z0-9'_-]+\/ in\n let lbracket = del \/[ \\t]*\\([ \\t]*[\"']\/ \"('\" in\n let rbracket = del \/[ \\t]*\\)\/ \")\" in\n let sep_comma = del \/[\"'][ \\t]*,[ \\t]*\/ \"', \" in\n let sto_to_rbracket = store (\/[^ \\t\\n][^\\n]*[^ \\t\\n\\)]|[^ \\t\\n\\)]\/ - \/.*;[ \\t]*(\\\/\\\/|#).*\/) in\n [ key \"define\"\n . lbracket\n . store variable_re\n . sep_comma\n . [ label \"value\" . sto_to_rbracket ]\n . rbracket\n . sep_scl\n . eol_or_comment ]\n\nlet entry = Util.indent . (global|variable|include|define)\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = open_php . (empty|comment|entry)* . close_php\n\nlet filter = incl \"\/etc\/squirrelmail\/config.php\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"50f7283c5743dc405497f3995a5e8f49533718ad","subject":"augeas-lens: fix for generating unnecessary newlines","message":"augeas-lens: fix for generating unnecessary newlines\n","repos":"CZ-NIC\/deckard,CZ-NIC\/deckard","old_file":"pydnstest\/deckard.aug","new_file":"pydnstest\/deckard.aug","new_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/; ]+\/\n\nlet comment = del \/[;]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;][^\\n]*)?\\n)*\/ \"\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/; ]+(\\.[^.\\t\\n\\\/; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9;\\n \\t][^\\t\\n\\\/; ]*\/) - class_re) ]\n(* RFC 3597 section 5 rdata syntax is \"\\# 1 ab\"*)\nlet data_re = \/((\\\\#[ \\t])?[^ \\t\\n;][^\\n;]*[^ \\t\\n;])|[^ \\t\\n;]\/ (*Can not start nor end with whitespace but can have whitespace in the middle. Disjunction is there so we match strings of length one.*)\nlet data = [label \"data\" . store data_re ]\n\nlet ip_re = \/[0-9a-f.:]+\/\nlet hex_re = \/[0-9a-fA-F]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\" | \"raw_id\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\" | \"BADSIG\" | \"BADKEY\" | \"BADTIME\" | \"BADMODE\" | \"BADNAME\" | \"BADALG\" | \"BADTRUNC\" | \"BADCOOKIE\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = [label \"record\" . domain . tab . (class . tab)? . type . comment_or_eol ]\nlet record = [label \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = [label \"section\" . section_question? . section_answer? . section_authority? . section_additional?]\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store hex_re ] . comment_or_eol\n\n(* This is quite dirty hack to match every combination of options given to entry since 'let dnsmsg = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)\n\nlet dnsmsg = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . dnsmsg . raw? . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . space . store data_re . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\n(*let filter = incl \"\/home\/test\/*.rpl\"*)\nlet filter = incl \"\/home\/sbalazik\/nic\/deckard\/git\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","old_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/; ]+\/\n\nlet comment = del \/[;]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;][^\\n]*)?\\n)*\/ \"\\n\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/; ]+(\\.[^.\\t\\n\\\/; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9;\\n \\t][^\\t\\n\\\/; ]*\/) - class_re) ]\n(* RFC 3597 section 5 rdata syntax is \"\\# 1 ab\"*)\nlet data_re = \/((\\\\#[ \\t])?[^ \\t\\n;][^\\n;]*[^ \\t\\n;])|[^ \\t\\n;]\/ (*Can not start nor end with whitespace but can have whitespace in the middle. Disjunction is there so we match strings of length one.*)\nlet data = [label \"data\" . store data_re ]\n\nlet ip_re = \/[0-9a-f.:]+\/\nlet hex_re = \/[0-9a-fA-F]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\" | \"raw_id\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\" | \"BADSIG\" | \"BADKEY\" | \"BADTIME\" | \"BADMODE\" | \"BADNAME\" | \"BADALG\" | \"BADTRUNC\" | \"BADCOOKIE\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = [label \"record\" . domain . tab . (class . tab)? . type . comment_or_eol ]\nlet record = [label \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = [label \"section\" . section_question? . section_answer? . section_authority? . section_additional?]\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store hex_re ] . comment_or_eol\n\n(* This is quite dirty hack to match every combination of options given to entry since 'let dnsmsg = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)\n\nlet dnsmsg = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . dnsmsg . raw? . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . space . store data_re . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\n(*let filter = incl \"\/home\/test\/*.rpl\"*)\nlet filter = incl \"\/home\/sbalazik\/nic\/deckard\/git\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Augeas"} {"commit":"2cb8db0ca8e2b99dc14cd316e203f0d50c38c070","subject":"Shellvars: add locale.conf, vconsole.conf systemd configs","message":"Shellvars: add locale.conf, vconsole.conf systemd configs\n\nFixes BZ#881841\n","repos":"pevalme\/augeas,lutter\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,lutter\/augeas,mlichvar\/augeas,kunkku\/augeas,raphink\/augeas,manandbytes\/augeas,manandbytes\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,ptoscano\/augeas,jasperla\/augeas,pevalme\/augeas,kumy\/augeas,kumy\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas,raphink\/augeas,lutter\/augeas,jtopjian\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,MikaelSmith\/augeas,mchf\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,dafugg\/augeas,kumy\/augeas,jtopjian\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,jasperla\/augeas,pevalme\/augeas,mchf\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment . empty*\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment . empty*\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1274ba9668934f4abc6517afe7f1ce502dfd04ca","subject":"Add examples note to reprepro_uploaders.aug","message":"Add examples note to reprepro_uploaders.aug\n","repos":"kumy\/augeas,kumy\/augeas,GeoffWilliams\/augeas,kumy\/augeas,dafugg\/augeas,ptoscano\/augeas,manandbytes\/augeas,pevalme\/augeas,domcleal\/augeas,kunkku\/augeas,jasperla\/augeas,hercules-team\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,dafugg\/augeas,pevalme\/augeas,MikaelSmith\/augeas,lutter\/augeas,jasperla\/augeas,domcleal\/augeas,mlichvar\/augeas,manandbytes\/augeas,jtopjian\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,lutter\/augeas,jjlin\/augeas,kumy\/augeas,mlichvar\/augeas,ptoscano\/augeas,jjlin\/augeas,raphink\/augeas,mchf\/augeas,kunkku\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas,dafugg\/augeas","old_file":"lenses\/inifile.aug","new_file":"lenses\/inifile.aug","new_contents":"(*\nModule: IniFile\n Generic module to create INI files lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: TODO\n Things to add in the future\n - Support double quotes in value\n\nAbout: Lens usage\n This lens is made to provide generic primitives to construct INI File lenses.\n See <Puppet>, <PHP>, <MySQL> or <Dput> for examples of real life lenses using it.\n\nAbout: Examples\n The <Test_Reprepro_Uploaders> file contains various examples and tests.\n*)\n\nmodule IniFile =\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Internal primitives *)\n\n(*\nVariable: eol\n End of line, inherited from <Util.eol>\n*)\nlet eol = Util.eol\n\n(*\nView: empty\n Empty line, an <eol> subnode\n*)\nlet empty = [ eol ]\n\n\n(* Group: Separators *)\n\n\n\n(*\nVariable: sep\n Generic separator\n\n Parameters:\n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep (pat:regexp) (default:string)\n = Sep.opt_space . del pat default\n\n(*\nVariable: sep_re\n The default regexp for a separator\n*)\n\nlet sep_re = \/[=:]\/\n\n(*\nVariable: sep_default\n The default separator value\n*)\nlet sep_default = \"=\"\n\n\n(* Group: Stores *)\n\n\n(*\nVariable: sto_to_eol\n Store until end of line\n*)\nlet sto_to_eol = Sep.opt_space . store Rx.space_in\n\n(*\nVariable: to_comment_re\n Regex until comment\n*)\nlet to_comment_re = \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n(*\nVariable: sto_to_comment\n Store until comment\n*)\nlet sto_to_comment = Sep.opt_space . store to_comment_re\n\nlet sto_multiline = Sep.opt_space\n . store (to_comment_re\n . (\/[ \\t]*\\n\/ . Rx.space . to_comment_re)*)\n\n\n(* Group: Define comment and defaults *)\n\n(*\nView: comment\n Map comments into \"#comment\" nodes\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment \"#\" \"#\"\n let comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment (pat:regexp) (default:string)\n = [ label \"#comment\" . sep pat default\n\t\t . sto_to_eol? . eol ]\n(*\nVariable: comment_re\n Default regexp for <comment> pattern\n*)\n\nlet comment_re = \/[;#]\/\n\n(*\nVariable: comment_default\n Default value for <comment> pattern\n*)\nlet comment_default = \";\"\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Group: entry includes comments *)\n\n(*\nView: entry\n Generic INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry setting sep comment\n*)\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment\n\n\nlet entry_multiline (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_multiline? . (comment|eol) ] | comment\n\n\n(*\nView: indented_entry\n Generic INI File entry that might be indented with an arbitrary\n amount of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.indented_entry setting sep comment\n*)\nlet indented_entry (kw:regexp) (sep:lens) (comment:lens)\n = [ Util.del_opt_ws \"\" .\n key kw . sep . sto_to_comment? .\n (comment|eol)\n ]\n | comment\n\n(*\nVariable: entry_re\n Default regexp for <entry> keyword\n*)\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9._-]+\/ )\n\n\n(************************************************************************\n * Group: RECORD\n *************************************************************************)\n\n(* Group: Title definition *)\n\n(*\nView: title\n Title for <record>. This maps the title of a record as a node in the abstract tree.\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title\n Title for <record>. This maps the title of a record as a node in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet indented_title (kw:regexp)\n = Util.indent . title kw\n\n(*\nView: title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree.\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet indented_title_label (name:string) (kw:regexp)\n = Util.indent . title_label name kw\n\n\n(*\nVariable: record_re\n Default regexp for <title> keyword pattern\n*)\nlet record_re = ( \/[^]\\n\\\/]+\/ - \/#comment\/ )\n\n(*\nVariable: record_label_re\n Default regexp for <title_label> keyword pattern\n*)\nlet record_label_re = \/[^]\\n]+\/\n\n\n(* Group: Record definition *)\n\n(*\nView: record_noempty\n INI File Record with no empty lines allowed.\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n*)\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\n\n(*\nView: record\n Generic INI File record\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n\n Sample Usage:\n > let record = IniFile.record title entry\n*)\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n\n(*\n\nGroup: Lens definition\n\nView: lns_noempty\n Generic INI File lens with no empty lines\n\n Parameters:\n record:lens - record lens to use. See <record_noempty>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns_noempty record comment\n*)\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\n\n(*\nView: lns\n Generic INI File lens\n\n Parameters:\n record:lens - record lens to use. See <record>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns record comment\n*)\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n","old_contents":"(*\nModule: IniFile\n Generic module to create INI files lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: TODO\n Things to add in the future\n - Support double quotes in value\n\nAbout: Lens usage\n This lens is made to provide generic primitives to construct INI File lenses.\n See <Puppet>, <PHP>, <MySQL> or <Dput> for examples of real life lenses using it.\n\n*)\n\nmodule IniFile =\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Internal primitives *)\n\n(*\nVariable: eol\n End of line, inherited from <Util.eol>\n*)\nlet eol = Util.eol\n\n(*\nView: empty\n Empty line, an <eol> subnode\n*)\nlet empty = [ eol ]\n\n\n(* Group: Separators *)\n\n\n\n(*\nVariable: sep\n Generic separator\n\n Parameters:\n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep (pat:regexp) (default:string)\n = Sep.opt_space . del pat default\n\n(*\nVariable: sep_re\n The default regexp for a separator\n*)\n\nlet sep_re = \/[=:]\/\n\n(*\nVariable: sep_default\n The default separator value\n*)\nlet sep_default = \"=\"\n\n\n(* Group: Stores *)\n\n\n(*\nVariable: sto_to_eol\n Store until end of line\n*)\nlet sto_to_eol = Sep.opt_space . store Rx.space_in\n\n(*\nVariable: to_comment_re\n Regex until comment\n*)\nlet to_comment_re = \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n(*\nVariable: sto_to_comment\n Store until comment\n*)\nlet sto_to_comment = Sep.opt_space . store to_comment_re\n\nlet sto_multiline = Sep.opt_space\n . store (to_comment_re\n . (\/[ \\t]*\\n\/ . Rx.space . to_comment_re)*)\n\n\n(* Group: Define comment and defaults *)\n\n(*\nView: comment\n Map comments into \"#comment\" nodes\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment \"#\" \"#\"\n let comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment (pat:regexp) (default:string)\n = [ label \"#comment\" . sep pat default\n\t\t . sto_to_eol? . eol ]\n(*\nVariable: comment_re\n Default regexp for <comment> pattern\n*)\n\nlet comment_re = \/[;#]\/\n\n(*\nVariable: comment_default\n Default value for <comment> pattern\n*)\nlet comment_default = \";\"\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Group: entry includes comments *)\n\n(*\nView: entry\n Generic INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry setting sep comment\n*)\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment\n\n\nlet entry_multiline (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_multiline? . (comment|eol) ] | comment\n\n\n(*\nView: indented_entry\n Generic INI File entry that might be indented with an arbitrary\n amount of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.indented_entry setting sep comment\n*)\nlet indented_entry (kw:regexp) (sep:lens) (comment:lens)\n = [ Util.del_opt_ws \"\" .\n key kw . sep . sto_to_comment? .\n (comment|eol)\n ]\n | comment\n\n(*\nVariable: entry_re\n Default regexp for <entry> keyword\n*)\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9._-]+\/ )\n\n\n(************************************************************************\n * Group: RECORD\n *************************************************************************)\n\n(* Group: Title definition *)\n\n(*\nView: title\n Title for <record>. This maps the title of a record as a node in the abstract tree.\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title\n Title for <record>. This maps the title of a record as a node in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet indented_title (kw:regexp)\n = Util.indent . title kw\n\n(*\nView: title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree.\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet indented_title_label (name:string) (kw:regexp)\n = Util.indent . title_label name kw\n\n\n(*\nVariable: record_re\n Default regexp for <title> keyword pattern\n*)\nlet record_re = ( \/[^]\\n\\\/]+\/ - \/#comment\/ )\n\n(*\nVariable: record_label_re\n Default regexp for <title_label> keyword pattern\n*)\nlet record_label_re = \/[^]\\n]+\/\n\n\n(* Group: Record definition *)\n\n(*\nView: record_noempty\n INI File Record with no empty lines allowed.\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n*)\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\n\n(*\nView: record\n Generic INI File record\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n\n Sample Usage:\n > let record = IniFile.record title entry\n*)\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n\n(*\n\nGroup: Lens definition\n\nView: lns_noempty\n Generic INI File lens with no empty lines\n\n Parameters:\n record:lens - record lens to use. See <record_noempty>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns_noempty record comment\n*)\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\n\n(*\nView: lns\n Generic INI File lens\n\n Parameters:\n record:lens - record lens to use. See <record>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns record comment\n*)\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0493d17d85f92e8d33ed65bd2f84d67c4575b006","subject":"Finalize doc for test_reprepro_uploaders.aug","message":"Finalize doc for test_reprepro_uploaders.aug\n","repos":"pevalme\/augeas,domcleal\/augeas,hercules-team\/augeas,ptoscano\/augeas,dafugg\/augeas,manandbytes\/augeas,jtopjian\/augeas,mchf\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mchf\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,dafugg\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kunkku\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,hercules-team\/augeas,jtopjian\/augeas,ptoscano\/augeas,mlichvar\/augeas,kumy\/augeas,lutter\/augeas,kunkku\/augeas,raphink\/augeas,kumy\/augeas,jjlin\/augeas,jasperla\/augeas,pevalme\/augeas,dafugg\/augeas,kunkku\/augeas,kumy\/augeas,domcleal\/augeas,manandbytes\/augeas,mlichvar\/augeas,lutter\/augeas,kumy\/augeas,MikaelSmith\/augeas,lutter\/augeas","old_file":"lenses\/tests\/test_reprepro_uploaders.aug","new_file":"lenses\/tests\/test_reprepro_uploaders.aug","new_contents":"(*\nModule: Test_Reprepro_Uploaders\n Provides unit tests and examples for the <Reprepro_Uploaders> lens.\n*)\n\nmodule Test_Reprepro_Uploaders =\n\n(* Test: Reprepro_Uploaders.entry\n A star condition gets mapped as direct value\n of the \"allow\" node.\n *)\ntest Reprepro_Uploaders.entry get\n \"allow * by anybody\\n\" =\n\n { \"allow\" = \"*\"\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n For simple keys, the \"by\" node gets the value \"key\"\n and the key ID gets mapped in a \"key\" subnode.\n *)\ntest Reprepro_Uploaders.entry get\n \"allow * by key ABCD1234\\n\" =\n\n { \"allow\" = \"*\"\n { \"by\" = \"key\"\n { \"key\" = \"ABCD1234\" } } }\n\n(* Test: Reprepro_Uploaders.entry\n Conditions are mapped inside a tree containing\n at least an \"and\" node and an \"or\" subnode.\n\n The value of each \"or\" subnode is the type of check\n (e.g. \"source\"), and this node contains \"or\" subnodes\n with the value(s) allowed for the check (e.g. \"bash\"). *)\ntest Reprepro_Uploaders.entry get\n \"allow source 'bash' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"source\"\n { \"or\" = \"bash\" } } }\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n Some checks use the \"contain\" keyword to loosen the condition.\n In that case, a \"contain\" subnode is added. Be sure to check for it\n to know how the condition has to be checked.\n *)\ntest Reprepro_Uploaders.entry get\n \"allow source 'bash' and binaries contain 'bash-doc' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"source\"\n { \"or\" = \"bash\" } } }\n { \"and\"\n { \"or\" = \"binaries\"\n { \"contain\" }\n { \"or\" = \"bash-doc\" } } }\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n Some checks support multiple values, separated by '|'.\n In this case, each value gets added to an \"or\" subnode.\n *)\ntest Reprepro_Uploaders.entry get\n\n \"allow sections 'main'|'restricted' and source 'bash' or binaries contain 'bash-doc' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"sections\"\n { \"or\" = \"main\" }\n { \"or\" = \"restricted\" } } }\n { \"and\"\n { \"or\" = \"source\"\n { \"or\" = \"bash\" } }\n { \"or\" = \"binaries\"\n { \"contain\" }\n { \"or\" = \"bash-doc\" } } }\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n Negated conditions are mapped with a \"not\" subnode. *)\ntest Reprepro_Uploaders.entry get\n\n \"allow not source 'bash' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"source\"\n { \"not\" }\n { \"or\" = \"bash\" } } }\n { \"by\" = \"anybody\" } }\n\n\n\n(* Variable: conf\n A full configuration *)\nlet conf = \"# ftpmaster\nallow * by key 74BF771E\n\nallow sections 'desktop\/*' by anybody\nallow sections 'gforge\/*' and binaries contain 'bzr' or not source '*melanie*'|'katya' by any key\n\"\n\n(* Test: Reprepro_Uploaders.lns\n Testing the full <conf> against <Reprepro_Uploaders.lns> *)\ntest Reprepro_Uploaders.lns get conf =\n { \"#comment\" = \"ftpmaster\" }\n { \"allow\" = \"*\"\n { \"by\" = \"key\"\n { \"key\" = \"74BF771E\" } } }\n { }\n { \"allow\"\n { \"and\" { \"or\" = \"sections\" { \"or\" = \"desktop\/*\" } } }\n { \"by\" = \"anybody\" } }\n { \"allow\"\n { \"and\" { \"or\" = \"sections\" { \"or\" = \"gforge\/*\" } } }\n { \"and\" { \"or\" = \"binaries\" { \"contain\" } { \"or\" = \"bzr\" } }\n { \"or\" = \"source\" { \"not\" } { \"or\" = \"*melanie*\" } { \"or\" = \"katya\" } } }\n { \"by\" = \"key\"\n { \"key\" = \"any\" } } }\n","old_contents":"(*\nModule: Test_Reprepro_Uploaders\n Provides unit tests and examples for the <Reprepro_Uploaders> lens.\n*)\n\nmodule Test_Reprepro_Uploaders =\n\n(* Test: Reprepro_Uploaders.entry\n A star condition gets mapped as direct value\n of the \"allow\" node.\n *)\ntest Reprepro_Uploaders.entry get\n\n \"allow * by anybody\\n\" =\n\n { \"allow\" = \"*\"\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n For simple keys, the \"by\" node gets the value \"key\"\n and the key ID gets mapped in a \"key\" subnode.\n *)\ntest Reprepro_Uploaders.entry get\n\n \"allow * by key ABCD1234\\n\" =\n\n { \"allow\" = \"*\"\n { \"by\" = \"key\"\n { \"key\" = \"ABCD1234\" } } }\n\n(* Test: Reprepro_Uploaders.entry\n Conditions are mapped inside a tree containing\n at least an \"and\" node and an \"or\" subnode.\n\n The value of each \"or\" subnode is the type of check\n (e.g. \"source\"), and this node contains \"or\" subnodes\n with the value(s) allowed for the check (e.g. \"bash\"). *)\ntest Reprepro_Uploaders.entry get\n\n \"allow source 'bash' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"source\"\n { \"or\" = \"bash\" } } }\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n Simple 'and' *)\ntest Reprepro_Uploaders.entry get\n\n \"allow source 'bash' and binaries contain 'bash-doc' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"source\"\n { \"or\" = \"bash\" } } }\n { \"and\"\n { \"or\" = \"binaries\"\n { \"contain\" }\n { \"or\" = \"bash-doc\" } } }\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n Simple 'or' *)\ntest Reprepro_Uploaders.entry get\n\n \"allow source 'bash' or binaries contain 'bash-doc' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"source\"\n { \"or\" = \"bash\" } }\n { \"or\" = \"binaries\"\n { \"contain\" }\n { \"or\" = \"bash-doc\" } } }\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n Test 'and' + 'or'\n *)\ntest Reprepro_Uploaders.entry get\n\n \"allow sections 'main'|'restricted' and source 'bash' or binaries contain 'bash-doc' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"sections\"\n { \"or\" = \"main\" }\n { \"or\" = \"restricted\" } } }\n { \"and\"\n { \"or\" = \"source\"\n { \"or\" = \"bash\" } }\n { \"or\" = \"binaries\"\n { \"contain\" }\n { \"or\" = \"bash-doc\" } } }\n { \"by\" = \"anybody\" } }\n\n(* Test: Reprepro_Uploaders.entry\n Not *)\ntest Reprepro_Uploaders.entry get\n\n \"allow not source 'bash' by anybody\\n\" =\n\n { \"allow\"\n { \"and\"\n { \"or\" = \"source\"\n { \"not\" }\n { \"or\" = \"bash\" } } }\n { \"by\" = \"anybody\" } }\n\n\n\n(* Variable: conf\n A full configuration *)\nlet conf = \"# ftpmaster\nallow * by key 74BF771E\n\nallow sections 'desktop\/*' by anybody\nallow sections 'gforge\/*' and binaries contain 'bzr' or not source '*melanie*'|'katya' by any key\n\"\n\n(* Test: Reprepro_Uploaders.lns\n Testing the full <conf> against <Reprepro_Uploaders.lns> *)\ntest Reprepro_Uploaders.lns get conf =\n { \"#comment\" = \"ftpmaster\" }\n { \"allow\" = \"*\"\n { \"by\" = \"key\"\n { \"key\" = \"74BF771E\" } } }\n { }\n { \"allow\"\n { \"and\" { \"or\" = \"sections\" { \"or\" = \"desktop\/*\" } } }\n { \"by\" = \"anybody\" } }\n { \"allow\"\n { \"and\" { \"or\" = \"sections\" { \"or\" = \"gforge\/*\" } } }\n { \"and\" { \"or\" = \"binaries\" { \"contain\" } { \"or\" = \"bzr\" } }\n { \"or\" = \"source\" { \"not\" } { \"or\" = \"*melanie*\" } { \"or\" = \"katya\" } } }\n { \"by\" = \"key\"\n { \"key\" = \"any\" } } }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cad80b6ad6cac58afa05f36b78c624cdf10b9192","subject":"Util: add empty_any","message":"Util: add empty_any\n","repos":"kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas,kunkku\/augeas,pevalme\/augeas,pevalme\/augeas,manandbytes\/augeas,lutter\/augeas,ptoscano\/augeas,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,mchf\/augeas,mchf\/augeas,manandbytes\/augeas,pevalme\/augeas,hercules-team\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n*)\n\n\n(* View: comment_generic_seteol\n Map comments and set default comment sign\n*)\n\n let comment_generic_seteol (r:regexp) (d:string) (eol:lens) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . eol ]\n\n(* View: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n comment_generic_seteol r d doseol\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: comment_c_style_or_hash\n A comment line, C-style or hash *)\n let comment_c_style_or_hash =\n comment_generic \/[ \\t]*((\\\/\\\/)|#)[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* Variable: empty_generic_re *)\n let empty_generic_re = \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic empty_generic_re\n\n(* Variable: empty_c_style_re *)\n let empty_c_style_re = \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style = empty_generic empty_c_style_re\n\n(* View: empty_any\n Either <empty> or <empty_c_style> *)\n let empty_any = empty_generic (empty_generic_re | empty_c_style_re)\n\n(* View: empty_generic_dos\n A generic definition of <empty> with dos newlines\n Map empty lines, including empty comments *)\n let empty_generic_dos (r:regexp) =\n [ del r \"\" . del \/\\r?\\n\/ \"\\n\" ]\n\n(* View: empty_dos *)\n let empty_dos =\n empty_generic_dos \/[ \\t]*#?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\") .\n (excl \"*.bak\") .\n (excl \"*.old\") .\n (excl \"#*#\")\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n*)\n\n\n(* View: comment_generic_seteol\n Map comments and set default comment sign\n*)\n\n let comment_generic_seteol (r:regexp) (d:string) (eol:lens) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . eol ]\n\n(* View: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n comment_generic_seteol r d doseol\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: comment_c_style_or_hash\n A comment line, C-style or hash *)\n let comment_c_style_or_hash =\n comment_generic \/[ \\t]*((\\\/\\\/)|#)[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* Variable: empty_generic_re *)\n let empty_generic_re = \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic empty_generic_re\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n(* View: empty_generic_dos\n A generic definition of <empty> with dos newlines\n Map empty lines, including empty comments *)\n let empty_generic_dos (r:regexp) =\n [ del r \"\" . del \/\\r?\\n\/ \"\\n\" ]\n\n(* View: empty_dos *)\n let empty_dos =\n empty_generic_dos \/[ \\t]*#?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\") .\n (excl \"*.bak\") .\n (excl \"*.old\") .\n (excl \"#*#\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"704476729dea0a69d5d4bd777fffc38a9668d609","subject":"Add a path to pg_hba.aug, fixes Trac ticket #281.","message":"Add a path to pg_hba.aug, fixes Trac ticket #281.\n","repos":"jtopjian\/augeas,kunkku\/augeas,jasperla\/augeas,manandbytes\/augeas,dafugg\/augeas,mlichvar\/augeas,dafugg\/augeas,ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,raphink\/augeas,kumy\/augeas,mchf\/augeas,hercules-team\/augeas,kumy\/augeas,jjlin\/augeas,lutter\/augeas,pevalme\/augeas,kumy\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,mchf\/augeas,jjlin\/augeas,raphink\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,kunkku\/augeas,pevalme\/augeas,lutter\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,kumy\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,MikaelSmith\/augeas","old_file":"lenses\/pg_hba.aug","new_file":"lenses\/pg_hba.aug","new_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:.]+(\\\/[0-9]+|[ \\t]+[0-9.]+)\/\n (* Variable: hostname\n Hostname, FQDN or part of an FQDN possibly \n starting with a dot. Taken from the syslog lens. *)\n let hostname = \/\\.?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: ipaddr_or_hostname *)\n let ipaddr_or_hostname = ipaddr | hostname\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr_or_hostname ]\n (* View: option\n part of <method> *)\n let option =\n let value_start = label \"value\" . Sep.equal\n in [ label \"option\" . store Rx.word\n . (Quote.quote_spaces value_start)? ]\n\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store \/[A-Za-z][A-Za-z0-9]+\/\n . ( Sep.tab . option )* ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/var\/lib\/pgsql\/*\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:.]+(\\\/[0-9]+|[ \\t]+[0-9.]+)\/\n (* Variable: hostname\n Hostname, FQDN or part of an FQDN possibly \n starting with a dot. Taken from the syslog lens. *)\n let hostname = \/\\.?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: ipaddr_or_hostname *)\n let ipaddr_or_hostname = ipaddr | hostname\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr_or_hostname ]\n (* View: option\n part of <method> *)\n let option =\n let value_start = label \"value\" . Sep.equal\n in [ label \"option\" . store Rx.word\n . (Quote.quote_spaces value_start)? ]\n\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store \/[A-Za-z][A-Za-z0-9]+\/\n . ( Sep.tab . option )* ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"894b7246ba634b85e4a7d7da7247f1fde194aaf4","subject":"Use Sys.getenv('HOME') in filter instead of ~ since it's not expanded","message":"Use Sys.getenv('HOME') in filter instead of ~ since it's not expanded\n","repos":"kunkku\/augeas,domcleal\/augeas,jjlin\/augeas,jtopjian\/augeas,hercules-team\/augeas,raphink\/augeas,dafugg\/augeas,kumy\/augeas,dafugg\/augeas,pevalme\/augeas,lutter\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,mlichvar\/augeas,pevalme\/augeas,kunkku\/augeas,domcleal\/augeas,kumy\/augeas,ptoscano\/augeas,dafugg\/augeas,jtopjian\/augeas,jjlin\/augeas,mchf\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,raphink\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,MikaelSmith\/augeas,kunkku\/augeas,domcleal\/augeas,manandbytes\/augeas,lutter\/augeas,manandbytes\/augeas,mlichvar\/augeas,jasperla\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,kumy\/augeas,jasperla\/augeas,ptoscano\/augeas","old_file":"lenses\/ssh.aug","new_file":"lenses\/ssh.aug","new_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let spc = Util.del_ws_spc\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_spc = store \/[^ \\t\\n]+\/\n let value_to_comma = store \/[^, \\t\\n]+\/\n\n let array_entry (k:string) =\n [ indent . key k . counter k . [ spc . seq k . value_to_spc]* . eol ]\n\n let commas_entry (k:string) =\n\t[ key k . counter k . spc .\n\t [ seq k . value_to_comma] . ([ seq k . comma . value_to_comma])* . eol ]\n\n let send_env = array_entry \"SendEnv\"\n\n let proxy_command = [ indent . key \"ProxyCommand\" . spc . value_to_eol . eol ]\n\n let fw_entry (k:string) = [ indent . key k . spc .\n\t[ key \/[^ \\t\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let remote_fw = fw_entry \"RemoteForward\"\n let local_fw = fw_entry \"LocalForward\"\n\n let ciphers = commas_entry \"Ciphers\"\n let macs\t= commas_entry \"MACs\"\n\n let other_entry =\n\t[ indent . key key_re . spc . value_to_spc . eol ]\n\n let entry = (comment | empty\n\t| send_env\n\t| proxy_command\n\t| remote_fw\n\t| local_fw\n\t| macs\n\t| ciphers\n\t| other_entry)\n\n let host = [ key \"Host\" . spc . value_to_eol . eol . entry* ]\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","old_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let spc = Util.del_ws_spc\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_spc = store \/[^ \\t\\n]+\/\n let value_to_comma = store \/[^, \\t\\n]+\/\n\n let array_entry (k:string) =\n [ indent . key k . counter k . [ spc . seq k . value_to_spc]* . eol ]\n\n let commas_entry (k:string) =\n\t[ key k . counter k . spc .\n\t [ seq k . value_to_comma] . ([ seq k . comma . value_to_comma])* . eol ]\n\n let send_env = array_entry \"SendEnv\"\n\n let proxy_command = [ indent . key \"ProxyCommand\" . spc . value_to_eol . eol ]\n\n let fw_entry (k:string) = [ indent . key k . spc .\n\t[ key \/[^ \\t\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let remote_fw = fw_entry \"RemoteForward\"\n let local_fw = fw_entry \"LocalForward\"\n\n let ciphers = commas_entry \"Ciphers\"\n let macs\t= commas_entry \"MACs\"\n\n let other_entry =\n\t[ indent . key key_re . spc . value_to_spc . eol ]\n\n let entry = (comment | empty\n\t| send_env\n\t| proxy_command\n\t| remote_fw\n\t| local_fw\n\t| macs\n\t| ciphers\n\t| other_entry)\n\n let host = [ key \"Host\" . spc . value_to_eol . eol . entry* ]\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl \"~\/.ssh\/config\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8135581ec140afc561e48776e170363da4920b80","subject":"Group: Dropped nisentry (not valid here)","message":"Group: Dropped nisentry (not valid here)","repos":"kunkku\/augeas,pevalme\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,dafugg\/augeas,hercules-team\/augeas,kunkku\/augeas,mlichvar\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,lutter\/augeas,dafugg\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,manandbytes\/augeas,pevalme\/augeas,pevalme\/augeas,ptoscano\/augeas,jjlin\/augeas,ptoscano\/augeas,mchf\/augeas,hercules-team\/augeas,manandbytes\/augeas,jasperla\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,raphink\/augeas,lutter\/augeas,ptoscano\/augeas,jtopjian\/augeas,raphink\/augeas,jjlin\/augeas,mchf\/augeas","old_file":"lenses\/group.aug","new_file":"lenses\/group.aug","new_contents":"(* Group module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man 5 group\n\n*)\n\nmodule Group =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\n\nlet colon = Sep.colon\nlet comma = Sep.comma\n\nlet sto_to_spc = store Rx.space_in\nlet sto_to_col = store \/[^:\\n]+\/\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\nlet word = Rx.word\nlet password = \/[A-Za-z0-9_.!*-]*\/\nlet integer = Rx.integer\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet user = [ label \"user\" . store word ]\nlet user_list = Build.opt_list user comma\nlet params = [ label \"password\" . store password . colon ]\n . [ label \"gid\" . store integer . colon ]\n . user_list?\nlet entry = Build.key_value_line word colon params\n\nlet nisdefault =\n let overrides =\n colon\n . [ label \"password\" . store word? . colon ]\n . [ label \"gid\" . store integer? . colon ]\n . user_list? in\n [ dels \"+\" . label \"@nisdefault\" . overrides? . eol ]\n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry|nisdefault) *\n\nlet filter = incl \"\/etc\/group\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Group module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man 5 group\n\n*)\n\nmodule Group =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\n\nlet colon = Sep.colon\nlet comma = Sep.comma\n\nlet sto_to_spc = store Rx.space_in\nlet sto_to_col = store \/[^:\\n]+\/\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\nlet word = Rx.word\nlet password = \/[A-Za-z0-9_.!*-]*\/\nlet integer = Rx.integer\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet user = [ label \"user\" . store word ]\nlet user_list = Build.opt_list user comma\nlet params = [ label \"password\" . store password . colon ]\n . [ label \"gid\" . store integer . colon ]\n . user_list?\nlet entry = Build.key_value_line word colon params\n\n(* A NIS entry has nothing bar the +@::: bits. *)\nlet nisentry =\n let nisgroup = \/\\+\\@[A-Za-z0-9_.-]+\/ in\n let colons = \":::\" in\n [ dels \"+@\" . label \"@nis\" . store word . dels colons . eol ]\n\nlet nisdefault =\n let overrides =\n colon\n . [ label \"password\" . store word? . colon ]\n . [ label \"gid\" . store integer? . colon ]\n . user_list? in\n [ dels \"+\" . label \"@nisdefault\" . overrides? . eol ]\n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry|nisentry|nisdefault) *\n\nlet filter = incl \"\/etc\/group\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9c572373a59d302f748db0fdd494783bb1bb91d7","subject":"Update the resolv lens (#708)","message":"Update the resolv lens (#708)\n\nCloses: #707","repos":"mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas,mlichvar\/augeas","old_file":"lenses\/resolv.aug","new_file":"lenses\/resolv.aug","new_contents":"(*\nModule: Resolv\n Parses \/etc\/resolv.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man resolv.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/resolv.conf. See <filter>.\n*)\n\nmodule Resolv =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \"# \"\n\n(* View: comment_eol *)\nlet comment_eol = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \" # \"\n\n(* View: empty *)\nlet empty = Util.empty_generic_dos \/[ \\t]*[#;]?[ \\t]*\/\n\n\n(************************************************************************\n * Group: MAIN OPTIONS\n *************************************************************************)\n\n(* View: netmask\nA network mask for IP addresses *)\nlet netmask = [ label \"netmask\" . Util.del_str \"\/\" . store Rx.ip ]\n\n(* View: ipaddr\nAn IP address or range with an optional mask *)\nlet ipaddr = [label \"ipaddr\" . store Rx.ip . netmask?]\n\n\n(* View: nameserver\n A nameserver entry *)\nlet nameserver = Build.key_value_line_comment\n \"nameserver\" Sep.space (store Rx.ip) comment_eol\n\n(* View: domain *)\nlet domain = Build.key_value_line_comment\n \"domain\" Sep.space (store Rx.word) comment_eol\n\n(* View: search *)\nlet search = Build.key_value_line_comment\n \"search\" Sep.space\n (Build.opt_list\n [label \"domain\" . store Rx.word]\n Sep.space)\n comment_eol\n\n(* View: sortlist *)\nlet sortlist = Build.key_value_line_comment\n \"sortlist\" Sep.space\n (Build.opt_list\n ipaddr\n Sep.space)\n comment_eol\n\n(* View: lookup *)\nlet lookup =\n let lookup_entry = Build.flag(\"bind\"|\"file\"|\"yp\")\n in Build.key_value_line_comment\n \"lookup\" Sep.space\n (Build.opt_list\n lookup_entry\n Sep.space)\n comment_eol\n\n(* View: family *)\nlet family =\n let family_entry = Build.flag(\"inet4\"|\"inet6\")\n in Build.key_value_line_comment\n \"family\" Sep.space\n (Build.opt_list\n family_entry\n Sep.space)\n comment_eol\n\n(************************************************************************\n * Group: SPECIAL OPTIONS\n *************************************************************************)\n\n(* View: ip6_dotint\n ip6-dotint option, which supports negation *)\nlet ip6_dotint =\n let negate = [ del \"no-\" \"no-\" . label \"negate\" ]\n in [ negate? . key \"ip6-dotint\" ]\n\n(* View: options\n Options values *)\nlet options =\n let options_entry = Build.key_value (\"ndots\"|\"timeout\"|\"attempts\")\n (Util.del_str \":\") (store Rx.integer)\n | Build.flag (\"debug\"|\"rotate\"|\"no-check-names\"\n |\"inet6\"|\"ip6-bytestring\"|\"edns0\"\n |\"single-request\"|\"single-request-reopen\"\n |\"no-tld-query\"|\"use-vc\"|\"no-reload\")\n | ip6_dotint\n\n in Build.key_value_line_comment\n \"options\" Sep.space\n (Build.opt_list\n options_entry\n Sep.space)\n comment_eol\n\n(* View: entry *)\nlet entry = nameserver\n | domain\n | search\n | sortlist\n | options\n | lookup\n | family\n\n(* View: lns *)\nlet lns = ( empty | comment | entry )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/resolv.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Resolv\n Parses \/etc\/resolv.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man resolv.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/resolv.conf. See <filter>.\n*)\n\nmodule Resolv =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \"# \"\n\n(* View: comment_eol *)\nlet comment_eol = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \" # \"\n\n(* View: empty *)\nlet empty = Util.empty_generic_dos \/[ \\t]*[#;]?[ \\t]*\/\n\n\n(************************************************************************\n * Group: MAIN OPTIONS\n *************************************************************************)\n\n(* View: netmask\nA network mask for IP addresses *)\nlet netmask = [ label \"netmask\" . Util.del_str \"\/\" . store Rx.ip ]\n\n(* View: ipaddr\nAn IP address or range with an optional mask *)\nlet ipaddr = [label \"ipaddr\" . store Rx.ip . netmask?]\n\n\n(* View: nameserver\n A nameserver entry *)\nlet nameserver = Build.key_value_line_comment\n \"nameserver\" Sep.space (store Rx.ip) comment_eol\n\n(* View: domain *)\nlet domain = Build.key_value_line_comment\n \"domain\" Sep.space (store Rx.word) comment_eol\n\n(* View: search *)\nlet search = Build.key_value_line_comment\n \"search\" Sep.space\n (Build.opt_list\n [label \"domain\" . store Rx.word]\n Sep.space)\n comment_eol\n\n(* View: sortlist *)\nlet sortlist = Build.key_value_line_comment\n \"sortlist\" Sep.space\n (Build.opt_list\n ipaddr\n Sep.space)\n comment_eol\n\n(* View: lookup *)\nlet lookup =\n let lookup_entry = Build.flag(\"bind\"|\"file\"|\"yp\")\n in Build.key_value_line_comment\n \"lookup\" Sep.space\n (Build.opt_list\n lookup_entry\n Sep.space)\n comment_eol\n\n(* View: family *)\nlet family =\n let family_entry = Build.flag(\"inet4\"|\"inet6\")\n in Build.key_value_line_comment\n \"family\" Sep.space\n (Build.opt_list\n family_entry\n Sep.space)\n comment_eol\n\n(************************************************************************\n * Group: SPECIAL OPTIONS\n *************************************************************************)\n\n(* View: ip6_dotint\n ip6-dotint option, which supports negation *)\nlet ip6_dotint =\n let negate = [ del \"no-\" \"no-\" . label \"negate\" ]\n in [ negate? . key \"ip6-dotint\" ]\n\n(* View: options\n Options values *)\nlet options =\n let options_entry = Build.key_value (\"ndots\"|\"timeout\"|\"attempts\")\n (Util.del_str \":\") (store Rx.integer)\n | Build.flag (\"debug\"|\"rotate\"|\"no-check-names\"\n |\"inet6\"|\"ip6-bytestring\"|\"edns0\"\n\t\t\t\t |\"single-request-reopen\")\n | ip6_dotint\n\n in Build.key_value_line_comment\n \"options\" Sep.space\n (Build.opt_list\n options_entry\n Sep.space)\n comment_eol\n\n(* View: entry *)\nlet entry = nameserver\n | domain\n | search\n | sortlist\n | options\n | lookup\n | family\n\n(* View: lns *)\nlet lns = ( empty | comment | entry )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/resolv.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"94f432ea8074d2c6cd43d1227b7911a8625c79cb","subject":"Hooks without any lines are valid in logrotate.aug","message":"Hooks without any lines are valid in logrotate.aug\n","repos":"jasperla\/augeas,kumy\/augeas,MikaelSmith\/augeas,mchf\/augeas,domcleal\/augeas,kunkku\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kunkku\/augeas,mlichvar\/augeas,kunkku\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas,pevalme\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,ptoscano\/augeas,hercules-team\/augeas,jasperla\/augeas,MikaelSmith\/augeas,mchf\/augeas,jjlin\/augeas,jtopjian\/augeas,raphink\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,lutter\/augeas,kumy\/augeas,manandbytes\/augeas,mlichvar\/augeas,domcleal\/augeas,pevalme\/augeas,jjlin\/augeas,ptoscano\/augeas,dafugg\/augeas,raphink\/augeas,mlichvar\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas","old_file":"lenses\/logrotate.aug","new_file":"lenses\/logrotate.aug","new_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = \/[0-9]+\/\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = \/\\\/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n (* define comments and empty lines *)\n let comment (indent:string) =\n let nl = Util.del_str \"\\n\" in\n [ label \"#comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n].*)?\/ . nl ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_val . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ del \/[ \\t]*\/ indent . key \"create\" .\n ( mode | mode . owner | mode . owner . group )?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" size indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" size indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . del \"\\n\" \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ del \/[ \\t]*\/ \"\\t\" . key hook_names . eol .\n hook_lines? .\n del \/[ \\t]*endscript[ \\t]*\\n\/ \"\\tendscript\\n\" ]\n\n (* Define rule *)\n\n let body = del \/\\{[ \\t]*\\n\/ \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n let rule =\n [ label \"rule\" . Util.indent .\n [ label \"file\" . store filename ] .\n\t [ del \/[ \\t\\n]+\/ \" \" . label \"file\" . store filename ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = \/[0-9]+\/\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = \/\\\/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n (* define comments and empty lines *)\n let comment (indent:string) =\n let nl = Util.del_str \"\\n\" in\n [ label \"#comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n].*)?\/ . nl ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_val . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ del \/[ \\t]*\/ indent . key \"create\" .\n ( mode | mode . owner | mode . owner . group )?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" size indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" size indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . del \"\\n\" \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ del \/[ \\t]*\/ \"\\t\" . key hook_names . eol .\n hook_lines .\n del \/[ \\t]*endscript[ \\t]*\\n\/ \"\\tendscript\\n\" ]\n\n (* Define rule *)\n\n let body = del \/\\{[ \\t]*\\n\/ \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n let rule =\n [ label \"rule\" . Util.indent .\n [ label \"file\" . store filename ] .\n\t [ del \/[ \\t\\n]+\/ \" \" . label \"file\" . store filename ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8d6f41faf6d516163b7378cf606cc5d22fa36c3a","subject":"Shellvars: process \/etc\/environment","message":"Shellvars: process \/etc\/environment\n","repos":"jjlin\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,dafugg\/augeas,kumy\/augeas,jasperla\/augeas,dafugg\/augeas,lutter\/augeas,kunkku\/augeas,jasperla\/augeas,hercules-team\/augeas,kumy\/augeas,mlichvar\/augeas,kunkku\/augeas,manandbytes\/augeas,manandbytes\/augeas,hercules-team\/augeas,kunkku\/augeas,domcleal\/augeas,mchf\/augeas,pevalme\/augeas,MikaelSmith\/augeas,domcleal\/augeas,jjlin\/augeas,mlichvar\/augeas,raphink\/augeas,domcleal\/augeas,dafugg\/augeas,kumy\/augeas,pevalme\/augeas,jtopjian\/augeas,kumy\/augeas,mlichvar\/augeas,jtopjian\/augeas,lutter\/augeas,raphink\/augeas,lutter\/augeas,ptoscano\/augeas,mchf\/augeas,pevalme\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n let bquot = \/`[^`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let lns = (comment | empty | source | kv | unset | bare_export) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n let bquot = \/`[^`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let lns = (comment | empty | source | kv | unset | bare_export) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"11671bd8b86e22b9db52d96af8dda3c3da8099f3","subject":"Slapd: remove duplicate entry in database_re","message":"Slapd: remove duplicate entry in database_re\n","repos":"jjlin\/augeas,mlichvar\/augeas,raphink\/augeas,manandbytes\/augeas,jjlin\/augeas,jtopjian\/augeas,raphink\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,mchf\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,jasperla\/augeas,ptoscano\/augeas,dafugg\/augeas,lutter\/augeas,ptoscano\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,kunkku\/augeas,mlichvar\/augeas,manandbytes\/augeas,dafugg\/augeas,kunkku\/augeas,jjlin\/augeas,kunkku\/augeas,lutter\/augeas,dafugg\/augeas,mchf\/augeas,hercules-team\/augeas,pevalme\/augeas,hercules-team\/augeas,jasperla\/augeas,lutter\/augeas,pevalme\/augeas,ptoscano\/augeas,pevalme\/augeas","old_file":"lenses\/slapd.aug","new_file":"lenses\/slapd.aug","new_contents":"(* Slapd module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man slapd.conf(5), man slapd.access (5)\n\n*)\n\nmodule Slapd =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet sep = del \/[ \\t\\n]+\/ \" \"\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet sto_to_spc = store \/[^\\\\# \\t\\n]+\/\nlet sto_to_by = store (\/[^\\\\# \\t\\n]+\/ - \"by\")\n\nlet comment = Util.comment\nlet empty = Util.empty\n\n(************************************************************************\n * ACCESS TO\n *************************************************************************)\n\nlet access_re = \"access to\"\nlet who = [ spc . label \"who\" . sto_to_spc ]\nlet what = [ spc . label \"access\" . sto_to_by ]\n\n(* TODO: parse the control field, see man slapd.access (5) *)\nlet control = [ spc . label \"control\" . sto_to_by ]\nlet by = [ sep . key \"by\". who . (what . control?)? ]\n\nlet access = [ key access_re . spc. sto_to_spc . by+ . eol ]\n\n(************************************************************************\n * GLOBAL\n *************************************************************************)\n\n(* TODO: parse special field separately, see man slapd.conf (5) *)\nlet global_re = \"allow\"\n | \"argsfile\"\n | \"attributeoptions\"\n | \"attributetype\"\n | \"authz-policy\"\n | \"ldap\"\n | \"dn\"\n | \"concurrency\"\n | \"cron_max_pending\"\n | \"conn_max_pending_auth\"\n | \"defaultsearchbase\"\n | \"disallow\"\n | \"ditcontentrule\"\n | \"gentlehup\"\n | \"idletimeout\"\n | \"include\"\n | \"index_substr_if_minlen\"\n | \"index_substr_if_maxlen\"\n | \"index_substr_any_len\"\n | \"index_substr_any_step\"\n | \"localSSF\"\n | \"loglevel\"\n | \"moduleload\"\n | \"modulepath\"\n | \"objectclass\"\n | \"objectidentifier\"\n | \"password-hash\"\n | \"password-crypt-salt-format\"\n | \"pidfile\"\n | \"referral\"\n | \"replica-argsfile\"\n | \"replica-pidfile\"\n | \"replicationinterval\"\n | \"require\"\n | \"reverse-lookup\"\n | \"rootDSE\"\n | \"sasl-host \"\n | \"sasl-realm\"\n | \"sasl-secprops\"\n | \"schemadn\"\n | \"security\"\n | \"sizelimit\"\n | \"sockbuf_max_incoming \"\n | \"sockbuf_max_incoming_auth\"\n | \"threads\"\n | \"timelimit time\"\n | \"tool-threads\"\n | \"TLSCipherSuite\"\n | \"TLSCACertificateFile\"\n | \"TLSCACertificatePath\"\n | \"TLSCertificateFile\"\n | \"TLSCertificateKeyFile\"\n | \"TLSDHParamFile\"\n | \"TLSRandFile\"\n | \"TLSVerifyClient\"\n | \"TLSCRLCheck\"\n | \"backend\"\n\nlet global = Build.key_ws_value global_re\n\n(************************************************************************\n * DATABASE\n *************************************************************************)\n\n(* TODO: support all types of database backend *)\nlet database_hdb = \"cachesize\"\n | \"cachefree\"\n | \"checkpoint\"\n | \"dbconfig\"\n | \"dbnosync\"\n | \"directory\"\n | \"dirtyread\"\n | \"idlcachesize\"\n | \"index\"\n | \"linearindex\"\n | \"lockdetect\"\n | \"mode\"\n | \"searchstack\"\n | \"shm_key\"\n\nlet database_re = \"suffix\"\n | \"lastmod\"\n | \"limits\"\n | \"maxderefdepth\"\n | \"overlay\"\n | \"readonly\"\n | \"replica uri\"\n | \"replogfile\"\n | \"restrict\"\n | \"rootdn\"\n | \"rootpw\"\n | \"subordinate\"\n | \"syncrepl rid\"\n | \"updatedn\"\n | \"updateref\"\n | database_hdb\n\nlet database = [ key \"database\"\n . spc\n . sto_to_eol\n . eol\n . (comment|empty|Build.key_ws_value database_re|access)* ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|global|access)* . (database)*\n\nlet filter = incl \"\/etc\/ldap\/slapd.conf\"\n . incl \"\/etc\/openldap\/slapd.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Slapd module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man slapd.conf(5), man slapd.access (5)\n\n*)\n\nmodule Slapd =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet sep = del \/[ \\t\\n]+\/ \" \"\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet sto_to_spc = store \/[^\\\\# \\t\\n]+\/\nlet sto_to_by = store (\/[^\\\\# \\t\\n]+\/ - \"by\")\n\nlet comment = Util.comment\nlet empty = Util.empty\n\n(************************************************************************\n * ACCESS TO\n *************************************************************************)\n\nlet access_re = \"access to\"\nlet who = [ spc . label \"who\" . sto_to_spc ]\nlet what = [ spc . label \"access\" . sto_to_by ]\n\n(* TODO: parse the control field, see man slapd.access (5) *)\nlet control = [ spc . label \"control\" . sto_to_by ]\nlet by = [ sep . key \"by\". who . (what . control?)? ]\n\nlet access = [ key access_re . spc. sto_to_spc . by+ . eol ]\n\n(************************************************************************\n * GLOBAL\n *************************************************************************)\n\n(* TODO: parse special field separately, see man slapd.conf (5) *)\nlet global_re = \"allow\"\n | \"argsfile\"\n | \"attributeoptions\"\n | \"attributetype\"\n | \"authz-policy\"\n | \"ldap\"\n | \"dn\"\n | \"concurrency\"\n | \"cron_max_pending\"\n | \"conn_max_pending_auth\"\n | \"defaultsearchbase\"\n | \"disallow\"\n | \"ditcontentrule\"\n | \"gentlehup\"\n | \"idletimeout\"\n | \"include\"\n | \"index_substr_if_minlen\"\n | \"index_substr_if_maxlen\"\n | \"index_substr_any_len\"\n | \"index_substr_any_step\"\n | \"localSSF\"\n | \"loglevel\"\n | \"moduleload\"\n | \"modulepath\"\n | \"objectclass\"\n | \"objectidentifier\"\n | \"password-hash\"\n | \"password-crypt-salt-format\"\n | \"pidfile\"\n | \"referral\"\n | \"replica-argsfile\"\n | \"replica-pidfile\"\n | \"replicationinterval\"\n | \"require\"\n | \"reverse-lookup\"\n | \"rootDSE\"\n | \"sasl-host \"\n | \"sasl-realm\"\n | \"sasl-secprops\"\n | \"schemadn\"\n | \"security\"\n | \"sizelimit\"\n | \"sockbuf_max_incoming \"\n | \"sockbuf_max_incoming_auth\"\n | \"threads\"\n | \"timelimit time\"\n | \"tool-threads\"\n | \"TLSCipherSuite\"\n | \"TLSCACertificateFile\"\n | \"TLSCACertificatePath\"\n | \"TLSCertificateFile\"\n | \"TLSCertificateKeyFile\"\n | \"TLSDHParamFile\"\n | \"TLSRandFile\"\n | \"TLSVerifyClient\"\n | \"TLSCRLCheck\"\n | \"backend\"\n\nlet global = Build.key_ws_value global_re\n\n(************************************************************************\n * DATABASE\n *************************************************************************)\n\n(* TODO: support all types of database backend *)\nlet database_hdb = \"cachesize\"\n | \"cachefree\"\n | \"checkpoint\"\n | \"dbconfig\"\n | \"dbnosync\"\n | \"directory\"\n | \"dirtyread\"\n | \"idlcachesize\"\n | \"index\"\n | \"linearindex\"\n | \"lockdetect\"\n | \"mode\"\n | \"searchstack\"\n | \"shm_key\"\n\nlet database_re = \"suffix\"\n | \"lastmod\"\n | \"limits\"\n | \"maxderefdepth\"\n | \"overlay\"\n | \"readonly\"\n | \"replica uri\"\n | \"replogfile\"\n | \"restrict\"\n | \"rootdn\"\n | \"rootpw\"\n | \"suffix\"\n | \"subordinate\"\n | \"syncrepl rid\"\n | \"updatedn\"\n | \"updateref\"\n | database_hdb\n\nlet database = [ key \"database\"\n . spc\n . sto_to_eol\n . eol\n . (comment|empty|Build.key_ws_value database_re|access)* ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|global|access)* . (database)*\n\nlet filter = incl \"\/etc\/ldap\/slapd.conf\"\n . incl \"\/etc\/openldap\/slapd.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5e426680edd603ed621da0975723a2ec68424502","subject":"Toml: time_re can start with one digit only","message":"Toml: time_re can start with one digit only\n","repos":"mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas,hercules-team\/augeas,kunkku\/augeas,kunkku\/augeas,ptoscano\/augeas,ptoscano\/augeas,mlichvar\/augeas,mlichvar\/augeas,hercules-team\/augeas","old_file":"lenses\/toml.aug","new_file":"lenses\/toml.aug","new_contents":"(*\nModule: Toml\n Parses TOML files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n https:\/\/github.com\/mojombo\/toml\/blob\/master\/README.md\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to TOML files.\n\nAbout: Examples\n The <Test_Toml> file contains various examples and tests.\n*)\n\nmodule Toml =\n\n(* Group: base definitions *)\n\n(* View: comment\n A simple comment *)\nlet comment = IniFile.comment \"#\" \"#\"\n\n(* View: empty\n An empty line *)\nlet empty = Util.empty\n\n(* View: eol\n An end of line *)\nlet eol = Util.eol\n\n\n(* Group: value entries *)\n\nlet bare_re_noquot = (\/[^][\", \\t\\r\\n]\/ - \"#\")\nlet bare_re = (\/[^][,\\r=]\/ - \"#\")+\nlet no_quot = \/[^][\"\\r\\n]*\/\nlet bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?))\nlet quoted = Quote.do_dquote (store (\/[^\"]\/ . \"#\"* . \/[^\"]\/))\n\nlet ws = del \/[ \\t\\n]*\/ \"\"\n\nlet space_or_empty = [ del \/[ \\t\\n]+\/ \" \" ]\n\nlet comma = Util.del_str \",\" . (space_or_empty | comment)?\nlet lbrace = Util.del_str \"{\" . (space_or_empty | comment)?\nlet rbrace = Util.del_str \"}\"\nlet lbrack = Util.del_str \"[\" . (space_or_empty | comment)?\nlet rbrack = Util.del_str \"]\"\n\n(* This follows the definition of 'string' at https:\/\/www.json.org\/\n It's a little wider than what's allowed there as it would accept\n nonsensical \\u escapes *)\nlet triple_dquote = Util.del_str \"\\\"\\\"\\\"\"\nlet str_store = Quote.dquote . store \/([^\\\\\"]|\\\\\\\\[\"\\\/bfnrtu\\\\])*\/ . Quote.dquote\n\nlet str_store_multi = triple_dquote . eol\n . store \/([^\\\\\"]|\\\\\\\\[\"\\\/bfnrtu\\\\])*\/\n . del \/\\n[ \\t]*\/ \"\\n\" . triple_dquote\n\nlet str_store_literal = Quote.squote . store \/([^\\\\']|\\\\\\\\['\\\/bfnrtu\\\\])*\/ . Quote.squote\n\nlet integer =\n let base10 = \/[+-]?[0-9_]+\/\n in let hex = \/0x[A-Za-z0-9]+\/\n in let oct = \/0o[0-7]+\/\n in let bin = \/0b[01]+\/\n in [ label \"integer\" . store (base10 | hex | oct | bin) ]\n\nlet float =\n let n = \/[0-9_]+\/\n in let pm = \/[+-]?\/\n in let z = pm . n\n in let decim = \".\" . n\n in let exp = \/[Ee]\/ . z\n in let num = z . decim | z . exp | z . decim . exp\n in let inf = pm . \"inf\"\n in let nan = pm . \"nan\"\n in [ label \"float\" . store (num | inf | nan) ]\n\nlet str = [ label \"string\" . str_store ]\n\nlet str_multi = [ label \"string_multi\" . str_store_multi ]\n\nlet str_literal = [ label \"string_literal\" . str_store_literal ]\n\nlet bool (r:regexp) = [ label \"bool\" . store r ]\n\n\nlet date_re = \/[0-9]{4}-[0-9]{2}-[0-9]{2}\/\nlet time_re = \/[0-9]{1,2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?[A-Z]*\/\n\nlet datetime = [ label \"datetime\" . store (date_re . \/[T ]\/ . time_re) ]\nlet date = [ label \"date\" . store date_re ]\nlet time = [ label \"time\" . store time_re ]\n\nlet norec = str | str_multi | str_literal\n | integer | float | bool \/true|false\/\n | datetime | date | time\n\nlet array (value:lens) = [ label \"array\" . lbrack\n . ( ( Build.opt_list value comma . space_or_empty? . rbrack )\n | rbrack ) ]\n\nlet array_norec = array norec\n\nlet rec array_rec = array (norec | array_rec)\n\nlet entry_base (value:lens) = [ label \"entry\" . store Rx.word . Sep.space_equal . value ]\n\nlet inline_table (value:lens) = [ label \"inline_table\" . lbrace\n . ( (Build.opt_list (entry_base value) comma . space_or_empty? . rbrace)\n | rbrace ) ]\n\nlet entry = [ label \"entry\" . Util.indent . store Rx.word . Sep.space_equal\n . (norec | array_rec | inline_table norec) . (eol | comment) ]\n\n(* Group: tables *)\n\n(* View: table_gen\n A generic table *)\nlet table_gen (name:string) (lbrack:string) (rbrack:string) =\n let title = Util.indent . label name\n . Util.del_str lbrack\n . store \/[^]\\r\\n.]+(\\.[^]\\r\\n.]+)*\/\n . Util.del_str rbrack . eol\n in [ title . (entry|empty|comment)* ]\n\n(* View: table\n A table or array of tables *)\nlet table = table_gen \"table\" \"[\" \"]\"\n | table_gen \"@table\" \"[[\" \"]]\"\n\n(* Group: lens *)\n\n(* View: lns\n The Toml lens *)\nlet lns = (entry | empty | comment)* . table*\n","old_contents":"(*\nModule: Toml\n Parses TOML files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n https:\/\/github.com\/mojombo\/toml\/blob\/master\/README.md\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to TOML files.\n\nAbout: Examples\n The <Test_Toml> file contains various examples and tests.\n*)\n\nmodule Toml =\n\n(* Group: base definitions *)\n\n(* View: comment\n A simple comment *)\nlet comment = IniFile.comment \"#\" \"#\"\n\n(* View: empty\n An empty line *)\nlet empty = Util.empty\n\n(* View: eol\n An end of line *)\nlet eol = Util.eol\n\n\n(* Group: value entries *)\n\nlet bare_re_noquot = (\/[^][\", \\t\\r\\n]\/ - \"#\")\nlet bare_re = (\/[^][,\\r=]\/ - \"#\")+\nlet no_quot = \/[^][\"\\r\\n]*\/\nlet bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?))\nlet quoted = Quote.do_dquote (store (\/[^\"]\/ . \"#\"* . \/[^\"]\/))\n\nlet ws = del \/[ \\t\\n]*\/ \"\"\n\nlet space_or_empty = [ del \/[ \\t\\n]+\/ \" \" ]\n\nlet comma = Util.del_str \",\" . (space_or_empty | comment)?\nlet lbrace = Util.del_str \"{\" . (space_or_empty | comment)?\nlet rbrace = Util.del_str \"}\"\nlet lbrack = Util.del_str \"[\" . (space_or_empty | comment)?\nlet rbrack = Util.del_str \"]\"\n\n(* This follows the definition of 'string' at https:\/\/www.json.org\/\n It's a little wider than what's allowed there as it would accept\n nonsensical \\u escapes *)\nlet triple_dquote = Util.del_str \"\\\"\\\"\\\"\"\nlet str_store = Quote.dquote . store \/([^\\\\\"]|\\\\\\\\[\"\\\/bfnrtu\\\\])*\/ . Quote.dquote\n\nlet str_store_multi = triple_dquote . eol\n . store \/([^\\\\\"]|\\\\\\\\[\"\\\/bfnrtu\\\\])*\/\n . del \/\\n[ \\t]*\/ \"\\n\" . triple_dquote\n\nlet str_store_literal = Quote.squote . store \/([^\\\\']|\\\\\\\\['\\\/bfnrtu\\\\])*\/ . Quote.squote\n\nlet integer =\n let base10 = \/[+-]?[0-9_]+\/\n in let hex = \/0x[A-Za-z0-9]+\/\n in let oct = \/0o[0-7]+\/\n in let bin = \/0b[01]+\/\n in [ label \"integer\" . store (base10 | hex | oct | bin) ]\n\nlet float =\n let n = \/[0-9_]+\/\n in let pm = \/[+-]?\/\n in let z = pm . n\n in let decim = \".\" . n\n in let exp = \/[Ee]\/ . z\n in let num = z . decim | z . exp | z . decim . exp\n in let inf = pm . \"inf\"\n in let nan = pm . \"nan\"\n in [ label \"float\" . store (num | inf | nan) ]\n\nlet str = [ label \"string\" . str_store ]\n\nlet str_multi = [ label \"string_multi\" . str_store_multi ]\n\nlet str_literal = [ label \"string_literal\" . str_store_literal ]\n\nlet bool (r:regexp) = [ label \"bool\" . store r ]\n\n\nlet date_re = \/[0-9]{4}-[0-9]{2}-[0-9]{2}\/\nlet time_re = \/[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?[A-Z]*\/\n\nlet datetime = [ label \"datetime\" . store (date_re . \/[T ]\/ . time_re) ]\nlet date = [ label \"date\" . store date_re ]\nlet time = [ label \"time\" . store time_re ]\n\nlet norec = str | str_multi | str_literal\n | integer | float | bool \/true|false\/\n | datetime | date | time\n\nlet array (value:lens) = [ label \"array\" . lbrack\n . ( ( Build.opt_list value comma . space_or_empty? . rbrack )\n | rbrack ) ]\n\nlet array_norec = array norec\n\nlet rec array_rec = array (norec | array_rec)\n\nlet entry_base (value:lens) = [ label \"entry\" . store Rx.word . Sep.space_equal . value ]\n\nlet inline_table (value:lens) = [ label \"inline_table\" . lbrace\n . ( (Build.opt_list (entry_base value) comma . space_or_empty? . rbrace)\n | rbrace ) ]\n\nlet entry = [ label \"entry\" . Util.indent . store Rx.word . Sep.space_equal\n . (norec | array_rec | inline_table norec) . (eol | comment) ]\n\n(* Group: tables *)\n\n(* View: table_gen\n A generic table *)\nlet table_gen (name:string) (lbrack:string) (rbrack:string) =\n let title = Util.indent . label name\n . Util.del_str lbrack\n . store \/[^]\\r\\n.]+(\\.[^]\\r\\n.]+)*\/\n . Util.del_str rbrack . eol\n in [ title . (entry|empty|comment)* ]\n\n(* View: table\n A table or array of tables *)\nlet table = table_gen \"table\" \"[\" \"]\"\n | table_gen \"@table\" \"[[\" \"]]\"\n\n(* Group: lens *)\n\n(* View: lns\n The Toml lens *)\nlet lns = (entry | empty | comment)* . table*\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7b659d22144a033eaba1d770845bfc15f5a66236","subject":"not necessary anymore.","message":"not necessary anymore.\n","repos":"Brainsware\/puppet-trafficserver,Brainsware\/puppet-trafficserver","old_file":"lib\/augeas\/lenses\/trafficserver_ssl_multicert.aug","new_file":"lib\/augeas\/lenses\/trafficserver_ssl_multicert.aug","new_contents":"","old_contents":"module Trafficserver_ssl_multicert =\n autoload ssl_multicert_xfm\n\n let indent = Util.indent\n let spc = Sep.space\n let eol = Util.comment_or_eol\n\n let storage_filter = incl \"\/etc\/trafficserver\/ssl_multicert.config\"\n\n let entry =\n let var = Build.key_value Rx.word Sep.equal (store Rx.no_spaces)\n in [ indent . seq \"entry\" . Build.opt_list var Sep.space . Util.eol ]\n\n let ssl_multicert_lns = (Util.empty | Util.comment | entry)*\n\n let ssl_multicert_xfm = transform ssl_multicert_lns storage_filter\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"a835d24bb82807fffadba8173afbd674730177d2","subject":"Added node config for OpenShift","message":"Added node config for OpenShift\n\nWhen the intial lens was developed there was a missing transform\non \/etc\/openshift\/node.conf\n\nThis is a fix for bug hercules-team\/augeas#22\n","repos":"kumy\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,kumy\/augeas,ptoscano\/augeas,manandbytes\/augeas,ptoscano\/augeas,mlichvar\/augeas,dafugg\/augeas,dafugg\/augeas,lutter\/augeas,pevalme\/augeas,kunkku\/augeas,kumy\/augeas,kunkku\/augeas,lutter\/augeas,hercules-team\/augeas,pevalme\/augeas,pevalme\/augeas,jasperla\/augeas,mchf\/augeas,mchf\/augeas,mlichvar\/augeas,jjlin\/augeas,lutter\/augeas,mlichvar\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,raphink\/augeas,hercules-team\/augeas,raphink\/augeas,jasperla\/augeas,jtopjian\/augeas,kunkku\/augeas,manandbytes\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jtopjian\/augeas","old_file":"lenses\/openshift_config.aug","new_file":"lenses\/openshift_config.aug","new_contents":"(*\nModule: OpenShift_Config\n Parses\n - \/etc\/openshift\/broker.conf\n - \/etc\/openshift\/broker-dev.conf\n - \/etc\/openshift\/console.conf\n - \/etc\/openshift\/console-dev.conf\n - \/etc\/openshift\/node.conf\n - \/etc\/openshift\/plugins.d\/*.conf\n\nAuthor: Brian Redbeard <redbeard@dead-city.org>\n\nAbout: License\n This file is licenced under the LGPL v2+, conforming to the other components\n of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get your current setup\n > print \/files\/etc\/openshift\n ...\n\n * Change OpenShift domain\n > set \/files\/etc\/openshift\/broker.conf\/CLOUD_DOMAIN ose.example.com\n\n Saving your file:\n\n > save\n\nAbout: Configuration files\n \/etc\/openshift\/broker.conf - Configuration file for an OpenShift Broker\n running in production mode.\n \/etc\/openshift\/broker-dev.conf - Configuration file for an OpenShift\n Broker running in development mode.\n \/etc\/openshift\/console.conf - Configuration file for an OpenShift\n console running in production mode.\n \/etc\/openshift\/console-dev.conf - Configuration file for an OpenShift\n console running in development mode.\n \/etc\/openshift\/node.conf - Configuration file for an OpenShift node\n \/etc\/openshift\/plugins.d\/*.conf - Configuration files for OpenShift\n plugins (i.e. mcollective configuration, remote auth, dns updates)\n\nAbout: Examples\n The <Test_OpenShift_Config> file contains various examples and tests.\n*)\nmodule OpenShift_Config =\n autoload xfm\n\n(* Variable: blank_val *)\nlet blank_val = del \/[\"']{2}\/ \"\\\"\\\"\"\n\n(* View: primary_entry *)\nlet primary_entry = Build.key_value_line Rx.word Sep.equal Quote.any_opt\n\n(* View: empty_entry *)\nlet empty_entry = Build.key_value_line Rx.word Sep.equal blank_val\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | primary_entry | empty_entry )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/openshift\/broker.conf\"\n . incl \"\/etc\/openshift\/broker-dev.conf\"\n . incl \"\/etc\/openshift\/console.conf\"\n . incl \"\/etc\/openshift\/resource_limits.conf\"\n . incl \"\/etc\/openshift\/console-dev.conf\"\n . incl \"\/etc\/openshift\/node.conf\"\n . incl \"\/etc\/openshift\/plugins.d\/*.conf\"\n . incl \"\/var\/www\/openshift\/broker\/conf\/broker.conf\"\n . incl \"\/var\/www\/openshift\/broker\/conf\/plugins.d\/*.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n(* vim: set ts=4 expandtab sw=4: *)\n","old_contents":"(*\nModule: OpenShift_Config\n Parses\n - \/etc\/openshift\/broker.conf\n - \/etc\/openshift\/broker-dev.conf\n - \/etc\/openshift\/console.conf\n - \/etc\/openshift\/console-dev.conf\n - \/etc\/openshift\/plugins.d\/*.conf\n\nAuthor: Brian Redbeard <redbeard@dead-city.org>\n\nAbout: License\n This file is licenced under the LGPL v2+, conforming to the other components\n of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get your current setup\n > print \/files\/etc\/openshift\n ...\n\n * Change OpenShift domain\n > set \/files\/etc\/openshift\/broker.conf\/CLOUD_DOMAIN ose.example.com\n\n Saving your file:\n\n > save\n\nAbout: Configuration files\n \/etc\/openshift\/broker.conf - Configuration file for an OpenShift Broker\n running in production mode.\n \/etc\/openshift\/broker-dev.conf - Configuration file for an OpenShift\n Broker running in development mode.\n \/etc\/openshift\/console.conf - Configuration file for an OpenShift\n console running in production mode.\n \/etc\/openshift\/console-dev.conf - Configuration file for an OpenShift\n console running in development mode.\n \/etc\/openshift\/plugins.d\/*.conf - Configuration files for OpenShift\n plugins (i.e. mcollective configuration, remote auth, dns updates)\n\nAbout: Examples\n The <Test_OpenShift_Config> file contains various examples and tests.\n*)\nmodule OpenShift_Config =\n autoload xfm\n\n(* Variable: blank_val *)\nlet blank_val = del \/[\"']{2}\/ \"\\\"\\\"\"\n\n(* View: primary_entry *)\nlet primary_entry = Build.key_value_line Rx.word Sep.equal Quote.any_opt\n\n(* View: empty_entry *)\nlet empty_entry = Build.key_value_line Rx.word Sep.equal blank_val\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | primary_entry | empty_entry )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/openshift\/broker.conf\"\n . incl \"\/etc\/openshift\/broker-dev.conf\"\n . incl \"\/etc\/openshift\/console.conf\"\n . incl \"\/etc\/openshift\/resource_limits.conf\"\n . incl \"\/etc\/openshift\/console-dev.conf\"\n . incl \"\/etc\/openshift\/plugins.d\/*.conf\"\n . incl \"\/var\/www\/openshift\/broker\/conf\/broker.conf\"\n . incl \"\/var\/www\/openshift\/broker\/conf\/plugins.d\/*.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n(* vim: set ts=4 expandtab sw=4: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f891239139281acc12629a39a997f47f91839e3d","subject":"Remove trailing spaces in nagioscfg.aug","message":"Remove trailing spaces in nagioscfg.aug\n","repos":"hercules-team\/augeas-do-not-use,kumy\/augeas,mlichvar\/augeas,raphink\/augeas,pevalme\/augeas,dafugg\/augeas,domcleal\/augeas,kunkku\/augeas,pevalme\/augeas,lutter\/augeas,jasperla\/augeas,dafugg\/augeas,kunkku\/augeas,dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,kumy\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,lutter\/augeas,raphink\/augeas,GeoffWilliams\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,MikaelSmith\/augeas,mchf\/augeas,jjlin\/augeas,jtopjian\/augeas,kumy\/augeas,mchf\/augeas,jtopjian\/augeas,ptoscano\/augeas,mlichvar\/augeas,domcleal\/augeas,ptoscano\/augeas,pevalme\/augeas,ptoscano\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,hercules-team\/augeas,lutter\/augeas","old_file":"lenses\/nagioscfg.aug","new_file":"lenses\/nagioscfg.aug","new_contents":"(*\nModule: NagiosConfig\n Parses \/etc\/nagios3\/*.cfg\n\nAuthors: Sebastien Aperghis-Tramoni <sebastien@aperghis.net>\n Rapha\u00ebl Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/nagios3\/*.cfg. See <filter>.\n*)\n\nmodule NagiosCfg =\n autoload xfm\n\n (* View: param_def\n define a field *)\n let param_def =\n key \/[A-Za-z0-9_]+\/\n . Sep.opt_space . Sep.equal\n . Sep.opt_space . store Rx.no_spaces\n\n (* View: param\n Params can have sub params *)\n let param =\n [ Util.indent . param_def\n . [ Sep.space . param_def ]*\n . Util.eol ]\n\n (* View: lns\n main structure *)\n let lns = ( Util.empty | Util.comment | param )*\n\n (* View: filter *)\n let filter = incl \"\/etc\/nagios3\/*.cfg\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n","old_contents":"(*\nModule: NagiosConfig\n Parses \/etc\/nagios3\/*.cfg\n\nAuthors: Sebastien Aperghis-Tramoni <sebastien@aperghis.net>\n Rapha\u00ebl Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/nagios3\/*.cfg. See <filter>.\n*)\n\nmodule NagiosCfg =\n autoload xfm\n\n (* View: param_def\n define a field *)\n let param_def = \n key \/[A-Za-z0-9_]+\/\n . Sep.opt_space . Sep.equal\n . Sep.opt_space . store Rx.no_spaces\n\n (* View: param\n Params can have sub params *)\n let param =\n [ Util.indent . param_def\n . [ Sep.space . param_def ]* \n . Util.eol ]\n\n (* View: lns\n main structure *)\n let lns = ( Util.empty | Util.comment | param )*\n\n (* View: filter *)\n let filter = incl \"\/etc\/nagios3\/*.cfg\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c9f7809880a113373b44f91f0788d1630c946205","subject":"Php: include files from Zend community edition","message":"Php: include files from Zend community edition\n\nFixes ticket #210\n","repos":"jtopjian\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,kumy\/augeas,manandbytes\/augeas,pevalme\/augeas,mlichvar\/augeas,kumy\/augeas,kunkku\/augeas,dafugg\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jtopjian\/augeas,hercules-team\/augeas,dafugg\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,domcleal\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,kunkku\/augeas,pevalme\/augeas,jasperla\/augeas,mlichvar\/augeas,raphink\/augeas,mchf\/augeas,kumy\/augeas,ptoscano\/augeas,raphink\/augeas,domcleal\/augeas,lutter\/augeas,lutter\/augeas,jasperla\/augeas,jjlin\/augeas,ptoscano\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,dafugg\/augeas,domcleal\/augeas,mchf\/augeas,kumy\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n (* Zend Community edition *)\n . (incl \"\/usr\/local\/zend\/etc\/php.ini\")\n . (incl \"\/usr\/local\/zend\/etc\/conf.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c8efe9d554b3e9a3ab566d1367958b42b547e9b2","subject":"Automounter: exclude \/etc\/auto.master","message":"Automounter: exclude \/etc\/auto.master\n","repos":"manandbytes\/augeas,pevalme\/augeas,domcleal\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,ptoscano\/augeas,kumy\/augeas,manandbytes\/augeas,kunkku\/augeas,dafugg\/augeas,kunkku\/augeas,jtopjian\/augeas,pevalme\/augeas,MikaelSmith\/augeas,raphink\/augeas,jjlin\/augeas,mlichvar\/augeas,jtopjian\/augeas,jasperla\/augeas,jjlin\/augeas,hercules-team\/augeas,mchf\/augeas,lutter\/augeas,MikaelSmith\/augeas,pevalme\/augeas,jasperla\/augeas,kumy\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,kumy\/augeas,domcleal\/augeas,lutter\/augeas,kumy\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas,mchf\/augeas,mlichvar\/augeas,raphink\/augeas","old_file":"lenses\/automounter.aug","new_file":"lenses\/automounter.aug","new_contents":"(*\nModule: Automounter\n Parses automounter file based maps\n\nAuthor: Dominic Cleal <dcleal@redhat.com>\n\nAbout: Reference\n See autofs(5)\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/auto.*, auto_*, excluding known scripts.\n\nAbout: Examples\n The <Test_Automounter> file contains various examples and tests.\n*)\n\nmodule Automounter =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: path *)\nlet path = \/[^-+#: \\t\\n][^#: \\t\\n]*\/\n\n(* View: hostname *)\nlet hostname = \/[^-:#\\(\\), \\n\\t]+\/\n\n(* An option label can't contain comma, comment, equals, or space *)\nlet optlabel = \/[^,#:\\(\\)= \\n\\t]+\/\nlet spec = \/[^,#:\\(\\)= \\n\\t][^ \\n\\t]*\/\n\n(* View: weight *)\nlet weight = Rx.integer\n\n(* View: map_name *)\nlet map_name = \/[^: \\t\\n]+\/\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n(* View: entry_key\n Key for a map entry *)\nlet entry_mkey = store path\n\n(* View: entry_path\n Path component of an entry location *)\nlet entry_path = [ label \"path\" . store path ]\n\n(* View: entry_host\n Host component with optional weight of an entry location *)\nlet entry_host = [ label \"host\" . store hostname\n . ( Util.del_str \"(\" . [ label \"weight\"\n . store weight ] . Util.del_str \")\" )? ]\n\n(* View: comma_sep_list\n Parses options for filesystems *)\nlet comma_sep_list (l:string) =\n let value = [ label \"value\" . Util.del_str \"=\" . store Rx.neg1 ] in\n let lns = [ label l . store optlabel . value? ] in\n Build.opt_list lns Sep.comma\n\n(* View: entry_options *)\nlet entry_options = Util.del_str \"-\" . comma_sep_list \"opt\" . Util.del_ws_tab\n\n(* View: entry_location\n A single location with one or more hosts, and one path *)\nlet entry_location = ( entry_host . ( Sep.comma . entry_host )* )?\n . Sep.colon . entry_path\n\n(* View: entry_locations \n Multiple locations (each with one or more hosts), separated by spaces *)\nlet entry_locations = [ label \"location\" . counter \"location\"\n . [ seq \"location\" . entry_location ]\n . ( [ Util.del_ws_spc . seq \"location\" . entry_location ] )* ]\n\n(* View: entry_multimount\n Parses one of many mountpoints given for a multimount line *)\nlet entry_multimount = entry_mkey . Util.del_ws_tab . entry_options? . entry_locations\n\n(* View: entry_multimount_sep\n Separator for multimount entries, permits line spanning with \"\\\" *)\nlet entry_multimount_sep = del \/[ \\t]+(\\\\\\\\[ \\t]*\\n[ \\t]+)?\/ \" \"\n\n(* View: entry_multimounts\n Parses multiple mountpoints given on an entry line *)\nlet entry_multimounts = [ label \"mount\" . counter \"mount\"\n . [ seq \"mount\" . entry_multimount ]\n . ( [ entry_multimount_sep . seq \"mount\" . entry_multimount ] )* ]\n\n(* View: entry\n A single map entry from start to finish, including multi-mounts *)\nlet entry = [ seq \"entry\" . entry_mkey . Util.del_ws_tab . entry_options?\n . ( entry_locations | entry_multimounts ) . Util.eol ]\n\n(* View: include\n An include line starting with a \"+\" and a map name *)\nlet include = [ seq \"entry\" . store \"+\" . Util.del_opt_ws \"\"\n . [ label \"map\" . store map_name ] . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | entry | include ) *\n\n(* Variable: filter\n Exclude scripts\/executable maps from here *)\nlet filter = incl \"\/etc\/auto.*\"\n . incl \"\/etc\/auto_*\"\n . excl \"\/etc\/auto.master\"\n . excl \"\/etc\/auto.net\"\n . excl \"\/etc\/auto.smb\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Automounter\n Parses automounter file based maps\n\nAuthor: Dominic Cleal <dcleal@redhat.com>\n\nAbout: Reference\n See autofs(5)\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/auto.*, auto_*, excluding known scripts.\n\nAbout: Examples\n The <Test_Automounter> file contains various examples and tests.\n*)\n\nmodule Automounter =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: path *)\nlet path = \/[^-+#: \\t\\n][^#: \\t\\n]*\/\n\n(* View: hostname *)\nlet hostname = \/[^-:#\\(\\), \\n\\t]+\/\n\n(* An option label can't contain comma, comment, equals, or space *)\nlet optlabel = \/[^,#:\\(\\)= \\n\\t]+\/\nlet spec = \/[^,#:\\(\\)= \\n\\t][^ \\n\\t]*\/\n\n(* View: weight *)\nlet weight = Rx.integer\n\n(* View: map_name *)\nlet map_name = \/[^: \\t\\n]+\/\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n(* View: entry_key\n Key for a map entry *)\nlet entry_mkey = store path\n\n(* View: entry_path\n Path component of an entry location *)\nlet entry_path = [ label \"path\" . store path ]\n\n(* View: entry_host\n Host component with optional weight of an entry location *)\nlet entry_host = [ label \"host\" . store hostname\n . ( Util.del_str \"(\" . [ label \"weight\"\n . store weight ] . Util.del_str \")\" )? ]\n\n(* View: comma_sep_list\n Parses options for filesystems *)\nlet comma_sep_list (l:string) =\n let value = [ label \"value\" . Util.del_str \"=\" . store Rx.neg1 ] in\n let lns = [ label l . store optlabel . value? ] in\n Build.opt_list lns Sep.comma\n\n(* View: entry_options *)\nlet entry_options = Util.del_str \"-\" . comma_sep_list \"opt\" . Util.del_ws_tab\n\n(* View: entry_location\n A single location with one or more hosts, and one path *)\nlet entry_location = ( entry_host . ( Sep.comma . entry_host )* )?\n . Sep.colon . entry_path\n\n(* View: entry_locations \n Multiple locations (each with one or more hosts), separated by spaces *)\nlet entry_locations = [ label \"location\" . counter \"location\"\n . [ seq \"location\" . entry_location ]\n . ( [ Util.del_ws_spc . seq \"location\" . entry_location ] )* ]\n\n(* View: entry_multimount\n Parses one of many mountpoints given for a multimount line *)\nlet entry_multimount = entry_mkey . Util.del_ws_tab . entry_options? . entry_locations\n\n(* View: entry_multimount_sep\n Separator for multimount entries, permits line spanning with \"\\\" *)\nlet entry_multimount_sep = del \/[ \\t]+(\\\\\\\\[ \\t]*\\n[ \\t]+)?\/ \" \"\n\n(* View: entry_multimounts\n Parses multiple mountpoints given on an entry line *)\nlet entry_multimounts = [ label \"mount\" . counter \"mount\"\n . [ seq \"mount\" . entry_multimount ]\n . ( [ entry_multimount_sep . seq \"mount\" . entry_multimount ] )* ]\n\n(* View: entry\n A single map entry from start to finish, including multi-mounts *)\nlet entry = [ seq \"entry\" . entry_mkey . Util.del_ws_tab . entry_options?\n . ( entry_locations | entry_multimounts ) . Util.eol ]\n\n(* View: include\n An include line starting with a \"+\" and a map name *)\nlet include = [ seq \"entry\" . store \"+\" . Util.del_opt_ws \"\"\n . [ label \"map\" . store map_name ] . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | entry | include ) *\n\n(* Variable: filter\n Exclude scripts\/executable maps from here *)\nlet filter = incl \"\/etc\/auto.*\"\n . incl \"\/etc\/auto_*\"\n . excl \"\/etc\/auto.net\"\n . excl \"\/etc\/auto.smb\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"13caed3e97e430954593ca4deff01997e8507478","subject":"Toml: support dos newlines","message":"Toml: support dos newlines\n","repos":"mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas,ptoscano\/augeas,ptoscano\/augeas,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas,kunkku\/augeas","old_file":"lenses\/toml.aug","new_file":"lenses\/toml.aug","new_contents":"(*\nModule: Toml\n Parses TOML files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n https:\/\/github.com\/mojombo\/toml\/blob\/master\/README.md\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to TOML files.\n\nAbout: Examples\n The <Test_Toml> file contains various examples and tests.\n*)\n\nmodule Toml =\n\n(* Group: base definitions *)\n\n(* View: comment\n A simple comment *)\nlet comment = IniFile.comment \"#\" \"#\"\n\n(* View: empty\n An empty line *)\nlet empty = Util.empty_dos\n\n(* View: eol\n An end of line *)\nlet eol = Util.doseol\n\n\n(* Group: value entries *)\n\nlet bare_re_noquot = (\/[^][\", \\t\\r\\n]\/ - \"#\")\nlet bare_re = (\/[^][,\\r=]\/ - \"#\")+\nlet no_quot = \/[^][\"\\r\\n]*\/\nlet bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?))\nlet quoted = Quote.do_dquote (store (\/[^\"]\/ . \"#\"* . \/[^\"]\/))\n\nlet ws = del \/[ \\t\\n]*\/ \"\"\n\nlet space_or_empty = [ del \/[ \\t\\n]+\/ \" \" ]\n\nlet comma = Util.del_str \",\" . (space_or_empty | comment)?\nlet lbrace = Util.del_str \"{\" . (space_or_empty | comment)?\nlet rbrace = Util.del_str \"}\"\nlet lbrack = Util.del_str \"[\" . (space_or_empty | comment)?\nlet rbrack = Util.del_str \"]\"\n\n(* This follows the definition of 'string' at https:\/\/www.json.org\/\n It's a little wider than what's allowed there as it would accept\n nonsensical \\u escapes *)\nlet triple_dquote = Util.del_str \"\\\"\\\"\\\"\"\nlet str_store = Quote.dquote . store \/([^\\\\\"]|\\\\\\\\[\"\\\/bfnrtu\\\\])*\/ . Quote.dquote\n\nlet str_store_multi = triple_dquote . eol\n . store \/([^\\\\\"]|\\\\\\\\[\"\\\/bfnrtu\\\\])*\/\n . del \/\\n[ \\t]*\/ \"\\n\" . triple_dquote\n\nlet str_store_literal = Quote.squote . store \/([^\\\\']|\\\\\\\\['\\\/bfnrtu\\\\])*\/ . Quote.squote\n\nlet integer =\n let base10 = \/[+-]?[0-9_]+\/\n in let hex = \/0x[A-Za-z0-9]+\/\n in let oct = \/0o[0-7]+\/\n in let bin = \/0b[01]+\/\n in [ label \"integer\" . store (base10 | hex | oct | bin) ]\n\nlet float =\n let n = \/[0-9_]+\/\n in let pm = \/[+-]?\/\n in let z = pm . n\n in let decim = \".\" . n\n in let exp = \/[Ee]\/ . z\n in let num = z . decim | z . exp | z . decim . exp\n in let inf = pm . \"inf\"\n in let nan = pm . \"nan\"\n in [ label \"float\" . store (num | inf | nan) ]\n\nlet str = [ label \"string\" . str_store ]\n\nlet str_multi = [ label \"string_multi\" . str_store_multi ]\n\nlet str_literal = [ label \"string_literal\" . str_store_literal ]\n\nlet bool (r:regexp) = [ label \"bool\" . store r ]\n\n\nlet date_re = \/[0-9]{4}-[0-9]{2}-[0-9]{2}\/\nlet time_re = \/[0-9]{1,2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?[A-Z]*\/\n\nlet datetime = [ label \"datetime\" . store (date_re . \/[T ]\/ . time_re) ]\nlet date = [ label \"date\" . store date_re ]\nlet time = [ label \"time\" . store time_re ]\n\nlet norec = str | str_multi | str_literal\n | integer | float | bool \/true|false\/\n | datetime | date | time\n\nlet array (value:lens) = [ label \"array\" . lbrack\n . ( ( Build.opt_list value comma . space_or_empty? . rbrack )\n | rbrack ) ]\n\nlet array_norec = array norec\n\nlet rec array_rec = array (norec | array_rec)\n\nlet entry_base (value:lens) = [ label \"entry\" . store Rx.word . Sep.space_equal . value ]\n\nlet inline_table (value:lens) = [ label \"inline_table\" . lbrace\n . ( (Build.opt_list (entry_base value) comma . space_or_empty? . rbrace)\n | rbrace ) ]\n\nlet entry = [ label \"entry\" . Util.indent . store Rx.word . Sep.space_equal\n . (norec | array_rec | inline_table norec) . (eol | comment) ]\n\n(* Group: tables *)\n\n(* View: table_gen\n A generic table *)\nlet table_gen (name:string) (lbrack:string) (rbrack:string) =\n let title = Util.indent . label name\n . Util.del_str lbrack\n . store \/[^]\\r\\n.]+(\\.[^]\\r\\n.]+)*\/\n . Util.del_str rbrack . eol\n in [ title . (entry|empty|comment)* ]\n\n(* View: table\n A table or array of tables *)\nlet table = table_gen \"table\" \"[\" \"]\"\n | table_gen \"@table\" \"[[\" \"]]\"\n\n(* Group: lens *)\n\n(* View: lns\n The Toml lens *)\nlet lns = (entry | empty | comment)* . table*\n","old_contents":"(*\nModule: Toml\n Parses TOML files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n https:\/\/github.com\/mojombo\/toml\/blob\/master\/README.md\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to TOML files.\n\nAbout: Examples\n The <Test_Toml> file contains various examples and tests.\n*)\n\nmodule Toml =\n\n(* Group: base definitions *)\n\n(* View: comment\n A simple comment *)\nlet comment = IniFile.comment \"#\" \"#\"\n\n(* View: empty\n An empty line *)\nlet empty = Util.empty\n\n(* View: eol\n An end of line *)\nlet eol = Util.eol\n\n\n(* Group: value entries *)\n\nlet bare_re_noquot = (\/[^][\", \\t\\r\\n]\/ - \"#\")\nlet bare_re = (\/[^][,\\r=]\/ - \"#\")+\nlet no_quot = \/[^][\"\\r\\n]*\/\nlet bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?))\nlet quoted = Quote.do_dquote (store (\/[^\"]\/ . \"#\"* . \/[^\"]\/))\n\nlet ws = del \/[ \\t\\n]*\/ \"\"\n\nlet space_or_empty = [ del \/[ \\t\\n]+\/ \" \" ]\n\nlet comma = Util.del_str \",\" . (space_or_empty | comment)?\nlet lbrace = Util.del_str \"{\" . (space_or_empty | comment)?\nlet rbrace = Util.del_str \"}\"\nlet lbrack = Util.del_str \"[\" . (space_or_empty | comment)?\nlet rbrack = Util.del_str \"]\"\n\n(* This follows the definition of 'string' at https:\/\/www.json.org\/\n It's a little wider than what's allowed there as it would accept\n nonsensical \\u escapes *)\nlet triple_dquote = Util.del_str \"\\\"\\\"\\\"\"\nlet str_store = Quote.dquote . store \/([^\\\\\"]|\\\\\\\\[\"\\\/bfnrtu\\\\])*\/ . Quote.dquote\n\nlet str_store_multi = triple_dquote . eol\n . store \/([^\\\\\"]|\\\\\\\\[\"\\\/bfnrtu\\\\])*\/\n . del \/\\n[ \\t]*\/ \"\\n\" . triple_dquote\n\nlet str_store_literal = Quote.squote . store \/([^\\\\']|\\\\\\\\['\\\/bfnrtu\\\\])*\/ . Quote.squote\n\nlet integer =\n let base10 = \/[+-]?[0-9_]+\/\n in let hex = \/0x[A-Za-z0-9]+\/\n in let oct = \/0o[0-7]+\/\n in let bin = \/0b[01]+\/\n in [ label \"integer\" . store (base10 | hex | oct | bin) ]\n\nlet float =\n let n = \/[0-9_]+\/\n in let pm = \/[+-]?\/\n in let z = pm . n\n in let decim = \".\" . n\n in let exp = \/[Ee]\/ . z\n in let num = z . decim | z . exp | z . decim . exp\n in let inf = pm . \"inf\"\n in let nan = pm . \"nan\"\n in [ label \"float\" . store (num | inf | nan) ]\n\nlet str = [ label \"string\" . str_store ]\n\nlet str_multi = [ label \"string_multi\" . str_store_multi ]\n\nlet str_literal = [ label \"string_literal\" . str_store_literal ]\n\nlet bool (r:regexp) = [ label \"bool\" . store r ]\n\n\nlet date_re = \/[0-9]{4}-[0-9]{2}-[0-9]{2}\/\nlet time_re = \/[0-9]{1,2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?[A-Z]*\/\n\nlet datetime = [ label \"datetime\" . store (date_re . \/[T ]\/ . time_re) ]\nlet date = [ label \"date\" . store date_re ]\nlet time = [ label \"time\" . store time_re ]\n\nlet norec = str | str_multi | str_literal\n | integer | float | bool \/true|false\/\n | datetime | date | time\n\nlet array (value:lens) = [ label \"array\" . lbrack\n . ( ( Build.opt_list value comma . space_or_empty? . rbrack )\n | rbrack ) ]\n\nlet array_norec = array norec\n\nlet rec array_rec = array (norec | array_rec)\n\nlet entry_base (value:lens) = [ label \"entry\" . store Rx.word . Sep.space_equal . value ]\n\nlet inline_table (value:lens) = [ label \"inline_table\" . lbrace\n . ( (Build.opt_list (entry_base value) comma . space_or_empty? . rbrace)\n | rbrace ) ]\n\nlet entry = [ label \"entry\" . Util.indent . store Rx.word . Sep.space_equal\n . (norec | array_rec | inline_table norec) . (eol | comment) ]\n\n(* Group: tables *)\n\n(* View: table_gen\n A generic table *)\nlet table_gen (name:string) (lbrack:string) (rbrack:string) =\n let title = Util.indent . label name\n . Util.del_str lbrack\n . store \/[^]\\r\\n.]+(\\.[^]\\r\\n.]+)*\/\n . Util.del_str rbrack . eol\n in [ title . (entry|empty|comment)* ]\n\n(* View: table\n A table or array of tables *)\nlet table = table_gen \"table\" \"[\" \"]\"\n | table_gen \"@table\" \"[[\" \"]]\"\n\n(* Group: lens *)\n\n(* View: lns\n The Toml lens *)\nlet lns = (entry | empty | comment)* . table*\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"afcff9cac33944288f695477346989cc3386534c","subject":"vsftpd.aug: Add require_ssl_reuse option","message":"vsftpd.aug: Add require_ssl_reuse option\n","repos":"dafugg\/augeas,kumy\/augeas,jasperla\/augeas,raphink\/augeas,pevalme\/augeas,ptoscano\/augeas,dafugg\/augeas,mlichvar\/augeas,dafugg\/augeas,jtopjian\/augeas,jjlin\/augeas,mlichvar\/augeas,jasperla\/augeas,manandbytes\/augeas,pevalme\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,hercules-team\/augeas,hercules-team\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kumy\/augeas,lutter\/augeas,ptoscano\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,kunkku\/augeas,raphink\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas,mchf\/augeas,jtopjian\/augeas,lutter\/augeas,kunkku\/augeas,kunkku\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/vsftpd.aug","new_file":"lenses\/vsftpd.aug","new_contents":"(* Parse vsftpd.conf *)\nmodule Vsftpd =\n autoload xfm\n\n(* The code in parseconf.c does not seem to allow for trailing whitespace *)\n(* in the config file *)\nlet eol = Util.del_str \"\\n\"\nlet empty = Util.empty\nlet comment = Util.comment\n\nlet bool_option_re = \/anonymous_enable|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert|require_ssl_reuse\/\n\nlet uint_option_re = \/accept_timeout|connect_timeout|local_umask|anon_umask|ftp_data_port|idle_session_timeout|data_connection_timeout|pasv_min_port|pasv_max_port|anon_max_rate|local_max_rate|listen_port|max_clients|file_open_mode|max_per_ip|trans_chunk_size|delay_failed_login|delay_successful_login|max_login_fails|chown_upload_mode\/\n\nlet str_option_re = \/secure_chroot_dir|ftp_username|chown_username|xferlog_file|vsftpd_log_file|message_file|nopriv_user|ftpd_banner|banned_email_file|chroot_list_file|pam_service_name|guest_username|userlist_file|anon_root|local_root|banner_file|pasv_address|listen_address|user_config_dir|listen_address6|cmds_allowed|hide_file|deny_file|user_sub_token|email_password_file|rsa_cert_file|dsa_cert_file|ssl_ciphers|rsa_private_key_file|dsa_private_key_file|ca_certs_file\/\n\nlet bool_value_re = \/[yY][eE][sS]|[tT][rR][uU][eE]|1|[nN][oO]|[fF][aA][lL][sS][eE]|0\/\n\nlet option (k:regexp) (v:regexp) = [ key k . Util.del_str \"=\" . store v . eol ]\n\nlet bool_option = option bool_option_re bool_value_re\n\nlet str_option = option str_option_re \/[^\\n]+\/\n\nlet uint_option = option uint_option_re \/[0-9]+\/\n\nlet lns = (bool_option|str_option|uint_option|comment|empty)*\n\nlet filter = (incl \"\/etc\/vsftpd.conf\") . (incl \"\/etc\/vsftpd\/vsftpd.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(* Parse vsftpd.conf *)\nmodule Vsftpd =\n autoload xfm\n\n(* The code in parseconf.c does not seem to allow for trailing whitespace *)\n(* in the config file *)\nlet eol = Util.del_str \"\\n\"\nlet empty = Util.empty\nlet comment = Util.comment\n\nlet bool_option_re = \/anonymous_enable|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert\/\n\nlet uint_option_re = \/accept_timeout|connect_timeout|local_umask|anon_umask|ftp_data_port|idle_session_timeout|data_connection_timeout|pasv_min_port|pasv_max_port|anon_max_rate|local_max_rate|listen_port|max_clients|file_open_mode|max_per_ip|trans_chunk_size|delay_failed_login|delay_successful_login|max_login_fails|chown_upload_mode\/\n\nlet str_option_re = \/secure_chroot_dir|ftp_username|chown_username|xferlog_file|vsftpd_log_file|message_file|nopriv_user|ftpd_banner|banned_email_file|chroot_list_file|pam_service_name|guest_username|userlist_file|anon_root|local_root|banner_file|pasv_address|listen_address|user_config_dir|listen_address6|cmds_allowed|hide_file|deny_file|user_sub_token|email_password_file|rsa_cert_file|dsa_cert_file|ssl_ciphers|rsa_private_key_file|dsa_private_key_file|ca_certs_file\/\n\nlet bool_value_re = \/[yY][eE][sS]|[tT][rR][uU][eE]|1|[nN][oO]|[fF][aA][lL][sS][eE]|0\/\n\nlet option (k:regexp) (v:regexp) = [ key k . Util.del_str \"=\" . store v . eol ]\n\nlet bool_option = option bool_option_re bool_value_re\n\nlet str_option = option str_option_re \/[^\\n]+\/\n\nlet uint_option = option uint_option_re \/[0-9]+\/\n\nlet lns = (bool_option|str_option|uint_option|comment|empty)*\n\nlet filter = (incl \"\/etc\/vsftpd.conf\") . (incl \"\/etc\/vsftpd\/vsftpd.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cc1467439013113b1bd559a6d741a2d9459765a3","subject":"Shellvars: added SuSE sysconfig puppet files","message":"Shellvars: added SuSE sysconfig puppet files\n\nFor SuSE systems, added \/etc\/sysconfig\/{puppet,puppetmaster} to lens.\n","repos":"jtopjian\/augeas,jjlin\/augeas,dafugg\/augeas,lutter\/augeas,kunkku\/augeas,kunkku\/augeas,ptoscano\/augeas,ptoscano\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,raphink\/augeas,mchf\/augeas,lutter\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,dafugg\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,mlichvar\/augeas,lutter\/augeas,raphink\/augeas,jasperla\/augeas,hercules-team\/augeas,pevalme\/augeas,mlichvar\/augeas,domcleal\/augeas,pevalme\/augeas,kumy\/augeas,jasperla\/augeas,jjlin\/augeas,domcleal\/augeas,domcleal\/augeas,kumy\/augeas,kunkku\/augeas,mchf\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,jjlin\/augeas,dafugg\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n let bquot = \/`[^`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let lns = (comment | empty | source | kv | unset | bare_export) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n let bquot = \/`[^`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let lns = (comment | empty | source | kv | unset | bare_export) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ca2cabd814c45a7b08b4da80013c53bd64d33689","subject":"Logrotate: small fixes","message":"Logrotate: small fixes\n\n* recognize 'yearly' schedule\n* allow whitespaces around { and }\n","repos":"pevalme\/augeas,manandbytes\/augeas,mlichvar\/augeas,jasperla\/augeas,kunkku\/augeas,mlichvar\/augeas,ptoscano\/augeas,camptocamp\/augeas,lutter\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,raphink\/augeas,bkearney\/augeas,ptoscano\/augeas,camptocamp\/augeas,lutter\/augeas,domcleal\/augeas,jasperla\/augeas,lutter\/augeas,raphink\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,pevalme\/augeas,kumy\/augeas,ptoscano\/augeas,kunkku\/augeas,jjlin\/augeas,dafugg\/augeas,mchf\/augeas,jjlin\/augeas,hercules-team\/augeas,manandbytes\/augeas,kumy\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,kumy\/augeas,domcleal\/augeas,dafugg\/augeas,mchf\/augeas,jjlin\/augeas,bkearney\/augeas,dafugg\/augeas,camptocamp\/augeas,kunkku\/augeas,bkearney\/augeas,mlichvar\/augeas","old_file":"lenses\/logrotate.aug","new_file":"lenses\/logrotate.aug","new_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate = \n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let eol = Util.del_str \"\\n\"\n let num = \/[0-9]+\/\n let word = \/[^,# \\n\\t{}]+\/\n \n\n (* define comments and empty lines *)\n let comment (indent:string) = [ label \"comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . eol ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_spc . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) = [ del \/[ \\t]*\/ indent . key \"create\" .\n ( sep_spc . [ label \"mode\" . store num ] . sep_spc .\n\t\t [ label \"owner\" . store word ] . sep_spc .\n\t\t [ label \"group\" . store word ])?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" word indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" num indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines = store ( ( \/.*\/ . \"\\n\") - \/[ \\t]*endscript[ \\t]*\\n\/ )* \n \n let hook_func (func_type:string) = [\n del \/[ \\t]*\/ \"\\t\" . key func_type . eol .\n hook_lines .\n del \/[ \\t]*endscript\\n\/ \"\\tendscript\\n\" ]\n\n let hooks = hook_func \"postrotate\"\n | hook_func \"prerotate\"\n | hook_func \"firstaction\"\n | hook_func \"lastaction\"\n\n (* Define rule *)\n\n let body = del \/\\{[ \\t]*\\n\/ \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n let rule = \n [ label \"rule\" . \n [ label \"file\" . store word ] .\n\t [ del \/[ \\t]+\/ \" \" . label \"file\" . store word ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n\n","old_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate = \n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let eol = Util.del_str \"\\n\"\n let num = \/[0-9]+\/\n let word = \/[^,# \\n\\t{}]+\/\n \n\n (* define comments and empty lines *)\n let comment (indent:string) = [ label \"comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . eol ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_spc . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) = [ del \/[ \\t]*\/ indent . key \"create\" .\n ( sep_spc . [ label \"mode\" . store num ] . sep_spc .\n\t\t [ label \"owner\" . store word ] . sep_spc .\n\t\t [ label \"group\" . store word ])?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" word indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" num indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines = store ( ( \/.*\/ . \"\\n\") - \/[ \\t]*endscript[ \\t]*\\n\/ )* \n \n let hook_func (func_type:string) = [\n del \/[ \\t]*\/ \"\\t\" . key func_type . eol .\n hook_lines .\n del \/[ \\t]*endscript\\n\/ \"\\tendscript\\n\" ]\n\n let hooks = hook_func \"postrotate\"\n | hook_func \"prerotate\"\n | hook_func \"firstaction\"\n | hook_func \"lastaction\"\n\n (* Define rule *)\n\n let body = Util.del_str \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . Util.del_str \"}\\n\"\n\n let rule = \n [ label \"rule\" . \n [ label \"file\" . store word ] .\n\t [ del \/[ \\t]+\/ \" \" . label \"file\" . store word ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7da96e843c3b8d75d9bd4dd2da128c155045012c","subject":"Modprobe: Suse includes","message":"Modprobe: Suse includes\n\n* lenses\/modprobe.aug: included \/etc\/modprobe.conf.local\n","repos":"raphink\/augeas,manandbytes\/augeas,kumy\/augeas,mlichvar\/augeas,jtopjian\/augeas,kunkku\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,hercules-team\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,manandbytes\/augeas,domcleal\/augeas,jtopjian\/augeas,hercules-team\/augeas,dafugg\/augeas,jasperla\/augeas,kumy\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,raphink\/augeas,jjlin\/augeas,mlichvar\/augeas,jjlin\/augeas,pevalme\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,kunkku\/augeas,domcleal\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,domcleal\/augeas,kumy\/augeas,mlichvar\/augeas,mchf\/augeas,lutter\/augeas,dafugg\/augeas,pevalme\/augeas,mchf\/augeas,dafugg\/augeas,MikaelSmith\/augeas,lutter\/augeas","old_file":"lenses\/modprobe.aug","new_file":"lenses\/modprobe.aug","new_contents":"(*\nModule: Modprobe\n Parses \/etc\/modprobe.conf and \/etc\/modprobe.d\/*\n*)\nmodule Modprobe =\nautoload xfm\n\nlet comment = Util.comment\nlet empty = Util.empty\nlet eol = Util.eol | Util.comment\n\n(* modprobe.conf allows continuing a line by ending it with backslash +\n newline; the backslash + newline token is suppressed We handle an\n approximation of that by classifying backslash + newline as a\n separator.\n*)\n\n(* A separator is either whitespace or \\ followed by newline *)\nlet sep_ch = \/[ \\t]|\\\\\\\\\\n\/\n(* Anything that's not a separator is part of a token *)\nlet tok_ch = \/[^ \\t\\n#\\\\]|\\\\\\\\[^ \\t\\n]\/\n\nlet spc = del sep_ch+ \" \"\nlet token = store tok_ch+\nlet indent = Util.del_opt_ws \"\"\n\nlet cmd (n:regexp) = key n . spc\nlet arg (n:string) = [ label n . token ]\nlet token_to_eol = store (tok_ch . \/([^#\\n\\\\]|\\\\\\\\\\n)*\/ . tok_ch | tok_ch)\n\nlet options =\n let opt_ch = \/[A-Za-z0-9_]\/ in\n let option = [ spc . key opt_ch+ . (del \/=\/ \"=\" . token)? ] in\n [ cmd \"options\" . token . option* . eol ]\n\nlet entry = [ cmd \"alias\" . token . spc . arg \"modulename\" . eol ]\n | [ cmd \"include\" . token . eol ]\n | options\n | [ cmd \/install|remove\/ . token_to_eol . eol ]\n | [ cmd \"blacklist\" . token . eol ]\n | [ cmd \"config\" . store \/binary_indexes|yes|no\/ ]\n\nlet lns = (comment|empty|entry)*\n\nlet filter = (incl \"\/etc\/modprobe.conf\") .\n (incl \"\/etc\/modprobe.d\/*\").\n (incl \"\/etc\/modprobe.conf.local\").\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Modprobe\n Parses \/etc\/modprobe.conf and \/etc\/modprobe.d\/*\n*)\nmodule Modprobe =\nautoload xfm\n\nlet comment = Util.comment\nlet empty = Util.empty\nlet eol = Util.eol | Util.comment\n\n(* modprobe.conf allows continuing a line by ending it with backslash +\n newline; the backslash + newline token is suppressed We handle an\n approximation of that by classifying backslash + newline as a\n separator.\n*)\n\n(* A separator is either whitespace or \\ followed by newline *)\nlet sep_ch = \/[ \\t]|\\\\\\\\\\n\/\n(* Anything that's not a separator is part of a token *)\nlet tok_ch = \/[^ \\t\\n#\\\\]|\\\\\\\\[^ \\t\\n]\/\n\nlet spc = del sep_ch+ \" \"\nlet token = store tok_ch+\nlet indent = Util.del_opt_ws \"\"\n\nlet cmd (n:regexp) = key n . spc\nlet arg (n:string) = [ label n . token ]\nlet token_to_eol = store (tok_ch . \/([^#\\n\\\\]|\\\\\\\\\\n)*\/ . tok_ch | tok_ch)\n\nlet options =\n let opt_ch = \/[A-Za-z0-9_]\/ in\n let option = [ spc . key opt_ch+ . (del \/=\/ \"=\" . token)? ] in\n [ cmd \"options\" . token . option* . eol ]\n\nlet entry = [ cmd \"alias\" . token . spc . arg \"modulename\" . eol ]\n | [ cmd \"include\" . token . eol ]\n | options\n | [ cmd \/install|remove\/ . token_to_eol . eol ]\n | [ cmd \"blacklist\" . token . eol ]\n | [ cmd \"config\" . store \/binary_indexes|yes|no\/ ]\n\nlet lns = (comment|empty|entry)*\n\nlet filter = (incl \"\/etc\/modprobe.conf\") .\n (incl \"\/etc\/modprobe.d\/*\").\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"aa3bc2648376cb760fde218255cfdf77170d8ac4","subject":"Add two files found on OpenBSD to the simplevars lens.","message":"Add two files found on OpenBSD to the simplevars lens.\n","repos":"lutter\/augeas,mchf\/augeas,mchf\/augeas,pevalme\/augeas,mlichvar\/augeas,kumy\/augeas,dafugg\/augeas,jtopjian\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,jjlin\/augeas,kunkku\/augeas,lutter\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,jasperla\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jasperla\/augeas,hercules-team\/augeas,ptoscano\/augeas,kumy\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,kunkku\/augeas,kumy\/augeas,dafugg\/augeas,jjlin\/augeas,dafugg\/augeas,raphink\/augeas,pevalme\/augeas,manandbytes\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,lutter\/augeas","old_file":"lenses\/simplevars.aug","new_file":"lenses\/simplevars.aug","new_contents":"(*\nModule: Simplevars\n Parses simple key = value conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Simplevars> file contains various examples and tests.\n*)\n\nmodule Simplevars =\n\nautoload xfm\n\n(* Variable: to_comment_re\n The regexp to match the value *)\nlet to_comment_re =\n let to_comment_squote = \/'[^\\n']*'\/\n in let to_comment_dquote = \/\"[^\\n\"]*\"\/\n in let to_comment_noquote = \/[^\\n \\t'\"#][^\\n#]*[^\\n \\t#]|[^\\n \\t'\"#]\/\n in to_comment_squote | to_comment_dquote | to_comment_noquote\n\n(* View: entry *)\nlet entry = Build.key_value Rx.word Sep.space_equal\n (store to_comment_re . (Util.eol|Util.comment_eol))\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/kernel-img.conf\"\n . incl \"\/etc\/kerneloops.conf\"\n . incl \"\/etc\/updatedb.conf\"\n . incl \"\/etc\/wgetrc\"\n . incl \"\/etc\/zabbix\/*.conf\"\n . incl \"\/etc\/audit\/auditd.conf\"\n . incl \"\/etc\/mixerctl.conf\"\n . incl \"\/etc\/wsconsctlctl.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Simplevars\n Parses simple key = value conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Simplevars> file contains various examples and tests.\n*)\n\nmodule Simplevars =\n\nautoload xfm\n\n(* Variable: to_comment_re\n The regexp to match the value *)\nlet to_comment_re =\n let to_comment_squote = \/'[^\\n']*'\/\n in let to_comment_dquote = \/\"[^\\n\"]*\"\/\n in let to_comment_noquote = \/[^\\n \\t'\"#][^\\n#]*[^\\n \\t#]|[^\\n \\t'\"#]\/\n in to_comment_squote | to_comment_dquote | to_comment_noquote\n\n(* View: entry *)\nlet entry = Build.key_value Rx.word Sep.space_equal\n (store to_comment_re . (Util.eol|Util.comment_eol))\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/kernel-img.conf\"\n . incl \"\/etc\/kerneloops.conf\"\n . incl \"\/etc\/updatedb.conf\"\n . incl \"\/etc\/wgetrc\"\n . incl \"\/etc\/zabbix\/*.conf\"\n . incl \"\/etc\/audit\/auditd.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"214aa2ad38d098c03555caae19e9f7e277abe9d2","subject":"Add a test to check we take the right branch","message":"Add a test to check we take the right branch\n\nThis does essentially the same as the test Pass_prefix_union introduced\nwith cset 489:3f4414038a30, but in a real world lens.\n","repos":"jtopjian\/augeas,raphink\/augeas,pevalme\/augeas,kunkku\/augeas,camptocamp\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,kumy\/augeas,camptocamp\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,kumy\/augeas,pevalme\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,mlichvar\/augeas,manandbytes\/augeas,ptoscano\/augeas,domcleal\/augeas,domcleal\/augeas,manandbytes\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,kunkku\/augeas,bkearney\/augeas,domcleal\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,bkearney\/augeas,lutter\/augeas,jjlin\/augeas,jasperla\/augeas,jasperla\/augeas,bkearney\/augeas,mchf\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,lutter\/augeas,GeoffWilliams\/augeas,raphink\/augeas,mchf\/augeas,camptocamp\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kunkku\/augeas,jtopjian\/augeas,jjlin\/augeas,dafugg\/augeas,kumy\/augeas,kumy\/augeas","old_file":"lenses\/tests\/test_yum.aug","new_file":"lenses\/tests\/test_yum.aug","new_contents":"module Test_yum =\n\n let yum_simple = \"[sec1]\n# comment\nkey=value\n[sec-two]\nkey1=value1\n# comment\nkey2=value2\n\"\n\n let yum_conf = \"[main]\ncachedir=\/var\/cache\/yum\nkeepcache=0\ndebuglevel=2\nlogfile=\/var\/log\/yum.log\nexactarch=1\nobsoletes=1\ngpgcheck=1\nplugins=1\nmetadata_expire=1800\n\ninstallonly_limit=100\n\n# PUT YOUR REPOS HERE OR IN separate files named file.repo\n# in \/etc\/yum.repos.d\n\"\n\n let cont = \"[main]\\nbaseurl=url1\\n url2 , url3\\n \\n\"\n\n test Yum.lns get yum_simple =\n { \"sec1\" {} { \"key\" = \"value\" } }\n { \"sec-two\" { \"key1\" = \"value1\" } {} { \"key2\" = \"value2\" } }\n\n test Yum.lns put yum_conf after\n rm \"main\"\n = \"\"\n\n test Yum.lns put yum_simple after\n set \"sec1\/key\" \"othervalue\"\n = \"[sec1]\\n# comment\\nkey=othervalue\\n[sec-two]\\nkey1=value1\\n# comment\\nkey2=value2\\n\"\n\n test Yum.lns put yum_simple after\n rm \"sec1\" ;\n rm \"sec-two\/key1\"\n = \"[sec-two]\\n# comment\\nkey2=value2\\n\"\n\n test Yum.lns put yum_simple after\n rm \"sec1\" ;\n rm \"sec-two\/key1\" ;\n set \"sec-two\/newkey\" \"newvalue\"\n = \"[sec-two]\\n# comment\\nkey2=value2\\nnewkey=newvalue\\n\"\n\n test Yum.lns put yum_simple after\n rm \"sec1\" ;\n set \"sec-two\/key1\" \"newvalue\"\n = \"[sec-two]\\nkey1=newvalue\\n# comment\\nkey2=value2\\n\"\n\n test Yum.lns get cont =\n { \"main\"\n { \"baseurl\" = \"url1\" }\n { \"baseurl\" = \"url2\" }\n { \"baseurl\" = \"url3\" }\n {}\n }\n\n test Yum.lns put cont after\n set \"main\/gpgcheck\" \"1\"\n =\n cont . \"gpgcheck=1\\n\"\n\n (* We are actually stricter than yum in checking syntax. The yum.conf *)\n (* man page mentions that it is illegal to have multiple baseurl keys *)\n (* in the same section, but yum will just carry on, usually with *)\n (* results that surpise the unsuspecting user *)\n test Yum.lns get \"[repo]\\nbaseurl=url1\\nbaseurl=url2\\n\" = *\n\n (* This checks that we take the right branch in the section lens. *)\n test Yum.section get \"[repo]\\nname=A name\\nbaseurl=url1\\n\" = \n { \"repo\"\n { \"name\" = \"A name\" }\n { \"baseurl\" = \"url1\" } }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"module Test_yum =\n\n let yum_simple = \"[sec1]\n# comment\nkey=value\n[sec-two]\nkey1=value1\n# comment\nkey2=value2\n\"\n\n let yum_conf = \"[main]\ncachedir=\/var\/cache\/yum\nkeepcache=0\ndebuglevel=2\nlogfile=\/var\/log\/yum.log\nexactarch=1\nobsoletes=1\ngpgcheck=1\nplugins=1\nmetadata_expire=1800\n\ninstallonly_limit=100\n\n# PUT YOUR REPOS HERE OR IN separate files named file.repo\n# in \/etc\/yum.repos.d\n\"\n\n let cont = \"[main]\\nbaseurl=url1\\n url2 , url3\\n \\n\"\n\n test Yum.lns get yum_simple =\n { \"sec1\" {} { \"key\" = \"value\" } }\n { \"sec-two\" { \"key1\" = \"value1\" } {} { \"key2\" = \"value2\" } }\n\n test Yum.lns put yum_conf after\n rm \"main\"\n = \"\"\n\n test Yum.lns put yum_simple after\n set \"sec1\/key\" \"othervalue\"\n = \"[sec1]\\n# comment\\nkey=othervalue\\n[sec-two]\\nkey1=value1\\n# comment\\nkey2=value2\\n\"\n\n test Yum.lns put yum_simple after\n rm \"sec1\" ;\n rm \"sec-two\/key1\"\n = \"[sec-two]\\n# comment\\nkey2=value2\\n\"\n\n test Yum.lns put yum_simple after\n rm \"sec1\" ;\n rm \"sec-two\/key1\" ;\n set \"sec-two\/newkey\" \"newvalue\"\n = \"[sec-two]\\n# comment\\nkey2=value2\\nnewkey=newvalue\\n\"\n\n test Yum.lns put yum_simple after\n rm \"sec1\" ;\n set \"sec-two\/key1\" \"newvalue\"\n = \"[sec-two]\\nkey1=newvalue\\n# comment\\nkey2=value2\\n\"\n\n test Yum.lns get cont =\n { \"main\"\n { \"baseurl\" = \"url1\" }\n { \"baseurl\" = \"url2\" }\n { \"baseurl\" = \"url3\" }\n {}\n }\n\n test Yum.lns put cont after\n set \"main\/gpgcheck\" \"1\"\n =\n cont . \"gpgcheck=1\\n\"\n\n (* We are actually stricter than yum in checking syntax. The yum.conf *)\n (* man page mentions that it is illegal to have multiple baseurl keys *)\n (* in the same section, but yum will just carry on, usually with *)\n (* results that surpise the unsuspecting user *)\n test Yum.lns get \"[repo]\\nbaseurl=url1\\nbaseurl=url2\\n\" = *\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a1794be211863553de68d32a93a4f1e661f1d2c2","subject":"yum.aug: Yum lenses work on DNF, add them to import list (#434)","message":"yum.aug: Yum lenses work on DNF, add them to import list (#434)\n\n","repos":"pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,mchf\/augeas,lutter\/augeas,mchf\/augeas,manandbytes\/augeas,hercules-team\/augeas,pevalme\/augeas,lutter\/augeas,ptoscano\/augeas,kunkku\/augeas,hercules-team\/augeas,mlichvar\/augeas,manandbytes\/augeas,mlichvar\/augeas,lutter\/augeas,kunkku\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas","old_file":"lenses\/yum.aug","new_file":"lenses\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . Sep.opt_space . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\" | \"exclude\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries =\n let list_entry_elem (k:string) = list_entry k . entry*\n in entry*\n | entry* . Build.combine_three_opt\n (list_entry_elem \"baseurl\")\n (list_entry_elem \"gpgkey\")\n (list_entry_elem \"exclude\")\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*.repo\")\n . (incl \"\/etc\/yum\/yum-cron*.conf\") \n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . (incl \"\/etc\/dnf\/dnf.conf\")\n . (incl \"\/etc\/dnf\/automatic.conf\")\n . (incl \"\/etc\/dnf\/plugins\/*.conf\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . Sep.opt_space . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\" | \"exclude\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries =\n let list_entry_elem (k:string) = list_entry k . entry*\n in entry*\n | entry* . Build.combine_three_opt\n (list_entry_elem \"baseurl\")\n (list_entry_elem \"gpgkey\")\n (list_entry_elem \"exclude\")\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*.repo\")\n . (incl \"\/etc\/yum\/yum-cron*.conf\") \n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"44cf9eefa64dd6b306ea5dc6047a6cecda024e0f","subject":"Mdadm_Conf: optimize regexp substractions","message":"Mdadm_Conf: optimize regexp substractions\n","repos":"mlichvar\/augeas,pevalme\/augeas,lutter\/augeas,raphink\/augeas,pevalme\/augeas,jasperla\/augeas,manandbytes\/augeas,raphink\/augeas,dafugg\/augeas,kunkku\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,kumy\/augeas,dafugg\/augeas,lutter\/augeas,jasperla\/augeas,kunkku\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,kunkku\/augeas,mlichvar\/augeas,ptoscano\/augeas,jjlin\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,kumy\/augeas,mchf\/augeas,kumy\/augeas,ptoscano\/augeas,ptoscano\/augeas,kumy\/augeas,mchf\/augeas,manandbytes\/augeas,jjlin\/augeas,lutter\/augeas,jtopjian\/augeas,mlichvar\/augeas,dafugg\/augeas","old_file":"lenses\/mdadm_conf.aug","new_file":"lenses\/mdadm_conf.aug","new_contents":"(******************************************************************************\nMdadm_conf module for Augeas\n\nAuthor: Matthew Booth <mbooth@redhat.com>\n\nCopyright (C):\n 2011 Red Hat Inc.\n\nReference:\n mdadm(5)\n config.c and policy.c from mdadm-3.2.2\n\nLicense:\n This file is licensed under the LGPL v2+.\n\nThis is a lens for \/etc\/mdadm.conf. It aims to parse every valid configuration\nfile as of version 3.2.2, and many invalid ones too. This last point is a\nfeature, not a bug! madm will generate warnings for invalid configuration which\ndo not prevent correct operation of the tool. Wherever possible, we try to\nallow for this behaviour.\n\nKeywords in mdadm.conf are matched with a case-insensitive prefix match of at\nleast 3 characters. Keys in key\/value pairs are also matched case-insensitively,\nbut require a full match. The exception is POLICY and PART-POLICY, where keys\nare matched case-sensitively.\n\nN.B. We can't use case-insensitive regular expressions in most places due to bug\n#147.\n*******************************************************************************)\n\nmodule Mdadm_conf =\n\n autoload xfm\n\n\n(******************************************************************************\n * PRIMITIVES\n ******************************************************************************)\n\nlet eol = Util.comment_or_eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet value = \/[^ \\t\\n#]+\/\nlet value_no_eq = \/[^ \\t\\n#=]+\/\nlet value_no_eq_sl = \/[^ \\t\\n#=\\\/]+\/\n\nlet continuation = \/\\n[ \\t]+\/\nlet space = \/[ \\t]+\/\nlet value_sep = ( del ( continuation | space . continuation? ) \" \"\n | comment . del space \" \" )\n\n(* We parse specific keys rather than having a catch-all owing to the varying\ncase of the syntax. This means the user can rely on 'array\/uuid' rather than\nadditionally testing for 'array\/UUID'.\n\nIt would be good to have an additional catchall, but I haven't been able to make\nthat work.\n*)\nlet keyvalue (r:regexp) (lc:string) (uc:string) =\n [ del ( r . \/=\/ ) ( uc . \"=\" ) . label lc . store value ]\n\nlet simplevalue (r:regexp) (lc:string) (uc:string) =\n [ del r uc . label lc\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * DEVICES\n ******************************************************************************)\n\nlet dev_re = \/dev(i(ce?)?)?\/i\n\nlet dev_containers_re = \/containers\/i\nlet dev_partitions_re = \/partitions\/i\n\nlet dev_containers = [ del dev_containers_re \"containers\" . label \"containers\" ]\nlet dev_partitions = [ del dev_partitions_re \"partitions\" . label \"partitions\" ]\nlet dev_device = [ label \"name\". store ( value - (dev_containers_re | dev_partitions_re)) ]\n\n(* Strictly there must be at least 1 device, but we err on the side of parsing\n*)\nlet dev_devices = ( value_sep . ( dev_containers\n | dev_partitions\n | dev_device ) )*\n\nlet device = [ del dev_re \"DEVICE\" . label \"device\" . dev_devices . eol ]\n\n\n(******************************************************************************\n * ARRAY\n ******************************************************************************)\n\nlet array_re = \/arr(ay?)?\/i\n\nlet arr_auto_re = \/auto\/i\nlet arr_bitmap_re = \/bitmap\/i\nlet arr_container_re = \/container\/i\nlet arr_devices_re = \/devices\/i\nlet arr_disks_re = \/disks\/i (* Undocumented *)\nlet arr_level_re = \/level\/i\nlet arr_member_re = \/member\/i\nlet arr_metadata_re = \/metadata\/i\nlet arr_name_re = \/name\/i\nlet arr_num_devices_re = \/num-devices\/i\nlet arr_spare_group_re = \/spare-group\/i\nlet arr_spares_re = \/spares\/i\nlet arr_super_minor_re = \/super-minor\/i\nlet arr_uuid_re = \/uuid\/i\n\nlet arr_devicename = [ store value_no_eq . label \"devicename\" ]\n\nlet arr_auto = keyvalue arr_auto_re \"auto\" \"AUTO\"\nlet arr_bitmap = keyvalue arr_bitmap_re \"bitmap\" \"BITMAP\"\nlet arr_container = keyvalue arr_container_re \"container\" \"CONTAINER\"\nlet arr_devices = keyvalue arr_devices_re \"devices\" \"DEVICES\"\nlet arr_disks = keyvalue arr_disks_re \"disks\" \"DISKS\"\nlet arr_level = keyvalue arr_level_re \"level\" \"LEVEL\"\nlet arr_member = keyvalue arr_member_re \"member\" \"MEMBER\"\nlet arr_metadata = keyvalue arr_metadata_re \"metadata\" \"METADATA\"\nlet arr_name = keyvalue arr_name_re \"name\" \"NAME\"\nlet arr_num_devices = keyvalue arr_num_devices_re \"num-devices\" \"NUM-DEVICES\"\nlet arr_spare_group = keyvalue arr_spare_group_re \"spare-group\" \"SPARE-GROUP\"\nlet arr_spares = keyvalue arr_spares_re \"spares\" \"SPARES\"\nlet arr_super_minor = keyvalue arr_super_minor_re \"super-minor\" \"SUPER-MINOR\"\nlet arr_uuid = keyvalue arr_uuid_re \"uuid\" \"UUID\"\n\nlet arr_options = ( value_sep . ( arr_devicename\n | arr_auto\n | arr_bitmap\n | arr_container\n | arr_devices\n | arr_disks\n | arr_level\n | arr_member\n | arr_metadata\n | arr_name\n | arr_num_devices\n | arr_spare_group\n | arr_spares\n | arr_super_minor\n | arr_uuid ) )*\n\nlet array = [ del array_re \"ARRAY\" . label \"array\" . arr_options . eol ]\n\n\n(******************************************************************************\n * MAILADDR\n ******************************************************************************)\n\nlet mailaddr_re = \/mai(l(a(d(dr?)?)?)?)?\/i\n\n(* We intentially allow multiple mailaddr values here, even though this is\ninvalid and would produce a warning. This is better than not parsing the file.\n*)\nlet mailaddr = simplevalue mailaddr_re \"mailaddr\" \"MAILADDR\"\n\n\n(******************************************************************************\n * MAILFROM\n ******************************************************************************)\n\n(* N.B. MAILFROM can only be abbreviated to 5 characters *)\nlet mailfrom_re = \/mailf(r(om?)?)?\/i\n\nlet mailfrom = [ del mailfrom_re \"MAILFROM\" . label \"mailfrom\"\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * PROGRAM\n ******************************************************************************)\n\nlet program_re = \/pro(g(r(am?)?)?)?\/i\n\nlet program = simplevalue program_re \"program\" \"PROGRAM\"\n\n\n(******************************************************************************\n * CREATE\n ******************************************************************************)\n\nlet create_re = \/cre(a(te?)?)?\/i\n\nlet cre_auto_re = \/auto\/i\nlet cre_owner_re = \/owner\/i\nlet cre_group_re = \/group\/i\nlet cre_mode_re = \/mode\/i\nlet cre_metadata_re = \/metadata\/i\nlet cre_symlinks_re = \/symlinks\/i\n\nlet cre_auto = keyvalue cre_auto_re \"auto\" \"AUTO\"\nlet cre_group = keyvalue cre_group_re \"group\" \"GROUP\"\nlet cre_metadata = keyvalue cre_metadata_re \"metadata\" \"METADATA\"\nlet cre_mode = keyvalue cre_mode_re \"mode\" \"MODE\"\nlet cre_owner = keyvalue cre_owner_re \"owner\" \"OWNER\"\nlet cre_symlinks = keyvalue cre_symlinks_re \"symlinks\" \"SYMLINKS\"\n\nlet cre_options = ( value_sep . ( arr_auto\n | cre_owner\n | cre_group\n | cre_mode\n | cre_metadata\n | cre_symlinks) )*\n\nlet create = [ del create_re \"CREATE\" . label \"create\" . cre_options . eol ]\n\n\n(******************************************************************************\n * HOMEHOST\n ******************************************************************************)\n\nlet homehost_re = \/hom(e(h(o(st?)?)?)?)?\/i\n\nlet homehost = simplevalue homehost_re \"homehost\" \"HOMEHOST\"\n\n\n(******************************************************************************\n * AUTO\n ******************************************************************************)\n\nlet auto_re = \/auto?\/i\n\nlet aut_plus = [ key \"+\" . store value ]\nlet aut_minus = [ key \"-\" . store value ]\nlet aut_homehost = [ del \/homehost\/i \"homehost\" . label \"homehost\" ]\n\nlet aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )*\n\nlet auto = [ del auto_re \"AUTO\" . label \"auto\" . aut_list . eol ]\n\n\n(******************************************************************************\n * POLICY and PART-POLICY\n ******************************************************************************)\n\n(* PART-POLICY is undocumented. A cursory inspection of the parsing code\nsuggests it's parsed the same way as POLICY, but treated slightly differently\nthereafter. *)\n\nlet policy_re = \/pol(i(cy?)?)?\/i\nlet part_policy_re = \/par(t(-(p(o(l(i(cy?)?)?)?)?)?)?)?\/i\n\n(* Unlike everything else, policy keys are matched case sensitive. This means we\ndon't have to mess around with explicit option matching, as the match string is\nfixed for a working configuration. *)\n\nlet pol_option (act:string) =\n [ del ( act . \"=\" ) ( act . \"=\" ) . label act . store value ]\n\nlet pol_options = ( value_sep . [ key value_no_eq_sl . del \"=\" \"=\"\n . store value ] )*\n\nlet policy = [ del policy_re \"POLICY\" . label \"policy\"\n . pol_options . eol ]\nlet part_policy = [ del part_policy_re \"PART-POLICY\" . label \"part-policy\"\n . pol_options . eol ]\n\n\n(******************************************************************************\n * LENS\n ******************************************************************************)\n\nlet lns = (comment\n | empty\n | device\n | array\n | mailaddr\n | mailfrom\n | program\n | create\n | homehost\n | auto\n | policy\n | part_policy )*\n\nlet filter = incl \"\/etc\/mdadm.conf\"\n . incl \"\/etc\/mdadm\/mdadm.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(******************************************************************************\nMdadm_conf module for Augeas\n\nAuthor: Matthew Booth <mbooth@redhat.com>\n\nCopyright (C):\n 2011 Red Hat Inc.\n\nReference:\n mdadm(5)\n config.c and policy.c from mdadm-3.2.2\n\nLicense:\n This file is licensed under the LGPL v2+.\n\nThis is a lens for \/etc\/mdadm.conf. It aims to parse every valid configuration\nfile as of version 3.2.2, and many invalid ones too. This last point is a\nfeature, not a bug! madm will generate warnings for invalid configuration which\ndo not prevent correct operation of the tool. Wherever possible, we try to\nallow for this behaviour.\n\nKeywords in mdadm.conf are matched with a case-insensitive prefix match of at\nleast 3 characters. Keys in key\/value pairs are also matched case-insensitively,\nbut require a full match. The exception is POLICY and PART-POLICY, where keys\nare matched case-sensitively.\n\nN.B. We can't use case-insensitive regular expressions in most places due to bug\n#147.\n*******************************************************************************)\n\nmodule Mdadm_conf =\n\n autoload xfm\n\n\n(******************************************************************************\n * PRIMITIVES\n ******************************************************************************)\n\nlet eol = Util.comment_or_eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet value = \/[^ \\t\\n#]+\/\nlet value_no_eq = \/[^ \\t\\n#=]+\/\nlet value_no_eq_sl = \/[^ \\t\\n#=\\\/]+\/\n\nlet continuation = \/\\n[ \\t]+\/\nlet space = \/[ \\t]+\/\nlet value_sep = ( del ( continuation | space . continuation? ) \" \"\n | comment . del space \" \" )\n\n(* We parse specific keys rather than having a catch-all owing to the varying\ncase of the syntax. This means the user can rely on 'array\/uuid' rather than\nadditionally testing for 'array\/UUID'.\n\nIt would be good to have an additional catchall, but I haven't been able to make\nthat work.\n*)\nlet keyvalue (r:regexp) (lc:string) (uc:string) =\n [ del ( r . \/=\/ ) ( uc . \"=\" ) . label lc . store value ]\n\nlet simplevalue (r:regexp) (lc:string) (uc:string) =\n [ del r uc . label lc\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * DEVICES\n ******************************************************************************)\n\nlet dev_re = \/dev(i(ce?)?)?\/i\n\nlet dev_containers_re = \/containers\/i\nlet dev_partitions_re = \/partitions\/i\n\nlet dev_containers = [ del dev_containers_re \"containers\" . label \"containers\" ]\nlet dev_partitions = [ del dev_partitions_re \"partitions\" . label \"partitions\" ]\nlet dev_device = [ label \"name\". store ( value - dev_containers_re - dev_partitions_re) ]\n\n(* Strictly there must be at least 1 device, but we err on the side of parsing\n*)\nlet dev_devices = ( value_sep . ( dev_containers\n | dev_partitions\n | dev_device ) )*\n\nlet device = [ del dev_re \"DEVICE\" . label \"device\" . dev_devices . eol ]\n\n\n(******************************************************************************\n * ARRAY\n ******************************************************************************)\n\nlet array_re = \/arr(ay?)?\/i\n\nlet arr_auto_re = \/auto\/i\nlet arr_bitmap_re = \/bitmap\/i\nlet arr_container_re = \/container\/i\nlet arr_devices_re = \/devices\/i\nlet arr_disks_re = \/disks\/i (* Undocumented *)\nlet arr_level_re = \/level\/i\nlet arr_member_re = \/member\/i\nlet arr_metadata_re = \/metadata\/i\nlet arr_name_re = \/name\/i\nlet arr_num_devices_re = \/num-devices\/i\nlet arr_spare_group_re = \/spare-group\/i\nlet arr_spares_re = \/spares\/i\nlet arr_super_minor_re = \/super-minor\/i\nlet arr_uuid_re = \/uuid\/i\n\nlet arr_devicename = [ store value_no_eq . label \"devicename\" ]\n\nlet arr_auto = keyvalue arr_auto_re \"auto\" \"AUTO\"\nlet arr_bitmap = keyvalue arr_bitmap_re \"bitmap\" \"BITMAP\"\nlet arr_container = keyvalue arr_container_re \"container\" \"CONTAINER\"\nlet arr_devices = keyvalue arr_devices_re \"devices\" \"DEVICES\"\nlet arr_disks = keyvalue arr_disks_re \"disks\" \"DISKS\"\nlet arr_level = keyvalue arr_level_re \"level\" \"LEVEL\"\nlet arr_member = keyvalue arr_member_re \"member\" \"MEMBER\"\nlet arr_metadata = keyvalue arr_metadata_re \"metadata\" \"METADATA\"\nlet arr_name = keyvalue arr_name_re \"name\" \"NAME\"\nlet arr_num_devices = keyvalue arr_num_devices_re \"num-devices\" \"NUM-DEVICES\"\nlet arr_spare_group = keyvalue arr_spare_group_re \"spare-group\" \"SPARE-GROUP\"\nlet arr_spares = keyvalue arr_spares_re \"spares\" \"SPARES\"\nlet arr_super_minor = keyvalue arr_super_minor_re \"super-minor\" \"SUPER-MINOR\"\nlet arr_uuid = keyvalue arr_uuid_re \"uuid\" \"UUID\"\n\nlet arr_options = ( value_sep . ( arr_devicename\n | arr_auto\n | arr_bitmap\n | arr_container\n | arr_devices\n | arr_disks\n | arr_level\n | arr_member\n | arr_metadata\n | arr_name\n | arr_num_devices\n | arr_spare_group\n | arr_spares\n | arr_super_minor\n | arr_uuid ) )*\n\nlet array = [ del array_re \"ARRAY\" . label \"array\" . arr_options . eol ]\n\n\n(******************************************************************************\n * MAILADDR\n ******************************************************************************)\n\nlet mailaddr_re = \/mai(l(a(d(dr?)?)?)?)?\/i\n\n(* We intentially allow multiple mailaddr values here, even though this is\ninvalid and would produce a warning. This is better than not parsing the file.\n*)\nlet mailaddr = simplevalue mailaddr_re \"mailaddr\" \"MAILADDR\"\n\n\n(******************************************************************************\n * MAILFROM\n ******************************************************************************)\n\n(* N.B. MAILFROM can only be abbreviated to 5 characters *)\nlet mailfrom_re = \/mailf(r(om?)?)?\/i\n\nlet mailfrom = [ del mailfrom_re \"MAILFROM\" . label \"mailfrom\"\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * PROGRAM\n ******************************************************************************)\n\nlet program_re = \/pro(g(r(am?)?)?)?\/i\n\nlet program = simplevalue program_re \"program\" \"PROGRAM\"\n\n\n(******************************************************************************\n * CREATE\n ******************************************************************************)\n\nlet create_re = \/cre(a(te?)?)?\/i\n\nlet cre_auto_re = \/auto\/i\nlet cre_owner_re = \/owner\/i\nlet cre_group_re = \/group\/i\nlet cre_mode_re = \/mode\/i\nlet cre_metadata_re = \/metadata\/i\nlet cre_symlinks_re = \/symlinks\/i\n\nlet cre_auto = keyvalue cre_auto_re \"auto\" \"AUTO\"\nlet cre_group = keyvalue cre_group_re \"group\" \"GROUP\"\nlet cre_metadata = keyvalue cre_metadata_re \"metadata\" \"METADATA\"\nlet cre_mode = keyvalue cre_mode_re \"mode\" \"MODE\"\nlet cre_owner = keyvalue cre_owner_re \"owner\" \"OWNER\"\nlet cre_symlinks = keyvalue cre_symlinks_re \"symlinks\" \"SYMLINKS\"\n\nlet cre_options = ( value_sep . ( arr_auto\n | cre_owner\n | cre_group\n | cre_mode\n | cre_metadata\n | cre_symlinks) )*\n\nlet create = [ del create_re \"CREATE\" . label \"create\" . cre_options . eol ]\n\n\n(******************************************************************************\n * HOMEHOST\n ******************************************************************************)\n\nlet homehost_re = \/hom(e(h(o(st?)?)?)?)?\/i\n\nlet homehost = simplevalue homehost_re \"homehost\" \"HOMEHOST\"\n\n\n(******************************************************************************\n * AUTO\n ******************************************************************************)\n\nlet auto_re = \/auto?\/i\n\nlet aut_plus = [ key \"+\" . store value ]\nlet aut_minus = [ key \"-\" . store value ]\nlet aut_homehost = [ del \/homehost\/i \"homehost\" . label \"homehost\" ]\n\nlet aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )*\n\nlet auto = [ del auto_re \"AUTO\" . label \"auto\" . aut_list . eol ]\n\n\n(******************************************************************************\n * POLICY and PART-POLICY\n ******************************************************************************)\n\n(* PART-POLICY is undocumented. A cursory inspection of the parsing code\nsuggests it's parsed the same way as POLICY, but treated slightly differently\nthereafter. *)\n\nlet policy_re = \/pol(i(cy?)?)?\/i\nlet part_policy_re = \/par(t(-(p(o(l(i(cy?)?)?)?)?)?)?)?\/i\n\n(* Unlike everything else, policy keys are matched case sensitive. This means we\ndon't have to mess around with explicit option matching, as the match string is\nfixed for a working configuration. *)\n\nlet pol_option (act:string) =\n [ del ( act . \"=\" ) ( act . \"=\" ) . label act . store value ]\n\nlet pol_options = ( value_sep . [ key value_no_eq_sl . del \"=\" \"=\"\n . store value ] )*\n\nlet policy = [ del policy_re \"POLICY\" . label \"policy\"\n . pol_options . eol ]\nlet part_policy = [ del part_policy_re \"PART-POLICY\" . label \"part-policy\"\n . pol_options . eol ]\n\n\n(******************************************************************************\n * LENS\n ******************************************************************************)\n\nlet lns = (comment\n | empty\n | device\n | array\n | mailaddr\n | mailfrom\n | program\n | create\n | homehost\n | auto\n | policy\n | part_policy )*\n\nlet filter = incl \"\/etc\/mdadm.conf\"\n . incl \"\/etc\/mdadm\/mdadm.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d182ba912daa4ad28f6a0c256084bceb17b2486c","subject":"Shellvars: Optimize regexp substraction","message":"Shellvars: Optimize regexp substraction\n","repos":"dafugg\/augeas,jasperla\/augeas,ptoscano\/augeas,jjlin\/augeas,mchf\/augeas,hercules-team\/augeas,pevalme\/augeas,jtopjian\/augeas,raphink\/augeas,mlichvar\/augeas,manandbytes\/augeas,pevalme\/augeas,manandbytes\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas,kumy\/augeas,dafugg\/augeas,kumy\/augeas,kumy\/augeas,jtopjian\/augeas,dafugg\/augeas,MikaelSmith\/augeas,pevalme\/augeas,kumy\/augeas,lutter\/augeas,mchf\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,lutter\/augeas,ptoscano\/augeas,jasperla\/augeas,mlichvar\/augeas,raphink\/augeas,jjlin\/augeas,ptoscano\/augeas,kunkku\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n (* NetworkManager used to write files with '!' in them; this has\n been patched upstream. We need to ignore these files, because\n their name causes trouble during aug_init *)\n sc_excl \"network-scripts\/ifcfg-*!*\" .\n (* Ditto, brackets conflict with paths and cause aug_init failures *)\n sc_excl \"network-scripts\/ifcfg-*(*\" .\n sc_excl \"network-scripts\/ifcfg-*)*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n (* NetworkManager used to write files with '!' in them; this has\n been patched upstream. We need to ignore these files, because\n their name causes trouble during aug_init *)\n sc_excl \"network-scripts\/ifcfg-*!*\" .\n (* Ditto, brackets conflict with paths and cause aug_init failures *)\n sc_excl \"network-scripts\/ifcfg-*(*\" .\n sc_excl \"network-scripts\/ifcfg-*)*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"81a0b36e796f222da1dcdef9c78579f38c1f1ce2","subject":"Deckard: support RFC 3597 syntax in message definitions","message":"Deckard: support RFC 3597 syntax in message definitions\n","repos":"CZ-NIC\/deckard,CZ-NIC\/deckard","old_file":"pydnstest\/deckard.aug","new_file":"pydnstest\/deckard.aug","new_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/#; ]+\/\n\nlet comment = del \/[;#]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;#][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;#][^\\n]*)?\\n)*\/ \"\\n\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/#; ]+(\\.[^.\\t\\n\\\/#; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9#;\\n \\t][^\\t\\n\\\/#; ]*\/) - class_re) ]\n(* RFC 3597 section 5 rdata syntax is \"\\# 1 ab\"*)\nlet data_re = \/((\\\\\\#[ \\t])?[^ \\t\\n#;][^\\n#;]*[^ \\t\\n#;])|[^ \\t\\n#;]\/ (*Can not start nor end with whitespace but can have whitespace in the middle. Disjunction is there so we match strings of length one.*)\nlet data = [label \"data\" . store data_re ]\n\nlet ip_re = \/[0-9a-f.:]+\/\nlet hex_re = \/[0-9a-fA-F]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\" | \"BADSIG\" | \"BADKEY\" | \"BADTIME\" | \"BADMODE\" | \"BADNAME\" | \"BADALG\" | \"BADTRUNC\" | \"BADCOOKIE\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = [label \"record\" . domain . tab . (class . tab)? . type . comment_or_eol ]\nlet record = [label \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = [label \"section\" . section_question? . section_answer? . section_authority? . section_additional?]\n\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store hex_re ] . comment_or_eol\n\n(* This is quite dirty hack to match every combination of options given to entry since 'let normal = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)\n\nlet normal = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . ( normal | raw ) . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . space . store data_re . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\n(*let filter = incl \"\/home\/test\/*.rpl\"*)\nlet filter = incl \"\/media\/test\/27159fa1-67d4-4162-8707-cd67900f3b36\/stepan\/nic\/deckard_stable\/deckard\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","old_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/#; ]+\/\n\nlet comment = del \/[;#]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;#][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;#][^\\n]*)?\\n)*\/ \"\\n\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/#; ]+(\\.[^.\\t\\n\\\/#; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9#;\\n \\t][^\\t\\n\\\/#; ]*\/) - class_re) ]\nlet data_re = \/([^ \\t\\n#;][^\\n#;]*[^ \\t\\n#;])|[^ \\t\\n#;]\/ (*Can not start nor end with whitespace but can have whitespace in the middle. Disjunction is there so we match strings of length one.*)\nlet data = [label \"data\" . store data_re ]\n\nlet ip_re = \/[0-9a-f.:]+\/\nlet hex_re = \/[0-9a-fA-F]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\" | \"BADSIG\" | \"BADKEY\" | \"BADTIME\" | \"BADMODE\" | \"BADNAME\" | \"BADALG\" | \"BADTRUNC\" | \"BADCOOKIE\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = [label \"record\" . domain . tab . (class . tab)? . type . comment_or_eol ]\nlet record = [label \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = [label \"section\" . section_question? . section_answer? . section_authority? . section_additional?]\n\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store hex_re ] . comment_or_eol\n\n(* This is quite dirty hack to match every combination of options given to entry since 'let normal = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)\n\nlet normal = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . ( normal | raw ) . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . space . store data_re . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\n(*let filter = incl \"\/home\/test\/*.rpl\"*)\nlet filter = incl \"\/media\/test\/27159fa1-67d4-4162-8707-cd67900f3b36\/stepan\/nic\/deckard_stable\/deckard\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Augeas"} {"commit":"8434aeb7afc57a85cfb261e378f2646994cac49e","subject":"Multipath: fix syntax error in test","message":"Multipath: fix syntax error in test\n\nError was introduced in commit ade45812\n","repos":"ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,kunkku\/augeas","old_file":"lenses\/tests\/test_multipath.aug","new_file":"lenses\/tests\/test_multipath.aug","new_contents":"module Test_multipath =\n\n let conf = \"# Blacklist all devices by default.\nblacklist {\n devnode \\\"*\\\"\n wwid *\n}\n\n# By default, devices with vendor = \\\"IBM\\\" and product = \\\"S\/390.*\\\" are\n# blacklisted. To enable mulitpathing on these devies, uncomment the\n# following lines.\nblacklist_exceptions {\n\tdevice {\n\t\tvendor\t\\\"IBM\\\"\n\t\tproduct\t\\\"S\/390.*\\\"\n\t}\n}\n\n#\n# Here is an example of how to configure some standard options.\n#\n\ndefaults {\n\tudev_dir\t\t\/dev\n\tpolling_interval \t10\n\tselector\t\t\\\"round-robin 0\\\"\n\tpath_grouping_policy\tmultibus\n\tgetuid_callout\t\t\\\"\/sbin\/scsi_id --whitelisted \/dev\/%n\\\"\n\tprio\t\t\talua\n\tpath_checker\t\treadsector0\n\trr_min_io\t\t100\n\tmax_fds\t\t\t8192\n\trr_weight\t\tpriorities\n\tfailback\t\timmediate\n\tno_path_retry\t\tfail\n\tuser_friendly_names\tyes\n dev_loss_tmo 30\n max_polling_interval 300\n verbosity 2\n reassign_maps yes\n fast_io_fail_tmo 5\n async_timeout 5\n flush_on_last_del no\n delay_watch_checks no\n delay_wait_checks no\n find_multipaths yes\n checker_timeout 10\n hwtable_regex_match yes\n reload_readwrite no\n force_sync yes\n config_dir \/etc\/multipath\/conf.d\n}\n\n# Sections without empty lines in between\nblacklist {\n wwid 26353900f02796769\n\tdevnode \\\"^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*\\\"\n\n # Comments and blank lines inside a section\n\tdevnode \\\"^hd[a-z]\\\"\n\n}\nmultipaths {\n\tmultipath {\n\t\twwid\t\t\t3600508b4000156d700012000000b0000\n\t\talias\t\t\tyellow\n\t\tpath_grouping_policy\tmultibus\n\t\tpath_checker\t\treadsector0\n\t\tpath_selector\t\t\\\"round-robin 0\\\"\n\t\tfailback\t\tmanual\n\t\trr_weight\t\tpriorities\n\t\tno_path_retry\t\t5\n flush_on_last_del yes\n\t}\n\tmultipath {\n\t\twwid\t\t\t1DEC_____321816758474\n\t\talias\t\t\tred\n\t}\n}\ndevices {\n\tdevice {\n\t\tvendor\t\t\t\\\"COMPAQ \\\"\n\t\tproduct\t\t\t\\\"HSV110 (C)COMPAQ\\\"\n\t\tpath_grouping_policy\tmultibus\n\t\tgetuid_callout \\\"\/sbin\/scsi_id --whitelisted \/dev\/%n\\\"\n\t\tpath_checker\t\treadsector0\n\t\tpath_selector\t\t\\\"round-robin 0\\\"\n\t\thardware_handler\t\\\"0\\\"\n\t\tfailback\t\t15\n\t\trr_weight\t\tpriorities\n\t\trr_min_io_rq\t\t75\n\t\tno_path_retry\t\tqueue\n reservation_key a12345\n\t}\n\tdevice {\n\t\tvendor\t\t\t\\\"COMPAQ \\\"\n\t\tproduct\t\t\t\\\"MSA1000 \\\"\n\t\tpath_grouping_policy\tmultibus\n\t\tpolling_interval\t9\n delay_watch_checks 10\n delay_wait_checks 10\n\t}\n}\\n\"\n\ntest Multipath.lns get conf =\n { \"#comment\" = \"Blacklist all devices by default.\" }\n { \"blacklist\"\n { \"devnode\" = \"*\" }\n { \"wwid\" = \"*\" } }\n { }\n { \"#comment\" = \"By default, devices with vendor = \\\"IBM\\\" and product = \\\"S\/390.*\\\" are\" }\n { \"#comment\" = \"blacklisted. To enable mulitpathing on these devies, uncomment the\" }\n { \"#comment\" = \"following lines.\" }\n { \"blacklist_exceptions\"\n { \"device\"\n { \"vendor\" = \"IBM\" }\n { \"product\" = \"S\/390.*\" } } }\n { }\n { }\n { \"#comment\" = \"Here is an example of how to configure some standard options.\" }\n { }\n { }\n { \"defaults\"\n { \"udev_dir\" = \"\/dev\" }\n { \"polling_interval\" = \"10\" }\n { \"selector\" = \"round-robin 0\" }\n { \"path_grouping_policy\" = \"multibus\" }\n { \"getuid_callout\" = \"\/sbin\/scsi_id --whitelisted \/dev\/%n\" }\n { \"prio\" = \"alua\" }\n { \"path_checker\" = \"readsector0\" }\n { \"rr_min_io\" = \"100\" }\n { \"max_fds\" = \"8192\" }\n { \"rr_weight\" = \"priorities\" }\n { \"failback\" = \"immediate\" }\n { \"no_path_retry\" = \"fail\" }\n { \"user_friendly_names\" = \"yes\" }\n { \"dev_loss_tmo\" = \"30\" }\n { \"max_polling_interval\" = \"300\" }\n { \"verbosity\" = \"2\" }\n { \"reassign_maps\" = \"yes\" }\n { \"fast_io_fail_tmo\" = \"5\" }\n { \"async_timeout\" = \"5\" }\n { \"flush_on_last_del\" = \"no\" }\n { \"delay_watch_checks\" = \"no\" }\n { \"delay_wait_checks\" = \"no\" }\n { \"find_multipaths\" = \"yes\" }\n { \"checker_timeout\" = \"10\" }\n { \"hwtable_regex_match\" = \"yes\" }\n { \"reload_readwrite\" = \"no\" }\n { \"force_sync\" = \"yes\" }\n { \"config_dir\" = \"\/etc\/multipath\/conf.d\" } }\n { }\n { \"#comment\" = \"Sections without empty lines in between\" }\n { \"blacklist\"\n { \"wwid\" = \"26353900f02796769\" }\n { \"devnode\" = \"^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*\" }\n { }\n { \"#comment\" = \"Comments and blank lines inside a section\" }\n { \"devnode\" = \"^hd[a-z]\" }\n { } }\n { \"multipaths\"\n { \"multipath\"\n { \"wwid\" = \"3600508b4000156d700012000000b0000\" }\n { \"alias\" = \"yellow\" }\n { \"path_grouping_policy\" = \"multibus\" }\n { \"path_checker\" = \"readsector0\" }\n { \"path_selector\" = \"round-robin 0\" }\n { \"failback\" = \"manual\" }\n { \"rr_weight\" = \"priorities\" }\n { \"no_path_retry\" = \"5\" }\n { \"flush_on_last_del\" = \"yes\" } }\n { \"multipath\"\n { \"wwid\" = \"1DEC_____321816758474\" }\n { \"alias\" = \"red\" } } }\n { \"devices\"\n { \"device\"\n { \"vendor\" = \"COMPAQ \" }\n { \"product\" = \"HSV110 (C)COMPAQ\" }\n { \"path_grouping_policy\" = \"multibus\" }\n { \"getuid_callout\" = \"\/sbin\/scsi_id --whitelisted \/dev\/%n\" }\n { \"path_checker\" = \"readsector0\" }\n { \"path_selector\" = \"round-robin 0\" }\n { \"hardware_handler\" = \"0\" }\n { \"failback\" = \"15\" }\n { \"rr_weight\" = \"priorities\" }\n { \"rr_min_io_rq\" = \"75\" }\n { \"no_path_retry\" = \"queue\" }\n { \"reservation_key\" = \"a12345\" } }\n { \"device\"\n { \"vendor\" = \"COMPAQ \" }\n { \"product\" = \"MSA1000 \" }\n { \"path_grouping_policy\" = \"multibus\" }\n { \"polling_interval\" = \"9\" }\n { \"delay_watch_checks\" = \"10\" }\n { \"delay_wait_checks\" = \"10\" } } }\n\ntest Multipath.lns get \"blacklist {\n devnode \\\".*\\\"\n wwid \\\"([a-z]+|ab?c).*\\\"\n}\\n\" =\n { \"blacklist\"\n { \"devnode\" = \".*\" }\n { \"wwid\" = \"([a-z]+|ab?c).*\" } }\n\ntest Multipath.lns get \"blacklist {\\n property \\\"[a-z]+\\\"\\n}\\n\" =\n { \"blacklist\"\n { \"property\" = \"[a-z]+\" } }\n\n(* Check that '\"\"' inside a string works *)\ntest Multipath.lns get \"blacklist {\n device {\n vendor SomeCorp\n product \\\"2.5\\\"\\\" SSD\\\"\n }\n}\\n\" =\n { \"blacklist\"\n { \"device\"\n { \"vendor\" = \"SomeCorp\" }\n { \"product\" = \"2.5\\\"\\\" SSD\" } } }\n","old_contents":"module Test_multipath =\n\n let conf = \"# Blacklist all devices by default.\nblacklist {\n devnode \\\"*\\\"\n wwid *\n}\n\n# By default, devices with vendor = \\\"IBM\\\" and product = \\\"S\/390.*\\\" are\n# blacklisted. To enable mulitpathing on these devies, uncomment the\n# following lines.\nblacklist_exceptions {\n\tdevice {\n\t\tvendor\t\\\"IBM\\\"\n\t\tproduct\t\\\"S\/390.*\\\"\n\t}\n}\n\n#\n# Here is an example of how to configure some standard options.\n#\n\ndefaults {\n\tudev_dir\t\t\/dev\n\tpolling_interval \t10\n\tselector\t\t\\\"round-robin 0\\\"\n\tpath_grouping_policy\tmultibus\n\tgetuid_callout\t\t\\\"\/sbin\/scsi_id --whitelisted \/dev\/%n\\\"\n\tprio\t\t\talua\n\tpath_checker\t\treadsector0\n\trr_min_io\t\t100\n\tmax_fds\t\t\t8192\n\trr_weight\t\tpriorities\n\tfailback\t\timmediate\n\tno_path_retry\t\tfail\n\tuser_friendly_names\tyes\n dev_loss_tmo 30\n max_polling_interval 300\n verbosity 2\n reassign_maps yes\n fast_io_fail_tmo 5\n async_timeout 5\n flush_on_last_del no\n delay_watch_checks no\n delay_wait_checks no\n find_multipaths yes\n checker_timeout 10\n hwtable_regex_match yes\n reload_readwrite no\n force_sync yes\n config_dir \/etc\/multipath\/conf.d\n}\n\n# Sections without empty lines in between\nblacklist {\n wwid 26353900f02796769\n\tdevnode \\\"^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*\\\"\n\n # Comments and blank lines inside a section\n\tdevnode \\\"^hd[a-z]\\\"\n\n}\nmultipaths {\n\tmultipath {\n\t\twwid\t\t\t3600508b4000156d700012000000b0000\n\t\talias\t\t\tyellow\n\t\tpath_grouping_policy\tmultibus\n\t\tpath_checker\t\treadsector0\n\t\tpath_selector\t\t\\\"round-robin 0\\\"\n\t\tfailback\t\tmanual\n\t\trr_weight\t\tpriorities\n\t\tno_path_retry\t\t5\n flush_on_last_del yes\n\t}\n\tmultipath {\n\t\twwid\t\t\t1DEC_____321816758474\n\t\talias\t\t\tred\n\t}\n}\ndevices {\n\tdevice {\n\t\tvendor\t\t\t\\\"COMPAQ \\\"\n\t\tproduct\t\t\t\\\"HSV110 (C)COMPAQ\\\"\n\t\tpath_grouping_policy\tmultibus\n\t\tgetuid_callout \\\"\/sbin\/scsi_id --whitelisted \/dev\/%n\\\"\n\t\tpath_checker\t\treadsector0\n\t\tpath_selector\t\t\\\"round-robin 0\\\"\n\t\thardware_handler\t\\\"0\\\"\n\t\tfailback\t\t15\n\t\trr_weight\t\tpriorities\n\t\trr_min_io_rq\t\t75\n\t\tno_path_retry\t\tqueue\n reservation_key a12345\n\t}\n\tdevice {\n\t\tvendor\t\t\t\\\"COMPAQ \\\"\n\t\tproduct\t\t\t\\\"MSA1000 \\\"\n\t\tpath_grouping_policy\tmultibus\n\t\tpolling_interval\t9\n delay_watch_checks 10\n delay_wait_checks 10\n\t}\n}\\n\"\n\ntest Multipath.lns get conf =\n { \"#comment\" = \"Blacklist all devices by default.\" }\n { \"blacklist\"\n { \"devnode\" = \"*\" }\n { \"wwid\" = \"*\" } }\n { }\n { \"#comment\" = \"By default, devices with vendor = \\\"IBM\\\" and product = \\\"S\/390.*\\\" are\" }\n { \"#comment\" = \"blacklisted. To enable mulitpathing on these devies, uncomment the\" }\n { \"#comment\" = \"following lines.\" }\n { \"blacklist_exceptions\"\n { \"device\"\n { \"vendor\" = \"IBM\" }\n { \"product\" = \"S\/390.*\" } } }\n { }\n { }\n { \"#comment\" = \"Here is an example of how to configure some standard options.\" }\n { }\n { }\n { \"defaults\"\n { \"udev_dir\" = \"\/dev\" }\n { \"polling_interval\" = \"10\" }\n { \"selector\" = \"round-robin 0\" }\n { \"path_grouping_policy\" = \"multibus\" }\n { \"getuid_callout\" = \"\/sbin\/scsi_id --whitelisted \/dev\/%n\" }\n { \"prio\" = \"alua\" }\n { \"path_checker\" = \"readsector0\" }\n { \"rr_min_io\" = \"100\" }\n { \"max_fds\" = \"8192\" }\n { \"rr_weight\" = \"priorities\" }\n { \"failback\" = \"immediate\" }\n { \"no_path_retry\" = \"fail\" }\n { \"user_friendly_names\" = \"yes\" }\n { \"dev_loss_tmo\" = \"30\" }\n { \"max_polling_interval\" = \"300\" }\n { \"verbosity\" = \"2\" }\n { \"reassign_maps\" = \"yes\" }\n { \"fast_io_fail_tmo\" = \"5\" }\n { \"async_timeout\" = \"5\" }\n { \"flush_on_last_del\" = \"no\" }\n { \"delay_watch_checks\" = \"no\" }\n { \"delay_wait_checks\" = \"no\" }\n { \"find_multipaths\" = \"yes\" }\n { \"checker_timeout\" = \"10\" }\n { \"hwtable_regex_match\" = \"yes\" }\n { \"reload_readwrite\" = \"no\" }\n { \"force_sync\" = \"yes\" }\n { \"config_dir\" = \"\/etc\/multipath\/conf.d\" } }\n { }\n { \"#comment\" = \"Sections without empty lines in between\" }\n { \"blacklist\"\n { \"wwid\" = \"26353900f02796769\" }\n { \"devnode\" = \"^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*\" }\n { }\n { \"#comment\" = \"Comments and blank lines inside a section\" }\n { \"devnode\" = \"^hd[a-z]\" }\n { } }\n { \"multipaths\"\n { \"multipath\"\n { \"wwid\" = \"3600508b4000156d700012000000b0000\" }\n { \"alias\" = \"yellow\" }\n { \"path_grouping_policy\" = \"multibus\" }\n { \"path_checker\" = \"readsector0\" }\n { \"path_selector\" = \"round-robin 0\" }\n { \"failback\" = \"manual\" }\n { \"rr_weight\" = \"priorities\" }\n { \"no_path_retry\" = \"5\" }\n { \"flush_on_last_del\" = \"yes\" } }\n { \"multipath\"\n { \"wwid\" = \"1DEC_____321816758474\" }\n { \"alias\" = \"red\" } } }\n { \"devices\"\n { \"device\"\n { \"vendor\" = \"COMPAQ \" }\n { \"product\" = \"HSV110 (C)COMPAQ\" }\n { \"path_grouping_policy\" = \"multibus\" }\n { \"getuid_callout\" = \"\/sbin\/scsi_id --whitelisted \/dev\/%n\" }\n { \"path_checker\" = \"readsector0\" }\n { \"path_selector\" = \"round-robin 0\" }\n { \"hardware_handler\" = \"0\" }\n { \"failback\" = \"15\" }\n { \"rr_weight\" = \"priorities\" }\n { \"rr_min_io_rq\" = \"75\" }\n { \"no_path_retry\" = \"queue\" }\n { \"reservation_key\" = \"a12345\" } }\n { \"device\"\n { \"vendor\" = \"COMPAQ \" }\n { \"product\" = \"MSA1000 \" }\n { \"path_grouping_policy\" = \"multibus\" }\n { \"polling_interval\" = \"9\" }\n { \"delay_watch_checks\" = \"10\" }\n { \"delay_wait_checks\" = \"10\" } } }\n\ntest Multipath.lns get \"blacklist {\n devnode \\\".*\\\"\n wwid \\\"([a-z]+|ab?c).*\\\"\n}\\n\" =\n { \"blacklist\"\n { \"devnode\" = \".*\" }\n { \"wwid\" = \"([a-z]+|ab?c).*\" } }\n\ntest Multipath.lns get \"blacklist {\\n property \\\"[a-z]+\\\"\\n}\\n\" =\n { \"blacklist\"\n { \"property\" = \"[a-z]+\" } }\n\n(* Check that '\"\"' inside a string works *)\ntest Multipath.lns get \"blacklist {\n device {\n vendor SomeCorp\n product \\\"2.5\\\"\\\" SSD\\\"\n }\n}\\n\" =\n { \"blacklist\"\n { \"device\"\n { \"vendor\" = \"SomeCorp\" }\n { \"product\" = \"2.5\"\" SSD\" } } }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"738e7d6501c03a7dea9a165f7ced4a78d2e338d6","subject":"util.aug: exclude unneeded files on debian systems (fix ticket #153)","message":"util.aug: exclude unneeded files on debian systems (fix ticket #153)\n","repos":"manandbytes\/augeas,kunkku\/augeas,ptoscano\/augeas,manandbytes\/augeas,kumy\/augeas,dafugg\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,mlichvar\/augeas,kumy\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas,lutter\/augeas,MikaelSmith\/augeas,domcleal\/augeas,dafugg\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,mchf\/augeas,raphink\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,jjlin\/augeas,mlichvar\/augeas,domcleal\/augeas,raphink\/augeas,jasperla\/augeas,mchf\/augeas,pevalme\/augeas,domcleal\/augeas,MikaelSmith\/augeas,lutter\/augeas,kunkku\/augeas,jasperla\/augeas,kumy\/augeas,pevalme\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment and empty\n This is a general definition of comment and empty.\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment\n Map comments into \"#comment\" nodes\n*)\n let comment =\n [ indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(*\nView: empty\n Map empty lines, including empty comments\n*)\n let empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment and empty\n This is a general definition of comment and empty.\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment\n Map comments into \"#comment\" nodes\n*)\n let comment =\n [ indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(*\nView: empty\n Map empty lines, including empty comments\n*)\n let empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"03dc912ac097e5b39e63ea4169f7cd7fe6fcfbc8","subject":"include only *.repo files from yum.repos.d;","message":"include only *.repo files from yum.repos.d;\n","repos":"mlichvar\/augeas,jjlin\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas,pevalme\/augeas,jasperla\/augeas,jjlin\/augeas,ptoscano\/augeas,manandbytes\/augeas,mchf\/augeas,raphink\/augeas,pevalme\/augeas,lutter\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,dafugg\/augeas,kunkku\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,raphink\/augeas,jjlin\/augeas,mchf\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,kunkku\/augeas,mlichvar\/augeas,jtopjian\/augeas,dafugg\/augeas,jasperla\/augeas,pevalme\/augeas,jtopjian\/augeas,lutter\/augeas","old_file":"lenses\/yum.aug","new_file":"lenses\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries = entry*\n | entry* . list_entry \"baseurl\" . entry*\n | entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"baseurl\" . entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"gpgkey\" . entry* . list_entry \"baseurl\" . entry*\n\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*.repo\")\n . (incl \"\/etc\/yum\/yum-cron*.conf\") \n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries = entry*\n | entry* . list_entry \"baseurl\" . entry*\n | entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"baseurl\" . entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"gpgkey\" . entry* . list_entry \"baseurl\" . entry*\n\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/yum-cron*.conf\") \n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3928bc416b4563793066600e616dd5fd66448e0a","subject":"Fix nocommand as nocomma in test_aliases.aug","message":"Fix nocommand as nocomma in test_aliases.aug\n","repos":"mlichvar\/augeas,kunkku\/augeas,lutter\/augeas,kunkku\/augeas,domcleal\/augeas,ptoscano\/augeas,ptoscano\/augeas,kumy\/augeas,raphink\/augeas,hercules-team\/augeas,mlichvar\/augeas,pevalme\/augeas,kunkku\/augeas,dafugg\/augeas,mchf\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,jjlin\/augeas,raphink\/augeas,mlichvar\/augeas,kumy\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,domcleal\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,lutter\/augeas,kumy\/augeas,manandbytes\/augeas,jjlin\/augeas,jjlin\/augeas,kumy\/augeas,MikaelSmith\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,jasperla\/augeas,jasperla\/augeas,jtopjian\/augeas,dafugg\/augeas,jtopjian\/augeas,mchf\/augeas","old_file":"lenses\/tests\/test_aliases.aug","new_file":"lenses\/tests\/test_aliases.aug","new_contents":"(*\nModule: Test_Aliases\n Provides unit tests and examples for the <Aliases> lens.\n*)\n\nmodule Test_aliases =\n\n(* Variable: file\n A full configuration file *)\n let file = \"#\n# Aliases in this file will NOT be expanded in the header from\n# Mail, but WILL be visible over networks or from \/bin\/mail.\n\n# Basic system aliases -- these MUST be present.\nmailer-daemon:\tpostmaster\npostmaster:\troot\n\n# General redirections for pseudo accounts.\nbin:\t\troot , adm,\n bob\ndaemon:\t\troot\nadm:\t\troot\nfile:\t\t\/var\/foo\npipe1:\t\t|\/bin\/ls\npipe2 :\t\t|\\\"\/usr\/bin\/ls args,\\\"\n\"\n\n(* Test: Aliases.lns\n Testing <Aliases.lns> on <file> *)\n test Aliases.lns get file =\n { }\n { \"#comment\" = \"Aliases in this file will NOT be expanded in the header from\" }\n { \"#comment\" = \"Mail, but WILL be visible over networks or from \/bin\/mail.\" }\n {}\n { \"#comment\" = \"Basic system aliases -- these MUST be present.\" }\n { \"1\" { \"name\" = \"mailer-daemon\" }\n { \"value\" = \"postmaster\" } }\n { \"2\" { \"name\" = \"postmaster\" }\n { \"value\" = \"root\" } }\n {}\n { \"#comment\" = \"General redirections for pseudo accounts.\" }\n { \"3\" { \"name\" = \"bin\" }\n { \"value\" = \"root\" }\n { \"value\" = \"adm\" }\n { \"value\" = \"bob\" } }\n { \"4\" { \"name\" = \"daemon\" }\n { \"value\" = \"root\" } }\n { \"5\" { \"name\" = \"adm\" }\n { \"value\" = \"root\" } }\n { \"6\" { \"name\" = \"file\" }\n { \"value\" = \"\/var\/foo\" } }\n { \"7\" { \"name\" = \"pipe1\" }\n { \"value\" = \"|\/bin\/ls\" } }\n { \"8\" { \"name\" = \"pipe2\" }\n { \"value\" = \"|\\\"\/usr\/bin\/ls args,\\\"\" } }\n\n(* Test: Aliases.lns\n Put test for <Aliases.lns> on <file> *)\n test Aliases.lns put file after\n rm \"\/4\" ; rm \"\/5\" ; rm \"\/6\" ; rm \"\/7\" ; rm \"\/8\" ;\n set \"\/1\/value[2]\" \"barbar\" ;\n set \"\/3\/value[2]\" \"ruth\"\n = \"#\n# Aliases in this file will NOT be expanded in the header from\n# Mail, but WILL be visible over networks or from \/bin\/mail.\n\n# Basic system aliases -- these MUST be present.\nmailer-daemon:\tpostmaster, barbar\npostmaster:\troot\n\n# General redirections for pseudo accounts.\nbin:\t\troot , ruth,\n bob\n\"\n\n (* Test: Aliases.lns\n Schema violation, no 3\/name *)\n test Aliases.lns put file after\n rm \"\/3\" ;\n set \"\/3\/value\/2\" \"ruth\"\n = *\n\n (* Variable: nocomma\n Don't have to have whitespace after a comma *)\n let nocomma = \"alias: target1,target2\\n\"\n\n (* Test: Aliases.lns\n Testing <Aliases.lns> on <nocomma> *)\n test Aliases.lns get nocomma =\n { \"1\"\n { \"name\" = \"alias\" }\n { \"value\" = \"target1\" }\n { \"value\" = \"target2\" } }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Test_Aliases\n Provides unit tests and examples for the <Aliases> lens.\n*)\n\nmodule Test_aliases =\n\n(* Variable: file\n A full configuration file *)\n let file = \"#\n# Aliases in this file will NOT be expanded in the header from\n# Mail, but WILL be visible over networks or from \/bin\/mail.\n\n# Basic system aliases -- these MUST be present.\nmailer-daemon:\tpostmaster\npostmaster:\troot\n\n# General redirections for pseudo accounts.\nbin:\t\troot , adm,\n bob\ndaemon:\t\troot\nadm:\t\troot\nfile:\t\t\/var\/foo\npipe1:\t\t|\/bin\/ls\npipe2 :\t\t|\\\"\/usr\/bin\/ls args,\\\"\n\"\n\n(* Test: Aliases.lns\n Testing <Aliases.lns> on <file> *)\n test Aliases.lns get file =\n { }\n { \"#comment\" = \"Aliases in this file will NOT be expanded in the header from\" }\n { \"#comment\" = \"Mail, but WILL be visible over networks or from \/bin\/mail.\" }\n {}\n { \"#comment\" = \"Basic system aliases -- these MUST be present.\" }\n { \"1\" { \"name\" = \"mailer-daemon\" }\n { \"value\" = \"postmaster\" } }\n { \"2\" { \"name\" = \"postmaster\" }\n { \"value\" = \"root\" } }\n {}\n { \"#comment\" = \"General redirections for pseudo accounts.\" }\n { \"3\" { \"name\" = \"bin\" }\n { \"value\" = \"root\" }\n { \"value\" = \"adm\" }\n { \"value\" = \"bob\" } }\n { \"4\" { \"name\" = \"daemon\" }\n { \"value\" = \"root\" } }\n { \"5\" { \"name\" = \"adm\" }\n { \"value\" = \"root\" } }\n { \"6\" { \"name\" = \"file\" }\n { \"value\" = \"\/var\/foo\" } }\n { \"7\" { \"name\" = \"pipe1\" }\n { \"value\" = \"|\/bin\/ls\" } }\n { \"8\" { \"name\" = \"pipe2\" }\n { \"value\" = \"|\\\"\/usr\/bin\/ls args,\\\"\" } }\n\n(* Test: Aliases.lns\n Put test for <Aliases.lns> on <file> *)\n test Aliases.lns put file after\n rm \"\/4\" ; rm \"\/5\" ; rm \"\/6\" ; rm \"\/7\" ; rm \"\/8\" ;\n set \"\/1\/value[2]\" \"barbar\" ;\n set \"\/3\/value[2]\" \"ruth\"\n = \"#\n# Aliases in this file will NOT be expanded in the header from\n# Mail, but WILL be visible over networks or from \/bin\/mail.\n\n# Basic system aliases -- these MUST be present.\nmailer-daemon:\tpostmaster, barbar\npostmaster:\troot\n\n# General redirections for pseudo accounts.\nbin:\t\troot , ruth,\n bob\n\"\n\n (* Test: Aliases.lns\n Schema violation, no 3\/name *)\n test Aliases.lns put file after\n rm \"\/3\" ;\n set \"\/3\/value\/2\" \"ruth\"\n = *\n\n (* Variable: nocommand\n Don't have to have whitespace after a comma *)\n let nocomma = \"alias: target1,target2\\n\"\n\n (* Test: Aliases.lns\n Testing <Aliases.lns> on <nocomma> *)\n test Aliases.lns get nocomma =\n { \"1\"\n { \"name\" = \"alias\" }\n { \"value\" = \"target1\" }\n { \"value\" = \"target2\" } }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d4bb2e91c366f8e9b55833ab7d093509048953ee","subject":"put on next line for readability","message":"put on next line for readability\n","repos":"mmckinst\/puppet-puppetserver","old_file":"files\/lenses\/trapperkeeper.aug","new_file":"files\/lenses\/trapperkeeper.aug","new_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del \/[ \\t]*\/ \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n let opt_dquot = del \/\"?\/ \"\"\n\n(* View: simple *)\nlet simple = [ Util.indent . key Rx.word . sep_with_spc\n . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot\n . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . key Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . key Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\"\n . incl \"\/etc\/puppetlabs\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del \/[ \\t]*\/ \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n let opt_dquot = del \/\"?\/ \"\"\n\n(* View: simple *)\nlet simple = [ Util.indent . key Rx.word . sep_with_spc\n . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot\n . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . key Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . key Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\" . incl \"\/etc\/puppetlabs\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"c948cb724653654f692fd8fd7c7df0a9fd108b21","subject":"Hosts: Refactor module","message":"Hosts: Refactor module\n","repos":"GeoffWilliams\/augeas,jjlin\/augeas,mlichvar\/augeas,ptoscano\/augeas,jtopjian\/augeas,jtopjian\/augeas,pevalme\/augeas,jasperla\/augeas,mlichvar\/augeas,jjlin\/augeas,pevalme\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,raphink\/augeas,mchf\/augeas,dafugg\/augeas,mchf\/augeas,MikaelSmith\/augeas,lutter\/augeas,dafugg\/augeas,ptoscano\/augeas,jasperla\/augeas,jjlin\/augeas,kunkku\/augeas,lutter\/augeas,lutter\/augeas,raphink\/augeas,ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas,hercules-team\/augeas,kunkku\/augeas,kunkku\/augeas,mlichvar\/augeas,pevalme\/augeas,manandbytes\/augeas","old_file":"lenses\/hosts.aug","new_file":"lenses\/hosts.aug","new_contents":"(* Parsing \/etc\/hosts *)\n\nmodule Hosts =\n autoload xfm\n\n let word = \/[^# \\n\\t]+\/\n let record = [ seq \"host\" . Util.indent .\n [ label \"ipaddr\" . store word ] . Sep.tab .\n [ label \"canonical\" . store word ] .\n [ label \"alias\" . Sep.space . store word ]*\n . Util.comment_or_eol ]\n\n let lns = ( Util.empty | Util.comment | record ) *\n\n let xfm = transform lns (incl \"\/etc\/hosts\")\n","old_contents":"(* Parsing \/etc\/hosts *)\n\nmodule Hosts =\n autoload xfm\n\n let sep_tab = Util.del_ws_tab\n let sep_spc = Util.del_ws_spc\n\n let eol = Util.eol\n let indent = Util.indent\n\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n let word = \/[^# \\n\\t]+\/\n let record = [ seq \"host\" . indent .\n [ label \"ipaddr\" . store word ] . sep_tab .\n [ label \"canonical\" . store word ] .\n [ label \"alias\" . sep_spc . store word ]*\n . comment_or_eol ]\n\n let lns = ( empty | comment | record ) *\n\n let xfm = transform lns (incl \"\/etc\/hosts\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"57bb25dc261b3b7192d86944c63b596b609df25e","subject":"Shellvars: process two more files on Debian","message":"Shellvars: process two more files on Debian\n\nAdd \/etc\/arno-iptables-firewall\/debconf.cfg and \/etc\/cron-apt\/config\n","repos":"ptoscano\/augeas,MikaelSmith\/augeas,kunkku\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,kumy\/augeas,jjlin\/augeas,mlichvar\/augeas,camptocamp\/augeas,jtopjian\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,raphink\/augeas,lutter\/augeas,kumy\/augeas,jtopjian\/augeas,domcleal\/augeas,raphink\/augeas,jasperla\/augeas,bkearney\/augeas,pevalme\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,hercules-team\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,hercules-team\/augeas,jasperla\/augeas,pevalme\/augeas,bkearney\/augeas,ptoscano\/augeas,lutter\/augeas,domcleal\/augeas,kumy\/augeas,jjlin\/augeas,mchf\/augeas,camptocamp\/augeas,camptocamp\/augeas,jjlin\/augeas,dafugg\/augeas,mlichvar\/augeas,kumy\/augeas,camptocamp\/augeas,mchf\/augeas,dafugg\/augeas,MikaelSmith\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n let eq = Util.del_str \"=\"\n let comment = [ del \/(#.*)?[ \\t]*\\n\/ \"# \\n\" ]\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/ \n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \"(\" \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t]+\/ \" \" . seq \"values\" . array_value ] *\n . del \")\" \")\"\n \n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value = \n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | empty_array)\n\n let kv = [ key key_re . eq . (simple_value | array) . eol ]\n\n let source = \n [ \n del \/\\.|source\/ \".\" . label \".source\" . \n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol \n ]\n\n let lns = (comment | source | kv) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig = \n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n let eq = Util.del_str \"=\"\n let comment = [ del \/(#.*)?[ \\t]*\\n\/ \"# \\n\" ]\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/ \n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \"(\" \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t]+\/ \" \" . seq \"values\" . array_value ] *\n . del \")\" \")\"\n \n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value = \n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | empty_array)\n\n let kv = [ key key_re . eq . (simple_value | array) . eol ]\n\n let source = \n [ \n del \/\\.|source\/ \".\" . label \".source\" . \n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol \n ]\n\n let lns = (comment | source | kv) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig = \n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7ee3bf0d479e705a9b05364a0cca7c4adf13be8b","subject":"Dovecot: no functional change; remove trailing whitespace","message":"Dovecot: no functional change; remove trailing whitespace\n","repos":"hercules-team\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,jjlin\/augeas,jjlin\/augeas,lutter\/augeas,mlichvar\/augeas,dafugg\/augeas,ptoscano\/augeas,pevalme\/augeas,jasperla\/augeas,raphink\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,manandbytes\/augeas,ptoscano\/augeas,mlichvar\/augeas,dafugg\/augeas,kunkku\/augeas,manandbytes\/augeas,lutter\/augeas,mchf\/augeas,lutter\/augeas,jjlin\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,kunkku\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,mchf\/augeas,raphink\/augeas,pevalme\/augeas,mlichvar\/augeas,jasperla\/augeas,dafugg\/augeas,kunkku\/augeas,ptoscano\/augeas","old_file":"lenses\/dovecot.aug","new_file":"lenses\/dovecot.aug","new_contents":"(*\nModule: Dovecot\n Parses dovecot configuration files.\n\nAuthor: Serge Smetana <serge.smetana@gmail.com>\n Acunote http:\/\/www.acunote.com\n Pluron, Inc. http:\/\/pluron.com\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Configuration files\n This lens applies to \/etc\/dovecot\/dovecot.conf and files in\n \/etc\/dovecot\/conf.d\/. See <filter>.\n\nAbout: Examples\n The <Test_Dovecot> file contains various examples and tests.\n\nAbout: TODO\n Support for multiline values like queries in dict-sql.conf\n*)\n\nmodule Dovecot =\n\n autoload xfm\n\n(******************************************************************\n * Group: USEFUL PRIMITIVES\n ******************************************************************)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: empty\nMap empty lines. *)\nlet empty = Util.empty\n\n(* View: comment\nMap comments in \"#comment\" nodes. *)\nlet comment = Util.comment\n\n(* View: eq *)\nlet eq = del \/[ \\t]*=\/ \" =\"\n\n(* Variable: any *)\nlet any = Rx.no_spaces\n\n(* Variable: value\nMatch any value after \" =\".\nShould not start and end with spaces. May contain spaces inside *)\nlet value = any . (Rx.space . any)*\n\n(* View: command_start *)\nlet command_start = Util.del_str \"!\"\n\n\n(******************************************************************\n * Group: ENTRIES\n ******************************************************************)\n\n(* Variable: commands *)\nlet commands = \/include|include_try\/\n\n(* Variable: block_names *)\nlet block_names = \/dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener\/\n\n(* Variable: keys\nMatch any possible key except commands and block names. *)\nlet keys = Rx.word - (commands | block_names)\n\n(* View: entry\nMap simple \"key = value\" entries including \"key =\" entries with empty value. *)\nlet entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]\n\n(* View: command\nMap commands started with \"!\". *)\nlet command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nBased off Quote.dquote_spaces\n\nParameters:\n lns1:lens - the lens before\n lns2:lens - the lens after\n*)\nlet dquote_spaces (lns1:lens) (lns2:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\"\\n]*[ \\t]+[^\"\\n]*\/)\n in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ]\n\nlet mailbox = indent\n . dquote_spaces\n (key \/mailbox\/ . Sep.space)\n (Build.block_newlines (entry) comment . eol)\n\nlet block_ldelim_newlines_re = \/[ \\t]+\\{([ \\t\\n]*\\n)?\/\n\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in del block_ldelim_newlines_re Build.block_ldelim_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default\n\n(* View: block\nMap block enclosed in brackets recursively.\nBlock may be indented and have optional argument.\nBlock body may have entries, comments, empty lines, and nested blocks recursively. *)\nlet rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store \/[\\\/A-Za-z0-9_-]+\/))? . block_newlines (entry|block|mailbox) comment . eol ]\n\n\n(******************************************************************\n * Group: LENS AND FILTER\n ******************************************************************)\n\n(* View: lns\nThe Dovecot lens *)\nlet lns = (comment|empty|entry|command|block)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/etc\/dovecot\/conf.d\/*.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Dovecot\n Parses dovecot configuration files.\n\nAuthor: Serge Smetana <serge.smetana@gmail.com>\n Acunote http:\/\/www.acunote.com\n Pluron, Inc. http:\/\/pluron.com\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Configuration files\n This lens applies to \/etc\/dovecot\/dovecot.conf and files in \n \/etc\/dovecot\/conf.d\/. See <filter>.\n\nAbout: Examples\n The <Test_Dovecot> file contains various examples and tests.\n\nAbout: TODO\n Support for multiline values like queries in dict-sql.conf \n*)\n\nmodule Dovecot =\n \n autoload xfm\n\n(******************************************************************\n * Group: USEFUL PRIMITIVES\n ******************************************************************)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: empty\nMap empty lines. *)\nlet empty = Util.empty\n\n(* View: comment\nMap comments in \"#comment\" nodes. *)\nlet comment = Util.comment\n\n(* View: eq *)\nlet eq = del \/[ \\t]*=\/ \" =\"\n\n(* Variable: any *)\nlet any = Rx.no_spaces\n\n(* Variable: value \nMatch any value after \" =\".\nShould not start and end with spaces. May contain spaces inside *)\nlet value = any . (Rx.space . any)* \n\n(* View: command_start *)\nlet command_start = Util.del_str \"!\"\n\n\n(******************************************************************\n * Group: ENTRIES\n ******************************************************************)\n\n(* Variable: commands *)\nlet commands = \/include|include_try\/\n\n(* Variable: block_names *)\nlet block_names = \/dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener\/\n\n(* Variable: keys \nMatch any possible key except commands and block names. *)\nlet keys = Rx.word - (commands | block_names)\n\n(* View: entry\nMap simple \"key = value\" entries including \"key =\" entries with empty value. *)\nlet entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]\n\n(* View: command\nMap commands started with \"!\". *)\nlet command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nBased off Quote.dquote_spaces\n\nParameters:\n lns1:lens - the lens before\n lns2:lens - the lens after\n*)\nlet dquote_spaces (lns1:lens) (lns2:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\"\\n]*[ \\t]+[^\"\\n]*\/)\n in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ]\n\nlet mailbox = indent\n . dquote_spaces\n (key \/mailbox\/ . Sep.space)\n (Build.block_newlines (entry) comment . eol)\n\nlet block_ldelim_newlines_re = \/[ \\t]+\\{([ \\t\\n]*\\n)?\/\n\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in del block_ldelim_newlines_re Build.block_ldelim_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default\n\n(* View: block\nMap block enclosed in brackets recursively. \nBlock may be indented and have optional argument.\nBlock body may have entries, comments, empty lines, and nested blocks recursively. *)\nlet rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store \/[\\\/A-Za-z0-9_-]+\/))? . block_newlines (entry|block|mailbox) comment . eol ]\n\n\n(******************************************************************\n * Group: LENS AND FILTER\n ******************************************************************)\n\n(* View: lns\nThe Dovecot lens *)\nlet lns = (comment|empty|entry|command|block)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/etc\/dovecot\/conf.d\/*.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"fb7b0a2685043073548031ab8816b56010c25458","subject":"Properly document this lens.","message":"Properly document this lens.\n","repos":"mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas,raphink\/augeas,raphink\/augeas,manandbytes\/augeas,kunkku\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,lutter\/augeas,MikaelSmith\/augeas,jjlin\/augeas,dafugg\/augeas,pevalme\/augeas,kumy\/augeas,kumy\/augeas,jjlin\/augeas,pevalme\/augeas,dafugg\/augeas,dafugg\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,kumy\/augeas,mchf\/augeas,kumy\/augeas,jtopjian\/augeas,jjlin\/augeas,manandbytes\/augeas,lutter\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,jasperla\/augeas","old_file":"lenses\/avahi.aug","new_file":"lenses\/avahi.aug","new_contents":"(*\nModule: Avahi\n Avahi module for Augeas\n\n Author: Athir Nuaimi <athir@nuaimi.com>\n\n avahi-daemon.conf is a standard INI File.\n*)\n\nmodule Avahi =\n autoload xfm\n\n(************************************************************************\n * Group: INI File settings\n * avahi-daemon.conf only supports \"# as commentary and \"=\" as separator\n *************************************************************************)\n(* View: comment *)\nlet comment = IniFile.comment \"#\" \"#\"\n(* View: sep *)\nlet sep = IniFile.sep \"=\" \"=\"\n\n(************************************************************************\n * Group: Entry\n *************************************************************************)\n(* View: entry *)\nlet entry = IniFile.indented_entry IniFile.entry_re sep comment\n\n(************************************************************************\n * Group: Record\n *************************************************************************)\n(* View: title *)\nlet title = IniFile.indented_title IniFile.record_re\n(* View: record *)\nlet record = IniFile.record title entry\n\n(************************************************************************\n * Group: Lens and filter\n *************************************************************************)\n(* View: lns *)\nlet lns = IniFile.lns record comment\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/avahi\/avahi-daemon.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Avahi\n Avahi module for Augeas\n\n Author: Athir Nuaimi <athir@nuaimi.com>\n\n avahi-daemon.conf is a standard INI File.\n*)\n\nmodule Avahi =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *\n * avahi-daemon.conf only supports \"# as commentary and \"=\" as separator\n *************************************************************************)\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\n\n(************************************************************************\n * ENTRY\n * avahi-daemon.conf uses standard INI File entries\n *************************************************************************)\nlet entry = IniFile.indented_entry IniFile.entry_re sep comment\n\n(************************************************************************\n * RECORD\n * avahi-daemon.conf uses standard INI File records\n *************************************************************************)\nlet title = IniFile.indented_title IniFile.record_re\nlet record = IniFile.record title entry\n\n(************************************************************************\n * LENS & FILTER\n * avahi-daemon.conf uses standard INI File records\n *************************************************************************)\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/avahi\/avahi-daemon.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"eeed428d16feebebc5a4eb1714dd858436a1d7a8","subject":"* lenses\/group.aug (password): remove backslashes","message":"* lenses\/group.aug (password): remove backslashes\n\nBackslashes in char classes are taken literally, they do not escape a\ncharacter.\n","repos":"dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,kunkku\/augeas,domcleal\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,kumy\/augeas,ptoscano\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,mlichvar\/augeas,dafugg\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,kumy\/augeas,jjlin\/augeas,pevalme\/augeas,kumy\/augeas,hercules-team\/augeas,jjlin\/augeas,hercules-team\/augeas,domcleal\/augeas,jtopjian\/augeas,jasperla\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,lutter\/augeas,domcleal\/augeas,raphink\/augeas,manandbytes\/augeas,ptoscano\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,raphink\/augeas,lutter\/augeas,mchf\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,manandbytes\/augeas,kumy\/augeas,ptoscano\/augeas,pevalme\/augeas","old_file":"lenses\/group.aug","new_file":"lenses\/group.aug","new_contents":"(* Group module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man 5 group\n\n*)\n\nmodule Group =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet colon = Sep.colon\nlet comma = Sep.comma\n\nlet sto_to_spc = store Rx.space_in\n\nlet word = Rx.word\nlet password = \/[A-Za-z0-9_.!*-]*\/\nlet integer = Rx.integer\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet user = [ label \"user\" . store word ]\nlet user_list = Build.opt_list user comma\nlet params = [ label \"password\" . store password . colon ]\n . [ label \"gid\" . store integer . colon ]\n . user_list?\nlet entry = Build.key_value_line word colon params\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter\n = incl \"\/etc\/group\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Group module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man 5 group\n\n*)\n\nmodule Group =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet colon = Sep.colon\nlet comma = Sep.comma\n\nlet sto_to_spc = store Rx.space_in\n\nlet word = Rx.word\nlet password = \/[A-Za-z0-9_.\\!\\*-]*\/\nlet integer = Rx.integer\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet user = [ label \"user\" . store word ]\nlet user_list = Build.opt_list user comma\nlet params = [ label \"password\" . store password . colon ]\n . [ label \"gid\" . store integer . colon ]\n . user_list?\nlet entry = Build.key_value_line word colon params\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter\n = incl \"\/etc\/group\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c1d793b84e65fe2ab781ce4bef344d95eecb0e36","subject":"Sep: add semicolon","message":"Sep: add semicolon\n","repos":"mlichvar\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,MikaelSmith\/augeas,pevalme\/augeas,jasperla\/augeas,lutter\/augeas,kumy\/augeas,lutter\/augeas,dafugg\/augeas,kunkku\/augeas,kunkku\/augeas,ptoscano\/augeas,raphink\/augeas,raphink\/augeas,GeoffWilliams\/augeas,mchf\/augeas,domcleal\/augeas,kumy\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,mlichvar\/augeas,manandbytes\/augeas,ptoscano\/augeas,domcleal\/augeas,pevalme\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,kunkku\/augeas,ptoscano\/augeas,dafugg\/augeas,domcleal\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,kumy\/augeas,jasperla\/augeas,jjlin\/augeas,dafugg\/augeas,pevalme\/augeas,jtopjian\/augeas,hercules-team\/augeas,hercules-team\/augeas,mchf\/augeas,kumy\/augeas","old_file":"lenses\/sep.aug","new_file":"lenses\/sep.aug","new_contents":"(*\nModule: Sep\n Generic separators to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Sep =\n\n(* Variable: colon *)\nlet colon = Util.del_str \":\"\n\n(* Variable: semicolon *)\nlet semicolon = Util.del_str \";\"\n\n(* Variable: comma *)\nlet comma = Util.del_str \",\"\n\n(* Variable: equal *)\nlet equal = Util.del_str \"=\"\n\n(* Variable: space_equal *)\nlet space_equal = Util.delim \"=\"\n\n(* Variable: space\n Deletes a <Rx.space> and default to a single space *)\nlet space = del Rx.space \" \"\n\n(* Variable: tab\n Deletes a <Rx.space> and default to a tab *)\nlet tab = del Rx.space \"\\t\"\n\n(* Variable: opt_space\n Deletes a <Rx.opt_space> and default to an empty string *)\nlet opt_space = del Rx.opt_space \"\"\n\n(* Variable: opt_tab\n Deletes a <Rx.opt_space> and default to a tab *)\nlet opt_tab = del Rx.opt_space \"\\t\"\n\n(* Variable: cl_or_space\n Deletes a <Rx.cl_or_space> and default to a single space *)\nlet cl_or_space = del Rx.cl_or_space \" \"\n\n(* Variable: cl_or_opt_space\n Deletes a <Rx.cl_or_opt_space> and default to a single space *)\nlet cl_or_opt_space = del Rx.cl_or_opt_space \" \"\n\n(* Variable: lbracket *)\nlet lbracket = Util.del_str \"(\"\n\n(* Variable: rbracket *)\nlet rbracket = Util.del_str \")\"\n","old_contents":"(*\nModule: Sep\n Generic separators to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Sep =\n\n(* Variable: colon *)\nlet colon = Util.del_str \":\"\n\n(* Variable: comma *)\nlet comma = Util.del_str \",\"\n\n(* Variable: equal *)\nlet equal = Util.del_str \"=\"\n\n(* Variable: space_equal *)\nlet space_equal = Util.delim \"=\"\n\n(* Variable: space\n Deletes a <Rx.space> and default to a single space *)\nlet space = del Rx.space \" \"\n\n(* Variable: tab\n Deletes a <Rx.space> and default to a tab *)\nlet tab = del Rx.space \"\\t\"\n\n(* Variable: opt_space\n Deletes a <Rx.opt_space> and default to an empty string *)\nlet opt_space = del Rx.opt_space \"\"\n\n(* Variable: opt_tab\n Deletes a <Rx.opt_space> and default to a tab *)\nlet opt_tab = del Rx.opt_space \"\\t\"\n\n(* Variable: cl_or_space\n Deletes a <Rx.cl_or_space> and default to a single space *)\nlet cl_or_space = del Rx.cl_or_space \" \"\n\n(* Variable: cl_or_opt_space\n Deletes a <Rx.cl_or_opt_space> and default to a single space *)\nlet cl_or_opt_space = del Rx.cl_or_opt_space \" \"\n\n(* Variable: lbracket *)\nlet lbracket = Util.del_str \"(\"\n\n(* Variable: rbracket *)\nlet rbracket = Util.del_str \")\"\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3fc48932df93e0095dfaef5921c68894dd9026d0","subject":"Use generic modules in bbhosts.aug","message":"Use generic modules in bbhosts.aug\n","repos":"ptoscano\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,jasperla\/augeas,ptoscano\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jasperla\/augeas,dafugg\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,lutter\/augeas,ptoscano\/augeas,kumy\/augeas,kunkku\/augeas,mchf\/augeas,jjlin\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,domcleal\/augeas,pevalme\/augeas,kumy\/augeas,pevalme\/augeas,lutter\/augeas,mchf\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,domcleal\/augeas,lutter\/augeas,kunkku\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,mlichvar\/augeas,pevalme\/augeas,jjlin\/augeas,kumy\/augeas,jtopjian\/augeas,kunkku\/augeas,dafugg\/augeas,mlichvar\/augeas,kumy\/augeas","old_file":"lenses\/bbhosts.aug","new_file":"lenses\/bbhosts.aug","new_contents":"(* BB-hosts module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* Supported : *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule BBhosts =\n autoload xfm\n\n (* Define useful shortcuts *)\n\n let eol = Util.eol\n let eol_no_spc = Util.del_str \"\\n\"\n let sep_spc = Sep.space\n let word = store \/[^|;# \\n\\t]+\/\n let value_to_eol = store \/[^ \\t][^\\n]+\/\n let ip = store Rx.ipv4\n let url = store \/https?:[^;,# \\n\\t]+\/\n\n (* Define comments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Define host *)\n let host_ip = [ label \"ip\" . ip ]\n let host_fqdn = [ label \"fqdn\" . sep_spc . word ]\n\n let host_test_url = [ label \"url\" . sep_spc . url ]\n let host_test_cont (kw:string) = [ sep_spc . store \/!?\/ . key kw .\n (Util.del_str \";\" .\n [ label \"url\" . word ] .\n\t\t\t (Util.del_str \";\" . [ label \"keyword\" . word ])?\n\t\t\t )?\n\t\t\t ]\n\n\n let host_test_flag (kw:string) = [ sep_spc . store \/!?\/ . key kw ]\n\n let host_test = host_test_cont \"cont\"\n | host_test_cont \"contInsecure\"\n | host_test_cont \"dns\"\n\t\t | host_test_flag \"noping\"\n\t\t | host_test_flag \"noconn\"\n\t\t | host_test_flag \"ssh\"\n\t\t | host_test_flag \"smtp\"\n\t\t | host_test_flag \"pop3\"\n\t\t | host_test_flag \"imap2\"\n\t\t | host_test_flag \"telnet\"\n\t\t | host_test_flag \"BBDISPLAY\"\n\t\t | host_test_flag \"BBNET\"\n\t\t | host_test_flag \"BBPAGER\"\n | host_test_url\n\n\n let host_opts = [ label \"probes\" . sep_spc . Util.del_str \"#\" . host_test* ]\n\n let host = [ label \"host\" . host_ip . host_fqdn . host_opts . eol ]\n\n (* Define group-compress and group-only *)\n let group_compress = [ key \"group-compress\" . sep_spc . value_to_eol . eol_no_spc .\n ( comment | empty | host)*\n\t\t ]\n\n let group_only_col = [ label \"col\" . word ]\n let group_only_cols = sep_spc . group_only_col . ( Util.del_str \"|\" . group_only_col )*\n let group_only = [ key \"group-only\" . group_only_cols . sep_spc . value_to_eol . eol_no_spc .\n ( comment | empty | host)*\n\t\t ]\n\n\n (* Define page *)\n let page_title = [ label \"title\" . sep_spc . value_to_eol . eol_no_spc ]\n let page = [ key \"page\" . sep_spc . word . page_title .\n ( comment | empty | host )* . ( group_compress | group_only )*\n\t\t ]\n\n\n (* Define lens *)\n\n let lns = (comment | empty)* . page*\n\n let filter = incl \"\/etc\/bb\/bb-hosts\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n","old_contents":"(* BB-hosts module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* Supported : *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule BBhosts =\n autoload xfm\n\n (* Define useful shortcuts *)\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let eol_no_spc = Util.del_str \"\\n\"\n let sep_spc = Util.del_ws_spc\n let word = store \/[^|;# \\n\\t]+\/\n let value_to_eol = store \/[^ \\t][^\\n]+\/\n let ip = store \/[0-9\\.]+\/\n let url = store \/https?:[^;,# \\n\\t]+\/\n\n (* Define comments and empty lines *)\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . eol_no_spc ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Define host *)\n let host_ip = [ label \"ip\" . ip ]\n let host_fqdn = [ label \"fqdn\" . sep_spc . word ]\n\n let host_test_url = [ label \"url\" . sep_spc . url ]\n let host_test_cont (kw:string) = [ sep_spc . store \/!?\/ . key kw .\n (Util.del_str \";\" .\n [ label \"url\" . word ] .\n\t\t\t (Util.del_str \";\" . [ label \"keyword\" . word ])?\n\t\t\t )?\n\t\t\t ]\n\n\n let host_test_flag (kw:string) = [ sep_spc . store \/!?\/ . key kw ]\n\n let host_test = host_test_cont \"cont\"\n | host_test_cont \"contInsecure\"\n | host_test_cont \"dns\"\n\t\t | host_test_flag \"noping\"\n\t\t | host_test_flag \"noconn\"\n\t\t | host_test_flag \"ssh\"\n\t\t | host_test_flag \"smtp\"\n\t\t | host_test_flag \"pop3\"\n\t\t | host_test_flag \"imap2\"\n\t\t | host_test_flag \"telnet\"\n\t\t | host_test_flag \"BBDISPLAY\"\n\t\t | host_test_flag \"BBNET\"\n\t\t | host_test_flag \"BBPAGER\"\n | host_test_url\n\n\n let host_opts = [ label \"probes\" . sep_spc . Util.del_str \"#\" . host_test* ]\n\n let host = [ label \"host\" . host_ip . host_fqdn . host_opts . eol ]\n\n (* Define group-compress and group-only *)\n let group_compress = [ key \"group-compress\" . sep_spc . value_to_eol . eol_no_spc .\n ( comment | empty | host)*\n\t\t ]\n\n let group_only_col = [ label \"col\" . word ]\n let group_only_cols = sep_spc . group_only_col . ( Util.del_str \"|\" . group_only_col )*\n let group_only = [ key \"group-only\" . group_only_cols . sep_spc . value_to_eol . eol_no_spc .\n ( comment | empty | host)*\n\t\t ]\n\n\n (* Define page *)\n let page_title = [ label \"title\" . sep_spc . value_to_eol . eol_no_spc ]\n let page = [ key \"page\" . sep_spc . word . page_title .\n ( comment | empty | host )* . ( group_compress | group_only )*\n\t\t ]\n\n\n (* Define lens *)\n\n let lns = (comment | empty)* . page*\n\n let filter = incl \"\/etc\/bb\/bb-hosts\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2342355d8ef3a07d08b81295b6ba70b373a019d2","subject":"Add \/etc\/puppetlabs\/mcollective to mcollective lens","message":"Add \/etc\/puppetlabs\/mcollective to mcollective lens\n\nIn the latest release of Puppet, the mcollective paths have been updated\nto reflect the documentation at\nhttps:\/\/github.com\/puppetlabs\/puppet-specifications\/blob\/master\/file_paths.md\n\nThis commit adds server.cfg and client.cfg in\n\/etc\/puppetlabs\/mcollective to the mcollective filter.\n","repos":"jtopjian\/augeas,hercules-team\/augeas,manandbytes\/augeas,kunkku\/augeas,manandbytes\/augeas,lutter\/augeas,lutter\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,jasperla\/augeas,kunkku\/augeas,dafugg\/augeas,jasperla\/augeas,ptoscano\/augeas,pevalme\/augeas,mlichvar\/augeas,pevalme\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,mchf\/augeas,mchf\/augeas,ptoscano\/augeas,mlichvar\/augeas,jtopjian\/augeas,jjlin\/augeas,dafugg\/augeas,hercules-team\/augeas,kunkku\/augeas,dafugg\/augeas","old_file":"lenses\/mcollective.aug","new_file":"lenses\/mcollective.aug","new_contents":"(*\nModule: MCollective\n Parses MCollective's configuration files\n\nAuthor: Marc Fournier <marc.fournier@camptocamp.com>\n\nAbout: Reference\n This lens is based on MCollective's default client.cfg and server.cfg.\n\nAbout: Usage Example\n(start code)\n augtool> get \/files\/etc\/mcollective\/client.cfg\/plugin.psk\n \/files\/etc\/mcollective\/client.cfg\/plugin.psk = unset\n\n augtool> ls \/files\/etc\/mcollective\/client.cfg\/\n topicprefix = \/topic\/\n main_collective = mcollective\n collectives = mcollective\n [...]\n\n augtool> set \/files\/etc\/mcollective\/client.cfg\/plugin.stomp.password example123\n augtool> save\n Saved 1 file(s)\n(end code)\n The <Test_MCollective> file also contains various examples.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n*)\n\nmodule MCollective =\nautoload xfm\n\nlet lns = Simplevars.lns\n\nlet filter = incl \"\/etc\/mcollective\/client.cfg\"\n . incl \"\/etc\/mcollective\/server.cfg\"\n . incl \"\/etc\/puppetlabs\/mcollective\/client.cfg\"\n . incl \"\/etc\/puppetlabs\/mcollective\/server.cfg\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: MCollective\n Parses MCollective's configuration files\n\nAuthor: Marc Fournier <marc.fournier@camptocamp.com>\n\nAbout: Reference\n This lens is based on MCollective's default client.cfg and server.cfg.\n\nAbout: Usage Example\n(start code)\n augtool> get \/files\/etc\/mcollective\/client.cfg\/plugin.psk\n \/files\/etc\/mcollective\/client.cfg\/plugin.psk = unset\n\n augtool> ls \/files\/etc\/mcollective\/client.cfg\/\n topicprefix = \/topic\/\n main_collective = mcollective\n collectives = mcollective\n [...]\n\n augtool> set \/files\/etc\/mcollective\/client.cfg\/plugin.stomp.password example123\n augtool> save\n Saved 1 file(s)\n(end code)\n The <Test_MCollective> file also contains various examples.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n*)\n\nmodule MCollective =\nautoload xfm\n\nlet lns = Simplevars.lns\n\nlet filter = incl \"\/etc\/mcollective\/client.cfg\"\n . incl \"\/etc\/mcollective\/server.cfg\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"30c5dbf980706c14f4be3cc556fc1dab01db3fec","subject":"Fix sudoers lens: recognize \"match_group_by_gid\"","message":"Fix sudoers lens: recognize \"match_group_by_gid\"\n\nThe option is now enabled by default in the default sudoers of\nRHEL 7.4 (and probably soon CentOS 7).\n\nCloses #482\n","repos":"ptoscano\/augeas,hercules-team\/augeas,pevalme\/augeas,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,pevalme\/augeas,mlichvar\/augeas,kunkku\/augeas,lutter\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas,ptoscano\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Sep.space\n\n(* Variable: sep_cont *)\nlet sep_cont = Sep.cl_or_space\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = Sep.cl_or_opt_space\n\n(* Variable: sep_cont_opt_build *)\nlet sep_cont_opt_build (sep:string) =\n del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (\" \" . sep . \" \")\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt_build \",\"\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt_build \"=\"\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt_build \":\"\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n(* Group: Negation expressions *)\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\n(************************************************************************\n * View: negate_or_value\n * A <del_negate>, followed by either a negated key, or a key\/value pair\n *************************************************************************)\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\n\nlet sto_to_com_cmnd = del_negate . negate_node? . (\n let alias = Rx.word - \/(NO)?(PASSWD|EXEC|SETENV)\/\n in let non_alias = \/[\\\/a-z]([^,:#()\\n\\\\]|\\\\\\\\[=:,\\\\])*[^,=:#() \\t\\n\\\\]|[^,=:#() \\t\\n\\\\]\/\n in store (alias | non_alias))\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces and NIS domains and allowed*)\nlet sto_to_com_user =\n let nis_re = \/([A-Z]([-A-Z0-9]|(\\\\\\\\[ \\t]))*+\\\\\\\\\\\\\\\\)\/\n in let user_re = \/[%+@a-z]([-A-Za-z0-9._+]|(\\\\\\\\[ \\t]))*\/\n in let alias_re = \/[A-Z_]+\/\n in store ((nis_re? . user_re) | alias_re)\n\n(* Variable: to_com_chars *)\nlet to_com_chars = \/[^\",=#() \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: to_com_dquot *)\nlet to_com_dquot = \/\"[^\",=#()\\n\\\\]+\"\/ (* \" relax emacs *)\n\n(* Variable: sto_to_com_dquot *)\nlet sto_to_com_dquot = store (to_com_chars|to_com_dquot)\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store to_com_chars\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\]+|\"[^\", \\t\\n\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n Build.opt_list (alias_field kw sto) sep_com\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '!' Cmnd_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:!>][^ \\t\\n\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\" | \"closefrom_override\"\n | \"closefrom_override\" | \"compress_io\" | \"fast_glob\"\n | \"log_input\" | \"log_output\" | \"pwfeedback\"\n | \"umask_override\" | \"use_pty\" | \"match_group_by_gid\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . sto_to_com_dquot ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"mailfrom\" \n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_dquot)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list> for listing\n * users and\/or groups used to run a command\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')' |\n * > '(:' Runas_List ')' |\n * > '(' Runas_List ':' Runas_List ')'\n *************************************************************************)\nlet runas_spec_user = alias_list \"runas_user\" sto_to_com\nlet runas_spec_group = Util.del_str \":\" . indent\n . alias_list \"runas_group\" sto_to_com\n\nlet runas_spec_usergroup = runas_spec_user . indent . runas_spec_group\n\nlet runas_spec = Util.del_str \"(\"\n . (runas_spec_user\n | runas_spec_group\n | runas_spec_usergroup )\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = Build.opt_list cmnd_spec sep_com\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . Build.opt_list spec_list sep_col\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Sep.space\n\n(* Variable: sep_cont *)\nlet sep_cont = Sep.cl_or_space\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = Sep.cl_or_opt_space\n\n(* Variable: sep_cont_opt_build *)\nlet sep_cont_opt_build (sep:string) =\n del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (\" \" . sep . \" \")\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt_build \",\"\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt_build \"=\"\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt_build \":\"\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n(* Group: Negation expressions *)\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\n(************************************************************************\n * View: negate_or_value\n * A <del_negate>, followed by either a negated key, or a key\/value pair\n *************************************************************************)\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\n\nlet sto_to_com_cmnd = del_negate . negate_node? . (\n let alias = Rx.word - \/(NO)?(PASSWD|EXEC|SETENV)\/\n in let non_alias = \/[\\\/a-z]([^,:#()\\n\\\\]|\\\\\\\\[=:,\\\\])*[^,=:#() \\t\\n\\\\]|[^,=:#() \\t\\n\\\\]\/\n in store (alias | non_alias))\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces and NIS domains and allowed*)\nlet sto_to_com_user =\n let nis_re = \/([A-Z]([-A-Z0-9]|(\\\\\\\\[ \\t]))*+\\\\\\\\\\\\\\\\)\/\n in let user_re = \/[%+@a-z]([-A-Za-z0-9._+]|(\\\\\\\\[ \\t]))*\/\n in let alias_re = \/[A-Z_]+\/\n in store ((nis_re? . user_re) | alias_re)\n\n(* Variable: to_com_chars *)\nlet to_com_chars = \/[^\",=#() \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: to_com_dquot *)\nlet to_com_dquot = \/\"[^\",=#()\\n\\\\]+\"\/ (* \" relax emacs *)\n\n(* Variable: sto_to_com_dquot *)\nlet sto_to_com_dquot = store (to_com_chars|to_com_dquot)\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store to_com_chars\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\]+|\"[^\", \\t\\n\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n Build.opt_list (alias_field kw sto) sep_com\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '!' Cmnd_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:!>][^ \\t\\n\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\" | \"closefrom_override\"\n | \"closefrom_override\" | \"compress_io\" | \"fast_glob\"\n | \"log_input\" | \"log_output\" | \"pwfeedback\"\n | \"umask_override\" | \"use_pty\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . sto_to_com_dquot ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"mailfrom\" \n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_dquot)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list> for listing\n * users and\/or groups used to run a command\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')' |\n * > '(:' Runas_List ')' |\n * > '(' Runas_List ':' Runas_List ')'\n *************************************************************************)\nlet runas_spec_user = alias_list \"runas_user\" sto_to_com\nlet runas_spec_group = Util.del_str \":\" . indent\n . alias_list \"runas_group\" sto_to_com\n\nlet runas_spec_usergroup = runas_spec_user . indent . runas_spec_group\n\nlet runas_spec = Util.del_str \"(\"\n . (runas_spec_user\n | runas_spec_group\n | runas_spec_usergroup )\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = Build.opt_list cmnd_spec sep_com\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . Build.opt_list spec_list sep_col\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2235a33d14986411606e1e003314e76473cd9a5c","subject":"Rabbitmq: Utilizing regexes for some options","message":"Rabbitmq: Utilizing regexes for some options\n","repos":"manandbytes\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,dafugg\/augeas,mchf\/augeas,jjlin\/augeas,kunkku\/augeas,pevalme\/augeas,pevalme\/augeas,jjlin\/augeas,mlichvar\/augeas,dafugg\/augeas,mchf\/augeas,dafugg\/augeas,kunkku\/augeas,manandbytes\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,jjlin\/augeas,hercules-team\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,ptoscano\/augeas,lutter\/augeas","old_file":"lenses\/rabbitmq.aug","new_file":"lenses\/rabbitmq.aug","new_contents":"(*\nModule: Rabbitmq\n Parses Rabbitmq configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `http:\/\/www.rabbitmq.com\/configure.html` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Rabbitmq configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Rabbitmq> file contains various examples and tests.\n*)\nmodule Rabbitmq =\n\nautoload xfm\n\n(* View: listeners\n A tcp\/ssl listener *)\nlet listeners =\n let value = Erlang.make_value Erlang.integer\n | Erlang.tuple Erlang.quoted Erlang.integer\n in Erlang.list \/(tcp|ssl)_listeners\/ value\n\n\n(* View: ssl_options\n (Incomplete) list of SSL options *)\nlet ssl_options =\n let versions_list = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let option = Erlang.value \/((ca)?cert|key)file\/ Erlang.path\n | Erlang.value \"verify\" Erlang.bare\n | Erlang.value \"verify_fun\" Erlang.boolean\n | Erlang.value \/fail_if_no_peer_cert|reuse_sessions\/ Erlang.boolean\n | Erlang.value \"depth\" Erlang.integer\n | Erlang.value \"password\" Erlang.quoted\n | Erlang.value \"versions\" versions_list\n in Erlang.list \"ssl_options\" option\n\n(* View: disk_free_limit *)\nlet disk_free_limit =\n let value = Erlang.integer | Erlang.tuple Erlang.bare Erlang.decimal\n in Erlang.value \"disk_free_limit\" value\n\n(* View: log_levels *)\nlet log_levels =\n let category = Erlang.tuple Erlang.bare Erlang.bare\n in Erlang.list \"log_levels\" category\n\n(* View: cluster_nodes\n Can be a tuple `(nodes, node_type)` or simple `nodes` *)\nlet cluster_nodes =\n let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let value = Erlang.tuple nodes Erlang.bare\n | nodes\n in Erlang.value \"cluster_nodes\" value\n\n(* View: cluster_partition_handling\n Can be single value or\n `{pause_if_all_down, [nodes], ignore | autoheal}` *)\nlet cluster_partition_handling =\n let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let value = Erlang.tuple3 Erlang.bare nodes Erlang.bare\n | Erlang.bare\n in Erlang.value \"cluster_partition_handling\" value\n\n(* View: tcp_listen_options *)\nlet tcp_listen_options =\n let value = Erlang.make_value Erlang.bare\n | Erlang.tuple Erlang.bare Erlang.bare\n in Erlang.list \"tcp_listen_options\" value\n\n(* View: parameters\n Top-level parameters for the lens *)\nlet parameters = listeners\n | ssl_options\n | disk_free_limit\n | log_levels\n | Erlang.value \/vm_memory_high_watermark(_paging_ratio)?\/ Erlang.decimal\n | Erlang.value \"frame_max\" Erlang.integer\n | Erlang.value \"heartbeat\" Erlang.integer\n | Erlang.value \/default_(vhost|user|pass)\/ Erlang.glob\n | Erlang.value_list \"default_user_tags\" Erlang.bare\n | Erlang.value_list \"default_permissions\" Erlang.glob\n | cluster_nodes\n | Erlang.value_list \"server_properties\" Erlang.bare\n | Erlang.value \"collect_statistics\" Erlang.bare\n | Erlang.value \"collect_statistics_interval\" Erlang.integer\n | Erlang.value_list \"auth_mechanisms\" Erlang.quoted\n | Erlang.value_list \"auth_backends\" Erlang.bare\n | Erlang.value \"delegate_count\" Erlang.integer\n | Erlang.value_list \"trace_vhosts\" Erlang.bare\n | tcp_listen_options\n | Erlang.value \"hipe_compile\" Erlang.boolean\n | Erlang.value \"msg_store_index_module\" Erlang.bare\n | Erlang.value \"backing_queue_module\" Erlang.bare\n | Erlang.value \"msg_store_file_size_limit\" Erlang.integer\n | Erlang.value \/queue_index_(max_journal_entries|embed_msgs_below)\/ Erlang.integer\n | cluster_partition_handling\n | Erlang.value \/(ssl_)?handshake_timeout\/ Erlang.integer\n | Erlang.value \"channel_max\" Erlang.integer\n | Erlang.value_list \"loopback_users\" Erlang.glob\n | Erlang.value \"reverse_dns_lookups\" Erlang.boolean\n | Erlang.value \"cluster_keepalive_interval\" Erlang.integer\n | Erlang.value \"mnesia_table_loading_timeout\" Erlang.integer\n\n(* View: rabbit\n The rabbit <Erlang.application> config *)\nlet rabbit = Erlang.application \"rabbit\" parameters\n\n(* View: lns\n A top-level <Erlang.config> *)\nlet lns = Erlang.config rabbit\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/rabbitmq\/rabbitmq.config\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Rabbitmq\n Parses Rabbitmq configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `http:\/\/www.rabbitmq.com\/configure.html` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Rabbitmq configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Rabbitmq> file contains various examples and tests.\n*)\nmodule Rabbitmq =\n\nautoload xfm\n\n(* View: listeners\n A tcp\/ssl listener *)\nlet listeners =\n let value = Erlang.make_value Erlang.integer\n | Erlang.tuple Erlang.quoted Erlang.integer\n in Erlang.list \/(tcp|ssl)_listeners\/ value\n\n\n(* View: ssl_options\n (Incomplete) list of SSL options *)\nlet ssl_options =\n let versions_list = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let option = Erlang.value \/((ca)?cert|key)file\/ Erlang.path\n | Erlang.value \"verify\" Erlang.bare\n | Erlang.value \"verify_fun\" Erlang.boolean\n | Erlang.value \/fail_if_no_peer_cert|reuse_sessions\/ Erlang.boolean\n | Erlang.value \"depth\" Erlang.integer\n | Erlang.value \"password\" Erlang.quoted\n | Erlang.value \"versions\" versions_list\n in Erlang.list \"ssl_options\" option\n\n(* View: disk_free_limit *)\nlet disk_free_limit =\n let value = Erlang.integer | Erlang.tuple Erlang.bare Erlang.decimal\n in Erlang.value \"disk_free_limit\" value\n\n(* View: log_levels *)\nlet log_levels =\n let category = Erlang.tuple Erlang.bare Erlang.bare\n in Erlang.list \"log_levels\" category\n\n(* View: cluster_nodes\n Can be a tuple `(nodes, node_type)` or simple `nodes` *)\nlet cluster_nodes =\n let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let value = Erlang.tuple nodes Erlang.bare\n | nodes\n in Erlang.value \"cluster_nodes\" value\n\n(* View: cluster_partition_handling\n Can be single value or\n `{pause_if_all_down, [nodes], ignore | autoheal}` *)\nlet cluster_partition_handling =\n let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)\n in let value = Erlang.tuple3 Erlang.bare nodes Erlang.bare\n | Erlang.bare\n in Erlang.value \"cluster_partition_handling\" value\n\n(* View: tcp_listen_options *)\nlet tcp_listen_options =\n let value = Erlang.make_value Erlang.bare\n | Erlang.tuple Erlang.bare Erlang.bare\n in Erlang.list \"tcp_listen_options\" value\n\n(* View: parameters\n Top-level parameters for the lens *)\nlet parameters = listeners\n | ssl_options\n | disk_free_limit\n | log_levels\n | Erlang.value \"vm_memory_high_watermark\" Erlang.decimal\n | Erlang.value \"vm_memory_high_watermark_paging_ratio\" Erlang.decimal\n | Erlang.value \"frame_max\" Erlang.integer\n | Erlang.value \"heartbeat\" Erlang.integer\n | Erlang.value \/default_(vhost|user|pass)\/ Erlang.glob\n | Erlang.value_list \"default_user_tags\" Erlang.bare\n | Erlang.value_list \"default_permissions\" Erlang.glob\n | cluster_nodes\n | Erlang.value_list \"server_properties\" Erlang.bare\n | Erlang.value \"collect_statistics\" Erlang.bare\n | Erlang.value \"collect_statistics_interval\" Erlang.integer\n | Erlang.value_list \"auth_mechanisms\" Erlang.quoted\n | Erlang.value_list \"auth_backends\" Erlang.bare\n | Erlang.value \"delegate_count\" Erlang.integer\n | Erlang.value_list \"trace_vhosts\" Erlang.bare\n | tcp_listen_options\n | Erlang.value \"hipe_compile\" Erlang.boolean\n | Erlang.value \"msg_store_index_module\" Erlang.bare\n | Erlang.value \"backing_queue_module\" Erlang.bare\n | Erlang.value \"msg_store_file_size_limit\" Erlang.integer\n | Erlang.value \"queue_index_max_journal_entries\" Erlang.integer\n | Erlang.value \"queue_index_embed_msgs_below\" Erlang.integer\n | cluster_partition_handling\n | Erlang.value \"handshake_timeout\" Erlang.integer\n | Erlang.value \"ssl_handshake_timeout\" Erlang.integer\n | Erlang.value \"channel_max\" Erlang.integer\n | Erlang.value_list \"loopback_users\" Erlang.glob\n | Erlang.value \"reverse_dns_lookups\" Erlang.boolean\n | Erlang.value \"cluster_keepalive_interval\" Erlang.integer\n | Erlang.value \"mnesia_table_loading_timeout\" Erlang.integer\n\n(* View: rabbit\n The rabbit <Erlang.application> config *)\nlet rabbit = Erlang.application \"rabbit\" parameters\n\n(* View: lns\n A top-level <Erlang.config> *)\nlet lns = Erlang.config rabbit\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/rabbitmq\/rabbitmq.config\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"981b1313506d87daf821c2c1f231539808512c60","subject":"Add header to shellvars.aug","message":"Add header to shellvars.aug\n","repos":"mchf\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,mlichvar\/augeas,jjlin\/augeas,lutter\/augeas,dafugg\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,jasperla\/augeas,pevalme\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,kumy\/augeas,manandbytes\/augeas,hercules-team\/augeas,jtopjian\/augeas,dafugg\/augeas,jasperla\/augeas,MikaelSmith\/augeas,raphink\/augeas,kunkku\/augeas,kumy\/augeas,domcleal\/augeas,domcleal\/augeas,dafugg\/augeas,ptoscano\/augeas,pevalme\/augeas,kumy\/augeas,raphink\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas,kumy\/augeas,jtopjian\/augeas,domcleal\/augeas,mlichvar\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif? . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif? . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"67344f59eb958598670123a017c63a1a40d1c280","subject":"Shellvars: add \/etc\/selinux\/config","message":"Shellvars: add \/etc\/selinux\/config\n","repos":"hercules-team\/augeas,domcleal\/augeas,dafugg\/augeas,jjlin\/augeas,raphink\/augeas,jjlin\/augeas,pevalme\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,mchf\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,lutter\/augeas,lutter\/augeas,manandbytes\/augeas,mlichvar\/augeas,domcleal\/augeas,kunkku\/augeas,kumy\/augeas,raphink\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kumy\/augeas,jtopjian\/augeas,kumy\/augeas,lutter\/augeas,jjlin\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,mchf\/augeas,jasperla\/augeas,kumy\/augeas,ptoscano\/augeas,jasperla\/augeas,ptoscano\/augeas,jtopjian\/augeas,mlichvar\/augeas,dafugg\/augeas,kunkku\/augeas,MikaelSmith\/augeas,ptoscano\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"kernel\" .\n sc_excl \"ip*tables\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"kernel\" .\n sc_excl \"ip*tables\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"dc056fad650209aa2906ab2a230afdfffd510797","subject":"Parse \/etc\/mailname with hostname.aug","message":"Parse \/etc\/mailname with hostname.aug\n","repos":"domcleal\/augeas,pevalme\/augeas,kunkku\/augeas,domcleal\/augeas,kumy\/augeas,kumy\/augeas,jjlin\/augeas,jjlin\/augeas,jasperla\/augeas,kumy\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,manandbytes\/augeas,raphink\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,hercules-team\/augeas,jtopjian\/augeas,mchf\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kunkku\/augeas,MikaelSmith\/augeas,raphink\/augeas,mlichvar\/augeas,kumy\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jjlin\/augeas,jtopjian\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas","old_file":"lenses\/hostname.aug","new_file":"lenses\/hostname.aug","new_contents":"(*\nModule: Hostname\n Parses \/etc\/hostname and \/etc\/mailname\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Hostname =\nautoload xfm\n\n(* View: lns *)\nlet lns = [ label \"hostname\" . store Rx.word . Util.eol ]\n\n(* View: filter *)\nlet filter = incl \"\/etc\/hostname\"\n . incl \"\/etc\/mailname\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Hostname\n Parses \/etc\/hostname\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Hostname =\nautoload xfm\n\n(* View: lns *)\nlet lns = [ label \"hostname\" . store Rx.word . Util.eol ]\n\n(* View: filter *)\nlet filter = incl \"\/etc\/hostname\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"585f7a7c741d481d144e0f62df5805c9169d9f54","subject":"Update group.aug","message":"Update group.aug","repos":"GeoffWilliams\/augeas,mlichvar\/augeas,jjlin\/augeas,jasperla\/augeas,pevalme\/augeas,manandbytes\/augeas,dafugg\/augeas,ptoscano\/augeas,jtopjian\/augeas,mlichvar\/augeas,pevalme\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,mchf\/augeas,mlichvar\/augeas,raphink\/augeas,MikaelSmith\/augeas,jjlin\/augeas,lutter\/augeas,ptoscano\/augeas,manandbytes\/augeas,dafugg\/augeas,kunkku\/augeas,mchf\/augeas,raphink\/augeas,kunkku\/augeas,jasperla\/augeas,kunkku\/augeas,ptoscano\/augeas,pevalme\/augeas,jtopjian\/augeas,lutter\/augeas,lutter\/augeas,hercules-team\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,jjlin\/augeas","old_file":"lenses\/group.aug","new_file":"lenses\/group.aug","new_contents":"(* Group module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man 5 group\n\n*)\n\nmodule Group =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\n\nlet colon = Sep.colon\nlet comma = Sep.comma\n\nlet sto_to_spc = store Rx.space_in\nlet sto_to_col = store \/[^:\\n]+\/\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\nlet word = Rx.word\nlet password = \/[A-Za-z0-9_.!*-]*\/\nlet integer = Rx.integer\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet user = [ label \"user\" . store word ]\nlet user_list = Build.opt_list user comma\nlet params = [ label \"password\" . store password . colon ]\n . [ label \"gid\" . store integer . colon ]\n . user_list?\nlet entry = Build.key_value_line word colon params\n\n(* A NIS entry has nothing bar the +@::: bits. *)\nlet nisentry =\n let nisgroup = \/\\+\\@[A-Za-z0-9_.-]+\/ in\n let colons = \":::\" in\n [ dels \"+@\" . label \"@nis\" . store word . dels colons . eol ]\n\nlet nisdefault =\n let overrides =\n colon\n . [ label \"password\" . store word? . colon ]\n . [ label \"gid\" . store integer? . colon ]\n . user_list? in\n [ dels \"+\" . label \"@nisdefault\" . overrides? . eol ]\n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry|nisentry|nisdefault) *\n\nlet filter = incl \"\/etc\/group\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Group module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man 5 group\n\n*)\n\nmodule Group =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet dels = Util.del_str\n\nlet colon = Sep.colon\nlet comma = Sep.comma\n\nlet sto_to_spc = store Rx.space_in\nlet sto_to_col = store \/[^:\\n]+\/\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\nlet word = Rx.word\nlet password = \/[A-Za-z0-9_.!*-]*\/\nlet integer = Rx.integer\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet user = [ label \"user\" . store word ]\nlet user_list = Build.opt_list user comma\nlet params = [ label \"password\" . store password . colon ]\n . [ label \"gid\" . store integer . colon ]\n . user_list?\nlet entry = Build.key_value_line word colon params\n\n(* A NIS entry has nothing bar the +@::: bits. *)\nlet nisentry =\n let nisuser = \/\\+\\@[A-Za-z0-9_.-]+\/ in\n let colons = \":::\" in\n [ dels \"+@\" . label \"@nis\" . store word . dels colons . eol ]\n\nlet nisdefault =\n let overrides =\n colon\n . [ label \"password\" . store word? . colon ]\n . [ label \"gid\" . store integer? . colon ]\n . user_list? in\n [ dels \"+\" . label \"@nisdefault\" . overrides? . eol ]\n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry|nisentry|nisdefault) *\n\nlet filter = incl \"\/etc\/group\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"eb241006d8bc9909bfdb073108882ccc99e24d61","subject":"Shellvars: exclude more tcsh profile scripts (#627)","message":"Shellvars: exclude more tcsh profile scripts (#627)\n\nFound tcsh profile scripts also with the .tcsh extension, so exclude\r\nthem too.\r\n\r\nFollowup of commit b78bbb61282208288f0182ec1a9b3045c1f61e2a.","repos":"mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas,ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,mlichvar\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_][-A-Za-z0-9_]*(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/\\$?[-A-Za-z0-9_.\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) (start_kw:string) (end_kw:string) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str start_kw . brace_eol\n . entry+\n . Util.indent . Util.del_str end_kw . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry \"{\" \"}\"\n | function entry \"(\" \")\"\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"anaconda\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n . excl \"\/etc\/profile.d\/*.csh\"\n . excl \"\/etc\/profile.d\/*.tcsh\"\n . excl \"\/etc\/profile.d\/csh.local\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lbu\/lbu.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.d\/*\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let brace_eol = del \/[ \\t\\n]+\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_][-A-Za-z0-9_]*(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"&|\\n\\\\# \\t]#*|\\\\\\\\.\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.cl_or_space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Sep.cl_or_space\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let action (operator:string) (lbl:string) (sto:lens) =\n let sp = Rx.cl_or_opt_space | \/[ \\t\\n]+\/\n in [ del (sp . operator . sp) (\" \" . operator . \" \")\n . label (\"@\".lbl) . sto ]\n\n let action_pipe = action \"|\" \"pipe\"\n let action_and = action \"&&\" \"and\"\n let action_or = action \"||\" \"or\"\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n (* Entry types *)\n let entry_eol_item (item:lens) = [ item . comment_or_eol ]\n let entry_item (item:lens) = [ item ]\n\n let entry_eol_nocommand =\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol_nocommand =\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n (* Command *)\n let rec command =\n let env = [ key key_re . eq . store anyquot . Sep.cl_or_space ]\n in let reserved_key = \/exit|shift|return|ulimit|unset|export|source|\\.|if|for|select|while|until|then|else|fi|done|case|eval|alias\/\n in let word = \/\\$?[-A-Za-z0-9_.\\\/]+\/\n in let entry_eol = entry_eol_nocommand | entry_eol_item command\n in let entry_noeol = entry_noeol_nocommand | entry_item command\n in let entry = entry_eol | entry_noeol\n in let pipe = action_pipe (entry_eol_item command | entry_item command)\n in let and = action_and entry\n in let or = action_or entry\n in Util.indent . label \"@command\" . env* . store (word - reserved_key)\n . [ Sep.cl_or_space . label \"@arg\" . sto_to_semicol]?\n . ( pipe | and | or )?\n\n let entry_eol = entry_eol_nocommand\n | entry_eol_item command\n\n let entry_noeol = entry_noeol_nocommand\n | entry_item command\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol\n . ( action_and sto_to_semicol | action_or sto_to_semicol )*\n . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let subshell (entry:lens) =\n [ Util.indent . label \"@subshell\"\n . Util.del_str \"{\" . brace_eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let function (entry:lens) (start_kw:string) (end_kw:string) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . (comment_eol|brace_eol) . Util.del_str start_kw . brace_eol\n . entry+\n . Util.indent . Util.del_str end_kw . eol ]\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry \"{\" \"}\"\n | function entry \"(\" \")\"\n | subshell entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"anaconda\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_excl \"network\/if-up.d\/SuSEfirewall2\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/star\"\n . excl \"\/etc\/default\/whoopsie\"\n . incl \"\/etc\/profile\"\n . incl \"\/etc\/profile.d\/*\"\n . excl \"\/etc\/profile.d\/*.csh\"\n . excl \"\/etc\/profile.d\/csh.local\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/conf.d\/*\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/kamailio\/kamctlrc\"\n . incl \"\/etc\/lbu\/lbu.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.d\/*\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n . incl \"\/etc\/byobu\/*\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d135fe33d438cf2a34a708cd74700c0c268acec9","subject":"Use regexp union instead of lens union in php.aug","message":"Use regexp union instead of lens union in php.aug\n\nUsing a union of regexps is much faster than a union of lenses, since the\nregular expressions that are constructed internally are much simpler.\n","repos":"camptocamp\/augeas,domcleal\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,manandbytes\/augeas,camptocamp\/augeas,dafugg\/augeas,lutter\/augeas,MikaelSmith\/augeas,kunkku\/augeas,raphink\/augeas,domcleal\/augeas,ptoscano\/augeas,bkearney\/augeas,ptoscano\/augeas,hercules-team\/augeas,kumy\/augeas,dafugg\/augeas,bkearney\/augeas,hercules-team\/augeas,jjlin\/augeas,jjlin\/augeas,domcleal\/augeas,camptocamp\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,kumy\/augeas,jtopjian\/augeas,mchf\/augeas,raphink\/augeas,bkearney\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mchf\/augeas,ptoscano\/augeas,jjlin\/augeas,jasperla\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jasperla\/augeas,pevalme\/augeas,bkearney\/augeas,pevalme\/augeas,kumy\/augeas,lutter\/augeas,kumy\/augeas","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n\n autoload xfm\n\n (* PHP is a standard INI file *)\n let setting = \"always_populate_raw_post_data\"\n | \"asp_tags\"\n | \"browscap\"\n | \"child_terminate\"\n | \"define_syslog_variables\"\n | \"doc_root\"\n | \"enable_dl\"\n | \"engine\"\n | \"expose_php\"\n | \"extension_dir\"\n | \"file_uploads\"\n\t\t| \"gpc_order\"\n | \"html_errors\"\n | \"implicit_flush\"\n | \"include_path\"\n | \"last_modified\"\n | \"memory_limit\"\n | \"open_basedir\"\n | \"post_max_size\"\n | \"precision\"\n | \"serialize_precision\"\n | \"short_open_tag\"\n | \"SMTP\"\n | \"smtp_port\"\n | \"track_errors\"\n | \"unserialize_callback_func\"\n | \"variables_order\"\n | \"xbithack\"\n | \"y2k_compliance\"\n | \/apc\\.(cache_by_default|enabled|filters|gc_ttl|mmap_file_mask|num_files_hint|optimization|shm_segments|shm_size|slam_defense|ttl|user_entries_hint|user_ttl)\/\n | \/apd\\.(dumpdir|statement_tracing)\/\n | \/arg_separator\\.(input|output)\/\n | \/assert\\.(active|bail|callback|quiet_eval|warning)\/\n | \/bcmath\\.(scale)\/\n | \/blenc\\.(key_file)\/\n | \/com\\.(allow_dcom|autoregister_casesensitive|autoregister_typelib|autoregister_verbose|code_page|typelib_file)\/\n | \/crack\\.(default_dictionary)\/\n | \/daffodildb\\.(default_host|default_password|default_socket|default_user|port)\/\n | \/date\\.(default_latitude|default_longitude|sunrise_zenith|sunset_zenith)\/\n | \/dba\\.(default_handler)\/\n | \/dbx\\.(colnames_case)\/\n | \/exif\\.(decode_jis_intel|decode_jis_motorola|decode_unicode_intel|decode_unicode_motorola|encode_jis|encode_unicode)\/\n | \/fbsql\\.(allow_persistent|autocommit|batchsize|default_database|default_database_password|default_host|default_password|default_user|generate_warnings|max_connections|max_links|max_persistent|max_results)\/\n | \/highlight\\.(bg|comment|default|html|keyword|string)\/\n | \/hyperwave\\.(allow_persistent|default_port)\/\n | \/ibase\\.(allow_persistent|dateformat|default_charset|default_db|default_password|default_user|max_links|max_persistent|timeformat|timestampformat)\/\n | \/iconv\\.(input_encoding|internal_encoding|output_encoding)\/\n | \/ifx\\.(allow_persistent|blobinfile|byteasvarchar|charasvarchar|default_host|default_password|default_user|max_links|max_persistent|nullformat|textasvarchar)\/\n | \/ingres\\.(allow_persistent|default_database|default_password|default_user|max_links|max_persistent)\/\n | \/ircg\\.(control_user|keep_alive_interval|max_format_message_sets|shared_mem_size|work_dir)\/\n | \/ldap\\.(max_links)\/\n | \/mail\\.(force_extra_parameters)\/\n | \/mailparse\\.(def_charset)\/\n | \/maxdb\\.(default_db|default_host|default_pw|default_user|long_readlen)\/\n | \/mbstring\\.(detect_order|encoding_translation|func_overload|http_input|http_output|internal_encoding|language|script_encoding|substitute_character)\/\n | \/mcrypt\\.(algorithms_dir|modes_dir)\/\n | \/mime_magic\\.(debug|magicfile)\/\n | \/mssql\\.(allow_persistent|batchsize|compatability_mode|connect_timeout|datetimeconvert|max_links|max_persistent|max_procs|min_error_severity|min_message_severity|secure_connection|textlimit|textsize|timeout)\/\n | \/msql\\.(allow_persistent|max_links|max_persistent)\/\n | \/mysql\\.(allow_persistent|connect_timeout|default_host|default_password|default_port|default_socket|default_user|max_links|max_persistent|trace_mode)\/\n | \/mysqli\\.(default_host|default_port|default_pw|default_socket|default_user|max_links|reconnect)\/\n | \/namazu\\.(debugmode|lang|loggingmode|sortmethod|sortorder)\/\n | \/nsapi\\.(read_timeout)\/\n | \/odbc\\.(allow_persistent|check_persistent|defaultbinmode|defaultlrl|default_db|default_pw|default_user|max_links|max_persistent)\/\n | \/opendirectory\\.(max_refs|separator)\/\n | \/pdo\\.(global_value)\/\n | \/pfpro\\.(defaulthost|defaultport|defaulttimeout|proxyaddress|proxylogon|proxypassword|proxyport)\/\n | \/pgsql\\.(allow_persistent|auto_reset_persistent|ignore_notice|log_notice|max_links|max_persistent)\/\n | \/printer\\.(default_printer)\/\n | \/session\\.(auto_start|bug_compat_42|bug_compat_warn|cache_expire|cache_limiter|cookie_(domain|httponly|lifetime|path|secure)|entropy_file|entropy_length|gc_divisor|gc_maxlifetime|gc_probability|hash_bits_per_character|hash_function|name|referer_check|save_handler|save_path|serialize_handler|use_cookies|use_only_cookies|use_trans_sid)\/\n | \/session_pgsql\\.(create_table|db|disable|failover_mode|gc_interval|keep_expired|sem_file_name|serializable|short_circuit|use_app_vars|vacuum_interval)\/\n | \/simple_cvs\\.(authMethod|compressionLevel|cvsRoot|host|moduleName|userName|workingDir)\/\n | \/soap\\.(wsdl_cache_dir|wsdl_cache_enabled|wsdl_cache_ttl)\/\n | \/sql\\.(safe_mode)\/\n | \/sqlite\\.(assoc_case)\/\n\t\t| \/sybase\\.(allow_persistent|max_(persistent|links)|interface_file|min_(error|message)_severity|compatability_mode)\/\n | \/sybct\\.(allow_persistent|deadlock_retry_count|hostname|login_timeout|max_links|max_persistent|min_client_severity|min_server_severity)\/\n | \/tidy\\.(clean_output|default_config)\/\n | \/url_rewriter\\.(tags)\/\n | \/valkyrie\\.(auto_validate|config_path)\/\n | \/xmms\\.(path|session)\/\n | \/yaz\\.(keepalive|log_file|max_links)\/\n | \/zend\\.(ze1_compatibility_mode)\/\n | \/zlib\\.(output_compression|output_compression_level|output_handler)\/\n | \/allow_(call_time_pass_reference|url_fopen|url_include)\/\n | \/auto_(append_file|detect_line_endings|globals_jit|prepend_file)\/\n | \/default_(charset|mimetype|socket_timeout)\/\n\t\t| \/display(_startup)?_errors\/\n | \/disable_(classes|functions)\/\n | \/docref_(ext|root)\/\n | \/error_(append_string|log|prepend_string|reporting)\/\n | \/ignore_(repeated_errors|repeated_source|user_abort)\/\n | \/log_errors(_max_len)?\/\n | \/magic_quotes_(gpc|runtime|sybase)\/\n | \/max_(execution_time|input_time)\/\n | \/output_(buffering|handler)\/\n | \/realpath_(cache_size|cache_ttl)\/\n | \/register_(argc_argv|globals|long_arrays)\/\n | \/report_(memleaks|zend_debug)\/\n | \/safe_mode(_(allowed_env_vars|exec_dir|gid|include_dir|protected_env_vars))?\/\n | \/sendmail_(from|path)\/\n | \/upload_(max_filesize|tmp_dir)\/\n | \/user_(agent|dir)\/\n | \/xmlrpc_error(s|_number)\/\n\n\n\tlet entry = IniFile.entry setting\n\n\tlet record = IniFile.record \"section\" entry\n\tlet lns = IniFile.lns record\n\n\tlet filter = (incl \"\/etc\/php*\/*\/php.ini\")\n\t . Util.stdexcl\n\n\tlet xfm = transform lns filter\n\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n\n autoload xfm\n\n (* PHP is a standard INI file *)\n let setting = IniFile.entry \"always_populate_raw_post_data\"\n | IniFile.entry \"asp_tags\"\n | IniFile.entry \"browscap\"\n | IniFile.entry \"child_terminate\"\n | IniFile.entry \"define_syslog_variables\"\n | IniFile.entry \"doc_root\"\n | IniFile.entry \"enable_dl\"\n | IniFile.entry \"engine\"\n | IniFile.entry \"expose_php\"\n | IniFile.entry \"extension_dir\"\n | IniFile.entry \"file_uploads\"\n\t\t| IniFile.entry \"gpc_order\"\n | IniFile.entry \"html_errors\"\n | IniFile.entry \"implicit_flush\"\n | IniFile.entry \"include_path\"\n | IniFile.entry \"last_modified\"\n | IniFile.entry \"memory_limit\"\n | IniFile.entry \"open_basedir\"\n | IniFile.entry \"post_max_size\"\n | IniFile.entry \"precision\"\n | IniFile.entry \"serialize_precision\"\n | IniFile.entry \"short_open_tag\"\n | IniFile.entry \"SMTP\"\n | IniFile.entry \"smtp_port\"\n | IniFile.entry \"track_errors\"\n | IniFile.entry \"unserialize_callback_func\"\n | IniFile.entry \"variables_order\"\n | IniFile.entry \"xbithack\"\n | IniFile.entry \"y2k_compliance\"\n | IniFile.entry \/apc\\.(cache_by_default|enabled|filters|gc_ttl|mmap_file_mask|num_files_hint|optimization|shm_segments|shm_size|slam_defense|ttl|user_entries_hint|user_ttl)\/\n | IniFile.entry \/apd\\.(dumpdir|statement_tracing)\/\n | IniFile.entry \/arg_separator\\.(input|output)\/\n | IniFile.entry \/assert\\.(active|bail|callback|quiet_eval|warning)\/\n | IniFile.entry \/bcmath\\.(scale)\/\n | IniFile.entry \/blenc\\.(key_file)\/\n | IniFile.entry \/com\\.(allow_dcom|autoregister_casesensitive|autoregister_typelib|autoregister_verbose|code_page|typelib_file)\/\n | IniFile.entry \/crack\\.(default_dictionary)\/\n | IniFile.entry \/daffodildb\\.(default_host|default_password|default_socket|default_user|port)\/\n | IniFile.entry \/date\\.(default_latitude|default_longitude|sunrise_zenith|sunset_zenith)\/\n | IniFile.entry \/dba\\.(default_handler)\/\n | IniFile.entry \/dbx\\.(colnames_case)\/\n | IniFile.entry \/exif\\.(decode_jis_intel|decode_jis_motorola|decode_unicode_intel|decode_unicode_motorola|encode_jis|encode_unicode)\/\n | IniFile.entry \/fbsql\\.(allow_persistent|autocommit|batchsize|default_database|default_database_password|default_host|default_password|default_user|generate_warnings|max_connections|max_links|max_persistent|max_results)\/\n | IniFile.entry \/highlight\\.(bg|comment|default|html|keyword|string)\/\n | IniFile.entry \/hyperwave\\.(allow_persistent|default_port)\/\n | IniFile.entry \/ibase\\.(allow_persistent|dateformat|default_charset|default_db|default_password|default_user|max_links|max_persistent|timeformat|timestampformat)\/\n | IniFile.entry \/iconv\\.(input_encoding|internal_encoding|output_encoding)\/\n | IniFile.entry \/ifx\\.(allow_persistent|blobinfile|byteasvarchar|charasvarchar|default_host|default_password|default_user|max_links|max_persistent|nullformat|textasvarchar)\/\n | IniFile.entry \/ingres\\.(allow_persistent|default_database|default_password|default_user|max_links|max_persistent)\/\n | IniFile.entry \/ircg\\.(control_user|keep_alive_interval|max_format_message_sets|shared_mem_size|work_dir)\/\n | IniFile.entry \/ldap\\.(max_links)\/\n | IniFile.entry \/mail\\.(force_extra_parameters)\/\n | IniFile.entry \/mailparse\\.(def_charset)\/\n | IniFile.entry \/maxdb\\.(default_db|default_host|default_pw|default_user|long_readlen)\/\n | IniFile.entry \/mbstring\\.(detect_order|encoding_translation|func_overload|http_input|http_output|internal_encoding|language|script_encoding|substitute_character)\/\n | IniFile.entry \/mcrypt\\.(algorithms_dir|modes_dir)\/\n | IniFile.entry \/mime_magic\\.(debug|magicfile)\/\n | IniFile.entry \/mssql\\.(allow_persistent|batchsize|compatability_mode|connect_timeout|datetimeconvert|max_links|max_persistent|max_procs|min_error_severity|min_message_severity|secure_connection|textlimit|textsize|timeout)\/\n | IniFile.entry \/msql\\.(allow_persistent|max_links|max_persistent)\/\n | IniFile.entry \/mysql\\.(allow_persistent|connect_timeout|default_host|default_password|default_port|default_socket|default_user|max_links|max_persistent|trace_mode)\/\n | IniFile.entry \/mysqli\\.(default_host|default_port|default_pw|default_socket|default_user|max_links|reconnect)\/\n | IniFile.entry \/namazu\\.(debugmode|lang|loggingmode|sortmethod|sortorder)\/\n | IniFile.entry \/nsapi\\.(read_timeout)\/\n | IniFile.entry \/odbc\\.(allow_persistent|check_persistent|defaultbinmode|defaultlrl|default_db|default_pw|default_user|max_links|max_persistent)\/\n | IniFile.entry \/opendirectory\\.(max_refs|separator)\/\n | IniFile.entry \/pdo\\.(global_value)\/\n | IniFile.entry \/pfpro\\.(defaulthost|defaultport|defaulttimeout|proxyaddress|proxylogon|proxypassword|proxyport)\/\n | IniFile.entry \/pgsql\\.(allow_persistent|auto_reset_persistent|ignore_notice|log_notice|max_links|max_persistent)\/\n | IniFile.entry \/printer\\.(default_printer)\/\n | IniFile.entry \/session\\.(auto_start|bug_compat_42|bug_compat_warn|cache_expire|cache_limiter|cookie_(domain|httponly|lifetime|path|secure)|entropy_file|entropy_length|gc_divisor|gc_maxlifetime|gc_probability|hash_bits_per_character|hash_function|name|referer_check|save_handler|save_path|serialize_handler|use_cookies|use_only_cookies|use_trans_sid)\/\n | IniFile.entry \/session_pgsql\\.(create_table|db|disable|failover_mode|gc_interval|keep_expired|sem_file_name|serializable|short_circuit|use_app_vars|vacuum_interval)\/\n | IniFile.entry \/simple_cvs\\.(authMethod|compressionLevel|cvsRoot|host|moduleName|userName|workingDir)\/\n | IniFile.entry \/soap\\.(wsdl_cache_dir|wsdl_cache_enabled|wsdl_cache_ttl)\/\n | IniFile.entry \/sql\\.(safe_mode)\/\n | IniFile.entry \/sqlite\\.(assoc_case)\/\n\t\t| IniFile.entry \/sybase\\.(allow_persistent|max_(persistent|links)|interface_file|min_(error|message)_severity|compatability_mode)\/\n | IniFile.entry \/sybct\\.(allow_persistent|deadlock_retry_count|hostname|login_timeout|max_links|max_persistent|min_client_severity|min_server_severity)\/\n | IniFile.entry \/tidy\\.(clean_output|default_config)\/\n | IniFile.entry \/url_rewriter\\.(tags)\/\n | IniFile.entry \/valkyrie\\.(auto_validate|config_path)\/\n | IniFile.entry \/xmms\\.(path|session)\/\n | IniFile.entry \/yaz\\.(keepalive|log_file|max_links)\/\n | IniFile.entry \/zend\\.(ze1_compatibility_mode)\/\n | IniFile.entry \/zlib\\.(output_compression|output_compression_level|output_handler)\/\n | IniFile.entry \/allow_(call_time_pass_reference|url_fopen|url_include)\/\n | IniFile.entry \/auto_(append_file|detect_line_endings|globals_jit|prepend_file)\/\n | IniFile.entry \/default_(charset|mimetype|socket_timeout)\/\n\t\t| IniFile.entry \/display(_startup)?_errors\/\n | IniFile.entry \/disable_(classes|functions)\/\n | IniFile.entry \/docref_(ext|root)\/\n | IniFile.entry \/error_(append_string|log|prepend_string|reporting)\/\n | IniFile.entry \/ignore_(repeated_errors|repeated_source|user_abort)\/\n | IniFile.entry \/log_errors(_max_len)?\/\n | IniFile.entry \/magic_quotes_(gpc|runtime|sybase)\/\n | IniFile.entry \/max_(execution_time|input_time)\/\n | IniFile.entry \/output_(buffering|handler)\/\n | IniFile.entry \/realpath_(cache_size|cache_ttl)\/\n | IniFile.entry \/register_(argc_argv|globals|long_arrays)\/\n | IniFile.entry \/report_(memleaks|zend_debug)\/\n | IniFile.entry \/safe_mode(_(allowed_env_vars|exec_dir|gid|include_dir|protected_env_vars))?\/\n | IniFile.entry \/sendmail_(from|path)\/\n | IniFile.entry \/upload_(max_filesize|tmp_dir)\/\n | IniFile.entry \/user_(agent|dir)\/\n | IniFile.entry \/xmlrpc_error(s|_number)\/\n\n\tlet record = IniFile.record \"section\" setting\n\tlet lns = IniFile.lns record\n\n\tlet filter = (incl \"\/etc\/php*\/*\/php.ini\")\n\t . Util.stdexcl\n\n\tlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7ed9ceafd66aaaaeb8bcec4a284b32a9c9a07adb","subject":"nsswitch: Add action merge (#609)","message":"nsswitch: Add action merge (#609)\n\n","repos":"mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas,hercules-team\/augeas,ptoscano\/augeas,ptoscano\/augeas","old_file":"lenses\/nsswitch.aug","new_file":"lenses\/nsswitch.aug","new_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: database_kw\n The database specification like `passwd', `shadow', or `hosts' *)\nlet database_kw = Rx.word\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n | \/[Mm][Ee][Rr][Gg][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.comment_or_eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: database_kw\n The database specification like `passwd', `shadow', or `hosts' *)\nlet database_kw = Rx.word\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.comment_or_eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b9704a8f906fcdcfc0f22090b5caa992f910a740","subject":"Added more pkinit_* options.","message":"Added more pkinit_* options.\n","repos":"mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,ptoscano\/augeas,ptoscano\/augeas,mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,hercules-team\/augeas","old_file":"lenses\/krb5.aug","new_file":"lenses\/krb5.aug","new_contents":"module Krb5 =\n\nautoload xfm\n\nlet comment = Inifile.comment IniFile.comment_re \"#\"\nlet empty = Inifile.empty\nlet eol = Inifile.eol\nlet dels = Util.del_str\n\nlet indent = del \/[ \\t]*\/ \"\"\nlet comma_or_space_sep = del \/[ \\t,]{1,}\/ \" \"\nlet eq = del \/[ \\t]*=[ \\t]*\/ \" = \"\nlet eq_openbr = del \/[ \\t]*=[ \\t\\n]*\\{[ \\t]*\\n\/ \" = {\\n\"\nlet closebr = del \/[ \\t]*\\}\/ \"}\"\n\n(* These two regexps for realms and apps are not entirely true\n - strictly speaking, there's no requirement that a realm is all upper case\n and an application only uses lowercase. But it's what's used in practice.\n\n Without that distinction we couldn't distinguish between applications\n and realms in the [appdefaults] section.\n*)\n\nlet realm_re = \/[A-Z0-9][.a-zA-Z0-9-]*\/\nlet realm_anycase_re = \/[A-Za-z0-9][.a-zA-Z0-9-]*\/\nlet app_re = \/[a-z][a-zA-Z0-9_]*\/\nlet name_re = \/[.a-zA-Z0-9_-]+\/\n\nlet value_br = store \/[^;# \\t\\r\\n{}]+\/\nlet value = store \/[^;# \\t\\r\\n]+\/\nlet entry (kw:regexp) (sep:lens) (value:lens) (comment:lens)\n = [ indent . key kw . sep . value . (comment|eol) ] | comment\n\nlet subsec_entry (kw:regexp) (sep:lens) (comment:lens)\n = ( entry kw sep value_br comment ) | empty\n\nlet simple_section (n:string) (k:regexp) =\n let title = Inifile.indented_title n in\n let entry = entry k eq value comment in\n Inifile.record title entry\n\nlet record (t:string) (e:lens) =\n let title = Inifile.indented_title t in\n Inifile.record title e\n\nlet v4_name_convert (subsec:lens) = [ indent . key \"v4_name_convert\" .\n eq_openbr . subsec* . closebr . eol ]\n\n(*\n For the enctypes this appears to be a list of the valid entries:\n c4-hmac arcfour-hmac aes128-cts rc4-hmac\n arcfour-hmac-md5 des3-cbc-sha1 des-cbc-md5 des-cbc-crc\n*)\nlet enctype_re = \/[a-zA-Z0-9-]{3,}\/\nlet enctypes = \/permitted_enctypes|default_tgs_enctypes|default_tkt_enctypes\/i\n\n(* An #eol label prevents ambiguity between \"k = v1 v2\" and \"k = v1\\n k = v2\" *)\nlet enctype_list (nr:regexp) (ns:string) =\n indent . del nr ns . eq\n . Build.opt_list [ label ns . store enctype_re ] comma_or_space_sep\n . (comment|eol) . [ label \"#eol\" ]\n\nlet libdefaults =\n let option = entry (name_re - (\"v4_name_convert\" |enctypes)) eq value comment in\n let enctype_lists = enctype_list \/permitted_enctypes\/i \"permitted_enctypes\"\n | enctype_list \/default_tgs_enctypes\/i \"default_tgs_enctypes\"\n | enctype_list \/default_tkt_enctypes\/i \"default_tkt_enctypes\" in\n let subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n record \"libdefaults\" (option|enctype_lists|v4_name_convert subsec)\n\nlet login =\n let keys = \/krb[45]_get_tickets|krb4_convert|krb_run_aklog\/\n |\/aklog_path|accept_passwd\/ in\n simple_section \"login\" keys\n\nlet appdefaults =\n let option = entry (name_re - (\"realm\" | \"application\")) eq value_br comment in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . (option|empty)* . closebr . eol ] in\n let app = [ indent . label \"application\" . store app_re .\n eq_openbr . (realm|option|empty)* . closebr . eol] in\n record \"appdefaults\" (option|realm|app)\n\nlet realms =\n let simple_option = \/kdc|admin_server|database_module|default_domain\/\n |\/v4_realm|auth_to_local(_names)?|master_kdc|kpasswd_server\/\n |\/admin_server|ticket_lifetime|pkinit_(anchors|identities|identity|pool)\/\n |\/krb524_server\/ in\n let subsec_option = \/v4_instance_convert\/ in\n let option = subsec_entry simple_option eq comment in\n let subsec = [ indent . key subsec_option . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n let v4subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n let realm = [ indent . label \"realm\" . store realm_anycase_re .\n eq_openbr . (option|subsec|(v4_name_convert v4subsec))* .\n closebr . eol ] in\n record \"realms\" (realm|comment)\n\nlet domain_realm =\n simple_section \"domain_realm\" name_re\n\nlet logging =\n let keys = \/kdc|admin_server|default\/ in\n let xchg (m:regexp) (d:string) (l:string) =\n del m d . label l in\n let xchgs (m:string) (l:string) = xchg m m l in\n let dest =\n [ xchg \/FILE[=:]\/ \"FILE=\" \"file\" . value ]\n |[ xchgs \"STDERR\" \"stderr\" ]\n |[ xchgs \"CONSOLE\" \"console\" ]\n |[ xchgs \"DEVICE=\" \"device\" . value ]\n |[ xchgs \"SYSLOG\" \"syslog\" .\n ([ xchgs \":\" \"severity\" . store \/[A-Za-z0-9]+\/ ].\n [ xchgs \":\" \"facility\" . store \/[A-Za-z0-9]+\/ ]?)? ] in\n let entry = [ indent . key keys . eq . dest . (comment|eol) ] | comment in\n record \"logging\" entry\n\nlet capaths =\n let realm = [ indent . key realm_re .\n eq_openbr .\n (entry realm_re eq value_br comment)* . closebr . eol ] in\n record \"capaths\" (realm|comment)\n\nlet dbdefaults =\n let keys = \/database_module|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbdefaults\" keys\n\nlet dbmodules =\n let keys = \/db_library|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbmodules\" keys\n\n(* This section is not documented in the krb5.conf manpage,\n but the Fermi example uses it. *)\nlet instance_mapping =\n let value = dels \"\\\"\" . store \/[^;# \\t\\r\\n{}]*\/ . dels \"\\\"\" in\n let map_node = label \"mapping\" . store \/[a-zA-Z0-9\\\/*]+\/ in\n let mapping = [ indent . map_node . eq .\n [ label \"value\" . value ] . (comment|eol) ] in\n let instance = [ indent . key name_re .\n eq_openbr . (mapping|comment)* . closebr . eol ] in\n record \"instancemapping\" instance\n\nlet kdc =\n simple_section \"kdc\" \/profile\/\n\nlet pam =\n simple_section \"pam\" name_re\n\nlet includes = Build.key_value_line \/include(dir)?\/ Sep.space (store Rx.fspath)\n\nlet lns = (comment|empty|includes)* .\n (libdefaults|login|appdefaults|realms|domain_realm\n |logging|capaths|dbdefaults|dbmodules|instance_mapping|kdc|pam)*\n\nlet filter = (incl \"\/etc\/krb5.conf.d\/*.conf\")\n . (incl \"\/etc\/krb5.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"module Krb5 =\n\nautoload xfm\n\nlet comment = Inifile.comment IniFile.comment_re \"#\"\nlet empty = Inifile.empty\nlet eol = Inifile.eol\nlet dels = Util.del_str\n\nlet indent = del \/[ \\t]*\/ \"\"\nlet comma_or_space_sep = del \/[ \\t,]{1,}\/ \" \"\nlet eq = del \/[ \\t]*=[ \\t]*\/ \" = \"\nlet eq_openbr = del \/[ \\t]*=[ \\t\\n]*\\{[ \\t]*\\n\/ \" = {\\n\"\nlet closebr = del \/[ \\t]*\\}\/ \"}\"\n\n(* These two regexps for realms and apps are not entirely true\n - strictly speaking, there's no requirement that a realm is all upper case\n and an application only uses lowercase. But it's what's used in practice.\n\n Without that distinction we couldn't distinguish between applications\n and realms in the [appdefaults] section.\n*)\n\nlet realm_re = \/[A-Z0-9][.a-zA-Z0-9-]*\/\nlet realm_anycase_re = \/[A-Za-z0-9][.a-zA-Z0-9-]*\/\nlet app_re = \/[a-z][a-zA-Z0-9_]*\/\nlet name_re = \/[.a-zA-Z0-9_-]+\/\n\nlet value_br = store \/[^;# \\t\\r\\n{}]+\/\nlet value = store \/[^;# \\t\\r\\n]+\/\nlet entry (kw:regexp) (sep:lens) (value:lens) (comment:lens)\n = [ indent . key kw . sep . value . (comment|eol) ] | comment\n\nlet subsec_entry (kw:regexp) (sep:lens) (comment:lens)\n = ( entry kw sep value_br comment ) | empty\n\nlet simple_section (n:string) (k:regexp) =\n let title = Inifile.indented_title n in\n let entry = entry k eq value comment in\n Inifile.record title entry\n\nlet record (t:string) (e:lens) =\n let title = Inifile.indented_title t in\n Inifile.record title e\n\nlet v4_name_convert (subsec:lens) = [ indent . key \"v4_name_convert\" .\n eq_openbr . subsec* . closebr . eol ]\n\n(*\n For the enctypes this appears to be a list of the valid entries:\n c4-hmac arcfour-hmac aes128-cts rc4-hmac\n arcfour-hmac-md5 des3-cbc-sha1 des-cbc-md5 des-cbc-crc\n*)\nlet enctype_re = \/[a-zA-Z0-9-]{3,}\/\nlet enctypes = \/permitted_enctypes|default_tgs_enctypes|default_tkt_enctypes\/i\n\n(* An #eol label prevents ambiguity between \"k = v1 v2\" and \"k = v1\\n k = v2\" *)\nlet enctype_list (nr:regexp) (ns:string) =\n indent . del nr ns . eq\n . Build.opt_list [ label ns . store enctype_re ] comma_or_space_sep\n . (comment|eol) . [ label \"#eol\" ]\n\nlet libdefaults =\n let option = entry (name_re - (\"v4_name_convert\" |enctypes)) eq value comment in\n let enctype_lists = enctype_list \/permitted_enctypes\/i \"permitted_enctypes\"\n | enctype_list \/default_tgs_enctypes\/i \"default_tgs_enctypes\"\n | enctype_list \/default_tkt_enctypes\/i \"default_tkt_enctypes\" in\n let subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n record \"libdefaults\" (option|enctype_lists|v4_name_convert subsec)\n\nlet login =\n let keys = \/krb[45]_get_tickets|krb4_convert|krb_run_aklog\/\n |\/aklog_path|accept_passwd\/ in\n simple_section \"login\" keys\n\nlet appdefaults =\n let option = entry (name_re - (\"realm\" | \"application\")) eq value_br comment in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . (option|empty)* . closebr . eol ] in\n let app = [ indent . label \"application\" . store app_re .\n eq_openbr . (realm|option|empty)* . closebr . eol] in\n record \"appdefaults\" (option|realm|app)\n\nlet realms =\n let simple_option = \/kdc|admin_server|database_module|default_domain\/\n |\/v4_realm|auth_to_local(_names)?|master_kdc|kpasswd_server\/\n |\/admin_server|ticket_lifetime|pkinit_anchors|krb524_server\/ in\n let subsec_option = \/v4_instance_convert\/ in\n let option = subsec_entry simple_option eq comment in\n let subsec = [ indent . key subsec_option . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n let v4subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n let realm = [ indent . label \"realm\" . store realm_anycase_re .\n eq_openbr . (option|subsec|(v4_name_convert v4subsec))* .\n closebr . eol ] in\n record \"realms\" (realm|comment)\n\nlet domain_realm =\n simple_section \"domain_realm\" name_re\n\nlet logging =\n let keys = \/kdc|admin_server|default\/ in\n let xchg (m:regexp) (d:string) (l:string) =\n del m d . label l in\n let xchgs (m:string) (l:string) = xchg m m l in\n let dest =\n [ xchg \/FILE[=:]\/ \"FILE=\" \"file\" . value ]\n |[ xchgs \"STDERR\" \"stderr\" ]\n |[ xchgs \"CONSOLE\" \"console\" ]\n |[ xchgs \"DEVICE=\" \"device\" . value ]\n |[ xchgs \"SYSLOG\" \"syslog\" .\n ([ xchgs \":\" \"severity\" . store \/[A-Za-z0-9]+\/ ].\n [ xchgs \":\" \"facility\" . store \/[A-Za-z0-9]+\/ ]?)? ] in\n let entry = [ indent . key keys . eq . dest . (comment|eol) ] | comment in\n record \"logging\" entry\n\nlet capaths =\n let realm = [ indent . key realm_re .\n eq_openbr .\n (entry realm_re eq value_br comment)* . closebr . eol ] in\n record \"capaths\" (realm|comment)\n\nlet dbdefaults =\n let keys = \/database_module|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbdefaults\" keys\n\nlet dbmodules =\n let keys = \/db_library|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbmodules\" keys\n\n(* This section is not documented in the krb5.conf manpage,\n but the Fermi example uses it. *)\nlet instance_mapping =\n let value = dels \"\\\"\" . store \/[^;# \\t\\r\\n{}]*\/ . dels \"\\\"\" in\n let map_node = label \"mapping\" . store \/[a-zA-Z0-9\\\/*]+\/ in\n let mapping = [ indent . map_node . eq .\n [ label \"value\" . value ] . (comment|eol) ] in\n let instance = [ indent . key name_re .\n eq_openbr . (mapping|comment)* . closebr . eol ] in\n record \"instancemapping\" instance\n\nlet kdc =\n simple_section \"kdc\" \/profile\/\n\nlet pam =\n simple_section \"pam\" name_re\n\nlet includes = Build.key_value_line \/include(dir)?\/ Sep.space (store Rx.fspath)\n\nlet lns = (comment|empty|includes)* .\n (libdefaults|login|appdefaults|realms|domain_realm\n |logging|capaths|dbdefaults|dbmodules|instance_mapping|kdc|pam)*\n\nlet filter = (incl \"\/etc\/krb5.conf.d\/*.conf\")\n . (incl \"\/etc\/krb5.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4acb8fc8575adacab73792e2de6c41a721302e73","subject":"Support \\r in comments in util.aug","message":"Support \\r in comments in util.aug\n","repos":"kumy\/augeas,ptoscano\/augeas,jtopjian\/augeas,mchf\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,ptoscano\/augeas,mchf\/augeas,manandbytes\/augeas,kumy\/augeas,jtopjian\/augeas,lutter\/augeas,raphink\/augeas,hercules-team\/augeas,kumy\/augeas,lutter\/augeas,pevalme\/augeas,jasperla\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,raphink\/augeas,kunkku\/augeas,pevalme\/augeas,jjlin\/augeas,hercules-team\/augeas,mlichvar\/augeas,jasperla\/augeas,pevalme\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,ptoscano\/augeas,domcleal\/augeas,domcleal\/augeas,dafugg\/augeas,kunkku\/augeas,domcleal\/augeas,manandbytes\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,dafugg\/augeas,MikaelSmith\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . doseol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n(* View: empty_dos *)\n let empty_dos =\n [ del \/[ \\t]*#?[ \\t]*\/ \"\" . del \/\\r?\\n\/ \"\\n\" ]\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"10ee1270ff310602fd50d7cb4080e493c1273ac9","subject":"qemu: group swtpm entry in augeas file","message":"qemu: group swtpm entry in augeas file\n\nThey are meant to be together.\n\nSigned-off-by: J\u00e1n Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>\nReviewed-by: John Ferlan <87558058f6f829e5ec976c8ef960720af4ff9c7d@redhat.com>\n","repos":"jardasgit\/libvirt,andreabolognani\/libvirt,nertpinx\/libvirt,libvirt\/libvirt,jardasgit\/libvirt,eskultety\/libvirt,nertpinx\/libvirt,crobinso\/libvirt,fabianfreyer\/libvirt,fabianfreyer\/libvirt,fabianfreyer\/libvirt,eskultety\/libvirt,andreabolognani\/libvirt,crobinso\/libvirt,jardasgit\/libvirt,olafhering\/libvirt,libvirt\/libvirt,eskultety\/libvirt,nertpinx\/libvirt,jfehlig\/libvirt,jfehlig\/libvirt,olafhering\/libvirt,zippy2\/libvirt,andreabolognani\/libvirt,crobinso\/libvirt,jardasgit\/libvirt,libvirt\/libvirt,nertpinx\/libvirt,nertpinx\/libvirt,eskultety\/libvirt,zippy2\/libvirt,zippy2\/libvirt,jfehlig\/libvirt,zippy2\/libvirt,jardasgit\/libvirt,olafhering\/libvirt,fabianfreyer\/libvirt,olafhering\/libvirt,libvirt\/libvirt,andreabolognani\/libvirt,fabianfreyer\/libvirt,jfehlig\/libvirt,eskultety\/libvirt,crobinso\/libvirt,andreabolognani\/libvirt","old_file":"src\/qemu\/libvirtd_qemu.aug","new_file":"src\/qemu\/libvirtd_qemu.aug","new_contents":"(* \/etc\/libvirt\/qemu.conf *)\n\nmodule Libvirtd_qemu =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n let unlimited_val = del \/\\\"\/ \"\\\"\" . store \/unlimited\/ . del \/\\\"\/ \"\\\"\"\n let limits_entry (kw:string) = [ key kw . value_sep . unlimited_val ] | [ key kw . value_sep . int_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let default_tls_entry = str_entry \"default_tls_x509_cert_dir\"\n | bool_entry \"default_tls_x509_verify\"\n | str_entry \"default_tls_x509_secret_uuid\"\n\n let vnc_entry = str_entry \"vnc_listen\"\n | bool_entry \"vnc_auto_unix_socket\"\n | bool_entry \"vnc_tls\"\n | str_entry \"vnc_tls_x509_cert_dir\"\n | bool_entry \"vnc_tls_x509_verify\"\n | str_entry \"vnc_password\"\n | bool_entry \"vnc_sasl\"\n | str_entry \"vnc_sasl_dir\"\n | bool_entry \"vnc_allow_host_audio\"\n\n let spice_entry = str_entry \"spice_listen\"\n | bool_entry \"spice_tls\"\n | str_entry \"spice_tls_x509_cert_dir\"\n | bool_entry \"spice_auto_unix_socket\"\n | str_entry \"spice_password\"\n | bool_entry \"spice_sasl\"\n | str_entry \"spice_sasl_dir\"\n\n let chardev_entry = bool_entry \"chardev_tls\"\n | str_entry \"chardev_tls_x509_cert_dir\"\n | bool_entry \"chardev_tls_x509_verify\"\n | str_entry \"chardev_tls_x509_secret_uuid\"\n\n let migrate_entry = str_entry \"migrate_tls_x509_cert_dir\"\n | bool_entry \"migrate_tls_x509_verify\"\n | str_entry \"migrate_tls_x509_secret_uuid\"\n\n let nogfx_entry = bool_entry \"nographics_allow_host_audio\"\n\n let remote_display_entry = int_entry \"remote_display_port_min\"\n | int_entry \"remote_display_port_max\"\n | int_entry \"remote_websocket_port_min\"\n | int_entry \"remote_websocket_port_max\"\n\n let security_entry = str_entry \"security_driver\"\n | bool_entry \"security_default_confined\"\n | bool_entry \"security_require_confined\"\n | str_entry \"user\"\n | str_entry \"group\"\n | bool_entry \"dynamic_ownership\"\n | str_array_entry \"cgroup_controllers\"\n | str_array_entry \"cgroup_device_acl\"\n | int_entry \"seccomp_sandbox\"\n | str_array_entry \"namespaces\"\n\n let save_entry = str_entry \"save_image_format\"\n | str_entry \"dump_image_format\"\n | str_entry \"snapshot_image_format\"\n | str_entry \"auto_dump_path\"\n | bool_entry \"auto_dump_bypass_cache\"\n | bool_entry \"auto_start_bypass_cache\"\n\n let process_entry = str_entry \"hugetlbfs_mount\"\n | bool_entry \"clear_emulator_capabilities\"\n | str_entry \"bridge_helper\"\n | str_entry \"pr_helper\"\n | bool_entry \"set_process_name\"\n | int_entry \"max_processes\"\n | int_entry \"max_files\"\n | limits_entry \"max_core\"\n | bool_entry \"dump_guest_core\"\n | str_entry \"stdio_handler\"\n\n let device_entry = bool_entry \"mac_filter\"\n | bool_entry \"relaxed_acs_check\"\n | bool_entry \"allow_disk_format_probing\"\n | str_entry \"lock_manager\"\n\n let rpc_entry = int_entry \"max_queued\"\n | int_entry \"keepalive_interval\"\n | int_entry \"keepalive_count\"\n\n let network_entry = str_entry \"migration_address\"\n | int_entry \"migration_port_min\"\n | int_entry \"migration_port_max\"\n | str_entry \"migration_host\"\n\n let log_entry = bool_entry \"log_timestamp\"\n\n let nvram_entry = str_array_entry \"nvram\"\n\n let gluster_debug_level_entry = int_entry \"gluster_debug_level\"\n\n let memory_entry = str_entry \"memory_backing_dir\"\n\n let vxhs_entry = bool_entry \"vxhs_tls\"\n | str_entry \"vxhs_tls_x509_cert_dir\"\n\n let nbd_entry = bool_entry \"nbd_tls\"\n | str_entry \"nbd_tls_x509_cert_dir\"\n\n let swtpm_entry = str_entry \"swtpm_user\"\n | str_entry \"swtpm_group\"\n\n (* Each entry in the config is one of the following ... *)\n let entry = default_tls_entry\n | vnc_entry\n | spice_entry\n | chardev_entry\n | migrate_entry\n | nogfx_entry\n | remote_display_entry\n | security_entry\n | save_entry\n | process_entry\n | device_entry\n | rpc_entry\n | network_entry\n | log_entry\n | nvram_entry\n | gluster_debug_level_entry\n | memory_entry\n | vxhs_entry\n | nbd_entry\n | swtpm_entry\n\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/qemu.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* \/etc\/libvirt\/qemu.conf *)\n\nmodule Libvirtd_qemu =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n let unlimited_val = del \/\\\"\/ \"\\\"\" . store \/unlimited\/ . del \/\\\"\/ \"\\\"\"\n let limits_entry (kw:string) = [ key kw . value_sep . unlimited_val ] | [ key kw . value_sep . int_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let default_tls_entry = str_entry \"default_tls_x509_cert_dir\"\n | bool_entry \"default_tls_x509_verify\"\n | str_entry \"default_tls_x509_secret_uuid\"\n\n let vnc_entry = str_entry \"vnc_listen\"\n | bool_entry \"vnc_auto_unix_socket\"\n | bool_entry \"vnc_tls\"\n | str_entry \"vnc_tls_x509_cert_dir\"\n | bool_entry \"vnc_tls_x509_verify\"\n | str_entry \"vnc_password\"\n | bool_entry \"vnc_sasl\"\n | str_entry \"vnc_sasl_dir\"\n | bool_entry \"vnc_allow_host_audio\"\n\n let spice_entry = str_entry \"spice_listen\"\n | bool_entry \"spice_tls\"\n | str_entry \"spice_tls_x509_cert_dir\"\n | bool_entry \"spice_auto_unix_socket\"\n | str_entry \"spice_password\"\n | bool_entry \"spice_sasl\"\n | str_entry \"spice_sasl_dir\"\n\n let chardev_entry = bool_entry \"chardev_tls\"\n | str_entry \"chardev_tls_x509_cert_dir\"\n | bool_entry \"chardev_tls_x509_verify\"\n | str_entry \"chardev_tls_x509_secret_uuid\"\n\n let migrate_entry = str_entry \"migrate_tls_x509_cert_dir\"\n | bool_entry \"migrate_tls_x509_verify\"\n | str_entry \"migrate_tls_x509_secret_uuid\"\n\n let nogfx_entry = bool_entry \"nographics_allow_host_audio\"\n\n let remote_display_entry = int_entry \"remote_display_port_min\"\n | int_entry \"remote_display_port_max\"\n | int_entry \"remote_websocket_port_min\"\n | int_entry \"remote_websocket_port_max\"\n\n let security_entry = str_entry \"security_driver\"\n | bool_entry \"security_default_confined\"\n | bool_entry \"security_require_confined\"\n | str_entry \"user\"\n | str_entry \"group\"\n | bool_entry \"dynamic_ownership\"\n | str_array_entry \"cgroup_controllers\"\n | str_array_entry \"cgroup_device_acl\"\n | int_entry \"seccomp_sandbox\"\n | str_array_entry \"namespaces\"\n\n let save_entry = str_entry \"save_image_format\"\n | str_entry \"dump_image_format\"\n | str_entry \"snapshot_image_format\"\n | str_entry \"auto_dump_path\"\n | bool_entry \"auto_dump_bypass_cache\"\n | bool_entry \"auto_start_bypass_cache\"\n\n let process_entry = str_entry \"hugetlbfs_mount\"\n | bool_entry \"clear_emulator_capabilities\"\n | str_entry \"bridge_helper\"\n | str_entry \"pr_helper\"\n | bool_entry \"set_process_name\"\n | int_entry \"max_processes\"\n | int_entry \"max_files\"\n | limits_entry \"max_core\"\n | bool_entry \"dump_guest_core\"\n | str_entry \"stdio_handler\"\n\n let device_entry = bool_entry \"mac_filter\"\n | bool_entry \"relaxed_acs_check\"\n | bool_entry \"allow_disk_format_probing\"\n | str_entry \"lock_manager\"\n\n let rpc_entry = int_entry \"max_queued\"\n | int_entry \"keepalive_interval\"\n | int_entry \"keepalive_count\"\n\n let network_entry = str_entry \"migration_address\"\n | int_entry \"migration_port_min\"\n | int_entry \"migration_port_max\"\n | str_entry \"migration_host\"\n\n let log_entry = bool_entry \"log_timestamp\"\n\n let nvram_entry = str_array_entry \"nvram\"\n\n let gluster_debug_level_entry = int_entry \"gluster_debug_level\"\n\n let memory_entry = str_entry \"memory_backing_dir\"\n\n let vxhs_entry = bool_entry \"vxhs_tls\"\n | str_entry \"vxhs_tls_x509_cert_dir\"\n\n let nbd_entry = bool_entry \"nbd_tls\"\n | str_entry \"nbd_tls_x509_cert_dir\"\n\n let swtpm_user_entry = str_entry \"swtpm_user\"\n let swtpm_group_entry = str_entry \"swtpm_group\"\n\n (* Each entry in the config is one of the following ... *)\n let entry = default_tls_entry\n | vnc_entry\n | spice_entry\n | chardev_entry\n | migrate_entry\n | nogfx_entry\n | remote_display_entry\n | security_entry\n | save_entry\n | process_entry\n | device_entry\n | rpc_entry\n | network_entry\n | log_entry\n | nvram_entry\n | gluster_debug_level_entry\n | memory_entry\n | vxhs_entry\n | nbd_entry\n | swtpm_user_entry\n | swtpm_group_entry\n\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/qemu.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"506858c21b0e2ae6a05ced36501efdd7f0b3810d","subject":"Grub: add support for 'serial' and 'terminal'","message":"Grub: add support for 'serial' and 'terminal'\n\nPatch by Sean E. Millichamp\n","repos":"pevalme\/augeas,mchf\/augeas,lutter\/augeas,dafugg\/augeas,mlichvar\/augeas,camptocamp\/augeas,lutter\/augeas,bkearney\/augeas,bkearney\/augeas,domcleal\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,MikaelSmith\/augeas,raphink\/augeas,jjlin\/augeas,camptocamp\/augeas,MikaelSmith\/augeas,jasperla\/augeas,bkearney\/augeas,kumy\/augeas,camptocamp\/augeas,dafugg\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,ptoscano\/augeas,lutter\/augeas,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,pevalme\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,kunkku\/augeas,hercules-team\/augeas,jtopjian\/augeas,kunkku\/augeas,hercules-team\/augeas,kumy\/augeas,mlichvar\/augeas,raphink\/augeas,domcleal\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,domcleal\/augeas,ptoscano\/augeas,kunkku\/augeas,mlichvar\/augeas,jasperla\/augeas,camptocamp\/augeas,kumy\/augeas,manandbytes\/augeas","old_file":"lenses\/grub.aug","new_file":"lenses\/grub.aug","new_contents":"module Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n let value_to_eol = store \/[^= \\t][^\\n]*\/\n let eol = Util.del_str \"\\n\"\n let del_to_eol = del \/[^\\n]*\/ \"\"\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n let kw_arg (kw:string) (indent:string) (dflt_sep:string) =\n [ Util.del_opt_ws indent . key kw . value_sep dflt_sep\n . value_to_eol . eol ]\n\n let kw_boot_arg (kw:string) = kw_arg kw \"\\t\" \" \"\n let kw_menu_arg (kw:string) = kw_arg kw \"\" \"=\"\n\n let kw_pres (kw:string) = [ key kw . del_to_eol . eol ]\n\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"serial\"\n | kw_menu_arg \"terminal\"\n\n let title = del \/title[ \\t]+\/ \"title \" . value_to_eol . eol\n\n let module_lines = [ label \"modules\" .\n Util.del_ws \"\\t\" .\n Util.del_str \"module\" . Util.del_ws_spc\n . value_to_eol . eol ]\n\n let boot_setting = kw_boot_arg \"root\"\n | kw_boot_arg \"kernel\"\n | kw_boot_arg \"initrd\"\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | module_lines\n\n let boot = [ label \"title\" . title . boot_setting* ]\n\n let comment = [ del \/(#.*|[ \\t]*)\\n\/ \"#\\n\" ]\n\n let lns = (comment | menu_setting | boot)*\n let xfm = transform lns (incl \"\/etc\/grub.conf\")\n","old_contents":"module Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n let value_to_eol = store \/[^= \\t][^\\n]*\/\n let eol = Util.del_str \"\\n\"\n let del_to_eol = del \/[^\\n]*\/ \"\"\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n let kw_arg (kw:string) (indent:string) (dflt_sep:string) =\n [ Util.del_opt_ws indent . key kw . value_sep dflt_sep\n . value_to_eol . eol ]\n\n let kw_boot_arg (kw:string) = kw_arg kw \"\\t\" \" \"\n let kw_menu_arg (kw:string) = kw_arg kw \"\" \"=\"\n\n let kw_pres (kw:string) = [ key kw . del_to_eol . eol ]\n\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n\n let title = del \/title[ \\t]+\/ \"title \" . value_to_eol . eol\n\n let module_lines = [ label \"modules\" .\n Util.del_ws \"\\t\" .\n Util.del_str \"module\" . Util.del_ws_spc\n . value_to_eol . eol ]\n\n let boot_setting = kw_boot_arg \"root\"\n | kw_boot_arg \"kernel\"\n | kw_boot_arg \"initrd\"\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | module_lines\n\n let boot = [ label \"title\" . title . boot_setting* ]\n\n let comment = [ del \/(#.*|[ \\t]*)\\n\/ \"#\\n\" ]\n\n let lns = (comment | menu_setting | boot)*\n let xfm = transform lns (incl \"\/etc\/grub.conf\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"11f45463e9a2bfc929cb9f52dc1fb56c2075b00a","subject":"Allow parsing of options with equal sign (#587)","message":"Allow parsing of options with equal sign (#587)\n\nSsh: Options in sshd_config can be specified using space, tab or equal sign.\r\nThey all have the same effect.","repos":"hercules-team\/augeas,kunkku\/augeas,ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas","old_file":"lenses\/sshd.aug","new_file":"lenses\/sshd.aug","new_contents":"(*\nModule: Sshd\n Parses \/etc\/ssh\/sshd_config\n\nAuthor: David Lutterkort lutter@redhat.com\n Dominique Dumont dominique.dumont@hp.com\n\nAbout: Reference\n sshd_config man page.\n See http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=sshd_config&sektion=5\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get your current setup\n > print \/files\/etc\/ssh\/sshd_config\n ...\n\n * Set X11Forwarding to \"no\"\n > set \/files\/etc\/ssh\/sshd_config\/X11Forwarding \"no\"\n\n More advanced usage:\n\n * Set a Match section\n > set \/files\/etc\/ssh\/sshd_config\/Match[1]\/Condition\/User \"foo\"\n > set \/files\/etc\/ssh\/sshd_config\/Match[1]\/Settings\/X11Forwarding \"yes\"\n\n Saving your file:\n\n > save\n\n\nAbout: CAVEATS\n\n In sshd_config, Match blocks must be located at the end of the file.\n This means that any new \"global\" parameters (i.e. outside of a Match\n block) must be written before the first Match block. By default,\n Augeas will write new parameters at the end of the file.\n\n I.e. if you have a Match section and no ChrootDirectory parameter,\n this command:\n\n > set \/files\/etc\/ssh\/sshd_config\/ChrootDirectory \"foo\"\n\n will be stored in a new node after the Match section and Augeas will\n refuse to save sshd_config file.\n\n To create a new parameter as the right place, you must first create\n a new Augeas node before the Match section:\n\n > ins ChrootDirectory before \/files\/etc\/ssh\/sshd_config\/Match\n\n Then, you can set the parameter\n\n > set \/files\/etc\/ssh\/sshd_config\/ChrootDirectory \"foo\"\n\n\nAbout: Configuration files\n This lens applies to \/etc\/ssh\/sshd_config\n\n*)\n\nmodule Sshd =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let sep = del \/[ \\t=]+\/ \" \"\n\n let indent = del \/[ \\t]*\/ \" \"\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/MACs|Match|AcceptEnv|Subsystem|Ciphers|(Kex|HostKey)Algorithms|(Allow|Deny)(Groups|Users)\/i\n\n let comment = Util.comment\n let comment_noindent = Util.comment_noindent\n let empty = Util.empty\n\n let array_entry (kw:regexp) (sq:string) =\n let bare = Quote.do_quote_opt_nil (store \/[^\"' \\t\\n=]+\/) in\n let quoted = Quote.do_quote (store \/[^\"'\\n]*[ \\t]+[^\"'\\n]*\/) in\n [ key kw\n . ( [ sep . seq sq . bare ] | [ sep . seq sq . quoted ] )*\n . eol ]\n\n let other_entry =\n let value = store \/[^ \\t\\n=]+([ \\t=]+[^ \\t\\n=]+)*\/ in\n [ key key_re . sep . value . eol ]\n\n let accept_env = array_entry \/AcceptEnv\/i \"AcceptEnv\"\n\n let allow_groups = array_entry \/AllowGroups\/i \"AllowGroups\"\n let allow_users = array_entry \/AllowUsers\/i \"AllowUsers\"\n let deny_groups = array_entry \/DenyGroups\/i \"DenyGroups\"\n let deny_users = array_entry \/DenyUsers\/i \"DenyUsers\"\n\n let subsystemvalue =\n let value = store (\/[^ \\t\\n=](.*[^ \\t\\n=])?\/) in\n [ key \/[A-Za-z0-9\\-]+\/ . sep . value . eol ]\n\n let subsystem =\n [ key \/Subsystem\/i . sep . subsystemvalue ]\n\n let list (kw:regexp) (sq:string) =\n let value = store \/[^, \\t\\n=]+\/ in\n [ key kw . sep .\n [ seq sq . value ] .\n ([ seq sq . Util.del_str \",\" . value])* .\n eol ]\n\n let macs = list \/MACs\/i \"MACs\"\n\n let ciphers = list \/Ciphers\/i \"Ciphers\"\n\n let kexalgorithms = list \/KexAlgorithms\/i \"KexAlgorithms\"\n\n let hostkeyalgorithms = list \/HostKeyAlgorithms\/i \"HostKeyAlgorithms\"\n\n let entry = accept_env | allow_groups | allow_users\n | deny_groups | subsystem | deny_users\n | macs | ciphers | kexalgorithms | hostkeyalgorithms\n | other_entry\n\n let condition_entry =\n let value = store \/[^ \\t\\n=]+\/ in\n [ sep . key \/[A-Za-z0-9]+\/ . sep . value ]\n\n let match_cond =\n [ label \"Condition\" . condition_entry+ . eol ]\n\n let match_entry = indent . (entry | comment_noindent)\n | empty\n\n let match =\n [ key \/Match\/i . match_cond\n . [ label \"Settings\" . match_entry+ ]\n ]\n\n let lns = (entry | comment | empty)* . match*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/sshd_config\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Sshd\n Parses \/etc\/ssh\/sshd_config\n\nAuthor: David Lutterkort lutter@redhat.com\n Dominique Dumont dominique.dumont@hp.com\n\nAbout: Reference\n sshd_config man page.\n See http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=sshd_config&sektion=5\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool:\n\n * Get your current setup\n > print \/files\/etc\/ssh\/sshd_config\n ...\n\n * Set X11Forwarding to \"no\"\n > set \/files\/etc\/ssh\/sshd_config\/X11Forwarding \"no\"\n\n More advanced usage:\n\n * Set a Match section\n > set \/files\/etc\/ssh\/sshd_config\/Match[1]\/Condition\/User \"foo\"\n > set \/files\/etc\/ssh\/sshd_config\/Match[1]\/Settings\/X11Forwarding \"yes\"\n\n Saving your file:\n\n > save\n\n\nAbout: CAVEATS\n\n In sshd_config, Match blocks must be located at the end of the file.\n This means that any new \"global\" parameters (i.e. outside of a Match\n block) must be written before the first Match block. By default,\n Augeas will write new parameters at the end of the file.\n\n I.e. if you have a Match section and no ChrootDirectory parameter,\n this command:\n\n > set \/files\/etc\/ssh\/sshd_config\/ChrootDirectory \"foo\"\n\n will be stored in a new node after the Match section and Augeas will\n refuse to save sshd_config file.\n\n To create a new parameter as the right place, you must first create\n a new Augeas node before the Match section:\n\n > ins ChrootDirectory before \/files\/etc\/ssh\/sshd_config\/Match\n\n Then, you can set the parameter\n\n > set \/files\/etc\/ssh\/sshd_config\/ChrootDirectory \"foo\"\n\n\nAbout: Configuration files\n This lens applies to \/etc\/ssh\/sshd_config\n\n*)\n\nmodule Sshd =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let sep = Util.del_ws_spc\n\n let indent = del \/[ \\t]*\/ \" \"\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/MACs|Match|AcceptEnv|Subsystem|Ciphers|(Kex|HostKey)Algorithms|(Allow|Deny)(Groups|Users)\/i\n\n let comment = Util.comment\n let comment_noindent = Util.comment_noindent\n let empty = Util.empty\n\n let array_entry (kw:regexp) (sq:string) =\n let bare = Quote.do_quote_opt_nil (store \/[^\"' \\t\\n]+\/) in\n let quoted = Quote.do_quote (store \/[^\"'\\n]*[ \\t]+[^\"'\\n]*\/) in\n [ key kw\n . ( [ sep . seq sq . bare ] | [ sep . seq sq . quoted ] )*\n . eol ]\n\n let other_entry =\n let value = store \/[^ \\t\\n]+([ \\t]+[^ \\t\\n]+)*\/ in\n [ key key_re . sep . value . eol ]\n\n let accept_env = array_entry \/AcceptEnv\/i \"AcceptEnv\"\n\n let allow_groups = array_entry \/AllowGroups\/i \"AllowGroups\"\n let allow_users = array_entry \/AllowUsers\/i \"AllowUsers\"\n let deny_groups = array_entry \/DenyGroups\/i \"DenyGroups\"\n let deny_users = array_entry \/DenyUsers\/i \"DenyUsers\"\n\n let subsystemvalue =\n let value = store (\/[^ \\t\\n](.*[^ \\t\\n])?\/) in\n [ key \/[A-Za-z0-9\\-]+\/ . sep . value . eol ]\n\n let subsystem =\n [ key \/Subsystem\/i . sep . subsystemvalue ]\n\n let list (kw:regexp) (sq:string) =\n let value = store \/[^, \\t\\n]+\/ in\n [ key kw . sep .\n [ seq sq . value ] .\n ([ seq sq . Util.del_str \",\" . value])* .\n eol ]\n\n let macs = list \/MACs\/i \"MACs\"\n\n let ciphers = list \/Ciphers\/i \"Ciphers\"\n\n let kexalgorithms = list \/KexAlgorithms\/i \"KexAlgorithms\"\n\n let hostkeyalgorithms = list \/HostKeyAlgorithms\/i \"HostKeyAlgorithms\"\n\n let entry = accept_env | allow_groups | allow_users\n | deny_groups | subsystem | deny_users\n | macs | ciphers | kexalgorithms | hostkeyalgorithms\n | other_entry\n\n let condition_entry =\n let value = store \/[^ \\t\\n]+\/ in\n [ sep . key \/[A-Za-z0-9]+\/ . sep . value ]\n\n let match_cond =\n [ label \"Condition\" . condition_entry+ . eol ]\n\n let match_entry = indent . (entry | comment_noindent)\n | empty\n\n let match =\n [ key \/Match\/i . match_cond\n . [ label \"Settings\" . match_entry+ ]\n ]\n\n let lns = (entry | comment | empty)* . match*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/sshd_config\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"36fa8645b82dab509dcd5c3387937529f2a7ed6d","subject":"Fix test_syslog.aug","message":"Fix test_syslog.aug\n","repos":"pevalme\/augeas,pevalme\/augeas,dafugg\/augeas,mchf\/augeas,dafugg\/augeas,mchf\/augeas,kunkku\/augeas,hercules-team\/augeas,jtopjian\/augeas,manandbytes\/augeas,mlichvar\/augeas,kumy\/augeas,lutter\/augeas,ptoscano\/augeas,kumy\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,jasperla\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,jtopjian\/augeas,jjlin\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,raphink\/augeas,raphink\/augeas,hercules-team\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,kunkku\/augeas,kumy\/augeas,ptoscano\/augeas,mlichvar\/augeas,pevalme\/augeas,jjlin\/augeas,dafugg\/augeas,lutter\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/tests\/test_syslog.aug","new_file":"lenses\/tests\/test_syslog.aug","new_contents":"module Test_syslog =\n\n\tlet conf=\"# $FreeBSD: src\/etc\/syslog.conf,v 1.30.2.1 2009\/08\/03 08:13:06 kensmith Exp $\n# \n\ndaemon.info \/var\/log\/cvsupd.log\nsecurity.*\t\t\t\t\t-\/var\/log\/security\n*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err\t\/var\/log\/messages\nuucp,news.crit \/var\/log\/spooler\n*.emerg\t\t\t\t\t\t*\ndaemon.!info\t\t\t\t\t\/var\/log\/foo\ndaemon.<=info\t\t\t\t\t\/var\/log\/foo\ndaemon.!<=info\t\t\t\t\t\/var\/log\/foo\n*.*\t\t\t\t\t\t@syslog.far.away\n*.*\t\t\t\t\t\t@syslog.far.away:123\n*.*\t\t\t\t\t\tfoo,bar\n*.*\t\t\t\t\t\t|\\\"\/usr\/bin\/soft arg\\\"\n!startslip\n# get that out\n*.*\t\t\t\t\t\t\/var\/log\/slip.log\n!pppd,ppp\n\n*.*\t\t\t\t\t\t\/var\/log\/ppp.log\n!+startslip\n*.*\t\t\t\t\t\t\/var\/log\/slip.log\n!-startslip\n*.*\t\t\t\t\t\t\/var\/log\/slip.log\n#!pppd\n*.*\t\t\t\t\t\t\/var\/log\/ppp.log\n+foo.example.com\ndaemon.info \/var\/log\/cvsupd.log\n+foo.example.com,bar.example.com\ndaemon.info \/var\/log\/cvsupd.log\n#+bar.example.com\ndaemon.info \/var\/log\/cvsupd.log\n-foo.example.com\ndaemon.info \/var\/log\/cvsupd.log\n+*\ndaemon.info \/var\/log\/cvsupd.log\n!*\ndaemon.info \/var\/log\/cvsupd.log\n*.=debug;\\\n auth,authpriv.none;\\\n news.none;mail.none -\/var\/log\/debug\n\"\n\n\ttest Syslog.lns get conf =\n { \"#comment\" = \"$FreeBSD: src\/etc\/syslog.conf,v 1.30.2.1 2009\/08\/03 08:13:06 kensmith Exp $\" }\n\t { }\n\t { }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"security\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"no_sync\" } { \"file\" = \"\/var\/log\/security\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"notice\" } }\n\t { \"selector\" { \"facility\" = \"authpriv\" } { \"level\" = \"none\" } }\n\t { \"selector\" { \"facility\" = \"kern\" } { \"level\" = \"debug\" } }\n\t { \"selector\" { \"facility\" = \"lpr\" } { \"level\" = \"info\" } }\n\t { \"selector\" { \"facility\" = \"mail\" } { \"level\" = \"crit\" } }\n\t { \"selector\" { \"facility\" = \"news\" } { \"level\" = \"err\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/messages\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"uucp\" } { \"facility\" = \"news\" } { \"level\" = \"crit\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/spooler\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"emerg\" } }\n\t { \"action\" { \"user\" = \"*\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"comparison\" = \"!\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/foo\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"comparison\" = \"<=\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/foo\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"comparison\" = \"!<=\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/foo\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"hostname\" = \"syslog.far.away\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"hostname\" = \"syslog.far.away\" } { \"port\" = \"123\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"user\" = \"foo\" } { \"user\" = \"bar\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"program\" = \"\\\"\/usr\/bin\/soft arg\\\"\" } }\n\t }\n\t { \"program\"\n\t { \"program\" = \"startslip\" }\n\t { \"#comment\" = \"get that out\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/slip.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"program\" = \"pppd\" }\n\t { \"program\" = \"ppp\" }\n\t { }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/ppp.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"program\" = \"startslip\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/slip.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"reverse\" }\n\t { \"program\" = \"startslip\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/slip.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"program\" = \"pppd\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/ppp.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"hostname\" = \"foo.example.com\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"hostname\" = \"foo.example.com\" }\n\t { \"hostname\" = \"bar.example.com\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"hostname\" = \"bar.example.com\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"reverse\" }\n\t { \"hostname\" = \"foo.example.com\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"hostname\" = \"*\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"program\" = \"*\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } } }\n { \"entry\"\n { \"selector\" { \"facility\" = \"*\" } { \"comparison\" = \"=\" } { \"level\" = \"debug\" } }\n { \"selector\" { \"facility\" = \"auth\" } { \"facility\" = \"authpriv\" } { \"level\" = \"none\" } }\n { \"selector\" { \"facility\" = \"news\" } { \"level\" = \"none\" } }\n { \"selector\" { \"facility\" = \"mail\" } { \"level\" = \"none\" } }\n\t { \"action\" { \"no_sync\" } { \"file\" = \"\/var\/log\/debug\" } } }\n\t }\n\n\t(* changing file *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t set \"\/entry[1]\/action\/file\" \"\/foo\"\n\t = \"*.* \/foo\\n\"\n\n\t(* removing entry *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry[1]\"\n\t = \"\"\n\n\t(* changing facility and level *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t set \"\/entry[1]\/selector\/facility\" \"daemon\" ;\n\t set \"\/entry[1]\/selector\/level\" \"info\"\n\t = \"daemon.info \/var\\n\"\n\n\t(* insert a facility *)\n\ttest Syslog.lns put \"daemon.* \/var\\n\" after\n\t insa \"facility\" \"\/entry\/selector\/facility\" ;\n\t set \"\/entry\/selector\/facility[2]\" \"mail\"\n\t = \"daemon,mail.* \/var\\n\"\n\n\t(* creating an entry *)\n\ttest Syslog.lns put \"\" after\n\t set \"\/entry\/selector\/facility\" \"daemon\" ;\n\t set \"\/entry\/selector\/level\" \"info\" ;\n\t set \"\/entry\/action\/file\" \"\/var\"\n\t = \"daemon.info\\t\/var\\n\"\n\n\t(* inserting an entry before *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t insb \"entry\" \"\/entry\" ;\n\t set \"\/entry[1]\/selector\/facility\" \"daemon\" ;\n\t set \"\/entry[1]\/selector\/level\" \"info\" ;\n\t set \"\/entry[1]\/action\/file\" \"\/foo\"\n\t = \"daemon.info \/foo\\n*.*\\t\/var\\n\"\n\n\t(* inserting an entry after *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t insa \"entry\" \"\/entry\" ;\n\t set \"\/entry[2]\/selector\/facility\" \"daemon\" ;\n\t set \"\/entry[2]\/selector\/level\" \"info\" ;\n\t set \"\/entry[2]\/action\/file\" \"\/foo\"\n\t = \"*.* \/var\\ndaemon.info\\t\/foo\\n\"\n\n\t(* insert sync on a file *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t insb \"no_sync\" \"\/entry\/action\/file\"\n\t = \"*.* -\/var\\n\"\n\n\t(* changing file to remote host *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry\/action\/file\" ;\n\t set \"\/entry\/action\/hostname\" \"far.far.away\"\n\t = \"*.* @far.far.away\\n\"\n\n\t(* changing file to * *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry\/action\/file\" ;\n\t set \"\/entry\/action\/user\" \"*\"\n\t = \"*.* *\\n\"\n\n\t(* changing file to users *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry\/action\/file\" ;\n\t set \"\/entry\/action\/user[1]\" \"john\" ;\n\t set \"\/entry\/action\/user[2]\" \"paul\" ;\n\t set \"\/entry\/action\/user[3]\" \"george\" ;\n\t set \"\/entry\/action\/user[4]\" \"ringo\"\n\t = \"*.* john,paul,george,ringo\\n\"\n\n\t(* changing file to program *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry\/action\/file\" ;\n\t set \"\/entry\/action\/program\" \"\/usr\/bin\/foo\"\n\t = \"*.* |\/usr\/bin\/foo\\n\"\n\n\t(* inserting a matching program *)\n\ttest Syslog.lns put \"\" after\n\t insa \"program\" \"\/\" ;\n\t set \"\/program\/program\" \"foo\"\n\t = \"!foo\\n\"\n\n\t(* inserting an entry to a matching program *)\n\ttest Syslog.lns put \"!foo\\n\" after\n\t set \"\/program\/entry\/selector\/facility\" \"*\" ;\n\t set \"\/program\/entry\/selector\/level\" \"*\" ;\n\t set \"\/program\/entry\/action\/file\" \"\/foo\"\n\t = \"!foo\\n*.*\\t\/foo\\n\"\n\n\t(* inserting a matching hostname *)\n\ttest Syslog.lns put \"\" after\n\t insa \"hostname\" \"\/\" ;\n\t set \"\/hostname\/hostname\" \"foo.foo.away\"\n\t = \"+foo.foo.away\\n\"\n\n\t(* inserting an entry to a matching hostname *)\n\ttest Syslog.lns put \"+foo.foo.away\\n\" after\n\t set \"\/hostname\/entry\/selector\/facility\" \"*\" ;\n\t set \"\/hostname\/entry\/selector\/level\" \"*\" ;\n\t set \"\/hostname\/entry\/action\/file\" \"\/foo\"\n\t = \"+foo.foo.away\\n*.*\\t\/foo\\n\"\n\n\t(* inserting a reverse matching hostname *)\n\ttest Syslog.lns put \"\" after\n\t insa \"hostname\" \"\/\" ;\n\t set \"\/hostname\/reverse\" \"\" ;\n\t set \"\/hostname\/hostname\" \"foo.foo.away\"\n\t = \"-foo.foo.away\\n\"\n\n (* tokens can contain capital letters *)\n test Syslog.lns get \"LOCAL5.* -\/var\/log\/foo.log\\n\" =\n { \"entry\"\n { \"selector\"\n { \"facility\" = \"LOCAL5\" }\n { \"level\" = \"*\" }\n }\n { \"action\"\n { \"no_sync\" }\n { \"file\" = \"\/var\/log\/foo.log\" }\n }\n }\n\n","old_contents":"module Test_syslog =\n\n\tlet conf=\"# $FreeBSD: src\/etc\/syslog.conf,v 1.30.2.1 2009\/08\/03 08:13:06 kensmith Exp $\n# \n\ndaemon.info \/var\/log\/cvsupd.log\nsecurity.*\t\t\t\t\t-\/var\/log\/security\n*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err\t\/var\/log\/messages\nuucp,news.crit \/var\/log\/spooler\n*.emerg\t\t\t\t\t\t*\ndaemon.!info\t\t\t\t\t\/var\/log\/foo\ndaemon.<=info\t\t\t\t\t\/var\/log\/foo\ndaemon.!<=info\t\t\t\t\t\/var\/log\/foo\n*.*\t\t\t\t\t\t@syslog.far.away\n*.*\t\t\t\t\t\t@syslog.far.away:123\n*.*\t\t\t\t\t\tfoo,bar\n*.*\t\t\t\t\t\t|\\\"\/usr\/bin\/soft arg\\\"\n!startslip\n# get that out\n*.*\t\t\t\t\t\t\/var\/log\/slip.log\n!pppd,ppp\n\n*.*\t\t\t\t\t\t\/var\/log\/ppp.log\n!+startslip\n*.*\t\t\t\t\t\t\/var\/log\/slip.log\n!-startslip\n*.*\t\t\t\t\t\t\/var\/log\/slip.log\n#!pppd\n*.*\t\t\t\t\t\t\/var\/log\/ppp.log\n+foo.example.com\ndaemon.info \/var\/log\/cvsupd.log\n+foo.example.com,bar.example.com\ndaemon.info \/var\/log\/cvsupd.log\n#+bar.example.com\ndaemon.info \/var\/log\/cvsupd.log\n-foo.example.com\ndaemon.info \/var\/log\/cvsupd.log\n+*\ndaemon.info \/var\/log\/cvsupd.log\n!*\ndaemon.info \/var\/log\/cvsupd.log\n*.=debug;\\\n auth,authpriv.none;\\\n news.none;mail.none -\/var\/log\/debug\n\"\n\n\ttest Syslog.lns get conf =\n { \"#comment\" = \"$FreeBSD: src\/etc\/syslog.conf,v 1.30.2.1 2009\/08\/03 08:13:06 kensmith Exp $\" }\n\t { }\n\t { }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"security\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"no_sync\" } { \"file\" = \"\/var\/log\/security\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"notice\" } }\n\t { \"selector\" { \"facility\" = \"authpriv\" } { \"level\" = \"none\" } }\n\t { \"selector\" { \"facility\" = \"kern\" } { \"level\" = \"debug\" } }\n\t { \"selector\" { \"facility\" = \"lpr\" } { \"level\" = \"info\" } }\n\t { \"selector\" { \"facility\" = \"mail\" } { \"level\" = \"crit\" } }\n\t { \"selector\" { \"facility\" = \"news\" } { \"level\" = \"err\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/messages\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"uucp\" } { \"facility\" = \"news\" } { \"level\" = \"crit\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/spooler\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"emerg\" } }\n\t { \"action\" { \"user\" = \"*\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"comparison\" = \"!\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/foo\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"comparison\" = \"<=\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/foo\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"comparison\" = \"!<=\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/foo\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"hostname\" = \"syslog.far.away\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"hostname\" = \"syslog.far.away\" } { \"port\" = \"123\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"user\" = \"foo\" } { \"user\" = \"bar\" } }\n\t }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"program\" = \"\\\"\/usr\/bin\/soft arg\\\"\" } }\n\t }\n\t { \"program\"\n\t { \"program\" = \"startslip\" }\n\t { \"#comment\" = \"get that out\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/slip.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"program\" = \"pppd\" }\n\t { \"program\" = \"ppp\" }\n\t { }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/ppp.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"program\" = \"startslip\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/slip.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"reverse\" }\n\t { \"program\" = \"startslip\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/slip.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"program\" = \"pppd\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"*\" } { \"level\" = \"*\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/ppp.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"hostname\" = \"foo.example.com\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"hostname\" = \"foo.example.com\" }\n\t { \"hostname\" = \"bar.example.com\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"hostname\" = \"bar.example.com\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"reverse\" }\n\t { \"hostname\" = \"foo.example.com\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"hostname\"\n\t { \"hostname\" = \"*\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } }\n\t }\n\t }\n\t { \"program\"\n\t { \"program\" = \"*\" }\n\t { \"entry\"\n\t { \"selector\" { \"facility\" = \"daemon\" } { \"level\" = \"info\" } }\n\t { \"action\" { \"file\" = \"\/var\/log\/cvsupd.log\" } } }\n { \"entry\"\n { \"selector\" { \"facility\" = \"*\" } { \"comparison\" = \"=\" } { \"level\" = \"debug\" } }\n { \"selector\" { \"facility\" = \"auth\" } { \"facility\" = \"authpriv\" } { \"level\" = \"none\" } }\n { \"selector\" { \"facility\" = \"news\" } { \"level\" = \"none\" } }\n { \"selector\" { \"facility\" = \"mail\" } { \"level\" = \"none\" } }\n\t { \"action\" { \"no_sync\" } { \"file\" = \"\/var\/log\/debug\" } } }\n\t }\n\n\t(* changing file *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t set \"\/entry[1]\/action\/file\" \"\/foo\"\n\t = \"*.* \/foo\\n\"\n\n\t(* removing entry *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry[1]\"\n\t = \"\"\n\n\t(* changing facility and level *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t set \"\/entry[1]\/selector\/facility\" \"daemon\" ;\n\t set \"\/entry[1]\/selector\/level\" \"info\"\n\t = \"daemon.info \/var\\n\"\n\n\t(* insert a facility *)\n\ttest Syslog.lns put \"daemon.* \/var\\n\" after\n\t insa \"facility\" \"\/entry\/selector\/facility\" ;\n\t set \"\/entry\/selector\/facility[2]\" \"mail\"\n\t = \"daemon,mail.* \/var\\n\"\n\n\t(* creating an entry *)\n\ttest Syslog.lns put \"\" after\n\t set \"\/entry\/selector\/facility\" \"daemon\" ;\n\t set \"\/entry\/selector\/level\" \"info\" ;\n\t set \"\/entry\/action\/file\" \"\/var\"\n\t = \"daemon.info\\t\/var\\n\"\n\n\t(* inserting an entry before *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t insb \"entry\" \"\/entry\" ;\n\t set \"\/entry[1]\/selector\/facility\" \"daemon\" ;\n\t set \"\/entry[1]\/selector\/level\" \"info\" ;\n\t set \"\/entry[1]\/action\/file\" \"\/foo\"\n\t = \"daemon.info \/foo\\n*.*\\t\/var\\n\"\n\n\t(* inserting an entry after *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t insa \"entry\" \"\/entry\" ;\n\t set \"\/entry[2]\/selector\/facility\" \"daemon\" ;\n\t set \"\/entry[2]\/selector\/level\" \"info\" ;\n\t set \"\/entry[2]\/action\/file\" \"\/foo\"\n\t = \"*.* \/var\\ndaemon.info\\t\/foo\\n\"\n\n\t(* insert sync on a file *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t insb \"no_sync\" \"\/entry\/action\/file\"\n\t = \"*.* -\/var\\n\"\n\n\t(* changing file to remote host *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry\/action\/file\" ;\n\t set \"\/entry\/action\/hostname\" \"far.far.away\"\n\t = \"*.* @far.far.away\\n\"\n\n\t(* changing file to * *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry\/action\/file\" ;\n\t set \"\/entry\/action\/user\" \"*\"\n\t = \"*.* *\\n\"\n\n\t(* changing file to users *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry\/action\/file\" ;\n\t set \"\/entry\/action\/user[1]\" \"john\" ;\n\t set \"\/entry\/action\/user[2]\" \"paul\" ;\n\t set \"\/entry\/action\/user[3]\" \"george\" ;\n\t set \"\/entry\/action\/user[4]\" \"ringo\"\n\t = \"*.* john,paul,george,ringo\\n\"\n\n\t(* changing file to program *)\n\ttest Syslog.lns put \"*.* \/var\\n\" after\n\t rm \"\/entry\/action\/file\" ;\n\t set \"\/entry\/action\/program\" \"\/usr\/bin\/foo\"\n\t = \"*.* |\/usr\/bin\/foo\\n\"\n\n\t(* inserting a matching program *)\n\ttest Syslog.lns put \"\" after\n\t insa \"program\" \"\/\" ;\n\t set \"\/program\/program\" \"foo\"\n\t = \"!foo\\n\"\n\n\t(* inserting an entry to a matching program *)\n\ttest Syslog.lns put \"!foo\\n\" after\n\t set \"\/program\/entry\/selector\/facility\" \"*\" ;\n\t set \"\/program\/entry\/selector\/level\" \"*\" ;\n\t set \"\/program\/entry\/action\/file\" \"\/foo\"\n\t = \"!foo\\n*.*\\t\/foo\\n\"\n\n\t(* inserting a matching hostname *)\n\ttest Syslog.lns put \"\" after\n\t insa \"hostname\" \"\/\" ;\n\t set \"\/hostname\/hostname\" \"foo.foo.away\"\n\t = \"+foo.foo.away\\n\"\n\n\t(* inserting an entry to a matching hostname *)\n\ttest Syslog.lns put \"+foo.foo.away\\n\" after\n\t set \"\/hostname\/entry\/selector\/facility\" \"*\" ;\n\t set \"\/hostname\/entry\/selector\/level\" \"*\" ;\n\t set \"\/hostname\/entry\/action\/file\" \"\/foo\"\n\t = \"+foo.foo.away\\n*.*\\t\/foo\\n\"\n\n\t(* inserting a reverse matching hostname *)\n\ttest Syslog.lns put \"\" after\n\t insa \"hostname\" \"\/\" ;\n\t set \"\/hostname\/reverse\" \"\" ;\n\t set \"\/hostname\/hostname\" \"foo.foo.away\"\n\t = \"-foo.foo.away\\n\"\n\n (* tokens can contain capital letters *)\n test Syslog.lns get \"LOCAL5.* -\/var\/log\/foo.log\\n\" = ?\n { \"entry\"\n { \"selector\"\n { \"facility\" = \"LOCAL5\" }\n { \"level\" = \"*\" }\n }\n { \"action\"\n { \"no_sync\" }\n { \"file\" = \"\/var\/log\/foo.log\" }\n }\n }\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8b77eb21f77972479c7fa2a2fe717b91f3ad9d8f","subject":"Modified yum spec that seems to work","message":"Modified yum spec that seems to work\n","repos":"pevalme\/augeas,kumy\/augeas,kumy\/augeas,MikaelSmith\/augeas,bkearney\/augeas,mlichvar\/augeas,domcleal\/augeas,pevalme\/augeas,ptoscano\/augeas,mchf\/augeas,lutter\/augeas,hercules-team\/augeas,jjlin\/augeas,dafugg\/augeas,kunkku\/augeas,jjlin\/augeas,hercules-team\/augeas,jasperla\/augeas,mlichvar\/augeas,camptocamp\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,bkearney\/augeas,lutter\/augeas,domcleal\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,kunkku\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,kumy\/augeas,ptoscano\/augeas,kunkku\/augeas,raphink\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,domcleal\/augeas,mchf\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,camptocamp\/augeas,raphink\/augeas,jasperla\/augeas,bkearney\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,bkearney\/augeas,jtopjian\/augeas","old_file":"spec\/yum.aug","new_file":"spec\/yum.aug","new_contents":"# Parsing inistyle files\n\nmap\n grammar yum\n include '\/etc\/yum.conf' '\/system\/config\/yum'\nend\n\ngrammar yum\n\n token EOL \/\\n\/ = '\\n'\n token INDENT \/[ \\t]+\/ = '\\t'\n token EQ \/\\s*=\\s*\/ = '='\n token COMMENT \/[ \\t]*(#|REM|rem).*\\n\/ = '# \\n'\n\n file: ( comment | section ) *\n\n comment: [ COMMENT ]\n\n section: [ \n '[' . key ... . ']' . EOL .\n ( comment | kv ) *\n ]\n\n kv: [ key ... . EQ . store ... . EOL ]\n\nend\n","old_contents":"# Parsing inistyle files\n\n#map\n# grammar yum\n# include '\/etc\/yum.conf' '\/system\/config\/yum'\n#end\n\ngrammar yum\n token EOL \/\\n\/ = '\\n'\n\n token INDENT \/[ \\t]+\/ = '\\t'\n\n token EQ \/\\s*=\\s*\/ = '='\n\n token OPT_WS \/[ \\t]*\/ = ''\n\n file: ( comment | section ) *\n\n comment: OPT_WS . ( \/#.*\/ | 'REM' | 'rem' )? . EOL\n\n section: [ \n '[' . key ... . ']' . EOL .\n ( comment | kv ) *\n ]\n\n kv: [ key ... . EQ . store ... . EOL ]\n\nend\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a73dfac68a9b749a3a5adf63658611b75a87a748","subject":"Fix example in lens","message":"Fix example in lens\n","repos":"hercules-team\/augeas-do-not-use,kunkku\/augeas,dafugg\/augeas,kumy\/augeas,jasperla\/augeas,mchf\/augeas,hercules-team\/augeas,jasperla\/augeas,lutter\/augeas,mlichvar\/augeas,pevalme\/augeas,ptoscano\/augeas,jjlin\/augeas,dafugg\/augeas,domcleal\/augeas,mlichvar\/augeas,kunkku\/augeas,raphink\/augeas,mchf\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,pevalme\/augeas,domcleal\/augeas,ptoscano\/augeas,lutter\/augeas,jtopjian\/augeas,kumy\/augeas,jtopjian\/augeas,pevalme\/augeas,kumy\/augeas,MikaelSmith\/augeas,lutter\/augeas,raphink\/augeas,domcleal\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,manandbytes\/augeas,kunkku\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas","old_file":"lenses\/cron.aug","new_file":"lenses\/cron.aug","new_contents":"(*\nModule: Cron\n Parses \/etc\/cron.d\/*, \/etc\/crontab\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 crontab` where\n possible.\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the entry that launches '\/usr\/bin\/ls'\n > match '\/files\/etc\/crontab\/entry[. = \"\/usr\/bin\/ls\"]'\n\nAbout: Configuration files\n This lens applies to \/etc\/cron.d\/* and \/etc\/crontab. See <filter>.\n*)\n\nmodule Cron =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: num *)\nlet num = \/[0-9\\*][0-9\\\/,-\\*]*\/\n\n(* Variable: alpha *)\nlet alpha = \/[A-Za-z]{3}\/\n\n(* Variable: alphanum *)\nlet alphanum = num | alpha\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_eq *)\nlet sep_eq = Util.del_str \"=\"\n\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = Shellvars.key_re - \"entry\" in\n [ key key_re . sep_eq . Shellvars.simple_value . eol ]\n\n\n(* View: minute *)\nlet minute = [ label \"minute\" . store num ]\n\n(* View: hour *)\nlet hour = [ label \"hour\" . store num ]\n\n(* View: dayofmonth *)\nlet dayofmonth = [ label \"dayofmonth\" . store num ]\n\n(* View: month *)\nlet month = [ label \"month\" . store alphanum ]\n\n(* View: dayofweek *)\nlet dayofweek = [ label \"dayofweek\" . store alphanum ]\n\n\n(* View: user *)\nlet user = [ label \"user\" . store Rx.word ]\n\n\n(************************************************************************\n * View: time\n * Time in the format \"minute hour dayofmonth month dayofweek\"\n *************************************************************************)\nlet time = [ label \"time\" .\n minute . sep_spc . hour . sep_spc . dayofmonth\n . sep_spc . month . sep_spc . dayofweek ]\n\n(* Variable: the valid values for schedules *)\nlet schedule_re = \"reboot\" | \"yearly\" | \"annually\" | \"monthly\"\n | \"weekly\" | \"daily\" | \"midnight\" | \"hourly\"\n\n(************************************************************************\n * View: schedule\n * Time in the format \"@keyword\"\n *************************************************************************)\nlet schedule = [ label \"schedule\" . Util.del_str \"@\"\n . store schedule_re ]\n\n\n(************************************************************************\n * View: entry\n * A crontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . indent\n . ( time | schedule )\n . sep_spc . user\n . sep_spc . store Rx.space_in . eol ]\n\n\n(*\n * View: lns\n * The cron lens\n *)\nlet lns = ( empty | comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/cron.d\/*\" .\n incl \"\/etc\/crontab\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Cron\n Parses \/etc\/cron.d\/*, \/etc\/crontab\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 crontab` where\n possible.\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Configuration files\n This lens applies to \/etc\/cron.d\/* and \/etc\/crontab. See <filter>.\n*)\n\nmodule Cron =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: num *)\nlet num = \/[0-9\\*][0-9\\\/,-\\*]*\/\n\n(* Variable: alpha *)\nlet alpha = \/[A-Za-z]{3}\/\n\n(* Variable: alphanum *)\nlet alphanum = num | alpha\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_eq *)\nlet sep_eq = Util.del_str \"=\"\n\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = Shellvars.key_re - \"entry\" in\n [ key key_re . sep_eq . Shellvars.simple_value . eol ]\n\n\n(* View: minute *)\nlet minute = [ label \"minute\" . store num ]\n\n(* View: hour *)\nlet hour = [ label \"hour\" . store num ]\n\n(* View: dayofmonth *)\nlet dayofmonth = [ label \"dayofmonth\" . store num ]\n\n(* View: month *)\nlet month = [ label \"month\" . store alphanum ]\n\n(* View: dayofweek *)\nlet dayofweek = [ label \"dayofweek\" . store alphanum ]\n\n\n(* View: user *)\nlet user = [ label \"user\" . store Rx.word ]\n\n\n(************************************************************************\n * View: time\n * Time in the format \"minute hour dayofmonth month dayofweek\"\n *************************************************************************)\nlet time = [ label \"time\" .\n minute . sep_spc . hour . sep_spc . dayofmonth\n . sep_spc . month . sep_spc . dayofweek ]\n\n(* Variable: the valid values for schedules *)\nlet schedule_re = \"reboot\" | \"yearly\" | \"annually\" | \"monthly\"\n | \"weekly\" | \"daily\" | \"midnight\" | \"hourly\"\n\n(************************************************************************\n * View: schedule\n * Time in the format \"@keyword\"\n *************************************************************************)\nlet schedule = [ label \"schedule\" . Util.del_str \"@\"\n . store schedule_re ]\n\n\n(************************************************************************\n * View: entry\n * A crontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . indent\n . ( time | schedule )\n . sep_spc . user\n . sep_spc . store Rx.space_in . eol ]\n\n\n(*\n * View: lns\n * The cron lens\n *)\nlet lns = ( empty | comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/cron.d\/*\" .\n incl \"\/etc\/crontab\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3d886ff7aefa1056e8addb29f79793b88c271ae3","subject":"Add ocsinventory-agent.cfg to SimpleVars (#637)","message":"Add ocsinventory-agent.cfg to SimpleVars (#637)\n\n","repos":"mlichvar\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas","old_file":"lenses\/simplevars.aug","new_file":"lenses\/simplevars.aug","new_contents":"(*\nModule: Simplevars\n Parses simple key = value conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Simplevars> file contains various examples and tests.\n*)\n\nmodule Simplevars =\n\nautoload xfm\n\n(* Variable: to_comment_re\n The regexp to match the value *)\nlet to_comment_re =\n let to_comment_squote = \/'[^\\n']*'\/\n in let to_comment_dquote = \/\"[^\\n\"]*\"\/\n in let to_comment_noquote = \/[^\\n \\t'\"#][^\\n#]*[^\\n \\t#]|[^\\n \\t'\"#]\/\n in to_comment_squote | to_comment_dquote | to_comment_noquote\n\n(* View: entry *)\nlet entry =\n let some_value = Sep.space_equal . store to_comment_re\n (* Avoid ambiguity in tree by making a subtree here *)\n in let empty_value = [del \/[ \\t]*=\/ \"=\"] . store \"\"\n in [ Util.indent . key Rx.word\n . (some_value? | empty_value)\n . (Util.eol | Util.comment_eol) ]\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/kernel-img.conf\"\n . incl \"\/etc\/kerneloops.conf\"\n . incl \"\/etc\/wgetrc\"\n . incl \"\/etc\/zabbix\/*.conf\"\n . incl \"\/etc\/audit\/auditd.conf\"\n . incl \"\/etc\/mixerctl.conf\"\n . incl \"\/etc\/wsconsctlctl.conf\"\n . incl \"\/etc\/ocsinventory\/ocsinventory-agent.cfg\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Simplevars\n Parses simple key = value conffiles\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Simplevars> file contains various examples and tests.\n*)\n\nmodule Simplevars =\n\nautoload xfm\n\n(* Variable: to_comment_re\n The regexp to match the value *)\nlet to_comment_re =\n let to_comment_squote = \/'[^\\n']*'\/\n in let to_comment_dquote = \/\"[^\\n\"]*\"\/\n in let to_comment_noquote = \/[^\\n \\t'\"#][^\\n#]*[^\\n \\t#]|[^\\n \\t'\"#]\/\n in to_comment_squote | to_comment_dquote | to_comment_noquote\n\n(* View: entry *)\nlet entry =\n let some_value = Sep.space_equal . store to_comment_re\n (* Avoid ambiguity in tree by making a subtree here *)\n in let empty_value = [del \/[ \\t]*=\/ \"=\"] . store \"\"\n in [ Util.indent . key Rx.word\n . (some_value? | empty_value)\n . (Util.eol | Util.comment_eol) ]\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/kernel-img.conf\"\n . incl \"\/etc\/kerneloops.conf\"\n . incl \"\/etc\/wgetrc\"\n . incl \"\/etc\/zabbix\/*.conf\"\n . incl \"\/etc\/audit\/auditd.conf\"\n . incl \"\/etc\/mixerctl.conf\"\n . incl \"\/etc\/wsconsctlctl.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"dcd7c3cff91a5884613b64ac3985c3df52b0ed8e","subject":"Add Util.doseol","message":"Add Util.doseol\n","repos":"hercules-team\/augeas,mchf\/augeas,jtopjian\/augeas,ptoscano\/augeas,mchf\/augeas,MikaelSmith\/augeas,dafugg\/augeas,mlichvar\/augeas,raphink\/augeas,kumy\/augeas,jjlin\/augeas,manandbytes\/augeas,kunkku\/augeas,kumy\/augeas,lutter\/augeas,mlichvar\/augeas,jasperla\/augeas,kumy\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,ptoscano\/augeas,kunkku\/augeas,domcleal\/augeas,jjlin\/augeas,lutter\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,pevalme\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,raphink\/augeas,jasperla\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,kumy\/augeas,dafugg\/augeas,dafugg\/augeas,mlichvar\/augeas,jjlin\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\r?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\n]*\\*\\\/[ \\t]*\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"664167e588e54669786f02e1e1bb25cbedb7b411","subject":"PHPFPM Support","message":"PHPFPM Support","repos":"pevalme\/augeas,raphink\/augeas,jtopjian\/augeas,pevalme\/augeas,mchf\/augeas,mchf\/augeas,dafugg\/augeas,dafugg\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,kumy\/augeas,kumy\/augeas,jjlin\/augeas,jjlin\/augeas,pevalme\/augeas,manandbytes\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas,lutter\/augeas,manandbytes\/augeas,dafugg\/augeas,jtopjian\/augeas,lutter\/augeas,jjlin\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,jasperla\/augeas,ptoscano\/augeas,raphink\/augeas,ptoscano\/augeas,kumy\/augeas,kunkku\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.indented_entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n (* PHPFPM Support *)\n . (incl \"\/etc\/php*\/fpm\/pool.d\/*.conf\")\n (* Zend Community edition *)\n . (incl \"\/usr\/local\/zend\/etc\/php.ini\")\n . (incl \"\/usr\/local\/zend\/etc\/conf.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.indented_entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n (* Zend Community edition *)\n . (incl \"\/usr\/local\/zend\/etc\/php.ini\")\n . (incl \"\/usr\/local\/zend\/etc\/conf.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c1a41cf88383ebd6703a4e46d75c90f422759fee","subject":"augeas: remove support for #comments","message":"augeas: remove support for #comments\n\nwe don't use them in the scenarios anyway\n","repos":"CZ-NIC\/deckard,CZ-NIC\/deckard","old_file":"pydnstest\/deckard.aug","new_file":"pydnstest\/deckard.aug","new_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/; ]+\/\n\nlet comment = del \/[;]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;][^\\n]*)?\\n)*\/ \"\\n\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/; ]+(\\.[^.\\t\\n\\\/; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9;\\n \\t][^\\t\\n\\\/; ]*\/) - class_re) ]\n(* RFC 3597 section 5 rdata syntax is \"\\# 1 ab\"*)\nlet data_re = \/((\\\\#[ \\t])?[^ \\t\\n;][^\\n;]*[^ \\t\\n;])|[^ \\t\\n;]\/ (*Can not start nor end with whitespace but can have whitespace in the middle. Disjunction is there so we match strings of length one.*)\nlet data = [label \"data\" . store data_re ]\n\nlet ip_re = \/[0-9a-f.:]+\/\nlet hex_re = \/[0-9a-fA-F]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\" | \"BADSIG\" | \"BADKEY\" | \"BADTIME\" | \"BADMODE\" | \"BADNAME\" | \"BADALG\" | \"BADTRUNC\" | \"BADCOOKIE\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = [label \"record\" . domain . tab . (class . tab)? . type . comment_or_eol ]\nlet record = [label \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = [label \"section\" . section_question? . section_answer? . section_authority? . section_additional?]\n\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store hex_re ] . comment_or_eol\n\n(* This is quite dirty hack to match every combination of options given to entry since 'let normal = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)\n\nlet normal = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . ( normal | raw ) . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . space . store data_re . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\n(*let filter = incl \"\/home\/test\/*.rpl\"*)\nlet filter = incl \"\/home\/sbalazik\/nic\/deckard\/git\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","old_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/#; ]+\/\n\nlet comment = del \/[;#]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;#][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;#][^\\n]*)?\\n)*\/ \"\\n\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/#; ]+(\\.[^.\\t\\n\\\/#; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9#;\\n \\t][^\\t\\n\\\/#; ]*\/) - class_re) ]\n(* RFC 3597 section 5 rdata syntax is \"\\# 1 ab\"*)\nlet data_re = \/((\\\\\\#[ \\t])?[^ \\t\\n#;][^\\n#;]*[^ \\t\\n#;])|[^ \\t\\n#;]\/ (*Can not start nor end with whitespace but can have whitespace in the middle. Disjunction is there so we match strings of length one.*)\nlet data = [label \"data\" . store data_re ]\n\nlet ip_re = \/[0-9a-f.:]+\/\nlet hex_re = \/[0-9a-fA-F]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\" | \"BADSIG\" | \"BADKEY\" | \"BADTIME\" | \"BADMODE\" | \"BADNAME\" | \"BADALG\" | \"BADTRUNC\" | \"BADCOOKIE\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = [label \"record\" . domain . tab . (class . tab)? . type . comment_or_eol ]\nlet record = [label \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = [label \"section\" . section_question? . section_answer? . section_authority? . section_additional?]\n\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store hex_re ] . comment_or_eol\n\n(* This is quite dirty hack to match every combination of options given to entry since 'let normal = ((match | adjust | reply | mandatory | tsig)* . sections)' just is not possible *)\n\nlet normal = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?)? . (mandatory | tsig)* . sections\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . ( normal | raw ) . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . space . store data_re . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\n(*let filter = incl \"\/home\/test\/*.rpl\"*)\nlet filter = incl \"\/media\/test\/27159fa1-67d4-4162-8707-cd67900f3b36\/stepan\/nic\/deckard_stable\/deckard\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Augeas"} {"commit":"091021c75a81a97149bb3e6eb9e3ffd187b7ff9c","subject":"Fstab: map comments and support empty lines","message":"Fstab: map comments and support empty lines\n","repos":"camptocamp\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,mlichvar\/augeas,kunkku\/augeas,dafugg\/augeas,pevalme\/augeas,pevalme\/augeas,jjlin\/augeas,mlichvar\/augeas,manandbytes\/augeas,ptoscano\/augeas,bkearney\/augeas,domcleal\/augeas,domcleal\/augeas,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,bkearney\/augeas,ptoscano\/augeas,hercules-team\/augeas,raphink\/augeas,kumy\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,pevalme\/augeas,jjlin\/augeas,jtopjian\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,lutter\/augeas,dafugg\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,mchf\/augeas,jasperla\/augeas,jasperla\/augeas,jjlin\/augeas,domcleal\/augeas,kunkku\/augeas,raphink\/augeas,hercules-team\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,kunkku\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,lutter\/augeas,bkearney\/augeas,lutter\/augeas,camptocamp\/augeas","old_file":"lenses\/fstab.aug","new_file":"lenses\/fstab.aug","new_contents":"(* Parsing \/etc\/fstab *)\n\nmodule Fstab =\n autoload xfm\n\n let sep_tab = Util.del_ws_tab\n let sep_spc = Util.del_ws_spc\n let comma = Util.del_str \",\"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let comment = Util.comment\n let empty = Util.empty \n\n let word = \/[^,# \\n\\t]+\/\n let comma_sep_list (l:string) =\n [ label l . store word ] . ([comma . label l . store word])*\n let record = [ seq \"mntent\" . \n [ label \"spec\" . store word ] . sep_tab .\n [ label \"file\" . store word ] . sep_tab .\n comma_sep_list \"vfstype\" . sep_tab .\n comma_sep_list \"opt\" .\n (sep_tab . [ label \"dump\" . store \/[0-9]+\/ ] .\n ( sep_spc . [ label \"passno\" . store \/[0-9]+\/ ])? )?\n . eol ]\n\n let lns = ( empty | comment | record ) *\n\n let xfm = transform lns (incl \"\/etc\/fstab\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n\n\n","old_contents":"(* Parsing \/etc\/fstab *)\n\nmodule Fstab =\n autoload xfm\n\n let sep_tab = Util.del_ws_tab\n let sep_spc = Util.del_ws_spc\n let comma = Util.del_str \",\"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let comment = [ del \/#.*\\n\/ \"# \" ]\n let word = \/[^,# \\n\\t]+\/\n let comma_sep_list (l:string) =\n [ label l . store word ] . ([comma . label l . store word])*\n let record = [ seq \"mntent\" . \n [ label \"spec\" . store word ] . sep_tab .\n [ label \"file\" . store word ] . sep_tab .\n comma_sep_list \"vfstype\" . sep_tab .\n comma_sep_list \"opt\" .\n (sep_tab . [ label \"dump\" . store \/[0-9]+\/ ] .\n ( sep_spc . [ label \"passno\" . store \/[0-9]+\/ ])? )?\n . eol ]\n\n let lns = ( comment | record ) *\n\n let xfm = transform lns (incl \"\/etc\/fstab\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"99d5a38861d4ad585d7883b80d634ac0642e10dd","subject":"Json: fix handling of whitespace","message":"Json: fix handling of whitespace\n\nWe just gobble up whitespace after various expressions as part of the lens\nprocessing that expression.\n","repos":"jtopjian\/augeas,lutter\/augeas,kumy\/augeas,GeoffWilliams\/augeas,lutter\/augeas,domcleal\/augeas,jtopjian\/augeas,ptoscano\/augeas,jasperla\/augeas,domcleal\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,pevalme\/augeas,jjlin\/augeas,manandbytes\/augeas,hercules-team\/augeas,kumy\/augeas,kunkku\/augeas,domcleal\/augeas,hercules-team\/augeas,jjlin\/augeas,kunkku\/augeas,jasperla\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,ptoscano\/augeas,lutter\/augeas,raphink\/augeas,mlichvar\/augeas,pevalme\/augeas,dafugg\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,mchf\/augeas,dafugg\/augeas,MikaelSmith\/augeas,kumy\/augeas,mlichvar\/augeas,manandbytes\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,kumy\/augeas","old_file":"lenses\/json.aug","new_file":"lenses\/json.aug","new_contents":"module Json =\n\n(* A generic lens for Json files *)\n(* Based on the following grammar from http:\/\/www.json.org\/ *)\n(* Object ::= '{'Members ? '}' *)\n(* Members ::= Pair+ *)\n(* Pair ::= String ':' Value *)\n(* Array ::= '[' Elements ']' *)\n(* Elements ::= Value ( \",\" Value )* *)\n(* Value ::= String | Number | Object | Array | \"true\" | \"false\" | \"null\" *)\n(* String ::= \"\\\"\" Char* \"\\\"\" *)\n(* Number ::= \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ *)\n\nlet spc = \/[ \\t\\n]*\/\n\nlet ws = del spc \"\"\nlet eol = del spc \"\\n\"\nlet delim (c:string) (d:string) = del (c . spc) d\nlet dels (s:string) = del s s\n\nlet comma = delim \",\" \",\"\nlet colon = delim \":\" \":\"\nlet lbrace = delim \"{\" \"{\"\nlet rbrace = delim \"}\" \"}\"\nlet lbrack = delim \"[\" \"[\"\nlet rbrack = delim \"]\" \"]\"\n\nlet str_store =\n let q = del \"\\\"\" \"\\\"\" in\n q . store \/[^\"]*\/ . q . ws (* \" Emacs, relax *)\n\nlet number = [ label \"number\" . store \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ ]\nlet str = [ label \"string\" . str_store ]\n\nlet const (r:regexp) = [ label \"const\" . store r . ws ]\n\nlet value0 = str | number | const \/true|false|null\/\n\nlet fix_value (value:lens) =\n let array = [ label \"array\" . lbrack . Build.opt_list value comma . rbrack ] in\n let pair = [ label \"entry\" . str_store . colon . value ] in\n let obj = [ label \"dict\" . lbrace . Build.opt_list pair comma . rbrace ] in\n (str | number | obj | array | const \/true|false|null\/)\n\n(* Typecheck finitely deep nesting *)\nlet value1 = fix_value value0\nlet value2 = fix_value value1\n\n(* Process arbitrarily deeply nested JSON objects *)\nlet rec rlns = fix_value rlns\n\nlet lns = ws . rlns\n","old_contents":"module Json =\n\n(* A generic lens for Json files *)\n(* Based on the following grammar from http:\/\/www.json.org\/ *)\n(* Object ::= '{'Members ? '}' *)\n(* Members ::= Pair+ *)\n(* Pair ::= String ':' Value *)\n(* Array ::= '[' Elements ']' *)\n(* Elements ::= Value ( \",\" Value )* *)\n(* Value ::= String | Number | Object | Array | \"true\" | \"false\" | \"null\" *)\n(* String ::= \"\\\"\" Char* \"\\\"\" *)\n(* Number ::= \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ *)\n\nlet spc = \/[ \\t\\n]*\/\n\nlet ws = del spc \"\"\nlet eol = del spc \"\\n\"\nlet delim (c:string) (d:string) = del (spc . c . spc) d\nlet dels (s:string) = del s s\n\nlet comma = delim \",\" \", \"\nlet colon = delim \":\" \": \"\nlet lbrace = delim \"{\" \"{ \"\nlet rbrace = delim \"}\" \"} \"\nlet lbrack = delim \"[\" \"[ \"\nlet rbrack = delim \"]\" \" ]\"\n\nlet str_store =\n let q = del \"\\\"\" \"\\\"\" in\n q . store \/[^\"]*\/ . q (* \" Emacs, relax *)\n\nlet number = [ label \"number\" . store \/-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\/ ]\nlet str = [ label \"string\" . str_store ]\n\nlet const (r:regexp) = [ label \"const\" . store r ]\n\nlet value0 = str | number | const \/true|false|null\/\n\nlet fix_value (value:lens) =\n let array = [ label \"array\" . lbrack . Build.opt_list value comma . rbrack ] in\n let pair = [ label \"entry\" . str_store . colon . value ] in\n let obj = [ label \"dict\" . lbrace . Build.opt_list pair comma . rbrace ] in\n str | number | obj | array | const \/true|false|null\/\n\n(* Do shallow typechecks *)\nlet value1 = fix_value value0\n(* FIXME: We are very sloppy with whitespace\nlet value2 = fix_value value1\n*)\n\n(* Construct the real lens *)\nlet rec lns = fix_value lns\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3729a7c605d48203af45dfdd9a70ddc3243dd555","subject":"Shellvars: add locale.conf, vconsole.conf systemd configs","message":"Shellvars: add locale.conf, vconsole.conf systemd configs\n\nFixes BZ#881841\n","repos":"jjlin\/augeas,lutter\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,mchf\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,raphink\/augeas,manandbytes\/augeas,mlichvar\/augeas,kunkku\/augeas,dafugg\/augeas,kumy\/augeas,jjlin\/augeas,mlichvar\/augeas,kunkku\/augeas,kumy\/augeas,lutter\/augeas,jtopjian\/augeas,ptoscano\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,mchf\/augeas,kumy\/augeas,GeoffWilliams\/augeas,lutter\/augeas,hercules-team\/augeas,ptoscano\/augeas,mlichvar\/augeas,pevalme\/augeas,jtopjian\/augeas,pevalme\/augeas,kunkku\/augeas,manandbytes\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jjlin\/augeas,hercules-team\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"19b833982c9d7d7745ac3be47aaa3591abb032be","subject":"Removed trailing space in token in slapd.lens","message":"Removed trailing space in token in slapd.lens\n","repos":"kunkku\/augeas,manandbytes\/augeas,mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,lutter\/augeas,pevalme\/augeas,mlichvar\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas,manandbytes\/augeas,ptoscano\/augeas,hercules-team\/augeas,pevalme\/augeas,mchf\/augeas,mchf\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas","old_file":"lenses\/slapd.aug","new_file":"lenses\/slapd.aug","new_contents":"(* Slapd module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man slapd.conf(5), man slapd.access (5)\n\n*)\n\nmodule Slapd =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet sep = del \/[ \\t\\n]+\/ \" \"\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet sto_to_spc = store \/[^\\\\# \\t\\n]+\/\n\nlet comment = Util.comment\nlet empty = Util.empty\n\n(************************************************************************\n * ACCESS TO\n *************************************************************************)\n\nlet access_re = \"access to\"\nlet control_re = \"stop\" | \"continue\" | \"break\"\nlet what = [ spc . label \"access\"\n . store (\/[^\\\\# \\t\\n]+\/ - (\"by\" | control_re)) ]\n\n(* TODO: parse the control field, see man slapd.access (5) *)\nlet control = [ spc . label \"control\" . store control_re ]\nlet by = [ sep . key \"by\" . spc . sto_to_spc\n . what? . control? ]\n\nlet access = [ key access_re . spc. sto_to_spc . by+ . eol ]\n\n(************************************************************************\n * GLOBAL\n *************************************************************************)\n\n(* TODO: parse special field separately, see man slapd.conf (5) *)\nlet global_re = \"allow\"\n | \"argsfile\"\n | \"attributeoptions\"\n | \"attributetype\"\n | \"authz-policy\"\n | \"ldap\"\n | \"dn\"\n | \"concurrency\"\n | \"cron_max_pending\"\n | \"conn_max_pending_auth\"\n | \"defaultsearchbase\"\n | \"disallow\"\n | \"ditcontentrule\"\n | \"gentlehup\"\n | \"idletimeout\"\n | \"include\"\n | \"index_substr_if_minlen\"\n | \"index_substr_if_maxlen\"\n | \"index_substr_any_len\"\n | \"index_substr_any_step\"\n | \"localSSF\"\n | \"loglevel\"\n | \"moduleload\"\n | \"modulepath\"\n | \"objectclass\"\n | \"objectidentifier\"\n | \"password-hash\"\n | \"password-crypt-salt-format\"\n | \"pidfile\"\n | \"referral\"\n | \"replica-argsfile\"\n | \"replica-pidfile\"\n | \"replicationinterval\"\n | \"require\"\n | \"reverse-lookup\"\n | \"rootDSE\"\n | \"sasl-host\"\n | \"sasl-realm\"\n | \"sasl-secprops\"\n | \"schemadn\"\n | \"security\"\n | \"sizelimit\"\n | \"sockbuf_max_incoming \"\n | \"sockbuf_max_incoming_auth\"\n | \"threads\"\n | \"timelimit time\"\n | \"tool-threads\"\n | \"TLSCipherSuite\"\n | \"TLSCACertificateFile\"\n | \"TLSCACertificatePath\"\n | \"TLSCertificateFile\"\n | \"TLSCertificateKeyFile\"\n | \"TLSDHParamFile\"\n | \"TLSRandFile\"\n | \"TLSVerifyClient\"\n | \"TLSCRLCheck\"\n | \"backend\"\n\nlet global = Build.key_ws_value global_re\n\n(************************************************************************\n * DATABASE\n *************************************************************************)\n\n(* TODO: support all types of database backend *)\nlet database_hdb = \"cachesize\"\n | \"cachefree\"\n | \"checkpoint\"\n | \"dbconfig\"\n | \"dbnosync\"\n | \"directory\"\n | \"dirtyread\"\n | \"idlcachesize\"\n | \"index\"\n | \"linearindex\"\n | \"lockdetect\"\n | \"mode\"\n | \"searchstack\"\n | \"shm_key\"\n\nlet database_re = \"suffix\"\n | \"lastmod\"\n | \"limits\"\n | \"maxderefdepth\"\n | \"overlay\"\n | \"readonly\"\n | \"replica uri\"\n | \"replogfile\"\n | \"restrict\"\n | \"rootdn\"\n | \"rootpw\"\n | \"subordinate\"\n | \"syncrepl rid\"\n | \"updatedn\"\n | \"updateref\"\n | database_hdb\n\nlet database_entry =\n let val = Quote.double_opt\n in Build.key_value_line database_re Sep.space val\n\nlet database = [ key \"database\"\n . spc\n . sto_to_eol\n . eol\n . (comment|empty|database_entry|access)* ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|global|access)* . (database)*\n\nlet filter = incl \"\/etc\/ldap\/slapd.conf\"\n . incl \"\/etc\/openldap\/slapd.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Slapd module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man slapd.conf(5), man slapd.access (5)\n\n*)\n\nmodule Slapd =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet sep = del \/[ \\t\\n]+\/ \" \"\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet sto_to_spc = store \/[^\\\\# \\t\\n]+\/\n\nlet comment = Util.comment\nlet empty = Util.empty\n\n(************************************************************************\n * ACCESS TO\n *************************************************************************)\n\nlet access_re = \"access to\"\nlet control_re = \"stop\" | \"continue\" | \"break\"\nlet what = [ spc . label \"access\"\n . store (\/[^\\\\# \\t\\n]+\/ - (\"by\" | control_re)) ]\n\n(* TODO: parse the control field, see man slapd.access (5) *)\nlet control = [ spc . label \"control\" . store control_re ]\nlet by = [ sep . key \"by\" . spc . sto_to_spc\n . what? . control? ]\n\nlet access = [ key access_re . spc. sto_to_spc . by+ . eol ]\n\n(************************************************************************\n * GLOBAL\n *************************************************************************)\n\n(* TODO: parse special field separately, see man slapd.conf (5) *)\nlet global_re = \"allow\"\n | \"argsfile\"\n | \"attributeoptions\"\n | \"attributetype\"\n | \"authz-policy\"\n | \"ldap\"\n | \"dn\"\n | \"concurrency\"\n | \"cron_max_pending\"\n | \"conn_max_pending_auth\"\n | \"defaultsearchbase\"\n | \"disallow\"\n | \"ditcontentrule\"\n | \"gentlehup\"\n | \"idletimeout\"\n | \"include\"\n | \"index_substr_if_minlen\"\n | \"index_substr_if_maxlen\"\n | \"index_substr_any_len\"\n | \"index_substr_any_step\"\n | \"localSSF\"\n | \"loglevel\"\n | \"moduleload\"\n | \"modulepath\"\n | \"objectclass\"\n | \"objectidentifier\"\n | \"password-hash\"\n | \"password-crypt-salt-format\"\n | \"pidfile\"\n | \"referral\"\n | \"replica-argsfile\"\n | \"replica-pidfile\"\n | \"replicationinterval\"\n | \"require\"\n | \"reverse-lookup\"\n | \"rootDSE\"\n | \"sasl-host \"\n | \"sasl-realm\"\n | \"sasl-secprops\"\n | \"schemadn\"\n | \"security\"\n | \"sizelimit\"\n | \"sockbuf_max_incoming \"\n | \"sockbuf_max_incoming_auth\"\n | \"threads\"\n | \"timelimit time\"\n | \"tool-threads\"\n | \"TLSCipherSuite\"\n | \"TLSCACertificateFile\"\n | \"TLSCACertificatePath\"\n | \"TLSCertificateFile\"\n | \"TLSCertificateKeyFile\"\n | \"TLSDHParamFile\"\n | \"TLSRandFile\"\n | \"TLSVerifyClient\"\n | \"TLSCRLCheck\"\n | \"backend\"\n\nlet global = Build.key_ws_value global_re\n\n(************************************************************************\n * DATABASE\n *************************************************************************)\n\n(* TODO: support all types of database backend *)\nlet database_hdb = \"cachesize\"\n | \"cachefree\"\n | \"checkpoint\"\n | \"dbconfig\"\n | \"dbnosync\"\n | \"directory\"\n | \"dirtyread\"\n | \"idlcachesize\"\n | \"index\"\n | \"linearindex\"\n | \"lockdetect\"\n | \"mode\"\n | \"searchstack\"\n | \"shm_key\"\n\nlet database_re = \"suffix\"\n | \"lastmod\"\n | \"limits\"\n | \"maxderefdepth\"\n | \"overlay\"\n | \"readonly\"\n | \"replica uri\"\n | \"replogfile\"\n | \"restrict\"\n | \"rootdn\"\n | \"rootpw\"\n | \"subordinate\"\n | \"syncrepl rid\"\n | \"updatedn\"\n | \"updateref\"\n | database_hdb\n\nlet database_entry =\n let val = Quote.double_opt\n in Build.key_value_line database_re Sep.space val\n\nlet database = [ key \"database\"\n . spc\n . sto_to_eol\n . eol\n . (comment|empty|database_entry|access)* ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|global|access)* . (database)*\n\nlet filter = incl \"\/etc\/ldap\/slapd.conf\"\n . incl \"\/etc\/openldap\/slapd.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ad5352e8cced72fd6f208eea4e96575bb60bf4e2","subject":"Upstream augeas fix for backslashes at the start of directive args","message":"Upstream augeas fix for backslashes at the start of directive args\n\nFrom: https:\/\/github.com\/hercules-team\/augeas\/pull\/325\nFixes: #1531\n","repos":"stweil\/letsencrypt,VladimirTyrin\/letsencrypt,jtl999\/certbot,dietsche\/letsencrypt,letsencrypt\/letsencrypt,dietsche\/letsencrypt,kuba\/letsencrypt,twstrike\/le_for_patching,lmcro\/letsencrypt,VladimirTyrin\/letsencrypt,bsmr-misc-forks\/letsencrypt,martindale\/letsencrypt,TheBoegl\/letsencrypt,twstrike\/le_for_patching,goofwear\/letsencrypt,wteiken\/letsencrypt,thanatos\/lets-encrypt-preview,brentdax\/letsencrypt,martindale\/letsencrypt,wteiken\/letsencrypt,mitnk\/letsencrypt,TheBoegl\/letsencrypt,DavidGarciaCat\/letsencrypt,brentdax\/letsencrypt,goofwear\/letsencrypt,jtl999\/certbot,stweil\/letsencrypt,lmcro\/letsencrypt,thanatos\/lets-encrypt-preview,xgin\/letsencrypt,xgin\/letsencrypt,DavidGarciaCat\/letsencrypt,letsencrypt\/letsencrypt,jsha\/letsencrypt,mitnk\/letsencrypt,bsmr-misc-forks\/letsencrypt,kuba\/letsencrypt,jsha\/letsencrypt","old_file":"letsencrypt-apache\/letsencrypt_apache\/augeas_lens\/httpd.aug","new_file":"letsencrypt-apache\/letsencrypt_apache\/augeas_lens\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/([^\\\\ '\"\\t\\r\\n]|[^ '\"\\t\\r\\n]+[^\\\\ '\"\\t\\r\\n])|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/([^\\\\ '\"\\t\\r\\n]|[^\\\\ '\"\\t\\r\\n][^ '\"\\t\\r\\n]*[^\\\\ '\"\\t\\r\\n])|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"8e43f8b1383380db3aa98394cd926f1388db7cb1","subject":"Make sure the usage shows up properly formated.","message":"Make sure the usage shows up properly formated.\n","repos":"ptoscano\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,pevalme\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,raphink\/augeas,MikaelSmith\/augeas,kumy\/augeas,dafugg\/augeas,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,kumy\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,jasperla\/augeas,mlichvar\/augeas,hercules-team\/augeas,manandbytes\/augeas,mchf\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,pevalme\/augeas,raphink\/augeas,MikaelSmith\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,dafugg\/augeas,lutter\/augeas,lutter\/augeas,jasperla\/augeas,mchf\/augeas,jtopjian\/augeas,jjlin\/augeas,kunkku\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas","old_file":"lenses\/ssh.aug","new_file":"lenses\/ssh.aug","new_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let spc = Util.del_ws_spc\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_spc = store \/[^ \\t\\n]+\/\n let value_to_comma = store \/[^, \\t\\n]+\/\n\n let array_entry (k:string) =\n [ indent . key k . counter k . [ spc . seq k . value_to_spc]* . eol ]\n\n let commas_entry (k:string) =\n\t[ key k . counter k . spc .\n\t [ seq k . value_to_comma] . ([ seq k . comma . value_to_comma])* . eol ]\n\n let send_env = array_entry \"SendEnv\"\n\n let proxy_command = [ indent . key \"ProxyCommand\" . spc . value_to_eol . eol ]\n\n let fw_entry (k:string) = [ indent . key k . spc .\n\t[ key \/[^ \\t\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let remote_fw = fw_entry \"RemoteForward\"\n let local_fw = fw_entry \"LocalForward\"\n\n let ciphers = commas_entry \"Ciphers\"\n let macs\t= commas_entry \"MACs\"\n\n let other_entry =\n\t[ indent . key key_re . spc . value_to_spc . eol ]\n\n let entry = (comment | empty\n\t| send_env\n\t| proxy_command\n\t| remote_fw\n\t| local_fw\n\t| macs\n\t| ciphers\n\t| other_entry)\n\n let host = [ key \"Host\" . spc . value_to_eol . eol . entry* ]\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","old_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let spc = Util.del_ws_spc\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n let value_to_spc = store \/[^ \\t\\n]+\/\n let value_to_comma = store \/[^, \\t\\n]+\/\n\n let array_entry (k:string) =\n [ indent . key k . counter k . [ spc . seq k . value_to_spc]* . eol ]\n\n let commas_entry (k:string) =\n\t[ key k . counter k . spc .\n\t [ seq k . value_to_comma] . ([ seq k . comma . value_to_comma])* . eol ]\n\n let send_env = array_entry \"SendEnv\"\n\n let proxy_command = [ indent . key \"ProxyCommand\" . spc . value_to_eol . eol ]\n\n let fw_entry (k:string) = [ indent . key k . spc .\n\t[ key \/[^ \\t\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let remote_fw = fw_entry \"RemoteForward\"\n let local_fw = fw_entry \"LocalForward\"\n\n let ciphers = commas_entry \"Ciphers\"\n let macs\t= commas_entry \"MACs\"\n\n let other_entry =\n\t[ indent . key key_re . spc . value_to_spc . eol ]\n\n let entry = (comment | empty\n\t| send_env\n\t| proxy_command\n\t| remote_fw\n\t| local_fw\n\t| macs\n\t| ciphers\n\t| other_entry)\n\n let host = [ key \"Host\" . spc . value_to_eol . eol . entry* ]\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a22912ffdbefb7ca3b03b3530d445777804d3b02","subject":"Dnsmasq: process files in \/etc\/dnsmasq.d\/*","message":"Dnsmasq: process files in \/etc\/dnsmasq.d\/*\n\nFixes bug #65 reported by abnormaliti\n","repos":"GeoffWilliams\/augeas,hercules-team\/augeas,raphink\/augeas,jjlin\/augeas,bkearney\/augeas,kumy\/augeas,jasperla\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,manandbytes\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kumy\/augeas,pevalme\/augeas,kumy\/augeas,kunkku\/augeas,jjlin\/augeas,domcleal\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,bkearney\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,mlichvar\/augeas,jasperla\/augeas,kunkku\/augeas,pevalme\/augeas,bkearney\/augeas,raphink\/augeas,mchf\/augeas,jjlin\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,manandbytes\/augeas,kunkku\/augeas,lutter\/augeas,mchf\/augeas,dafugg\/augeas,mlichvar\/augeas,mlichvar\/augeas,bkearney\/augeas,pevalme\/augeas,dafugg\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,domcleal\/augeas,lutter\/augeas,kumy\/augeas","old_file":"lenses\/dnsmasq.aug","new_file":"lenses\/dnsmasq.aug","new_contents":"(* Dnsmasq module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man dnsmasq (8)\n\n \"Format is one option per line, legal options are the same\n as the long options legal on the command line. See\n \"\/usr\/sbin\/dnsmasq --help\" or \"man 8 dnsmasq\" for details.\"\n\n*)\n\nmodule Dnsmasq =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sep_eq = del \/=\/ \"=\"\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet entry_re = \/[A-Za-z0-9\\._-]+\/\nlet entry = [ key entry_re . (sep_eq . sto_to_eol)? . eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/dnsmasq.conf\"\n . incl \"\/etc\/dnsmasq.d\/*\"\n . excl \"#*#\"\n . excl \".*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Dnsmasq module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man dnsmasq (8)\n\n \"Format is one option per line, legal options are the same\n as the long options legal on the command line. See\n \"\/usr\/sbin\/dnsmasq --help\" or \"man 8 dnsmasq\" for details.\"\n\n*)\n\nmodule Dnsmasq =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sep_eq = del \/=\/ \"=\"\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet entry_re = \/[A-Za-z0-9\\._-]+\/\nlet entry = [ key entry_re . (sep_eq . sto_to_eol)? . eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/dnsmasq.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ed57d6c6945c682a485201c463174137d1840ded","subject":"Improve grub.aug's performances slightly","message":"Improve grub.aug's performances slightly\n","repos":"dafugg\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,dafugg\/augeas,raphink\/augeas,raphink\/augeas,mlichvar\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,jtopjian\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kunkku\/augeas,kumy\/augeas,ptoscano\/augeas,jjlin\/augeas,MikaelSmith\/augeas,jasperla\/augeas,manandbytes\/augeas,kumy\/augeas,jasperla\/augeas,jjlin\/augeas,kumy\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,domcleal\/augeas,kumy\/augeas,jjlin\/augeas,lutter\/augeas,jtopjian\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,domcleal\/augeas,mchf\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,domcleal\/augeas,pevalme\/augeas,kunkku\/augeas,mchf\/augeas,kunkku\/augeas,ptoscano\/augeas","old_file":"lenses\/grub.aug","new_file":"lenses\/grub.aug","new_contents":"(*\nModule: Grub\n Parses grub configuration\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* View: value_to_eol *)\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n\n (* View: eol *)\n let eol = Util.eol\n\n (* View: del_to_eol *)\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n\n (* View: spc *)\n let spc = Util.del_ws_spc\n\n (* View: opt_ws *)\n let opt_ws = Util.del_opt_ws \"\"\n\n (* View: dels *)\n let dels (s:string) = Util.del_str s\n\n (* View: eq *)\n let eq = dels \"=\"\n\n (* View: switch *)\n let switch (n:regexp) = dels \"--\" . key n\n\n (* View: switch_arg *)\n let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces\n\n (* View: value_sep *)\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n (* View: comment_re *)\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n (* View: comment *)\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n\n (* View: empty *)\n let empty = Util.empty\n\n(************************************************************************\n * Group: USEFUL FUNCTIONS\n *************************************************************************)\n\n (* View: command *)\n let command (kw:regexp) (indent:string) =\n Util.del_opt_ws indent . key kw\n\n (* View: kw_arg *)\n let kw_arg (kw:regexp) (indent:string) (dflt_sep:string) =\n [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]\n\n (* View: kw_boot_arg *)\n let kw_boot_arg (kw:regexp) = kw_arg kw \"\\t\" \" \"\n\n (* View: kw_menu_arg *)\n let kw_menu_arg (kw:regexp) = kw_arg kw \"\" \" \"\n\n (* View: password_arg *)\n let password_arg = [ key \"password\" .\n (spc . [ switch \"md5\" ])? .\n (spc . [ switch \"encrypted\" ])? .\n spc . store (\/[^ \\t\\n]+\/ - \/--[^ \\t\\n]+\/) .\n (spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n (* View: kw_pres *)\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n(************************************************************************\n * Group: BOOT ENTRIES\n *************************************************************************)\n\n (* View: device\n * This is a shell-only directive in upstream grub; the grub versions\n * in at least Fedora\/RHEL use this to find devices for UEFI boot *)\n let device =\n\t [ command \"device\" \"\" . Sep.space . store \/\\([A-Za-z0-9_.-]+\\)\/ . spc .\n\t\t [ label \"file\" . value_to_eol ] . Util.eol ]\n\n (* View: color *)\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n dels \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n spc . [ label \"normal\" . color_spec ] .\n (spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n (* View: serial *)\n let serial =\n [ command \"serial\" \"\" .\n [ spc . switch_arg \/unit|port|speed|word|parity|stop|device\/ ]* .\n eol ]\n\n (* View: terminal *)\n let terminal =\n [ command \"terminal\" \"\" .\n ([ spc . switch \/dumb|no-echo|no-edit|silent\/ ]\n |[ spc . switch_arg \/timeout|lines\/ ])* .\n [ spc . key \/console|serial|hercules\/ ]* . eol ]\n\n (* View: menu_setting *)\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"gfxmenu\"\n | kw_menu_arg \"background\"\n | serial\n | terminal\n | password_arg\n | color\n\t\t | device\n\n (* View: title *)\n let title = del \/title[ \\t=]+\/ \"title \" . value_to_eol . eol\n\n (* View: multiboot_arg\n * Permits a second form for Solaris multiboot kernels that\n * take a path (with a slash) as their first arg, e.g.\n * \/boot\/multiboot kernel\/unix another=arg *)\n let multiboot_arg = [ label \"@path\" .\n store (Rx.word . \"\/\" . Rx.no_spaces) ]\n\n (* View: kernel_args\n Parse the file name and args on a kernel or module line. *)\n let kernel_args =\n let arg = \/[A-Za-z0-9_.$-]+\/ - \/type|no-mem-option\/ in\n store \/(\\([a-z0-9,]+\\))?\\\/[^ \\t\\n]*\/ .\n (spc . multiboot_arg)? .\n (spc . [ key arg . (eq. store \/([^ \\t\\n])*\/)?])* . eol\n\n (* View: module_line\n Solaris extension adds module$ and kernel$ for variable interpolation *)\n let module_line =\n [ command \/module\\$?\/ \"\\t\" . spc . kernel_args ]\n\n (* View: map_line *)\n let map_line =\n [ command \"map\" \"\\t\" . spc .\n [ label \"from\" . store \/[()A-za-z0-9]+\/ ] . spc .\n [ label \"to\" . store \/[()A-za-z0-9]+\/ ] . eol ]\n\n (* View: kernel *)\n let kernel =\n [ command \/kernel\\$?\/ \"\\t\" .\n (spc .\n ([switch \"type\" . eq . store \/[a-z]+\/]\n |[switch \"no-mem-option\"]))* .\n spc . kernel_args ]\n\n (* View: chainloader *)\n let chainloader =\n [ command \"chainloader\" \"\\t\" .\n [ spc . switch \"force\" ]? . spc . store Rx.no_spaces . eol ]\n\n (* View: savedefault *)\n let savedefault =\n [ command \"savedefault\" \"\\t\" . (spc . store Rx.integer)? . eol ]\n\n (* View: configfile *)\n let configfile =\n [ command \"configfile\" \"\\t\" . spc . store Rx.no_spaces . eol ]\n\n (* View: boot_setting\n <boot> entries *)\n let boot_setting =\n let boot_arg_re = \"root\" | \"initrd\" | \"rootnoverify\" | \"uuid\"\n | \"findroot\" | \"bootfs\" (* Solaris extensions *)\n in kw_boot_arg boot_arg_re\n | kernel\n | chainloader\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | savedefault\n | configfile\n | module_line\n | map_line\n\n (* View: boot *)\n let boot =\n let line = ((boot_setting|comment)* . boot_setting)? in\n [ label \"title\" . title . line ]\n\n(************************************************************************\n * Group: DEBIAN-SPECIFIC SECTIONS\n *************************************************************************)\n\n (* View: debian_header\n Header for a <debian>-specific section *)\n let debian_header = \"## ## Start Default Options ##\\n\"\n\n (* View: debian_footer\n Footer for a <debian>-specific section *)\n let debian_footer = \"## ## End Default Options ##\\n\"\n\n (* View: debian_comment_re *)\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n\n (* View: debian_comment\n A comment entry inside a <debian>-specific section *)\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n\n (* View: debian_setting_re *)\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n | \"indomU\"\n\n (* View: debian_entry *)\n let debian_entry = [ Util.del_str \"#\" . Util.indent\n . key debian_setting_re . del \/[ \\t]*=\/ \"=\"\n . value_to_eol? . eol ]\n\n (* View: debian\n A debian-specific section, made of <debian_entry> lines *)\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n (* View: lns *)\n let lns = (comment | empty | menu_setting | boot | debian)*\n\n (* View: filter *)\n let filter = incl \"\/boot\/grub\/menu.lst\"\n . incl \"\/etc\/grub.conf\"\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Grub\n Parses grub configuration\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* View: value_to_eol *)\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n\n (* View: eol *)\n let eol = Util.eol\n\n (* View: del_to_eol *)\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n\n (* View: spc *)\n let spc = Util.del_ws_spc\n\n (* View: opt_ws *)\n let opt_ws = Util.del_opt_ws \"\"\n\n (* View: dels *)\n let dels (s:string) = Util.del_str s\n\n (* View: eq *)\n let eq = dels \"=\"\n\n (* View: switch *)\n let switch (n:regexp) = dels \"--\" . key n\n\n (* View: switch_arg *)\n let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces\n\n (* View: value_sep *)\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n (* View: comment_re *)\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n (* View: comment *)\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n\n (* View: empty *)\n let empty = Util.empty\n\n(************************************************************************\n * Group: USEFUL FUNCTIONS\n *************************************************************************)\n\n (* View: command *)\n let command (kw:regexp) (indent:string) =\n Util.del_opt_ws indent . key kw\n\n (* View: kw_arg *)\n let kw_arg (kw:regexp) (indent:string) (dflt_sep:string) =\n [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]\n\n (* View: kw_boot_arg *)\n let kw_boot_arg (kw:string) = kw_arg kw \"\\t\" \" \"\n\n (* View: kw_menu_arg *)\n let kw_menu_arg (kw:string) = kw_arg kw \"\" \" \"\n\n (* View: password_arg *)\n let password_arg = [ key \"password\" .\n (spc . [ switch \"md5\" ])? .\n (spc . [ switch \"encrypted\" ])? .\n spc . store (\/[^ \\t\\n]+\/ - \/--[^ \\t\\n]+\/) .\n (spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n (* View: kw_pres *)\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n(************************************************************************\n * Group: BOOT ENTRIES\n *************************************************************************)\n\n (* View: device\n * This is a shell-only directive in upstream grub; the grub versions\n * in at least Fedora\/RHEL use this to find devices for UEFI boot *)\n let device =\n\t [ command \"device\" \"\" . Sep.space . store \/\\([A-Za-z0-9_.-]+\\)\/ . spc .\n\t\t [ label \"file\" . value_to_eol ] . Util.eol ]\n\n (* View: color *)\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n dels \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n spc . [ label \"normal\" . color_spec ] .\n (spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n (* View: serial *)\n let serial =\n [ command \"serial\" \"\" .\n [ spc . switch_arg \/unit|port|speed|word|parity|stop|device\/ ]* .\n eol ]\n\n (* View: terminal *)\n let terminal =\n [ command \"terminal\" \"\" .\n ([ spc . switch \/dumb|no-echo|no-edit|silent\/ ]\n |[ spc . switch_arg \/timeout|lines\/ ])* .\n [ spc . key \/console|serial|hercules\/ ]* . eol ]\n\n (* View: menu_setting *)\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"gfxmenu\"\n | kw_menu_arg \"background\"\n | serial\n | terminal\n | password_arg\n | color\n\t\t | device\n\n (* View: title *)\n let title = del \/title[ \\t=]+\/ \"title \" . value_to_eol . eol\n\n (* View: multiboot_arg\n * Permits a second form for Solaris multiboot kernels that\n * take a path (with a slash) as their first arg, e.g.\n * \/boot\/multiboot kernel\/unix another=arg *)\n let multiboot_arg = [ label \"@path\" .\n store (Rx.word . \"\/\" . Rx.no_spaces) ]\n\n (* View: kernel_args\n Parse the file name and args on a kernel or module line. *)\n let kernel_args =\n let arg = \/[A-Za-z0-9_.$-]+\/ - \/type|no-mem-option\/ in\n store \/(\\([a-z0-9,]+\\))?\\\/[^ \\t\\n]*\/ .\n (spc . multiboot_arg)? .\n (spc . [ key arg . (eq. store \/([^ \\t\\n])*\/)?])* . eol\n\n (* View: module_line\n Solaris extension adds module$ and kernel$ for variable interpolation *)\n let module_line =\n [ command \/module\\$?\/ \"\\t\" . spc . kernel_args ]\n\n (* View: map_line *)\n let map_line =\n [ command \"map\" \"\\t\" . spc .\n [ label \"from\" . store \/[()A-za-z0-9]+\/ ] . spc .\n [ label \"to\" . store \/[()A-za-z0-9]+\/ ] . eol ]\n\n (* View: kernel *)\n let kernel =\n [ command \/kernel\\$?\/ \"\\t\" .\n (spc .\n ([switch \"type\" . eq . store \/[a-z]+\/]\n |[switch \"no-mem-option\"]))* .\n spc . kernel_args ]\n\n (* View: chainloader *)\n let chainloader =\n [ command \"chainloader\" \"\\t\" .\n [ spc . switch \"force\" ]? . spc . store Rx.no_spaces . eol ]\n\n (* View: savedefault *)\n let savedefault =\n [ command \"savedefault\" \"\\t\" . (spc . store Rx.integer)? . eol ]\n\n (* View: configfile *)\n let configfile =\n [ command \"configfile\" \"\\t\" . spc . store Rx.no_spaces . eol ]\n\n (* View: boot_setting\n <boot> entries *)\n let boot_setting = kw_boot_arg \"root\"\n | kernel\n | kw_boot_arg \"initrd\"\n | kw_boot_arg \"rootnoverify\"\n | chainloader\n | kw_boot_arg \"uuid\"\n | kw_boot_arg \"findroot\" (* Solaris extension *)\n | kw_boot_arg \"bootfs\" (* Solaris extension *)\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | savedefault\n | configfile\n | module_line\n | map_line\n\n (* View: boot *)\n let boot =\n let line = ((boot_setting|comment)* . boot_setting)? in\n [ label \"title\" . title . line ]\n\n(************************************************************************\n * Group: DEBIAN-SPECIFIC SECTIONS\n *************************************************************************)\n\n (* View: debian_header\n Header for a <debian>-specific section *)\n let debian_header = \"## ## Start Default Options ##\\n\"\n\n (* View: debian_footer\n Footer for a <debian>-specific section *)\n let debian_footer = \"## ## End Default Options ##\\n\"\n\n (* View: debian_comment_re *)\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n\n (* View: debian_comment\n A comment entry inside a <debian>-specific section *)\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n\n (* View: debian_setting_re *)\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n | \"indomU\"\n\n (* View: debian_entry *)\n let debian_entry = [ Util.del_str \"#\" . Util.indent\n . key debian_setting_re . del \/[ \\t]*=\/ \"=\"\n . value_to_eol? . eol ]\n\n (* View: debian\n A debian-specific section, made of <debian_entry> lines *)\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n (* View: lns *)\n let lns = (comment | empty | menu_setting | boot | debian)*\n\n (* View: filter *)\n let filter = incl \"\/boot\/grub\/menu.lst\"\n . incl \"\/etc\/grub.conf\"\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8108bd1b6cbfdc1e4b110b586922a084cdd06bdc","subject":"Improve documentation for reprepro_uploaders.aug","message":"Improve documentation for reprepro_uploaders.aug\n","repos":"domcleal\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,lutter\/augeas,raphink\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,kumy\/augeas,jasperla\/augeas,mlichvar\/augeas,lutter\/augeas,pevalme\/augeas,kumy\/augeas,lutter\/augeas,jjlin\/augeas,kunkku\/augeas,pevalme\/augeas,mlichvar\/augeas,jtopjian\/augeas,domcleal\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,kunkku\/augeas,domcleal\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,jjlin\/augeas,jasperla\/augeas,kumy\/augeas,kumy\/augeas,mchf\/augeas,raphink\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,jtopjian\/augeas,hercules-team\/augeas,ptoscano\/augeas,mlichvar\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,pevalme\/augeas,hercules-team\/augeas","old_file":"lenses\/reprepro_uploaders.aug","new_file":"lenses\/reprepro_uploaders.aug","new_contents":"(*\nModule: Reprepro_Uploaders\n Parses reprepro's uploaders files\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 1 reprepro` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n See <lns>.\n\nAbout: Configuration files\n This lens applies to reprepro's uploaders files.\n*)\n\nmodule Reprepro_Uploaders =\n\n(* View: logic_construct_condition\n A logical construction for <condition> and <condition_list> *)\nlet logic_construct_condition (kw:string) (lns:lens) =\n [ label kw . lns ]\n . [ Sep.space . key kw . Sep.space . lns ]*\n\n(* View: logic_construct_field\n A generic definition for <condition_field> *)\nlet logic_construct_field (kw:string) (sep:string) (lns:lens) =\n [ label kw . lns ]\n . [ Build.xchgs sep kw . lns ]*\n\n(* View: condition_re\n A condition can be of several types:\n\n - source\n - byhand\n - sections\n - sections contain\n - binaries\n - binaries contain\n - architectures\n - architectures contain\n\n While the lens technically also accepts \"source contain\"\n and \"byhand contain\", these are not understood by reprepro.\n\n The \"contain\" types are built by adding a \"contain\" subnode.\n See the <condition_field> definition.\n\n *)\nlet condition_re =\n \"source\"\n | \"byhand\"\n | \"sections\"\n | \"binaries\"\n | \"architectures\"\n\n(* View: condition_field\n A single condition field is an 'or' node.\n It may contain several values, listed in 'or' subnodes:\n\n > $reprepro\/allow[1]\/and\/or = \"architectures\"\n > $reprepro\/allow[1]\/and\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and\/or\/or[3] = \"all\"\n\n *)\nlet condition_field =\n let sto_condition = Util.del_str \"'\" . store \/[^'\\n]+\/ . Util.del_str \"'\" in\n store condition_re\n . [ Sep.space . key \"contain\" ]?\n . Sep.space\n . logic_construct_field \"or\" \"|\" sto_condition\n\n(* View: condition\n A condition is an 'and' node,\n representing a union of <condition_fields>,\n listed under 'or' subnodes:\n\n > $reprepro\/allow[1]\/and\n > $reprepro\/allow[1]\/and\/or = \"architectures\"\n > $reprepro\/allow[1]\/and\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and\/or\/or[3] = \"all\"\n\n *)\nlet condition =\n logic_construct_condition \"or\" condition_field\n\n(* View: condition_list\n A list of <conditions>, inspired by Debctrl.dependency_list\n An upload condition list is either the wildcard '*', stored verbatim,\n or an intersection of conditions listed under 'and' subnodes:\n\n > $reprepro\/allow[1]\/and[1]\n > $reprepro\/allow[1]\/and[1]\/or = \"architectures\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[3] = \"all\"\n > $reprepro\/allow[1]\/and[2]\n > $reprepro\/allow[1]\/and[2]\/or = \"sections\"\n > $reprepro\/allow[1]\/and[2]\/or\/contain\n > $reprepro\/allow[1]\/and[2]\/or\/or = \"main\"\n\n *)\nlet condition_list =\n store \"*\"\n | logic_construct_condition \"and\" condition\n\n(* View: by_key\n When a key is used to authenticate packages,\n the value can either be a key ID or \"any\":\n\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n > $reprepro\/allow[2]\/by\/key = \"any\"\n\n *)\nlet by_key =\n let any_key = [ store \"any\" . Sep.space\n . key \"key\" ] in\n let named_key = [ key \"key\" . Sep.space\n . store (Rx.word - \"any\") ] in\n value \"key\" . (any_key | named_key)\n\n(* View: by\n <by> statements define who is allowed to upload.\n It can be simple keywords, like \"anybody\" or \"unsigned\",\n or a key ID, in which case a \"key\" subnode is added:\n\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n > $reprepro\/allow[2]\/by\/key = \"any\"\n > $reprepro\/allow[3]\/by = \"anybody\"\n > $reprepro\/allow[4]\/by = \"unsigned\"\n\n *)\nlet by =\n [ key \"by\" . Sep.space\n . ( store (\"anybody\"|\"unsigned\")\n | by_key ) ]\n\n(* View: entry\n An entry is an allow statement, e.g.:\n\n > $reprepro\/allow[1]\n > $reprepro\/allow[1]\/and[1]\n > $reprepro\/allow[1]\/and[1]\/or = \"architectures\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[3] = \"all\"\n > $reprepro\/allow[1]\/and[2]\n > $reprepro\/allow[1]\/and[2]\/or = \"sections\"\n > $reprepro\/allow[1]\/and[2]\/or\/contain\n > $reprepro\/allow[1]\/and[2]\/or\/or = \"main\"\n > $reprepro\/allow[1]\/by = \"key\"\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n\n *)\nlet entry =\n [ key \"allow\" . Sep.space\n . condition_list . Sep.space\n . by . Util.eol ]\n\n(* View: lns\n The lens is made of <Util.empty>, <Util.comment> and <entry> lines *)\nlet lns = (Util.empty|Util.comment|entry)*\n","old_contents":"(*\nModule: Reprepro_Uploaders\n Parses reprepro's uploaders files\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 1 reprepro` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n See <lns>.\n\nAbout: Configuration files\n This lens applies to reprepro's uploaders files.\n*)\n\nmodule Reprepro_Uploaders =\n\n(* View: logic_construct_field\n A generic definition for <logic_construct>s *)\nlet logic_construct_field (kw:string) (sep:string) (lns:lens) =\n [ label kw . lns ]\n . [ Build.xchgs sep kw . lns ]*\n\n(* View: condition_re\n A condition can be of several types:\n\n - source\n - byhand\n - sections\n - sections contain\n - binaries\n - binaries contain\n - architectures\n - architectures contain\n\n While the lens technically also accepts \"source contain\"\n and \"byhand contain\", these are not understood by reprepro.\n\n The \"contain\" types are built by adding a \"contain\" subnode.\n See the <condition_field> definition.\n\n *)\nlet condition_re =\n \"source\"\n | \"byhand\"\n | \"sections\"\n | \"binaries\"\n | \"architectures\"\n\n(* View: logic_construct_condition\n A logical construction for <condition> and <condition_list> *)\nlet logic_construct_condition (kw:string) (lns:lens) =\n [ label kw . lns ]\n . [ Sep.space . key kw . Sep.space . lns ]*\n\n(* View: condition_field\n A single condition field is an 'or' node.\n It may contain several values, listed in 'or' subnodes:\n\n > $reprepro\/allow[1]\/and\/or = \"architectures\"\n > $reprepro\/allow[1]\/and\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and\/or\/or[3] = \"all\"\n\n *)\nlet condition_field =\n let sto_condition = Util.del_str \"'\" . store \/[^'\\n]+\/ . Util.del_str \"'\" in\n store condition_re\n . [ Sep.space . key \"contain\" ]?\n . Sep.space\n . logic_construct_field \"or\" \"|\" sto_condition\n\n(* View: condition\n A condition is an 'and' node,\n representing a union of <condition_field>s,\n listed under 'or' subnodes:\n\n > $reprepro\/allow[1]\/and\n > $reprepro\/allow[1]\/and\/or = \"architectures\"\n > $reprepro\/allow[1]\/and\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and\/or\/or[3] = \"all\"\n\n *)\nlet condition =\n logic_construct_condition \"or\" condition_field\n\n(* View: condition_list\n A list of <condition>s, inspired by Debctrl.dependency_list\n An upload condition list is either the wildcard '*', stored verbatim,\n or an intersection of conditions listed under 'and' subnodes:\n\n > $reprepro\/allow[1]\/and[1]\n > $reprepro\/allow[1]\/and[1]\/or = \"architectures\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[3] = \"all\"\n > $reprepro\/allow[1]\/and[2]\n > $reprepro\/allow[1]\/and[2]\/or = \"sections\"\n > $reprepro\/allow[1]\/and[2]\/or\/contain\n > $reprepro\/allow[1]\/and[2]\/or\/or = \"main\"\n\n *)\nlet condition_list =\n store \"*\"\n | logic_construct_condition \"and\" condition\n\n(* View: by_key\n When a key is used to authenticate packages,\n the value can either be a key ID or \"any\":\n\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n > $reprepro\/allow[2]\/by\/key = \"any\"\n\n *)\nlet by_key =\n let any_key = [ store \"any\" . Sep.space\n . key \"key\" ] in\n let named_key = [ key \"key\" . Sep.space\n . store (Rx.word - \"any\") ] in\n value \"key\" . (any_key | named_key)\n\n(* View: by\n <by> statements define who is allowed to upload.\n It can be simple keywords, like \"anybody\" or \"unsigned\",\n or a key ID, in which case a \"key\" subnode is added:\n\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n > $reprepro\/allow[2]\/by\/key = \"any\"\n > $reprepro\/allow[3]\/by = \"anybody\"\n > $reprepro\/allow[4]\/by = \"unsigned\"\n\n *)\nlet by =\n [ key \"by\" . Sep.space\n . ( store (\"anybody\"|\"unsigned\")\n | by_key ) ]\n\n(* View: entry\n An entry is an allow statement, e.g.:\n\n > $reprepro\/allow[1]\n > $reprepro\/allow[1]\/and[1]\n > $reprepro\/allow[1]\/and[1]\/or = \"architectures\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[1] = \"i386\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[2] = \"amd64\"\n > $reprepro\/allow[1]\/and[1]\/or\/or[3] = \"all\"\n > $reprepro\/allow[1]\/and[2]\n > $reprepro\/allow[1]\/and[2]\/or = \"sections\"\n > $reprepro\/allow[1]\/and[2]\/or\/contain\n > $reprepro\/allow[1]\/and[2]\/or\/or = \"main\"\n > $reprepro\/allow[1]\/by = \"key\"\n > $reprepro\/allow[1]\/by\/key = \"ABCD1234\"\n\n *)\nlet entry =\n [ key \"allow\" . Sep.space\n . condition_list . Sep.space\n . by . Util.eol ]\n\n(* View: lns\n The lens is made of <Util.empty>, <Util.comment> and <entry> lines *)\nlet lns = (Util.empty|Util.comment|entry)*\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a652ebb721f409080ce7104031d06ca2eeeb4a1e","subject":"Nsswitch: remove long list of databases, match by regexp","message":"Nsswitch: remove long list of databases, match by regexp\n","repos":"GeoffWilliams\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,mlichvar\/augeas,jjlin\/augeas,kunkku\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,domcleal\/augeas,mlichvar\/augeas,kunkku\/augeas,dafugg\/augeas,lutter\/augeas,jjlin\/augeas,pevalme\/augeas,kumy\/augeas,hercules-team\/augeas,domcleal\/augeas,jjlin\/augeas,lutter\/augeas,kumy\/augeas,pevalme\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,kumy\/augeas,dafugg\/augeas,ptoscano\/augeas,hercules-team\/augeas,kunkku\/augeas,jtopjian\/augeas,jtopjian\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,pevalme\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,domcleal\/augeas,dafugg\/augeas,mchf\/augeas,kumy\/augeas,raphink\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/nsswitch.aug","new_file":"lenses\/nsswitch.aug","new_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: database_kw\n The database specification like `passwd', `shadow', or `hosts' *)\nlet database_kw = Rx.word\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n let database_kw = \"aliases\"\n | \"auth_attr\"\n | \"automount\"\n | \"bootparams\"\n | \"ethers\"\n | \"group\"\n | \"group_compat\"\n | \"hosts\"\n | \"ipnodes\"\n | \"netgroup\"\n | \"netmasks\"\n | \"networks\"\n | \"passwd\"\n | \"passwd_compat\"\n | \"printers\"\n | \"prof_attr\"\n | \"project\"\n | \"protocols\"\n | \"publickey\"\n | \"rpc\"\n | \"sendmailvars\"\n | \"services\"\n | \"shadow\"\n | \"shadow_compat\"\n | \"sudoers\"\n | \"tnrhtp\"\n | \"tnrhdb\"\n in [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cb5db1398956d0953e70c3cbf71baf1890222862","subject":"Add test for dovecot permitting ! in block names","message":"Add test for dovecot permitting ! in block names\n","repos":"ptoscano\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,mlichvar\/augeas,hercules-team\/augeas,hercules-team\/augeas,ptoscano\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_dovecot.aug","new_file":"lenses\/tests\/test_dovecot.aug","new_contents":"(*\nModule: Test_Dovecot\n Provides unit tests and examples for the <Dovecot> lens.\n*)\n\nmodule Test_Dovecot =\n\n(* *********************** \/etc\/dovecot.conf ******************************** *)\n\nlet dovecot_conf = \"# Dovecot configuration file\n\n# If you're in a hurry, see http:\/\/wiki2.dovecot.org\/QuickConfiguration\n\n# Default values are shown for each setting, it's not required to uncomment\n# those. These are exceptions to this though: No sections (e.g. namespace {})\n# or plugin settings are added by default, they're listed only as examples.\n# Paths are also just examples with the real defaults being based on configure\n# options. The paths listed here are for configure --prefix=\/usr\n# --sysconfdir=\/etc --localstatedir=\/var\n\n# include_try command\n!include_try \/usr\/share\/dovecot\/protocols.d\/*.protocol\n\n# Wildcard, comma and space in value\nlisten = *, ::\n\n# Filesystem path in value\nbase_dir = \/var\/run\/dovecot\/\ninstance_name = dovecot\n\n# Space and dot in value\nlogin_greeting = Dovecot ready.\n\n# Empty values\nlogin_trusted_networks =\nlogin_access_sockets = \n\n# Simple values\nverbose_proctitle = no\nshutdown_clients = yes\n\n# Number in value\ndoveadm_worker_count = 0\n# Dash in value\ndoveadm_socket_path = doveadm-server\n\nimport_environment = TZ\n\n##\n## Comment\n##\n\n# Simple commented dict block\ndict {\n #quota = mysql:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\n #expire = sqlite:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\n}\n\n# Simple uncommented dict block\ndict {\n quota = mysql:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\n expire = sqlite:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\n}\n\n# Include command\n!include conf.d\/*.conf\n\n# Include_try command\n!include_try local.conf\n\n\"\n\ntest Dovecot.lns get dovecot_conf = \n { \"#comment\" = \"Dovecot configuration file\" }\n { }\n { \"#comment\" = \"If you're in a hurry, see http:\/\/wiki2.dovecot.org\/QuickConfiguration\" }\n { }\n { \"#comment\" = \"Default values are shown for each setting, it's not required to uncomment\" }\n { \"#comment\" = \"those. These are exceptions to this though: No sections (e.g. namespace {})\" }\n { \"#comment\" = \"or plugin settings are added by default, they're listed only as examples.\" }\n { \"#comment\" = \"Paths are also just examples with the real defaults being based on configure\" }\n { \"#comment\" = \"options. The paths listed here are for configure --prefix=\/usr\" }\n { \"#comment\" = \"--sysconfdir=\/etc --localstatedir=\/var\" }\n { }\n { \"#comment\" = \"include_try command\" }\n { \"include_try\" = \"\/usr\/share\/dovecot\/protocols.d\/*.protocol\" }\n { }\n { \"#comment\" = \"Wildcard, comma and space in value\" }\n { \"listen\" = \"*, ::\" }\n { }\n { \"#comment\" = \"Filesystem path in value\" }\n { \"base_dir\" = \"\/var\/run\/dovecot\/\" }\n { \"instance_name\" = \"dovecot\" }\n { }\n { \"#comment\" = \"Space and dot in value\" }\n { \"login_greeting\" = \"Dovecot ready.\" }\n { }\n { \"#comment\" = \"Empty values\" }\n { \"login_trusted_networks\" }\n { \"login_access_sockets\" }\n { }\n { \"#comment\" = \"Simple values\" }\n { \"verbose_proctitle\" = \"no\" }\n { \"shutdown_clients\" = \"yes\" }\n { }\n { \"#comment\" = \"Number in value\" }\n { \"doveadm_worker_count\" = \"0\" }\n { \"#comment\" = \"Dash in value\" }\n { \"doveadm_socket_path\" = \"doveadm-server\" }\n { }\n { \"import_environment\" = \"TZ\" }\n { }\n { \"#comment\" = \"#\" }\n { \"#comment\" = \"# Comment\" }\n { \"#comment\" = \"#\" }\n { }\n { \"#comment\" = \"Simple commented dict block\" }\n { \"dict\"\n { \"#comment\" = \"quota = mysql:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\" }\n { \"#comment\" = \"expire = sqlite:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\" }\n }\n { }\n { \"#comment\" = \"Simple uncommented dict block\" }\n { \"dict\"\n { \"quota\" = \"mysql:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\" }\n { \"expire\" = \"sqlite:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\" }\n }\n { }\n { \"#comment\" = \"Include command\" }\n { \"include\" = \"conf.d\/*.conf\" }\n { }\n { \"#comment\" = \"Include_try command\" }\n { \"include_try\" = \"local.conf\" }\n { }\n\n\n\n(* *********************************** dict ********************************* *)\n\nlet dovecot_dict_sql_conf = \"connect = host=localhost dbname=mails user=testuser password=pass\n\n# CREATE TABLE quota (\n# username varchar(100) not null,\n# bytes bigint not null default 0,\n# messages integer not null default 0,\n# primary key (username)\n# );\n\nmap {\n pattern = priv\/quota\/storage\n table = quota\n username_field = username\n value_field = bytes\n}\nmap {\n pattern = priv\/quota\/messages\n table = quota\n username_field = username\n value_field = messages\n}\n\n# CREATE TABLE expires (\n# username varchar(100) not null,\n# mailbox varchar(255) not null,\n# expire_stamp integer not null,\n# primary key (username, mailbox)\n# );\n\nmap {\n pattern = shared\/expire\/$user\/$mailbox\n table = expires\n value_field = expire_stamp\n\n fields {\n username = $user\n mailbox = $mailbox\n }\n}\n\"\n\ntest Dovecot.lns get dovecot_dict_sql_conf =\n { \"connect\" = \"host=localhost dbname=mails user=testuser password=pass\" }\n { }\n { \"#comment\" = \"CREATE TABLE quota (\" }\n { \"#comment\" = \"username varchar(100) not null,\" }\n { \"#comment\" = \"bytes bigint not null default 0,\" }\n { \"#comment\" = \"messages integer not null default 0,\" }\n { \"#comment\" = \"primary key (username)\" }\n { \"#comment\" = \");\" }\n { }\n { \"map\"\n { \"pattern\" = \"priv\/quota\/storage\" }\n { \"table\" = \"quota\" }\n { \"username_field\" = \"username\" }\n { \"value_field\" = \"bytes\" }\n }\n { \"map\"\n { \"pattern\" = \"priv\/quota\/messages\" }\n { \"table\" = \"quota\" }\n { \"username_field\" = \"username\" }\n { \"value_field\" = \"messages\" }\n }\n { }\n { \"#comment\" = \"CREATE TABLE expires (\" }\n { \"#comment\" = \"username varchar(100) not null,\" }\n { \"#comment\" = \"mailbox varchar(255) not null,\" }\n { \"#comment\" = \"expire_stamp integer not null,\" }\n { \"#comment\" = \"primary key (username, mailbox)\" }\n { \"#comment\" = \");\" }\n { }\n { \"map\"\n { \"pattern\" = \"shared\/expire\/$user\/$mailbox\" }\n { \"table\" = \"expires\" }\n { \"value_field\" = \"expire_stamp\" }\n { }\n { \"fields\"\n { \"username\" = \"$user\" }\n { \"mailbox\" = \"$mailbox\" }\n }\n }\n\n(* ********************************** auth ********************************** *)\n\nlet auth_conf = \"## Authentication processes\n\ndisable_plaintext_auth = yes\nauth_cache_size = 0\nauth_cache_ttl = 1 hour\nauth_cache_negative_ttl = 1 hour\nauth_realms =\nauth_default_realm = \nauth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@\nauth_username_translation =\nauth_username_format =\nauth_master_user_separator =\nauth_anonymous_username = anonymous\nauth_worker_max_count = 30\nauth_gssapi_hostname =\nauth_krb5_keytab = \nauth_use_winbind = no\nauth_winbind_helper_path = \/usr\/bin\/ntlm_auth\nauth_failure_delay = 2 secs\nauth_ssl_require_client_cert = no\nauth_ssl_username_from_cert = no\nauth_mechanisms = plain\n\n!include auth-deny.conf.ext\n!include auth-master.conf.ext\n!include auth-system.conf.ext\n!include auth-sql.conf.ext\n!include auth-ldap.conf.ext\n!include auth-passwdfile.conf.ext\n!include auth-checkpassword.conf.ext\n!include auth-vpopmail.conf.ext\n!include auth-static.conf.ext\n\npassdb {\n driver = passwd-file\n deny = yes\n\n # File contains a list of usernames, one per line\n args = \/etc\/dovecot\/deny-users\n}\n\npassdb {\n driver = passwd-file\n master = yes\n args = \/etc\/dovecot\/master-users\n\n # Unless you're using PAM, you probably still want the destination user to\n # be looked up from passdb that it really exists. pass=yes does that.\n pass = yes\n}\n\nuserdb {\n driver = passwd-file\n args = username_format=%u \/etc\/dovecot\/users\n}\n\"\n\ntest Dovecot.lns get auth_conf =\n { \"#comment\" = \"# Authentication processes\" }\n { }\n { \"disable_plaintext_auth\" = \"yes\" }\n { \"auth_cache_size\" = \"0\" }\n { \"auth_cache_ttl\" = \"1 hour\" }\n { \"auth_cache_negative_ttl\" = \"1 hour\" }\n { \"auth_realms\" }\n { \"auth_default_realm\" }\n { \"auth_username_chars\" = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@\" }\n { \"auth_username_translation\" }\n { \"auth_username_format\" }\n { \"auth_master_user_separator\" }\n { \"auth_anonymous_username\" = \"anonymous\" }\n { \"auth_worker_max_count\" = \"30\" }\n { \"auth_gssapi_hostname\" }\n { \"auth_krb5_keytab\" }\n { \"auth_use_winbind\" = \"no\" }\n { \"auth_winbind_helper_path\" = \"\/usr\/bin\/ntlm_auth\" }\n { \"auth_failure_delay\" = \"2 secs\" }\n { \"auth_ssl_require_client_cert\" = \"no\" }\n { \"auth_ssl_username_from_cert\" = \"no\" }\n { \"auth_mechanisms\" = \"plain\" }\n { }\n { \"include\" = \"auth-deny.conf.ext\" }\n { \"include\" = \"auth-master.conf.ext\" }\n { \"include\" = \"auth-system.conf.ext\" }\n { \"include\" = \"auth-sql.conf.ext\" }\n { \"include\" = \"auth-ldap.conf.ext\" }\n { \"include\" = \"auth-passwdfile.conf.ext\" }\n { \"include\" = \"auth-checkpassword.conf.ext\" }\n { \"include\" = \"auth-vpopmail.conf.ext\" }\n { \"include\" = \"auth-static.conf.ext\" }\n { }\n { \"passdb\"\n { \"driver\" = \"passwd-file\" }\n { \"deny\" = \"yes\" }\n { }\n { \"#comment\" = \"File contains a list of usernames, one per line\" }\n { \"args\" = \"\/etc\/dovecot\/deny-users\" }\n }\n { }\n { \"passdb\"\n { \"driver\" = \"passwd-file\" }\n { \"master\" = \"yes\" }\n { \"args\" = \"\/etc\/dovecot\/master-users\" }\n { }\n { \"#comment\" = \"Unless you're using PAM, you probably still want the destination user to\" }\n { \"#comment\" = \"be looked up from passdb that it really exists. pass=yes does that.\" }\n { \"pass\" = \"yes\" }\n }\n { }\n { \"userdb\"\n { \"driver\" = \"passwd-file\" }\n { \"args\" = \"username_format=%u \/etc\/dovecot\/users\" }\n }\n\n(* ******************************** director ******************************** *)\n\nlet director_conf = \"## Director-specific settings.\ndirector_servers = \ndirector_mail_servers = \ndirector_user_expire = 15 min\ndirector_doveadm_port = 0\n\nservice director {\n unix_listener login\/director {\n mode = 0666\n }\n fifo_listener login\/proxy-notify {\n mode = 0666\n }\n unix_listener director-userdb {\n #mode = 0600\n }\n inet_listener {\n port = \n }\n}\n\nservice imap-login {\n executable = imap-login director\n}\nservice pop3-login {\n executable = pop3-login director\n}\nprotocol lmtp {\n auth_socket_path = director-userdb\n}\n\"\n\ntest Dovecot.lns get director_conf =\n { \"#comment\" = \"# Director-specific settings.\" }\n { \"director_servers\" }\n { \"director_mail_servers\" }\n { \"director_user_expire\" = \"15 min\" }\n { \"director_doveadm_port\" = \"0\" }\n { }\n { \"service\" = \"director\"\n { \"unix_listener\" = \"login\/director\"\n { \"mode\" = \"0666\" }\n }\n { \"fifo_listener\" = \"login\/proxy-notify\"\n { \"mode\" = \"0666\" }\n }\n { \"unix_listener\" = \"director-userdb\"\n { \"#comment\" = \"mode = 0600\" }\n }\n { \"inet_listener\"\n { \"port\" }\n }\n }\n { }\n { \"service\" = \"imap-login\"\n { \"executable\" = \"imap-login director\" }\n }\n { \"service\" = \"pop3-login\"\n { \"executable\" = \"pop3-login director\" }\n }\n { \"protocol\" = \"lmtp\"\n { \"auth_socket_path\" = \"director-userdb\" }\n }\n\n(* ********************************* logging ******************************** *)\n\nlet logging_conf = \"## Log destination.\nlog_path = syslog\ninfo_log_path = \ndebug_log_path = \nsyslog_facility = mail\nauth_verbose = no\nauth_verbose_passwords = no\nauth_debug = no\nauth_debug_passwords = no\nmail_debug = no\nverbose_ssl = no\n\nplugin {\n mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename\n mail_log_fields = uid box msgid size\n}\n\nlog_timestamp = \\\"%b %d %H:%M:%S \\\"\nlogin_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c\nlogin_log_format = %$: %s\nmail_log_prefix = \\\"%s(%u): \\\"\ndeliver_log_format = msgid=%m: %$\n\"\n\ntest Dovecot.lns get logging_conf =\n { \"#comment\" = \"# Log destination.\" }\n { \"log_path\" = \"syslog\" }\n { \"info_log_path\" }\n { \"debug_log_path\" }\n { \"syslog_facility\" = \"mail\" }\n { \"auth_verbose\" = \"no\" }\n { \"auth_verbose_passwords\" = \"no\" }\n { \"auth_debug\" = \"no\" }\n { \"auth_debug_passwords\" = \"no\" }\n { \"mail_debug\" = \"no\" }\n { \"verbose_ssl\" = \"no\" }\n { }\n { \"plugin\"\n { \"mail_log_events\" = \"delete undelete expunge copy mailbox_delete mailbox_rename\" }\n { \"mail_log_fields\" = \"uid box msgid size\" }\n }\n { }\n { \"log_timestamp\" = \"\\\"%b %d %H:%M:%S \\\"\" }\n { \"login_log_format_elements\" = \"user=<%u> method=%m rip=%r lip=%l mpid=%e %c\" }\n { \"login_log_format\" = \"%$: %s\" }\n { \"mail_log_prefix\" = \"\\\"%s(%u): \\\"\" }\n { \"deliver_log_format\" = \"msgid=%m: %$\" }\n\n\n(* ********************************** mail ********************************** *)\n\nlet mail_conf = \"## Mailbox locations and namespaces\nmail_location = \nnamespace {\n type = private\n separator = \n prefix = \n location =\n inbox = no\n hidden = no\n list = yes\n subscriptions = yes\n mailbox \\\"Sent Messages\\\" {\n special_use = \\Sent\n }\n}\n\n# Example shared namespace configuration\nnamespace {\n type = shared\n separator = \/\n prefix = shared\/%%u\/\n location = maildir:%%h\/Maildir:INDEX=~\/Maildir\/shared\/%%u\n subscriptions = no\n list = children\n}\n\nmail_uid =\nmail_gid =\nmail_privileged_group =\nmail_access_groups =\nmail_full_filesystem_access = no\nmmap_disable = no\ndotlock_use_excl = yes\nmail_fsync = optimized\nmail_nfs_storage = no\nmail_nfs_index = no\nlock_method = fcntl\nmail_temp_dir = \/tmp\nfirst_valid_uid = 500\nlast_valid_uid = 0\nfirst_valid_gid = 1\nlast_valid_gid = 0\nmail_max_keyword_length = 50\nvalid_chroot_dirs = \nmail_chroot = \nauth_socket_path = \/var\/run\/dovecot\/auth-userdb\nmail_plugin_dir = \/usr\/lib\/dovecot\/modules\nmail_plugins = \nmail_cache_min_mail_count = 0\nmailbox_idle_check_interval = 30 secs\nmail_save_crlf = no\nmaildir_stat_dirs = no\nmaildir_copy_with_hardlinks = yes\nmaildir_very_dirty_syncs = no\nmbox_read_locks = fcntl\nmbox_write_locks = dotlock fcntl\nmbox_lock_timeout = 5 mins\nmbox_dotlock_change_timeout = 2 mins\nmbox_dirty_syncs = yes\nmbox_very_dirty_syncs = no\nmbox_lazy_writes = yes\nmbox_min_index_size = 0\nmdbox_rotate_size = 2M\nmdbox_rotate_interval = 0\nmdbox_preallocate_space = no\nmail_attachment_dir =\nmail_attachment_min_size = 128k\nmail_attachment_fs = sis posix\nmail_attachment_hash = %{sha1}\n\nprotocol !indexer-worker {\n mail_vsize_bg_after_count = 0\n}\n\"\ntest Dovecot.lns get mail_conf =\n { \"#comment\" = \"# Mailbox locations and namespaces\" }\n { \"mail_location\" }\n { \"namespace\"\n { \"type\" = \"private\" }\n { \"separator\" }\n { \"prefix\" }\n { \"location\" }\n { \"inbox\" = \"no\" }\n { \"hidden\" = \"no\" }\n { \"list\" = \"yes\" }\n { \"subscriptions\" = \"yes\" }\n { \"mailbox\" = \"Sent Messages\" \n { \"special_use\" = \"\\Sent\" }\n }\n }\n { }\n { \"#comment\" = \"Example shared namespace configuration\" }\n { \"namespace\"\n { \"type\" = \"shared\" }\n { \"separator\" = \"\/\" }\n { \"prefix\" = \"shared\/%%u\/\" }\n { \"location\" = \"maildir:%%h\/Maildir:INDEX=~\/Maildir\/shared\/%%u\" }\n { \"subscriptions\" = \"no\" }\n { \"list\" = \"children\" }\n }\n { }\n { \"mail_uid\" }\n { \"mail_gid\" }\n { \"mail_privileged_group\" }\n { \"mail_access_groups\" }\n { \"mail_full_filesystem_access\" = \"no\" }\n { \"mmap_disable\" = \"no\" }\n { \"dotlock_use_excl\" = \"yes\" }\n { \"mail_fsync\" = \"optimized\" }\n { \"mail_nfs_storage\" = \"no\" }\n { \"mail_nfs_index\" = \"no\" }\n { \"lock_method\" = \"fcntl\" }\n { \"mail_temp_dir\" = \"\/tmp\" }\n { \"first_valid_uid\" = \"500\" }\n { \"last_valid_uid\" = \"0\" }\n { \"first_valid_gid\" = \"1\" }\n { \"last_valid_gid\" = \"0\" }\n { \"mail_max_keyword_length\" = \"50\" }\n { \"valid_chroot_dirs\" }\n { \"mail_chroot\" }\n { \"auth_socket_path\" = \"\/var\/run\/dovecot\/auth-userdb\" }\n { \"mail_plugin_dir\" = \"\/usr\/lib\/dovecot\/modules\" }\n { \"mail_plugins\" }\n { \"mail_cache_min_mail_count\" = \"0\" }\n { \"mailbox_idle_check_interval\" = \"30 secs\" }\n { \"mail_save_crlf\" = \"no\" }\n { \"maildir_stat_dirs\" = \"no\" }\n { \"maildir_copy_with_hardlinks\" = \"yes\" }\n { \"maildir_very_dirty_syncs\" = \"no\" }\n { \"mbox_read_locks\" = \"fcntl\" }\n { \"mbox_write_locks\" = \"dotlock fcntl\" }\n { \"mbox_lock_timeout\" = \"5 mins\" }\n { \"mbox_dotlock_change_timeout\" = \"2 mins\" }\n { \"mbox_dirty_syncs\" = \"yes\" }\n { \"mbox_very_dirty_syncs\" = \"no\" }\n { \"mbox_lazy_writes\" = \"yes\" }\n { \"mbox_min_index_size\" = \"0\" }\n { \"mdbox_rotate_size\" = \"2M\" }\n { \"mdbox_rotate_interval\" = \"0\" }\n { \"mdbox_preallocate_space\" = \"no\" }\n { \"mail_attachment_dir\" }\n { \"mail_attachment_min_size\" = \"128k\" }\n { \"mail_attachment_fs\" = \"sis posix\" }\n { \"mail_attachment_hash\" = \"%{sha1}\" }\n { }\n { \"protocol\" = \"!indexer-worker\"\n { \"mail_vsize_bg_after_count\" = \"0\" }\n }\n\n\n(* ********************************* master ********************************* *)\n\nlet master_conf = \"\ndefault_process_limit = 100\ndefault_client_limit = 1000\ndefault_vsz_limit = 256M\ndefault_login_user = dovenull\ndefault_internal_user = dovecot\n\nservice imap-login {\n inet_listener imap {\n port = 143\n }\n inet_listener imaps {\n port = 993\n ssl = yes\n }\n service_count = 1\n process_min_avail = 0\n vsz_limit = 64M\n}\n\nservice pop3-login {\n inet_listener pop3 {\n port = 110\n }\n inet_listener pop3s {\n port = 995\n ssl = yes\n }\n}\n\nservice lmtp {\n unix_listener lmtp {\n mode = 0666\n }\n inet_listener lmtp {\n address =\n port = \n }\n}\n\nservice imap {\n vsz_limit = 256M\n process_limit = 1024\n}\n\nservice auth {\n unix_listener auth-userdb {\n mode = 0600\n user = \n group = \n }\n}\n\nservice auth-worker {\n user = root\n}\n\nservice dict {\n unix_listener dict {\n mode = 0600\n user = \n group = \n }\n}\n\"\n\ntest Dovecot.lns get master_conf =\n { }\n { \"default_process_limit\" = \"100\" }\n { \"default_client_limit\" = \"1000\" }\n { \"default_vsz_limit\" = \"256M\" }\n { \"default_login_user\" = \"dovenull\" }\n { \"default_internal_user\" = \"dovecot\" }\n { }\n { \"service\" = \"imap-login\"\n { \"inet_listener\" = \"imap\"\n { \"port\" = \"143\" }\n }\n { \"inet_listener\" = \"imaps\"\n { \"port\" = \"993\" }\n { \"ssl\" = \"yes\" }\n }\n { \"service_count\" = \"1\" }\n { \"process_min_avail\" = \"0\" }\n { \"vsz_limit\" = \"64M\" }\n }\n { }\n { \"service\" = \"pop3-login\"\n { \"inet_listener\" = \"pop3\"\n { \"port\" = \"110\" }\n }\n { \"inet_listener\" = \"pop3s\"\n { \"port\" = \"995\" }\n { \"ssl\" = \"yes\" }\n }\n }\n { }\n { \"service\" = \"lmtp\"\n { \"unix_listener\" = \"lmtp\"\n { \"mode\" = \"0666\" }\n }\n { \"inet_listener\" = \"lmtp\"\n { \"address\" }\n { \"port\" }\n }\n }\n { }\n { \"service\" = \"imap\"\n { \"vsz_limit\" = \"256M\" }\n { \"process_limit\" = \"1024\" }\n }\n { }\n { \"service\" = \"auth\"\n { \"unix_listener\" = \"auth-userdb\"\n { \"mode\" = \"0600\" }\n { \"user\" }\n { \"group\" }\n }\n }\n { }\n { \"service\" = \"auth-worker\"\n { \"user\" = \"root\" }\n }\n { }\n { \"service\" = \"dict\"\n { \"unix_listener\" = \"dict\"\n { \"mode\" = \"0600\" }\n { \"user\" }\n { \"group\" }\n }\n }\n\n(* *********************************** ssl ********************************** *)\n\nlet ssl_conf = \"## SSL settings\nssl = yes\nssl_cert = <\/etc\/ssl\/certs\/dovecot.pem\nssl_key = <\/etc\/ssl\/private\/dovecot.pem\nssl_key_password =\nssl_ca = \nssl_verify_client_cert = no\nssl_cert_username_field = commonName\nssl_parameters_regenerate = 168\nssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL\n\"\ntest Dovecot.lns get ssl_conf =\n { \"#comment\" = \"# SSL settings\" }\n { \"ssl\" = \"yes\" }\n { \"ssl_cert\" = \"<\/etc\/ssl\/certs\/dovecot.pem\" }\n { \"ssl_key\" = \"<\/etc\/ssl\/private\/dovecot.pem\" }\n { \"ssl_key_password\" }\n { \"ssl_ca\" }\n { \"ssl_verify_client_cert\" = \"no\" }\n { \"ssl_cert_username_field\" = \"commonName\" }\n { \"ssl_parameters_regenerate\" = \"168\" }\n { \"ssl_cipher_list\" = \"ALL:!LOW:!SSLv2:!EXP:!aNULL\" }\n\n(* ********************* \/etc\/dovecot\/conf.d\/15-lda.conf ******************** *)\n\nlet lda_conf = \"## LDA specific settings (also used by LMTP)\npostmaster_address =\nhostname = \nquota_full_tempfail = no\nsendmail_path = \/usr\/sbin\/sendmail\nsubmission_host =\nrejection_subject = Rejected: %s\nrejection_reason = Your message to <%t> was automatically rejected:%n%r\nrecipient_delimiter = +\nlda_original_recipient_header =\nlda_mailbox_autocreate = no\nlda_mailbox_autosubscribe = no\n\nprotocol lda {\n mail_plugins = $mail_plugins\n}\n\"\ntest Dovecot.lns get lda_conf =\n { \"#comment\" = \"# LDA specific settings (also used by LMTP)\" }\n { \"postmaster_address\" }\n { \"hostname\" }\n { \"quota_full_tempfail\" = \"no\" }\n { \"sendmail_path\" = \"\/usr\/sbin\/sendmail\" }\n { \"submission_host\" }\n { \"rejection_subject\" = \"Rejected: %s\" }\n { \"rejection_reason\" = \"Your message to <%t> was automatically rejected:%n%r\" }\n { \"recipient_delimiter\" = \"+\" }\n { \"lda_original_recipient_header\" }\n { \"lda_mailbox_autocreate\" = \"no\" }\n { \"lda_mailbox_autosubscribe\" = \"no\" }\n { }\n { \"protocol\" = \"lda\"\n { \"mail_plugins\" = \"$mail_plugins\" }\n }\n\n(* *********************************** acl ********************************** *)\n\nlet acl_conf = \"## Mailbox access control lists.\nplugin {\n acl = vfile:\/etc\/dovecot\/global-acls:cache_secs=300\n}\nplugin {\n acl_shared_dict = file:\/var\/lib\/dovecot\/shared-mailboxes\n}\n\"\n\ntest Dovecot.lns get acl_conf =\n { \"#comment\" = \"# Mailbox access control lists.\" }\n { \"plugin\"\n { \"acl\" = \"vfile:\/etc\/dovecot\/global-acls:cache_secs=300\" }\n }\n { \"plugin\"\n { \"acl_shared_dict\" = \"file:\/var\/lib\/dovecot\/shared-mailboxes\" }\n }\n\n(* ******************************** plugins ********************************* *)\n\nlet plugins_conf = \"\nplugin {\n quota_rule = *:storage=1G\n quota_rule2 = Trash:storage=+100M\n}\nplugin {\n quota_warning = storage=95%% quota-warning 95 %u\n quota_warning2 = storage=80%% quota-warning 80 %u\n}\nservice quota-warning {\n executable = script \/usr\/local\/bin\/quota-warning.sh\n user = dovecot\n unix_listener quota-warning {\n user = vmail\n }\n}\nplugin {\n quota = dirsize:User quota\n quota = maildir:User quota\n quota = dict:User quota::proxy::quota\n quota = fs:User quota\n}\nplugin {\n quota = dict:user::proxy::quota\n quota2 = dict:domain:%d:proxy::quota_domain\n quota_rule = *:storage=102400\n quota2_rule = *:storage=1048576\n}\nplugin {\n acl = vfile:\/etc\/dovecot\/global-acls:cache_secs=300\n}\nplugin {\n acl_shared_dict = file:\/var\/lib\/dovecot\/shared-mailboxes\n}\n\"\ntest Dovecot.lns get plugins_conf =\n { }\n { \"plugin\"\n { \"quota_rule\" = \"*:storage=1G\" }\n { \"quota_rule2\" = \"Trash:storage=+100M\" }\n }\n { \"plugin\"\n { \"quota_warning\" = \"storage=95%% quota-warning 95 %u\" }\n { \"quota_warning2\" = \"storage=80%% quota-warning 80 %u\" }\n }\n { \"service\" = \"quota-warning\"\n { \"executable\" = \"script \/usr\/local\/bin\/quota-warning.sh\" }\n { \"user\" = \"dovecot\" }\n { \"unix_listener\" = \"quota-warning\"\n { \"user\" = \"vmail\" }\n }\n }\n { \"plugin\"\n { \"quota\" = \"dirsize:User quota\" }\n { \"quota\" = \"maildir:User quota\" }\n { \"quota\" = \"dict:User quota::proxy::quota\" }\n { \"quota\" = \"fs:User quota\" }\n }\n { \"plugin\"\n { \"quota\" = \"dict:user::proxy::quota\" }\n { \"quota2\" = \"dict:domain:%d:proxy::quota_domain\" }\n { \"quota_rule\" = \"*:storage=102400\" }\n { \"quota2_rule\" = \"*:storage=1048576\" }\n }\n { \"plugin\"\n { \"acl\" = \"vfile:\/etc\/dovecot\/global-acls:cache_secs=300\" }\n }\n { \"plugin\"\n { \"acl_shared_dict\" = \"file:\/var\/lib\/dovecot\/shared-mailboxes\" }\n }\n","old_contents":"(*\nModule: Test_Dovecot\n Provides unit tests and examples for the <Dovecot> lens.\n*)\n\nmodule Test_Dovecot =\n\n(* *********************** \/etc\/dovecot.conf ******************************** *)\n\nlet dovecot_conf = \"# Dovecot configuration file\n\n# If you're in a hurry, see http:\/\/wiki2.dovecot.org\/QuickConfiguration\n\n# Default values are shown for each setting, it's not required to uncomment\n# those. These are exceptions to this though: No sections (e.g. namespace {})\n# or plugin settings are added by default, they're listed only as examples.\n# Paths are also just examples with the real defaults being based on configure\n# options. The paths listed here are for configure --prefix=\/usr\n# --sysconfdir=\/etc --localstatedir=\/var\n\n# include_try command\n!include_try \/usr\/share\/dovecot\/protocols.d\/*.protocol\n\n# Wildcard, comma and space in value\nlisten = *, ::\n\n# Filesystem path in value\nbase_dir = \/var\/run\/dovecot\/\ninstance_name = dovecot\n\n# Space and dot in value\nlogin_greeting = Dovecot ready.\n\n# Empty values\nlogin_trusted_networks =\nlogin_access_sockets = \n\n# Simple values\nverbose_proctitle = no\nshutdown_clients = yes\n\n# Number in value\ndoveadm_worker_count = 0\n# Dash in value\ndoveadm_socket_path = doveadm-server\n\nimport_environment = TZ\n\n##\n## Comment\n##\n\n# Simple commented dict block\ndict {\n #quota = mysql:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\n #expire = sqlite:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\n}\n\n# Simple uncommented dict block\ndict {\n quota = mysql:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\n expire = sqlite:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\n}\n\n# Include command\n!include conf.d\/*.conf\n\n# Include_try command\n!include_try local.conf\n\n\"\n\ntest Dovecot.lns get dovecot_conf = \n { \"#comment\" = \"Dovecot configuration file\" }\n { }\n { \"#comment\" = \"If you're in a hurry, see http:\/\/wiki2.dovecot.org\/QuickConfiguration\" }\n { }\n { \"#comment\" = \"Default values are shown for each setting, it's not required to uncomment\" }\n { \"#comment\" = \"those. These are exceptions to this though: No sections (e.g. namespace {})\" }\n { \"#comment\" = \"or plugin settings are added by default, they're listed only as examples.\" }\n { \"#comment\" = \"Paths are also just examples with the real defaults being based on configure\" }\n { \"#comment\" = \"options. The paths listed here are for configure --prefix=\/usr\" }\n { \"#comment\" = \"--sysconfdir=\/etc --localstatedir=\/var\" }\n { }\n { \"#comment\" = \"include_try command\" }\n { \"include_try\" = \"\/usr\/share\/dovecot\/protocols.d\/*.protocol\" }\n { }\n { \"#comment\" = \"Wildcard, comma and space in value\" }\n { \"listen\" = \"*, ::\" }\n { }\n { \"#comment\" = \"Filesystem path in value\" }\n { \"base_dir\" = \"\/var\/run\/dovecot\/\" }\n { \"instance_name\" = \"dovecot\" }\n { }\n { \"#comment\" = \"Space and dot in value\" }\n { \"login_greeting\" = \"Dovecot ready.\" }\n { }\n { \"#comment\" = \"Empty values\" }\n { \"login_trusted_networks\" }\n { \"login_access_sockets\" }\n { }\n { \"#comment\" = \"Simple values\" }\n { \"verbose_proctitle\" = \"no\" }\n { \"shutdown_clients\" = \"yes\" }\n { }\n { \"#comment\" = \"Number in value\" }\n { \"doveadm_worker_count\" = \"0\" }\n { \"#comment\" = \"Dash in value\" }\n { \"doveadm_socket_path\" = \"doveadm-server\" }\n { }\n { \"import_environment\" = \"TZ\" }\n { }\n { \"#comment\" = \"#\" }\n { \"#comment\" = \"# Comment\" }\n { \"#comment\" = \"#\" }\n { }\n { \"#comment\" = \"Simple commented dict block\" }\n { \"dict\"\n { \"#comment\" = \"quota = mysql:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\" }\n { \"#comment\" = \"expire = sqlite:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\" }\n }\n { }\n { \"#comment\" = \"Simple uncommented dict block\" }\n { \"dict\"\n { \"quota\" = \"mysql:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\" }\n { \"expire\" = \"sqlite:\/etc\/dovecot\/dovecot-dict-sql.conf.ext\" }\n }\n { }\n { \"#comment\" = \"Include command\" }\n { \"include\" = \"conf.d\/*.conf\" }\n { }\n { \"#comment\" = \"Include_try command\" }\n { \"include_try\" = \"local.conf\" }\n { }\n\n\n\n(* *********************************** dict ********************************* *)\n\nlet dovecot_dict_sql_conf = \"connect = host=localhost dbname=mails user=testuser password=pass\n\n# CREATE TABLE quota (\n# username varchar(100) not null,\n# bytes bigint not null default 0,\n# messages integer not null default 0,\n# primary key (username)\n# );\n\nmap {\n pattern = priv\/quota\/storage\n table = quota\n username_field = username\n value_field = bytes\n}\nmap {\n pattern = priv\/quota\/messages\n table = quota\n username_field = username\n value_field = messages\n}\n\n# CREATE TABLE expires (\n# username varchar(100) not null,\n# mailbox varchar(255) not null,\n# expire_stamp integer not null,\n# primary key (username, mailbox)\n# );\n\nmap {\n pattern = shared\/expire\/$user\/$mailbox\n table = expires\n value_field = expire_stamp\n\n fields {\n username = $user\n mailbox = $mailbox\n }\n}\n\"\n\ntest Dovecot.lns get dovecot_dict_sql_conf =\n { \"connect\" = \"host=localhost dbname=mails user=testuser password=pass\" }\n { }\n { \"#comment\" = \"CREATE TABLE quota (\" }\n { \"#comment\" = \"username varchar(100) not null,\" }\n { \"#comment\" = \"bytes bigint not null default 0,\" }\n { \"#comment\" = \"messages integer not null default 0,\" }\n { \"#comment\" = \"primary key (username)\" }\n { \"#comment\" = \");\" }\n { }\n { \"map\"\n { \"pattern\" = \"priv\/quota\/storage\" }\n { \"table\" = \"quota\" }\n { \"username_field\" = \"username\" }\n { \"value_field\" = \"bytes\" }\n }\n { \"map\"\n { \"pattern\" = \"priv\/quota\/messages\" }\n { \"table\" = \"quota\" }\n { \"username_field\" = \"username\" }\n { \"value_field\" = \"messages\" }\n }\n { }\n { \"#comment\" = \"CREATE TABLE expires (\" }\n { \"#comment\" = \"username varchar(100) not null,\" }\n { \"#comment\" = \"mailbox varchar(255) not null,\" }\n { \"#comment\" = \"expire_stamp integer not null,\" }\n { \"#comment\" = \"primary key (username, mailbox)\" }\n { \"#comment\" = \");\" }\n { }\n { \"map\"\n { \"pattern\" = \"shared\/expire\/$user\/$mailbox\" }\n { \"table\" = \"expires\" }\n { \"value_field\" = \"expire_stamp\" }\n { }\n { \"fields\"\n { \"username\" = \"$user\" }\n { \"mailbox\" = \"$mailbox\" }\n }\n }\n\n(* ********************************** auth ********************************** *)\n\nlet auth_conf = \"## Authentication processes\n\ndisable_plaintext_auth = yes\nauth_cache_size = 0\nauth_cache_ttl = 1 hour\nauth_cache_negative_ttl = 1 hour\nauth_realms =\nauth_default_realm = \nauth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@\nauth_username_translation =\nauth_username_format =\nauth_master_user_separator =\nauth_anonymous_username = anonymous\nauth_worker_max_count = 30\nauth_gssapi_hostname =\nauth_krb5_keytab = \nauth_use_winbind = no\nauth_winbind_helper_path = \/usr\/bin\/ntlm_auth\nauth_failure_delay = 2 secs\nauth_ssl_require_client_cert = no\nauth_ssl_username_from_cert = no\nauth_mechanisms = plain\n\n!include auth-deny.conf.ext\n!include auth-master.conf.ext\n!include auth-system.conf.ext\n!include auth-sql.conf.ext\n!include auth-ldap.conf.ext\n!include auth-passwdfile.conf.ext\n!include auth-checkpassword.conf.ext\n!include auth-vpopmail.conf.ext\n!include auth-static.conf.ext\n\npassdb {\n driver = passwd-file\n deny = yes\n\n # File contains a list of usernames, one per line\n args = \/etc\/dovecot\/deny-users\n}\n\npassdb {\n driver = passwd-file\n master = yes\n args = \/etc\/dovecot\/master-users\n\n # Unless you're using PAM, you probably still want the destination user to\n # be looked up from passdb that it really exists. pass=yes does that.\n pass = yes\n}\n\nuserdb {\n driver = passwd-file\n args = username_format=%u \/etc\/dovecot\/users\n}\n\"\n\ntest Dovecot.lns get auth_conf =\n { \"#comment\" = \"# Authentication processes\" }\n { }\n { \"disable_plaintext_auth\" = \"yes\" }\n { \"auth_cache_size\" = \"0\" }\n { \"auth_cache_ttl\" = \"1 hour\" }\n { \"auth_cache_negative_ttl\" = \"1 hour\" }\n { \"auth_realms\" }\n { \"auth_default_realm\" }\n { \"auth_username_chars\" = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@\" }\n { \"auth_username_translation\" }\n { \"auth_username_format\" }\n { \"auth_master_user_separator\" }\n { \"auth_anonymous_username\" = \"anonymous\" }\n { \"auth_worker_max_count\" = \"30\" }\n { \"auth_gssapi_hostname\" }\n { \"auth_krb5_keytab\" }\n { \"auth_use_winbind\" = \"no\" }\n { \"auth_winbind_helper_path\" = \"\/usr\/bin\/ntlm_auth\" }\n { \"auth_failure_delay\" = \"2 secs\" }\n { \"auth_ssl_require_client_cert\" = \"no\" }\n { \"auth_ssl_username_from_cert\" = \"no\" }\n { \"auth_mechanisms\" = \"plain\" }\n { }\n { \"include\" = \"auth-deny.conf.ext\" }\n { \"include\" = \"auth-master.conf.ext\" }\n { \"include\" = \"auth-system.conf.ext\" }\n { \"include\" = \"auth-sql.conf.ext\" }\n { \"include\" = \"auth-ldap.conf.ext\" }\n { \"include\" = \"auth-passwdfile.conf.ext\" }\n { \"include\" = \"auth-checkpassword.conf.ext\" }\n { \"include\" = \"auth-vpopmail.conf.ext\" }\n { \"include\" = \"auth-static.conf.ext\" }\n { }\n { \"passdb\"\n { \"driver\" = \"passwd-file\" }\n { \"deny\" = \"yes\" }\n { }\n { \"#comment\" = \"File contains a list of usernames, one per line\" }\n { \"args\" = \"\/etc\/dovecot\/deny-users\" }\n }\n { }\n { \"passdb\"\n { \"driver\" = \"passwd-file\" }\n { \"master\" = \"yes\" }\n { \"args\" = \"\/etc\/dovecot\/master-users\" }\n { }\n { \"#comment\" = \"Unless you're using PAM, you probably still want the destination user to\" }\n { \"#comment\" = \"be looked up from passdb that it really exists. pass=yes does that.\" }\n { \"pass\" = \"yes\" }\n }\n { }\n { \"userdb\"\n { \"driver\" = \"passwd-file\" }\n { \"args\" = \"username_format=%u \/etc\/dovecot\/users\" }\n }\n\n(* ******************************** director ******************************** *)\n\nlet director_conf = \"## Director-specific settings.\ndirector_servers = \ndirector_mail_servers = \ndirector_user_expire = 15 min\ndirector_doveadm_port = 0\n\nservice director {\n unix_listener login\/director {\n mode = 0666\n }\n fifo_listener login\/proxy-notify {\n mode = 0666\n }\n unix_listener director-userdb {\n #mode = 0600\n }\n inet_listener {\n port = \n }\n}\n\nservice imap-login {\n executable = imap-login director\n}\nservice pop3-login {\n executable = pop3-login director\n}\nprotocol lmtp {\n auth_socket_path = director-userdb\n}\n\"\n\ntest Dovecot.lns get director_conf =\n { \"#comment\" = \"# Director-specific settings.\" }\n { \"director_servers\" }\n { \"director_mail_servers\" }\n { \"director_user_expire\" = \"15 min\" }\n { \"director_doveadm_port\" = \"0\" }\n { }\n { \"service\" = \"director\"\n { \"unix_listener\" = \"login\/director\"\n { \"mode\" = \"0666\" }\n }\n { \"fifo_listener\" = \"login\/proxy-notify\"\n { \"mode\" = \"0666\" }\n }\n { \"unix_listener\" = \"director-userdb\"\n { \"#comment\" = \"mode = 0600\" }\n }\n { \"inet_listener\"\n { \"port\" }\n }\n }\n { }\n { \"service\" = \"imap-login\"\n { \"executable\" = \"imap-login director\" }\n }\n { \"service\" = \"pop3-login\"\n { \"executable\" = \"pop3-login director\" }\n }\n { \"protocol\" = \"lmtp\"\n { \"auth_socket_path\" = \"director-userdb\" }\n }\n\n(* ********************************* logging ******************************** *)\n\nlet logging_conf = \"## Log destination.\nlog_path = syslog\ninfo_log_path = \ndebug_log_path = \nsyslog_facility = mail\nauth_verbose = no\nauth_verbose_passwords = no\nauth_debug = no\nauth_debug_passwords = no\nmail_debug = no\nverbose_ssl = no\n\nplugin {\n mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename\n mail_log_fields = uid box msgid size\n}\n\nlog_timestamp = \\\"%b %d %H:%M:%S \\\"\nlogin_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c\nlogin_log_format = %$: %s\nmail_log_prefix = \\\"%s(%u): \\\"\ndeliver_log_format = msgid=%m: %$\n\"\n\ntest Dovecot.lns get logging_conf =\n { \"#comment\" = \"# Log destination.\" }\n { \"log_path\" = \"syslog\" }\n { \"info_log_path\" }\n { \"debug_log_path\" }\n { \"syslog_facility\" = \"mail\" }\n { \"auth_verbose\" = \"no\" }\n { \"auth_verbose_passwords\" = \"no\" }\n { \"auth_debug\" = \"no\" }\n { \"auth_debug_passwords\" = \"no\" }\n { \"mail_debug\" = \"no\" }\n { \"verbose_ssl\" = \"no\" }\n { }\n { \"plugin\"\n { \"mail_log_events\" = \"delete undelete expunge copy mailbox_delete mailbox_rename\" }\n { \"mail_log_fields\" = \"uid box msgid size\" }\n }\n { }\n { \"log_timestamp\" = \"\\\"%b %d %H:%M:%S \\\"\" }\n { \"login_log_format_elements\" = \"user=<%u> method=%m rip=%r lip=%l mpid=%e %c\" }\n { \"login_log_format\" = \"%$: %s\" }\n { \"mail_log_prefix\" = \"\\\"%s(%u): \\\"\" }\n { \"deliver_log_format\" = \"msgid=%m: %$\" }\n\n\n(* ********************************** mail ********************************** *)\n\nlet mail_conf = \"## Mailbox locations and namespaces\nmail_location = \nnamespace {\n type = private\n separator = \n prefix = \n location =\n inbox = no\n hidden = no\n list = yes\n subscriptions = yes\n mailbox \\\"Sent Messages\\\" {\n special_use = \\Sent\n }\n}\n\n# Example shared namespace configuration\nnamespace {\n type = shared\n separator = \/\n prefix = shared\/%%u\/\n location = maildir:%%h\/Maildir:INDEX=~\/Maildir\/shared\/%%u\n subscriptions = no\n list = children\n}\n\nmail_uid =\nmail_gid =\nmail_privileged_group =\nmail_access_groups =\nmail_full_filesystem_access = no\nmmap_disable = no\ndotlock_use_excl = yes\nmail_fsync = optimized\nmail_nfs_storage = no\nmail_nfs_index = no\nlock_method = fcntl\nmail_temp_dir = \/tmp\nfirst_valid_uid = 500\nlast_valid_uid = 0\nfirst_valid_gid = 1\nlast_valid_gid = 0\nmail_max_keyword_length = 50\nvalid_chroot_dirs = \nmail_chroot = \nauth_socket_path = \/var\/run\/dovecot\/auth-userdb\nmail_plugin_dir = \/usr\/lib\/dovecot\/modules\nmail_plugins = \nmail_cache_min_mail_count = 0\nmailbox_idle_check_interval = 30 secs\nmail_save_crlf = no\nmaildir_stat_dirs = no\nmaildir_copy_with_hardlinks = yes\nmaildir_very_dirty_syncs = no\nmbox_read_locks = fcntl\nmbox_write_locks = dotlock fcntl\nmbox_lock_timeout = 5 mins\nmbox_dotlock_change_timeout = 2 mins\nmbox_dirty_syncs = yes\nmbox_very_dirty_syncs = no\nmbox_lazy_writes = yes\nmbox_min_index_size = 0\nmdbox_rotate_size = 2M\nmdbox_rotate_interval = 0\nmdbox_preallocate_space = no\nmail_attachment_dir =\nmail_attachment_min_size = 128k\nmail_attachment_fs = sis posix\nmail_attachment_hash = %{sha1}\n\"\ntest Dovecot.lns get mail_conf =\n { \"#comment\" = \"# Mailbox locations and namespaces\" }\n { \"mail_location\" }\n { \"namespace\"\n { \"type\" = \"private\" }\n { \"separator\" }\n { \"prefix\" }\n { \"location\" }\n { \"inbox\" = \"no\" }\n { \"hidden\" = \"no\" }\n { \"list\" = \"yes\" }\n { \"subscriptions\" = \"yes\" }\n { \"mailbox\" = \"Sent Messages\" \n { \"special_use\" = \"\\Sent\" }\n }\n }\n { }\n { \"#comment\" = \"Example shared namespace configuration\" }\n { \"namespace\"\n { \"type\" = \"shared\" }\n { \"separator\" = \"\/\" }\n { \"prefix\" = \"shared\/%%u\/\" }\n { \"location\" = \"maildir:%%h\/Maildir:INDEX=~\/Maildir\/shared\/%%u\" }\n { \"subscriptions\" = \"no\" }\n { \"list\" = \"children\" }\n }\n { }\n { \"mail_uid\" }\n { \"mail_gid\" }\n { \"mail_privileged_group\" }\n { \"mail_access_groups\" }\n { \"mail_full_filesystem_access\" = \"no\" }\n { \"mmap_disable\" = \"no\" }\n { \"dotlock_use_excl\" = \"yes\" }\n { \"mail_fsync\" = \"optimized\" }\n { \"mail_nfs_storage\" = \"no\" }\n { \"mail_nfs_index\" = \"no\" }\n { \"lock_method\" = \"fcntl\" }\n { \"mail_temp_dir\" = \"\/tmp\" }\n { \"first_valid_uid\" = \"500\" }\n { \"last_valid_uid\" = \"0\" }\n { \"first_valid_gid\" = \"1\" }\n { \"last_valid_gid\" = \"0\" }\n { \"mail_max_keyword_length\" = \"50\" }\n { \"valid_chroot_dirs\" }\n { \"mail_chroot\" }\n { \"auth_socket_path\" = \"\/var\/run\/dovecot\/auth-userdb\" }\n { \"mail_plugin_dir\" = \"\/usr\/lib\/dovecot\/modules\" }\n { \"mail_plugins\" }\n { \"mail_cache_min_mail_count\" = \"0\" }\n { \"mailbox_idle_check_interval\" = \"30 secs\" }\n { \"mail_save_crlf\" = \"no\" }\n { \"maildir_stat_dirs\" = \"no\" }\n { \"maildir_copy_with_hardlinks\" = \"yes\" }\n { \"maildir_very_dirty_syncs\" = \"no\" }\n { \"mbox_read_locks\" = \"fcntl\" }\n { \"mbox_write_locks\" = \"dotlock fcntl\" }\n { \"mbox_lock_timeout\" = \"5 mins\" }\n { \"mbox_dotlock_change_timeout\" = \"2 mins\" }\n { \"mbox_dirty_syncs\" = \"yes\" }\n { \"mbox_very_dirty_syncs\" = \"no\" }\n { \"mbox_lazy_writes\" = \"yes\" }\n { \"mbox_min_index_size\" = \"0\" }\n { \"mdbox_rotate_size\" = \"2M\" }\n { \"mdbox_rotate_interval\" = \"0\" }\n { \"mdbox_preallocate_space\" = \"no\" }\n { \"mail_attachment_dir\" }\n { \"mail_attachment_min_size\" = \"128k\" }\n { \"mail_attachment_fs\" = \"sis posix\" }\n { \"mail_attachment_hash\" = \"%{sha1}\" }\n\n\n(* ********************************* master ********************************* *)\n\nlet master_conf = \"\ndefault_process_limit = 100\ndefault_client_limit = 1000\ndefault_vsz_limit = 256M\ndefault_login_user = dovenull\ndefault_internal_user = dovecot\n\nservice imap-login {\n inet_listener imap {\n port = 143\n }\n inet_listener imaps {\n port = 993\n ssl = yes\n }\n service_count = 1\n process_min_avail = 0\n vsz_limit = 64M\n}\n\nservice pop3-login {\n inet_listener pop3 {\n port = 110\n }\n inet_listener pop3s {\n port = 995\n ssl = yes\n }\n}\n\nservice lmtp {\n unix_listener lmtp {\n mode = 0666\n }\n inet_listener lmtp {\n address =\n port = \n }\n}\n\nservice imap {\n vsz_limit = 256M\n process_limit = 1024\n}\n\nservice auth {\n unix_listener auth-userdb {\n mode = 0600\n user = \n group = \n }\n}\n\nservice auth-worker {\n user = root\n}\n\nservice dict {\n unix_listener dict {\n mode = 0600\n user = \n group = \n }\n}\n\"\n\ntest Dovecot.lns get master_conf =\n { }\n { \"default_process_limit\" = \"100\" }\n { \"default_client_limit\" = \"1000\" }\n { \"default_vsz_limit\" = \"256M\" }\n { \"default_login_user\" = \"dovenull\" }\n { \"default_internal_user\" = \"dovecot\" }\n { }\n { \"service\" = \"imap-login\"\n { \"inet_listener\" = \"imap\"\n { \"port\" = \"143\" }\n }\n { \"inet_listener\" = \"imaps\"\n { \"port\" = \"993\" }\n { \"ssl\" = \"yes\" }\n }\n { \"service_count\" = \"1\" }\n { \"process_min_avail\" = \"0\" }\n { \"vsz_limit\" = \"64M\" }\n }\n { }\n { \"service\" = \"pop3-login\"\n { \"inet_listener\" = \"pop3\"\n { \"port\" = \"110\" }\n }\n { \"inet_listener\" = \"pop3s\"\n { \"port\" = \"995\" }\n { \"ssl\" = \"yes\" }\n }\n }\n { }\n { \"service\" = \"lmtp\"\n { \"unix_listener\" = \"lmtp\"\n { \"mode\" = \"0666\" }\n }\n { \"inet_listener\" = \"lmtp\"\n { \"address\" }\n { \"port\" }\n }\n }\n { }\n { \"service\" = \"imap\"\n { \"vsz_limit\" = \"256M\" }\n { \"process_limit\" = \"1024\" }\n }\n { }\n { \"service\" = \"auth\"\n { \"unix_listener\" = \"auth-userdb\"\n { \"mode\" = \"0600\" }\n { \"user\" }\n { \"group\" }\n }\n }\n { }\n { \"service\" = \"auth-worker\"\n { \"user\" = \"root\" }\n }\n { }\n { \"service\" = \"dict\"\n { \"unix_listener\" = \"dict\"\n { \"mode\" = \"0600\" }\n { \"user\" }\n { \"group\" }\n }\n }\n\n(* *********************************** ssl ********************************** *)\n\nlet ssl_conf = \"## SSL settings\nssl = yes\nssl_cert = <\/etc\/ssl\/certs\/dovecot.pem\nssl_key = <\/etc\/ssl\/private\/dovecot.pem\nssl_key_password =\nssl_ca = \nssl_verify_client_cert = no\nssl_cert_username_field = commonName\nssl_parameters_regenerate = 168\nssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL\n\"\ntest Dovecot.lns get ssl_conf =\n { \"#comment\" = \"# SSL settings\" }\n { \"ssl\" = \"yes\" }\n { \"ssl_cert\" = \"<\/etc\/ssl\/certs\/dovecot.pem\" }\n { \"ssl_key\" = \"<\/etc\/ssl\/private\/dovecot.pem\" }\n { \"ssl_key_password\" }\n { \"ssl_ca\" }\n { \"ssl_verify_client_cert\" = \"no\" }\n { \"ssl_cert_username_field\" = \"commonName\" }\n { \"ssl_parameters_regenerate\" = \"168\" }\n { \"ssl_cipher_list\" = \"ALL:!LOW:!SSLv2:!EXP:!aNULL\" }\n\n(* ********************* \/etc\/dovecot\/conf.d\/15-lda.conf ******************** *)\n\nlet lda_conf = \"## LDA specific settings (also used by LMTP)\npostmaster_address =\nhostname = \nquota_full_tempfail = no\nsendmail_path = \/usr\/sbin\/sendmail\nsubmission_host =\nrejection_subject = Rejected: %s\nrejection_reason = Your message to <%t> was automatically rejected:%n%r\nrecipient_delimiter = +\nlda_original_recipient_header =\nlda_mailbox_autocreate = no\nlda_mailbox_autosubscribe = no\n\nprotocol lda {\n mail_plugins = $mail_plugins\n}\n\"\ntest Dovecot.lns get lda_conf =\n { \"#comment\" = \"# LDA specific settings (also used by LMTP)\" }\n { \"postmaster_address\" }\n { \"hostname\" }\n { \"quota_full_tempfail\" = \"no\" }\n { \"sendmail_path\" = \"\/usr\/sbin\/sendmail\" }\n { \"submission_host\" }\n { \"rejection_subject\" = \"Rejected: %s\" }\n { \"rejection_reason\" = \"Your message to <%t> was automatically rejected:%n%r\" }\n { \"recipient_delimiter\" = \"+\" }\n { \"lda_original_recipient_header\" }\n { \"lda_mailbox_autocreate\" = \"no\" }\n { \"lda_mailbox_autosubscribe\" = \"no\" }\n { }\n { \"protocol\" = \"lda\"\n { \"mail_plugins\" = \"$mail_plugins\" }\n }\n\n(* *********************************** acl ********************************** *)\n\nlet acl_conf = \"## Mailbox access control lists.\nplugin {\n acl = vfile:\/etc\/dovecot\/global-acls:cache_secs=300\n}\nplugin {\n acl_shared_dict = file:\/var\/lib\/dovecot\/shared-mailboxes\n}\n\"\n\ntest Dovecot.lns get acl_conf =\n { \"#comment\" = \"# Mailbox access control lists.\" }\n { \"plugin\"\n { \"acl\" = \"vfile:\/etc\/dovecot\/global-acls:cache_secs=300\" }\n }\n { \"plugin\"\n { \"acl_shared_dict\" = \"file:\/var\/lib\/dovecot\/shared-mailboxes\" }\n }\n\n(* ******************************** plugins ********************************* *)\n\nlet plugins_conf = \"\nplugin {\n quota_rule = *:storage=1G\n quota_rule2 = Trash:storage=+100M\n}\nplugin {\n quota_warning = storage=95%% quota-warning 95 %u\n quota_warning2 = storage=80%% quota-warning 80 %u\n}\nservice quota-warning {\n executable = script \/usr\/local\/bin\/quota-warning.sh\n user = dovecot\n unix_listener quota-warning {\n user = vmail\n }\n}\nplugin {\n quota = dirsize:User quota\n quota = maildir:User quota\n quota = dict:User quota::proxy::quota\n quota = fs:User quota\n}\nplugin {\n quota = dict:user::proxy::quota\n quota2 = dict:domain:%d:proxy::quota_domain\n quota_rule = *:storage=102400\n quota2_rule = *:storage=1048576\n}\nplugin {\n acl = vfile:\/etc\/dovecot\/global-acls:cache_secs=300\n}\nplugin {\n acl_shared_dict = file:\/var\/lib\/dovecot\/shared-mailboxes\n}\n\"\ntest Dovecot.lns get plugins_conf =\n { }\n { \"plugin\"\n { \"quota_rule\" = \"*:storage=1G\" }\n { \"quota_rule2\" = \"Trash:storage=+100M\" }\n }\n { \"plugin\"\n { \"quota_warning\" = \"storage=95%% quota-warning 95 %u\" }\n { \"quota_warning2\" = \"storage=80%% quota-warning 80 %u\" }\n }\n { \"service\" = \"quota-warning\"\n { \"executable\" = \"script \/usr\/local\/bin\/quota-warning.sh\" }\n { \"user\" = \"dovecot\" }\n { \"unix_listener\" = \"quota-warning\"\n { \"user\" = \"vmail\" }\n }\n }\n { \"plugin\"\n { \"quota\" = \"dirsize:User quota\" }\n { \"quota\" = \"maildir:User quota\" }\n { \"quota\" = \"dict:User quota::proxy::quota\" }\n { \"quota\" = \"fs:User quota\" }\n }\n { \"plugin\"\n { \"quota\" = \"dict:user::proxy::quota\" }\n { \"quota2\" = \"dict:domain:%d:proxy::quota_domain\" }\n { \"quota_rule\" = \"*:storage=102400\" }\n { \"quota2_rule\" = \"*:storage=1048576\" }\n }\n { \"plugin\"\n { \"acl\" = \"vfile:\/etc\/dovecot\/global-acls:cache_secs=300\" }\n }\n { \"plugin\"\n { \"acl_shared_dict\" = \"file:\/var\/lib\/dovecot\/shared-mailboxes\" }\n }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b8ab4c27a55a600baeddb769bf9afa9bd3212d62","subject":"Krb5 (realm_re, app_re): allow digits in realm names","message":"Krb5 (realm_re, app_re): allow digits in realm names\n\nStill makes the incorrect assumption that realm names start with an upper\ncase letter, and app names with a lower case one, but it's an improvement\nover the current restrictions.\n\nFixes bug https:\/\/fedorahosted.org\/augeas\/ticket\/139\n","repos":"manandbytes\/augeas,pevalme\/augeas,domcleal\/augeas,lutter\/augeas,kunkku\/augeas,kumy\/augeas,manandbytes\/augeas,mchf\/augeas,raphink\/augeas,dafugg\/augeas,lutter\/augeas,kumy\/augeas,ptoscano\/augeas,mchf\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,domcleal\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,ptoscano\/augeas,kumy\/augeas,MikaelSmith\/augeas,jasperla\/augeas,domcleal\/augeas,ptoscano\/augeas,jjlin\/augeas,mlichvar\/augeas,jtopjian\/augeas,raphink\/augeas,kumy\/augeas,hercules-team\/augeas,kunkku\/augeas,jjlin\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,pevalme\/augeas,dafugg\/augeas,jasperla\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/krb5.aug","new_file":"lenses\/krb5.aug","new_contents":"module Krb5 =\n\nautoload xfm\n\nlet comment = Inifile.comment \"#\" \"#\"\nlet empty = Inifile.empty\nlet eol = Inifile.eol\nlet dels = Util.del_str\n\nlet indent = del \/[ \\t]*\/ \"\"\nlet eq = del \/[ \\t]*=[ \\t]*\/ \" = \"\nlet eq_openbr = del \/[ \\t]*=[ \\t\\n]*\\{([ \\t]*\\n)*\/ \" = {\"\nlet closebr = del \/[ \\t]*\\}\/ \"}\"\n\n(* These two regexps for realms and apps are not entirely true\n - strictly speaking, there's no requirement that a realm is all upper case\n and an application only uses lowercase. But it's what's used in practice.\n\n Without that distinction we couldn't distinguish between applications\n and realms in the [appdefaults] section.\n*)\n\nlet realm_re = \/[A-Z][.a-zA-Z0-9-]*\/\nlet app_re = \/[a-z][a-zA-Z0-9_]*\/\nlet name_re = \/[.a-zA-Z0-9_-]+\/\n\nlet value = store \/[^;# \\t\\n{}]+\/\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ indent . key kw . sep . value . (comment|eol) ] | comment\n\nlet simple_section (n:string) (k:regexp) =\n let title = Inifile.indented_title n in\n let entry = entry k eq comment in\n Inifile.record title entry\n\nlet record (t:string) (e:lens) =\n let title = Inifile.indented_title t in\n Inifile.record title e\n\nlet libdefaults =\n let option = entry (name_re - \"v4_name_convert\") eq comment in\n let subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (entry name_re eq comment)* . closebr . eol ] in\n let v4_name_convert = [ indent . key \"v4_name_convert\" . eq_openbr .\n subsec* . closebr . eol ] in\n record \"libdefaults\" (option|v4_name_convert)\n\nlet login =\n let keys = \/krb[45]_get_tickets|krb4_convert|krb_run_aklog\/\n |\/aklog_path|accept_passwd\/ in\n simple_section \"login\" keys\n\nlet appdefaults =\n let option = entry (name_re - \"realm\" - \"application\") eq comment in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . option* . closebr . eol ] in\n let app = [ indent . label \"application\" . store app_re .\n eq_openbr . (realm|option)* . closebr . eol] in\n record \"appdefaults\" (option|realm|app)\n\nlet realms =\n let simple_option = \/kdc|admin_server|database_module|default_domain\/\n |\/v4_realm|auth_to_local(_names)?|master_kdc|kpasswd_server\/\n |\/admin_server\/ in\n let subsec_option = \/v4_instance_convert\/ in\n let option = entry simple_option eq comment in\n let subsec = [ indent . key subsec_option . eq_openbr .\n (entry name_re eq comment)* . closebr . eol ] in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . (option|subsec)* . closebr . eol ] in\n record \"realms\" (realm|comment)\n\nlet domain_realm =\n simple_section \"domain_realm\" name_re\n\nlet logging =\n let keys = \/kdc|admin_server|default\/ in\n let xchg (m:regexp) (d:string) (l:string) =\n del m d . label l in\n let xchgs (m:string) (l:string) = xchg m m l in\n let dest =\n [ xchg \/FILE[=:]\/ \"FILE=\" \"file\" . value ]\n |[ xchgs \"STDERR\" \"stderr\" ]\n |[ xchgs \"CONSOLE\" \"console\" ]\n |[ xchgs \"DEVICE=\" \"device\" . value ]\n |[ xchgs \"SYSLOG\" \"syslog\" .\n ([ xchgs \":\" \"severity\" . store \/[A-Za-z0-9]+\/ ].\n [ xchgs \":\" \"facility\" . store \/[A-Za-z0-9]+\/ ]?)? ] in\n let entry = [ indent . key keys . eq . dest . (comment|eol) ] | comment in\n record \"logging\" entry\n\nlet capaths =\n let realm = [ indent . key realm_re .\n eq_openbr .\n (entry realm_re eq comment)* . closebr . eol ] in\n record \"capaths\" (realm|comment)\n\nlet dbdefaults =\n let keys = \/database_module|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbdefaults\" keys\n\nlet dbmodules =\n let keys = \/db_library|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbmodules\" keys\n\n(* This section is not documented in the krb5.conf manpage,\n but the Fermi example uses it. *)\nlet instance_mapping =\n let value = dels \"\\\"\" . store \/[^;# \\t\\n{}]*\/ . dels \"\\\"\" in\n let map_node = label \"mapping\" . store \/[a-zA-Z0-9\\\/*]+\/ in\n let mapping = [ indent . map_node . eq .\n [ label \"value\" . value ] . (comment|eol) ] in\n let instance = [ indent . key name_re .\n eq_openbr . (mapping|comment)* . closebr . eol ] in\n record \"instancemapping\" instance\n\nlet kdc =\n simple_section \"kdc\" \/profile\/\n\nlet lns = (comment|empty)* .\n (libdefaults|login|appdefaults|realms|domain_realm\n |logging|capaths|dbdefaults|dbmodules|instance_mapping|kdc)*\n\nlet xfm = transform lns (incl \"\/etc\/krb5.conf\")\n","old_contents":"module Krb5 =\n\nautoload xfm\n\nlet comment = Inifile.comment \"#\" \"#\"\nlet empty = Inifile.empty\nlet eol = Inifile.eol\nlet dels = Util.del_str\n\nlet indent = del \/[ \\t]*\/ \"\"\nlet eq = del \/[ \\t]*=[ \\t]*\/ \" = \"\nlet eq_openbr = del \/[ \\t]*=[ \\t\\n]*\\{([ \\t]*\\n)*\/ \" = {\"\nlet closebr = del \/[ \\t]*\\}\/ \"}\"\n\n(* These two regexps for realms and apps are not entirely true\n - strictly speaking, there's no requirement that a realm is all upper case\n and an application only uses lowercase. But it's what's used in practice.\n\n Without that distinction we couldn't distinguish between applications\n and realms in the [appdefaults] section.\n*)\n\nlet realm_re = \/[.A-Z-]+\/\nlet app_re = \/[a-z0-9_]+\/\nlet name_re = \/[.a-zA-Z0-9_-]+\/\n\nlet value = store \/[^;# \\t\\n{}]+\/\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ indent . key kw . sep . value . (comment|eol) ] | comment\n\nlet simple_section (n:string) (k:regexp) =\n let title = Inifile.indented_title n in\n let entry = entry k eq comment in\n Inifile.record title entry\n\nlet record (t:string) (e:lens) =\n let title = Inifile.indented_title t in\n Inifile.record title e\n\nlet libdefaults =\n let option = entry (name_re - \"v4_name_convert\") eq comment in\n let subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (entry name_re eq comment)* . closebr . eol ] in\n let v4_name_convert = [ indent . key \"v4_name_convert\" . eq_openbr .\n subsec* . closebr . eol ] in\n record \"libdefaults\" (option|v4_name_convert)\n\nlet login =\n let keys = \/krb[45]_get_tickets|krb4_convert|krb_run_aklog\/\n |\/aklog_path|accept_passwd\/ in\n simple_section \"login\" keys\n\nlet appdefaults =\n let option = entry (name_re - \"realm\" - \"application\") eq comment in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . option* . closebr . eol ] in\n let app = [ indent . label \"application\" . store app_re .\n eq_openbr . (realm|option)* . closebr . eol] in\n record \"appdefaults\" (option|realm|app)\n\nlet realms =\n let simple_option = \/kdc|admin_server|database_module|default_domain\/\n |\/v4_realm|auth_to_local(_names)?|master_kdc|kpasswd_server\/\n |\/admin_server\/ in\n let subsec_option = \/v4_instance_convert\/ in\n let option = entry simple_option eq comment in\n let subsec = [ indent . key subsec_option . eq_openbr .\n (entry name_re eq comment)* . closebr . eol ] in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . (option|subsec)* . closebr . eol ] in\n record \"realms\" (realm|comment)\n\nlet domain_realm =\n simple_section \"domain_realm\" name_re\n\nlet logging =\n let keys = \/kdc|admin_server|default\/ in\n let xchg (m:regexp) (d:string) (l:string) =\n del m d . label l in\n let xchgs (m:string) (l:string) = xchg m m l in\n let dest =\n [ xchg \/FILE[=:]\/ \"FILE=\" \"file\" . value ]\n |[ xchgs \"STDERR\" \"stderr\" ]\n |[ xchgs \"CONSOLE\" \"console\" ]\n |[ xchgs \"DEVICE=\" \"device\" . value ]\n |[ xchgs \"SYSLOG\" \"syslog\" .\n ([ xchgs \":\" \"severity\" . store \/[A-Za-z0-9]+\/ ].\n [ xchgs \":\" \"facility\" . store \/[A-Za-z0-9]+\/ ]?)? ] in\n let entry = [ indent . key keys . eq . dest . (comment|eol) ] | comment in\n record \"logging\" entry\n\nlet capaths =\n let realm = [ indent . key realm_re .\n eq_openbr .\n (entry realm_re eq comment)* . closebr . eol ] in\n record \"capaths\" (realm|comment)\n\nlet dbdefaults =\n let keys = \/database_module|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbdefaults\" keys\n\nlet dbmodules =\n let keys = \/db_library|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbmodules\" keys\n\n(* This section is not documented in the krb5.conf manpage,\n but the Fermi example uses it. *)\nlet instance_mapping =\n let value = dels \"\\\"\" . store \/[^;# \\t\\n{}]*\/ . dels \"\\\"\" in\n let map_node = label \"mapping\" . store \/[a-zA-Z0-9\\\/*]+\/ in\n let mapping = [ indent . map_node . eq .\n [ label \"value\" . value ] . (comment|eol) ] in\n let instance = [ indent . key name_re .\n eq_openbr . (mapping|comment)* . closebr . eol ] in\n record \"instancemapping\" instance\n\nlet kdc =\n simple_section \"kdc\" \/profile\/\n\nlet lns = (comment|empty)* .\n (libdefaults|login|appdefaults|realms|domain_realm\n |logging|capaths|dbdefaults|dbmodules|instance_mapping|kdc)*\n\nlet xfm = transform lns (incl \"\/etc\/krb5.conf\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4c7d4e8e4109995287e1a823414fb141224bc898","subject":"Add lbracket and rbracket to sep.aug","message":"Add lbracket and rbracket to sep.aug\n","repos":"hercules-team\/augeas-do-not-use,lutter\/augeas,jasperla\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,mchf\/augeas,jjlin\/augeas,jjlin\/augeas,kumy\/augeas,jtopjian\/augeas,ptoscano\/augeas,jasperla\/augeas,pevalme\/augeas,mlichvar\/augeas,manandbytes\/augeas,jtopjian\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,mchf\/augeas,kumy\/augeas,mlichvar\/augeas,ptoscano\/augeas,lutter\/augeas,domcleal\/augeas,kumy\/augeas,mlichvar\/augeas,kunkku\/augeas,domcleal\/augeas,ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,kunkku\/augeas,pevalme\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,lutter\/augeas,raphink\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,kumy\/augeas,kunkku\/augeas,dafugg\/augeas,MikaelSmith\/augeas,domcleal\/augeas","old_file":"lenses\/sep.aug","new_file":"lenses\/sep.aug","new_contents":"(*\nModule: Sep\n Generic separators to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Sep =\n\n(* Variable: colon *)\nlet colon = Util.del_str \":\"\n\n(* Variable: comma *)\nlet comma = Util.del_str \",\"\n\n(* Variable: equal *)\nlet equal = Util.del_str \"=\"\n\n(* Variable: space_equal *)\nlet space_equal = Util.delim \"=\"\n\n(* Variable: space\n Deletes a <Rx.space> and default to a single space *)\nlet space = del Rx.space \" \"\n\n(* Variable: tab\n Deletes a <Rx.space> and default to a tab *)\nlet tab = del Rx.space \"\\t\"\n\n(* Variable: opt_space\n Deletes a <Rx.opt_space> and default to an empty string *)\nlet opt_space = del Rx.opt_space \"\"\n\n(* Variable: opt_tab\n Deletes a <Rx.opt_space> and default to a tab *)\nlet opt_tab = del Rx.opt_space \"\\t\"\n\n(* Variable: lbracket *)\nlet lbracket = Util.del_str \"(\"\n\n(* Variable: rbracket *)\nlet rbracket = Util.del_str \")\"\n","old_contents":"(*\nModule: Sep\n Generic separators to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Sep =\n\n(* Variable: colon *)\nlet colon = Util.del_str \":\"\n\n(* Variable: comma *)\nlet comma = Util.del_str \",\"\n\n(* Variable: equal *)\nlet equal = Util.del_str \"=\"\n\n(* Variable: space_equal *)\nlet space_equal = Util.delim \"=\"\n\n(* Variable: space\n Deletes a <Rx.space> and default to a single space *)\nlet space = del Rx.space \" \"\n\n(* Variable: tab\n Deletes a <Rx.space> and default to a tab *)\nlet tab = del Rx.space \"\\t\"\n\n(* Variable: opt_space\n Deletes a <Rx.opt_space> and default to an empty string *)\nlet opt_space = del Rx.opt_space \"\"\n\n(* Variable: opt_tab\n Deletes a <Rx.opt_space> and default to a tab *)\nlet opt_tab = del Rx.opt_space \"\\t\"\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9d87ed04c462d5bc7497369e0957027cb95cf7c9","subject":"Limits: also look for files in \/etc\/security\/limits.d","message":"Limits: also look for files in \/etc\/security\/limits.d\n\nSuggested by David Timms\n","repos":"kumy\/augeas,jjlin\/augeas,kumy\/augeas,raphink\/augeas,hercules-team\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,lutter\/augeas,ptoscano\/augeas,kunkku\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,manandbytes\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,mchf\/augeas,raphink\/augeas,jtopjian\/augeas,pevalme\/augeas,mlichvar\/augeas,hercules-team\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,jtopjian\/augeas,pevalme\/augeas,jasperla\/augeas,mlichvar\/augeas,mlichvar\/augeas,mchf\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,domcleal\/augeas,kunkku\/augeas,kumy\/augeas,kunkku\/augeas,jasperla\/augeas,jjlin\/augeas,domcleal\/augeas,manandbytes\/augeas,lutter\/augeas","old_file":"lenses\/limits.aug","new_file":"lenses\/limits.aug","new_contents":"(* Limits module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: \/etc\/security\/limits.conf\n\n*)\n\nmodule Limits =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet domain = label \"domain\" . store \/[%@]?[A-Za-z0-9_.-]+|\\*\/\n\nlet type_re = \"soft\"\n | \"hard\"\n | \"-\"\nlet type = [ label \"type\" . store type_re ]\n\nlet item_re = \"core\"\n | \"data\"\n | \"fsize\"\n | \"memlock\"\n | \"nofile\"\n | \"rss\"\n | \"stack\"\n | \"cpu\"\n | \"nproc\"\n | \"as\"\n | \"maxlogins\"\n | \"maxsyslogins\"\n | \"priority\"\n | \"locks\"\n | \"sigpending\"\n | \"msgqueue\"\n | \"nice\"\n | \"rtprio\"\n | \"chroot\"\nlet item = [ label \"item\" . store item_re ]\n\nlet value = [ label \"value\" . store \/[A-Za-z0-9_.\\\/-]+\/ ]\nlet entry = [ domain . spc\n . type . spc\n . item . spc\n . value . eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/security\/limits.conf\"\n . incl \"\/etc\/security\/limits.d\/*.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Limits module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: \/etc\/security\/limits.conf\n\n*)\n\nmodule Limits =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet domain = label \"domain\" . store \/[%@]?[A-Za-z0-9_.-]+|\\*\/\n\nlet type_re = \"soft\"\n | \"hard\"\n | \"-\"\nlet type = [ label \"type\" . store type_re ]\n\nlet item_re = \"core\"\n | \"data\"\n | \"fsize\"\n | \"memlock\"\n | \"nofile\"\n | \"rss\"\n | \"stack\"\n | \"cpu\"\n | \"nproc\"\n | \"as\"\n | \"maxlogins\"\n | \"maxsyslogins\"\n | \"priority\"\n | \"locks\"\n | \"sigpending\"\n | \"msgqueue\"\n | \"nice\"\n | \"rtprio\"\n | \"chroot\"\nlet item = [ label \"item\" . store item_re ]\n\nlet value = [ label \"value\" . store \/[A-Za-z0-9_.\\\/-]+\/ ]\nlet entry = [ domain . spc\n . type . spc\n . item . spc\n . value . eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/security\/limits.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cf757985fc41a310d9cf79b7fda78034ac249aad","subject":"Shellvars: add unsupported syntax to tests (Issue #343)","message":"Shellvars: add unsupported syntax to tests (Issue #343)\n","repos":"manandbytes\/augeas,kunkku\/augeas,manandbytes\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas,pevalme\/augeas,lutter\/augeas,ptoscano\/augeas,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas,mchf\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\"\n { \"1\" = \"ONBOOT\" }\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\"\n { \"1\" = \"FOO\" } }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Allow wrapping builtin arguments to multiple lines *)\n test Shellvars.lns get \"ulimit -c \\\\\\nunlimited\\nulimit \\\\\\n -x 123\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c \\\\\\nunlimited\" } }\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-x 123\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file1\" }\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file2\" }\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"@unset\"\n { \"1\" = \"f\" } } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"b\" }\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\"\n { \"@pattern\" = \"eth0\" }\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\"\n { \"1\" = \"f\" } } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" { \"@pattern\" = \"*\" } } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\"\n { \"@pattern\" = \"*debug*\" }\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* Partial quoting is allowed *)\n test Shellvars.lns get \"FOO=\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\\n\" =\n { \"FOO\" = \"\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\"\n { \"1\" = \"${!LC_*}\" } }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n # \n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\ntest \\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\ntest \\\\\\ntest2\\\"\" }\n\n (* Export of multiple variables, RHBZ#1033795 *)\n test lns get \"export TestVar1 TestVar2\\n\" =\n { \"@export\"\n { \"1\" = \"TestVar1\" }\n { \"2\" = \"TestVar2\" } }\n\n (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)\n test lns get \"case $ARG in\n 0) TestVar=\\\"test0\\\" ;;\n 1) TestVar=\\\"test1\\\" ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"TestVar\" = \"\\\"test0\\\"\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"TestVar\" = \"\\\"test1\\\"\" } } }\n\n (* case: support ;; on the same line with multiple commands *)\n test lns get \"case $ARG in\n 0) Foo=0; Bar=1;;\n 1)\n\t Foo=2\n\t Bar=3; Baz=4;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"Foo\" = \"0\" }\n { \"Bar\" = \"1\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"Foo\" = \"2\" }\n { \"Bar\" = \"3\" }\n { \"Baz\" = \"4\" }\n }\n }\n\n(* Test: Shellvars.lns\n Support `##` bashism in conditions (GH issue #118) *)\ntest Shellvars.lns get \"if [ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ] ; then\n SUFFIX=\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\nelse\n SUFFIX=\nfi\\n\" =\n { \"@if\" = \"[ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ]\"\n { \"SUFFIX\" = \"\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\" }\n { \"@else\"\n { \"SUFFIX\" = \"\" }\n }\n }\n\n (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)\n test lns get \"export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\\n\" =\n { \"MALLOC_PERTURB_\" = \"$(($RANDOM % 255 + 1))\"\n { \"export\" } }\n\n (*\n * Github issue 202\n *)\n let starts_with_blank = \"\\n \\nVAR=value\\n\"\n\n test lns get starts_with_blank = { \"VAR\" = \"value\" }\n\n (* It is now possible to insert at the beginning of a file\n * that starts with blank lines *)\n test lns put starts_with_blank after\n insb \"#comment\" \"\/*[1]\";\n set \"\/#comment[1]\" \"a comment\" =\n \" # a comment\\nVAR=value\\n\"\n\n (* Modifications of the file lose the blank lines though *)\n test lns put starts_with_blank after\n set \"\/VAR2\" \"abc\" = \"VAR=value\\nVAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\";\n set \"\/VAR2\" \"abc\" = \"VAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\" = \"\"\n\n (* Support associative arrays *)\n test lns get \"var[alpha_beta,gamma]=something\\n\" =\n { \"var[alpha_beta,gamma]\" = \"something\" }\n\n (* GH #188: support more conditions *)\n test Shellvars.lns get \"[ -f $FILENAME ]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" } }\n\n test Shellvars.lns get \"[[ -f $FILENAME ]]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[[\" } }\n\n (* Allow wrapping loop condition to multiple lines *)\n test Shellvars.lns get \"for x in foo \\\\\\nbar\\\\\\nbaz; do y=$x; done\\n\" =\n { \"@for\" = \"x in foo \\\\\\nbar\\\\\\nbaz\" { \"y\" = \"$x\" } }\n\n (* Allow quotes in loop conditions *)\n test Shellvars.lns get \"for x in \\\"$@\\\"; do y=$x; done\\n\" =\n { \"@for\" = \"x in \\\"$@\\\"\" { \"y\" = \"$x\" } }\n\n (* case: support quotes and spaces in pattern lists *)\n test lns get \"case $ARG in\n \\\"foo bar\\\")\n Foo=0\n ;;\n baz | quux)\n Foo=1\n ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"\\\"foo bar\\\"\" }\n { \"Foo\" = \"0\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"baz\" }\n { \"@pattern\" = \"quux\" }\n { \"Foo\" = \"1\" }\n }\n }\n\n (* eval *)\n test lns get \"eval `dircolors`\\n\" =\n { \"@eval\" = \"`dircolors`\" }\n\n (* alias *)\n test lns get \"alias ls='ls $LS_OPTIONS'\\n\" =\n { \"@alias\" = \"ls\" { \"value\" = \"'ls $LS_OPTIONS'\" } }\n\n (* Allow && and || constructs after condition *)\n test Shellvars.lns get \"[ -f $FILENAME ] && do this || or that\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" }\n { \"@and\" = \"do this\" }\n { \"@or\" = \"or that\" } }\n\n(* Test: Shellvars.lns\n Parse (almost) any command *)\ntest Shellvars.lns get \"echo foobar 'and this is baz'\n\/usr\/local\/bin\/myscript.sh with args\necho foo \\\nbar\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foobar 'and this is baz'\" }\n }\n { \"@command\" = \"\/usr\/local\/bin\/myscript.sh\"\n { \"@arg\" = \"with args\" }\n }\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foo \\\\\\nbar\" }\n }\n\n(* Test: Shellvars.lns\n Support pipes in commands *)\ntest Shellvars.lns get \"echo \\\"$STRING\\\" | grep foo\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"\\\"$STRING\\\"\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"foo\" } } } }\n\n(* Test: Shellvars.lns\n Support && and || after command\n GH #215 *)\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && echo moo\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue || echo baa\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && DEBIAN=1\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"DEBIAN\" = \"1\" } } }\n\ntest Shellvars.lns get \"cat \/etc\/issue | grep -q \\\"Debian\\\" && echo moo || echo baa\\n\" =\n { \"@command\" = \"cat\"\n { \"@arg\" = \"\/etc\/issue\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\"\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } } } } } }\n\n(* Command-specific environment variables *)\ntest Shellvars.lns get \"abc=def \\\\\\n ghi=\\\"jkl mno\\\" command arg1 arg2\\n\" =\n { \"@command\" = \"command\"\n { \"abc\" = \"def\" }\n { \"ghi\" = \"\\\"jkl mno\\\"\" }\n { \"@arg\" = \"arg1 arg2\" }\n }\n\n(* Wrapped command sequences *)\n\ntest Shellvars.lns get \"foo && \\\\\\nbar baz \\\\\\n|| qux \\\\\\n quux\\\\\\ncorge grault\\n\" =\n { \"@command\" = \"foo\"\n { \"@and\"\n { \"@command\" = \"bar\"\n { \"@arg\" = \"baz\" }\n\t{ \"@or\" { \"@command\" = \"qux\" { \"@arg\" = \"quux\\\\\\ncorge grault\" } } }\n }\n }\n }\n\n(* Comment after function definition (Issue #339) *)\ntest Shellvars.lns get \"SetDir() # hello\n{\n echo\n}\\n\" =\n { \"@function\" = \"SetDir\"\n { \"#comment\" = \"hello\" }\n { \"@command\" = \"echo\" }\n }\n\n(* Function with new lines *)\ntest Shellvars.lns get \"MyFunc()\n{\n echo\n}\\n\" =\n { \"@function\" = \"MyFunc\"\n { \"@command\" = \"echo\" }\n }\n\n(* Pipe and newline without cl (Issue #339) *)\ntest Shellvars.lns get \"echo |\ntr\\n\" =\n { \"@command\" = \"echo\"\n { \"@pipe\"\n { \"@command\" = \"tr\" } } }\n\n\n(* Subshell (Issue #339) *)\ntest Shellvars.lns get \"{ echo\n}\\n\" =\n { \"@subshell\"\n { \"@command\" = \"echo\" }\n } \n\n(* One-liner function *)\ntest Shellvars.lns get \"MyFunc() { echo; }\\n\" =\n { \"@function\" = \"MyFunc\"\n { \"@command\" = \"echo\" }\n }\n\n\n(*********************************************************\n * Group: Unsupported syntax *\n * *\n * The following tests are known to be failing currently *\n *********************************************************)\n\n(* Any piping (Issue #343) *)\ntest Shellvars.lns get \"FOO=bar && BAR=foo\necho foo || { echo bar; }\necho FOO | myfunc() { echo bar; }\\n\" = *\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\"\n { \"1\" = \"ONBOOT\" }\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\"\n { \"1\" = \"FOO\" } }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Allow wrapping builtin arguments to multiple lines *)\n test Shellvars.lns get \"ulimit -c \\\\\\nunlimited\\nulimit \\\\\\n -x 123\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c \\\\\\nunlimited\" } }\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-x 123\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file1\" }\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"\/tmp\/file2\" }\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"@unset\"\n { \"1\" = \"f\" } } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\"\n { \"@pattern\" = \"a\" }\n { \"B\" = \"C\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"b\" }\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\"\n { \"@pattern\" = \"eth0\" }\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\"\n { \"@pattern\" = \"*\" }\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\"\n { \"1\" = \"f\" } } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" { \"@pattern\" = \"*\" } } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\"\n { \"@pattern\" = \"*debug*\" }\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* Partial quoting is allowed *)\n test Shellvars.lns get \"FOO=\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\\n\" =\n { \"FOO\" = \"\\\"$bar\\\"\/'baz'\/$(quux)$((1 + 2))\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\"\n { \"1\" = \"${!LC_*}\" } }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n # \n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\ntest \\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\ntest \\\\\\ntest2\\\"\" }\n\n (* Export of multiple variables, RHBZ#1033795 *)\n test lns get \"export TestVar1 TestVar2\\n\" =\n { \"@export\"\n { \"1\" = \"TestVar1\" }\n { \"2\" = \"TestVar2\" } }\n\n (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)\n test lns get \"case $ARG in\n 0) TestVar=\\\"test0\\\" ;;\n 1) TestVar=\\\"test1\\\" ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"TestVar\" = \"\\\"test0\\\"\" } }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"TestVar\" = \"\\\"test1\\\"\" } } }\n\n (* case: support ;; on the same line with multiple commands *)\n test lns get \"case $ARG in\n 0) Foo=0; Bar=1;;\n 1)\n\t Foo=2\n\t Bar=3; Baz=4;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"0\" }\n { \"Foo\" = \"0\" }\n { \"Bar\" = \"1\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"1\" }\n { \"Foo\" = \"2\" }\n { \"Bar\" = \"3\" }\n { \"Baz\" = \"4\" }\n }\n }\n\n(* Test: Shellvars.lns\n Support `##` bashism in conditions (GH issue #118) *)\ntest Shellvars.lns get \"if [ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ] ; then\n SUFFIX=\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\nelse\n SUFFIX=\nfi\\n\" =\n { \"@if\" = \"[ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ]\"\n { \"SUFFIX\" = \"\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\" }\n { \"@else\"\n { \"SUFFIX\" = \"\" }\n }\n }\n\n (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)\n test lns get \"export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\\n\" =\n { \"MALLOC_PERTURB_\" = \"$(($RANDOM % 255 + 1))\"\n { \"export\" } }\n\n (*\n * Github issue 202\n *)\n let starts_with_blank = \"\\n \\nVAR=value\\n\"\n\n test lns get starts_with_blank = { \"VAR\" = \"value\" }\n\n (* It is now possible to insert at the beginning of a file\n * that starts with blank lines *)\n test lns put starts_with_blank after\n insb \"#comment\" \"\/*[1]\";\n set \"\/#comment[1]\" \"a comment\" =\n \" # a comment\\nVAR=value\\n\"\n\n (* Modifications of the file lose the blank lines though *)\n test lns put starts_with_blank after\n set \"\/VAR2\" \"abc\" = \"VAR=value\\nVAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\";\n set \"\/VAR2\" \"abc\" = \"VAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\" = \"\"\n\n (* Support associative arrays *)\n test lns get \"var[alpha_beta,gamma]=something\\n\" =\n { \"var[alpha_beta,gamma]\" = \"something\" }\n\n (* GH #188: support more conditions *)\n test Shellvars.lns get \"[ -f $FILENAME ]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" } }\n\n test Shellvars.lns get \"[[ -f $FILENAME ]]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[[\" } }\n\n (* Allow wrapping loop condition to multiple lines *)\n test Shellvars.lns get \"for x in foo \\\\\\nbar\\\\\\nbaz; do y=$x; done\\n\" =\n { \"@for\" = \"x in foo \\\\\\nbar\\\\\\nbaz\" { \"y\" = \"$x\" } }\n\n (* Allow quotes in loop conditions *)\n test Shellvars.lns get \"for x in \\\"$@\\\"; do y=$x; done\\n\" =\n { \"@for\" = \"x in \\\"$@\\\"\" { \"y\" = \"$x\" } }\n\n (* case: support quotes and spaces in pattern lists *)\n test lns get \"case $ARG in\n \\\"foo bar\\\")\n Foo=0\n ;;\n baz | quux)\n Foo=1\n ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\"\n { \"@pattern\" = \"\\\"foo bar\\\"\" }\n { \"Foo\" = \"0\" }\n }\n { \"@case_entry\"\n { \"@pattern\" = \"baz\" }\n { \"@pattern\" = \"quux\" }\n { \"Foo\" = \"1\" }\n }\n }\n\n (* eval *)\n test lns get \"eval `dircolors`\\n\" =\n { \"@eval\" = \"`dircolors`\" }\n\n (* alias *)\n test lns get \"alias ls='ls $LS_OPTIONS'\\n\" =\n { \"@alias\" = \"ls\" { \"value\" = \"'ls $LS_OPTIONS'\" } }\n\n (* Allow && and || constructs after condition *)\n test Shellvars.lns get \"[ -f $FILENAME ] && do this || or that\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" }\n { \"@and\" = \"do this\" }\n { \"@or\" = \"or that\" } }\n\n(* Test: Shellvars.lns\n Parse (almost) any command *)\ntest Shellvars.lns get \"echo foobar 'and this is baz'\n\/usr\/local\/bin\/myscript.sh with args\necho foo \\\nbar\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foobar 'and this is baz'\" }\n }\n { \"@command\" = \"\/usr\/local\/bin\/myscript.sh\"\n { \"@arg\" = \"with args\" }\n }\n { \"@command\" = \"echo\"\n { \"@arg\" = \"foo \\\\\\nbar\" }\n }\n\n(* Test: Shellvars.lns\n Support pipes in commands *)\ntest Shellvars.lns get \"echo \\\"$STRING\\\" | grep foo\\n\" =\n { \"@command\" = \"echo\"\n { \"@arg\" = \"\\\"$STRING\\\"\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"foo\" } } } }\n\n(* Test: Shellvars.lns\n Support && and || after command\n GH #215 *)\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && echo moo\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue || echo baa\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } }\n\ntest Shellvars.lns get \"grep -q \\\"Debian\\\" \/etc\/issue && DEBIAN=1\\n\" =\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\" \/etc\/issue\" }\n { \"@and\"\n { \"DEBIAN\" = \"1\" } } }\n\ntest Shellvars.lns get \"cat \/etc\/issue | grep -q \\\"Debian\\\" && echo moo || echo baa\\n\" =\n { \"@command\" = \"cat\"\n { \"@arg\" = \"\/etc\/issue\" }\n { \"@pipe\"\n { \"@command\" = \"grep\"\n { \"@arg\" = \"-q \\\"Debian\\\"\" }\n { \"@and\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"moo\" }\n { \"@or\"\n { \"@command\" = \"echo\"\n { \"@arg\" = \"baa\" } } } } } } } }\n\n(* Command-specific environment variables *)\ntest Shellvars.lns get \"abc=def \\\\\\n ghi=\\\"jkl mno\\\" command arg1 arg2\\n\" =\n { \"@command\" = \"command\"\n { \"abc\" = \"def\" }\n { \"ghi\" = \"\\\"jkl mno\\\"\" }\n { \"@arg\" = \"arg1 arg2\" }\n }\n\n(* Wrapped command sequences *)\n\ntest Shellvars.lns get \"foo && \\\\\\nbar baz \\\\\\n|| qux \\\\\\n quux\\\\\\ncorge grault\\n\" =\n { \"@command\" = \"foo\"\n { \"@and\"\n { \"@command\" = \"bar\"\n { \"@arg\" = \"baz\" }\n\t{ \"@or\" { \"@command\" = \"qux\" { \"@arg\" = \"quux\\\\\\ncorge grault\" } } }\n }\n }\n }\n\n(* Comment after function definition (Issue #339) *)\ntest Shellvars.lns get \"SetDir() # hello\n{\n echo\n}\\n\" =\n { \"@function\" = \"SetDir\"\n { \"#comment\" = \"hello\" }\n { \"@command\" = \"echo\" }\n }\n\n(* Function with new lines *)\ntest Shellvars.lns get \"MyFunc()\n{\n echo\n}\\n\" =\n { \"@function\" = \"MyFunc\"\n { \"@command\" = \"echo\" }\n }\n\n(* Pipe and newline without cl (Issue #339) *)\ntest Shellvars.lns get \"echo |\ntr\\n\" =\n { \"@command\" = \"echo\"\n { \"@pipe\"\n { \"@command\" = \"tr\" } } }\n\n\n(* Subshell (Issue #339) *)\ntest Shellvars.lns get \"{ echo\n}\\n\" =\n { \"@subshell\"\n { \"@command\" = \"echo\" }\n } \n\n(* One-liner function *)\ntest Shellvars.lns get \"MyFunc() { echo; }\\n\" =\n { \"@function\" = \"MyFunc\"\n { \"@command\" = \"echo\" }\n }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"355144a2c8304852694a6b333da3a74ab6bb6b0f","subject":"Shellvars: add systemd's \/etc\/os-release file","message":"Shellvars: add systemd's \/etc\/os-release file\n","repos":"mchf\/augeas,kumy\/augeas,jasperla\/augeas,mlichvar\/augeas,domcleal\/augeas,ptoscano\/augeas,jtopjian\/augeas,lutter\/augeas,jjlin\/augeas,kumy\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jjlin\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,pevalme\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,pevalme\/augeas,mlichvar\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,lutter\/augeas,kunkku\/augeas,dafugg\/augeas,kumy\/augeas,kunkku\/augeas,domcleal\/augeas,MikaelSmith\/augeas,raphink\/augeas,ptoscano\/augeas,jasperla\/augeas,mchf\/augeas,kunkku\/augeas,kumy\/augeas,domcleal\/augeas,mlichvar\/augeas,pevalme\/augeas,ptoscano\/augeas,dafugg\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4fa3e7085ba9aff48ff96c204b16ae8900c36c0a","subject":"Add seccomp_sandbox to vsftpd.aug lens","message":"Add seccomp_sandbox to vsftpd.aug lens\n\nRequired for Docker containers. Enabled by default on amd64\r\nhttps:\/\/wiki.gentoo.org\/wiki\/Vsftpd\r\nseccomp filter sanboxing with vsftpd 3.0.x","repos":"kunkku\/augeas,mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas,lutter\/augeas,pevalme\/augeas,pevalme\/augeas,hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,mlichvar\/augeas,ptoscano\/augeas,lutter\/augeas,lutter\/augeas,kunkku\/augeas","old_file":"lenses\/vsftpd.aug","new_file":"lenses\/vsftpd.aug","new_contents":"(* Parse vsftpd.conf *)\nmodule Vsftpd =\n autoload xfm\n\n(* The code in parseconf.c does not seem to allow for trailing whitespace *)\n(* in the config file *)\nlet eol = Util.del_str \"\\n\"\nlet empty = Util.empty\nlet comment = Util.comment\n\nlet bool_option_re = \/anonymous_enable|isolate|isolate_network|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert|require_ssl_reuse|allow_writeable_chroot|seccomp_sandbox\/\n\nlet uint_option_re = \/accept_timeout|connect_timeout|local_umask|anon_umask|ftp_data_port|idle_session_timeout|data_connection_timeout|pasv_min_port|pasv_max_port|anon_max_rate|local_max_rate|listen_port|max_clients|file_open_mode|max_per_ip|trans_chunk_size|delay_failed_login|delay_successful_login|max_login_fails|chown_upload_mode\/\n\nlet str_option_re = \/secure_chroot_dir|ftp_username|chown_username|xferlog_file|vsftpd_log_file|message_file|nopriv_user|ftpd_banner|banned_email_file|chroot_list_file|pam_service_name|guest_username|userlist_file|anon_root|local_root|banner_file|pasv_address|listen_address|user_config_dir|listen_address6|cmds_allowed|hide_file|deny_file|user_sub_token|email_password_file|rsa_cert_file|dsa_cert_file|ssl_ciphers|rsa_private_key_file|dsa_private_key_file|ca_certs_file\/\n\nlet bool_value_re = \/[yY][eE][sS]|[tT][rR][uU][eE]|1|[nN][oO]|[fF][aA][lL][sS][eE]|0\/\n\nlet option (k:regexp) (v:regexp) = [ key k . Util.del_str \"=\" . store v . eol ]\n\nlet bool_option = option bool_option_re bool_value_re\n\nlet str_option = option str_option_re \/[^\\n]+\/\n\nlet uint_option = option uint_option_re \/[0-9]+\/\n\nlet lns = (bool_option|str_option|uint_option|comment|empty)*\n\nlet filter = (incl \"\/etc\/vsftpd.conf\") . (incl \"\/etc\/vsftpd\/vsftpd.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(* Parse vsftpd.conf *)\nmodule Vsftpd =\n autoload xfm\n\n(* The code in parseconf.c does not seem to allow for trailing whitespace *)\n(* in the config file *)\nlet eol = Util.del_str \"\\n\"\nlet empty = Util.empty\nlet comment = Util.comment\n\nlet bool_option_re = \/anonymous_enable|isolate|isolate_network|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert|require_ssl_reuse|allow_writeable_chroot\/\n\nlet uint_option_re = \/accept_timeout|connect_timeout|local_umask|anon_umask|ftp_data_port|idle_session_timeout|data_connection_timeout|pasv_min_port|pasv_max_port|anon_max_rate|local_max_rate|listen_port|max_clients|file_open_mode|max_per_ip|trans_chunk_size|delay_failed_login|delay_successful_login|max_login_fails|chown_upload_mode\/\n\nlet str_option_re = \/secure_chroot_dir|ftp_username|chown_username|xferlog_file|vsftpd_log_file|message_file|nopriv_user|ftpd_banner|banned_email_file|chroot_list_file|pam_service_name|guest_username|userlist_file|anon_root|local_root|banner_file|pasv_address|listen_address|user_config_dir|listen_address6|cmds_allowed|hide_file|deny_file|user_sub_token|email_password_file|rsa_cert_file|dsa_cert_file|ssl_ciphers|rsa_private_key_file|dsa_private_key_file|ca_certs_file\/\n\nlet bool_value_re = \/[yY][eE][sS]|[tT][rR][uU][eE]|1|[nN][oO]|[fF][aA][lL][sS][eE]|0\/\n\nlet option (k:regexp) (v:regexp) = [ key k . Util.del_str \"=\" . store v . eol ]\n\nlet bool_option = option bool_option_re bool_value_re\n\nlet str_option = option str_option_re \/[^\\n]+\/\n\nlet uint_option = option uint_option_re \/[0-9]+\/\n\nlet lns = (bool_option|str_option|uint_option|comment|empty)*\n\nlet filter = (incl \"\/etc\/vsftpd.conf\") . (incl \"\/etc\/vsftpd\/vsftpd.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"534854be44fb2ab1bb0148dcb4db275568b094c2","subject":"Util: Add comment_c_style_or_hash","message":"Util: Add comment_c_style_or_hash\n","repos":"ptoscano\/augeas,kunkku\/augeas,dafugg\/augeas,manandbytes\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas,ptoscano\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,jjlin\/augeas,lutter\/augeas,dafugg\/augeas,kunkku\/augeas,hercules-team\/augeas,jjlin\/augeas,mchf\/augeas,manandbytes\/augeas,mlichvar\/augeas,dafugg\/augeas,ptoscano\/augeas,mchf\/augeas,lutter\/augeas,pevalme\/augeas,pevalme\/augeas,mlichvar\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n*)\n\n\n(* View: comment_generic_seteol\n Map comments and set default comment sign\n*)\n\n let comment_generic_seteol (r:regexp) (d:string) (eol:lens) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . eol ]\n\n(* View: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n comment_generic_seteol r d doseol\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: comment_c_style_or_hash\n A comment line, C-style or hash *)\n let comment_c_style_or_hash =\n comment_generic \/[ \\t]*((\\\/\\\/)|#)[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* Variable: empty_generic_re *)\n let empty_generic_re = \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic empty_generic_re\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n(* View: empty_generic_dos\n A generic definition of <empty> with dos newlines\n Map empty lines, including empty comments *)\n let empty_generic_dos (r:regexp) =\n [ del r \"\" . del \/\\r?\\n\/ \"\\n\" ]\n\n(* View: empty_dos *)\n let empty_dos =\n empty_generic_dos \/[ \\t]*#?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\") .\n (excl \"*.bak\") .\n (excl \"*.old\") .\n (excl \"#*#\")\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n*)\n\n\n(* View: comment_generic_seteol\n Map comments and set default comment sign\n*)\n\n let comment_generic_seteol (r:regexp) (d:string) (eol:lens) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . eol ]\n\n(* View: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n comment_generic_seteol r d doseol\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* Variable: empty_generic_re *)\n let empty_generic_re = \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic empty_generic_re\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n(* View: empty_generic_dos\n A generic definition of <empty> with dos newlines\n Map empty lines, including empty comments *)\n let empty_generic_dos (r:regexp) =\n [ del r \"\" . del \/\\r?\\n\/ \"\\n\" ]\n\n(* View: empty_dos *)\n let empty_dos =\n empty_generic_dos \/[ \\t]*#?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\") .\n (excl \"*.bak\") .\n (excl \"*.old\") .\n (excl \"#*#\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"05ac46664af854214b39de2f0c0d3ba9c4cf233e","subject":"Add FreeBSD \/etc\/rc.conf file to Shellvars lens.","message":"Add FreeBSD \/etc\/rc.conf file to Shellvars lens.\n","repos":"jtopjian\/augeas,domcleal\/augeas,mlichvar\/augeas,ptoscano\/augeas,jtopjian\/augeas,jjlin\/augeas,lutter\/augeas,domcleal\/augeas,kumy\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,lutter\/augeas,dafugg\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,dafugg\/augeas,jjlin\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,kumy\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,kumy\/augeas,lutter\/augeas,kumy\/augeas,manandbytes\/augeas,pevalme\/augeas,dafugg\/augeas,ptoscano\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,raphink\/augeas,jasperla\/augeas,pevalme\/augeas,domcleal\/augeas,mchf\/augeas,mchf\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . store \/[^ \\t\\n][^;\\n]+[^ \\t\\n]|[^ \\t;\\n]+\/ ]\n . eol ]\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/rc.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . store \/[^ \\t\\n][^;\\n]+[^ \\t\\n]|[^ \\t;\\n]+\/ ]\n . eol ]\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e3cf080cf4d69e12043c68cb59310d06177e6a05","subject":"Nsswitch: add passwd_compat, group_compat and shadow_compat GNU extensions","message":"Nsswitch: add passwd_compat, group_compat and shadow_compat GNU extensions\n","repos":"raphink\/augeas,domcleal\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,raphink\/augeas,mlichvar\/augeas,mchf\/augeas,jjlin\/augeas,hercules-team\/augeas,domcleal\/augeas,kumy\/augeas,domcleal\/augeas,manandbytes\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kunkku\/augeas,dafugg\/augeas,dafugg\/augeas,pevalme\/augeas,jasperla\/augeas,mlichvar\/augeas,jjlin\/augeas,mchf\/augeas,ptoscano\/augeas,ptoscano\/augeas,kumy\/augeas,lutter\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,kunkku\/augeas,hercules-team\/augeas,jjlin\/augeas,ptoscano\/augeas,kunkku\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,mlichvar\/augeas,lutter\/augeas,jtopjian\/augeas,jasperla\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/nsswitch.aug","new_file":"lenses\/nsswitch.aug","new_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n let database_kw = \"aliases\"\n | \"automount\"\n | \"bootparams\"\n | \"ethers\"\n | \"group\"\n | \"hosts\"\n | \"netgroup\"\n | \"netmasks\"\n | \"networks\"\n | \"passwd\"\n | \"protocols\"\n | \"publickey\"\n | \"rpc\"\n | \"sendmailvars\"\n | \"services\"\n | \"shadow\"\n | \"sudoers\"\n | \"passwd_compat\"\n | \"group_compat\"\n | \"shadow_compat\"\n in [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n let database_kw = \"aliases\"\n | \"automount\"\n | \"bootparams\"\n | \"ethers\"\n | \"group\"\n | \"hosts\"\n | \"netgroup\"\n | \"netmasks\"\n | \"networks\"\n | \"passwd\"\n | \"protocols\"\n | \"publickey\"\n | \"rpc\"\n | \"sendmailvars\"\n | \"services\"\n | \"shadow\"\n | \"sudoers\"\n in [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"03d6082d0f74931a3ef733fe873554f595d9dcae","subject":"update rsyslog lens to includ files in rsyslog.d dir (#475)","message":"update rsyslog lens to includ files in rsyslog.d dir (#475)\n\n","repos":"pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas,lutter\/augeas,pevalme\/augeas,lutter\/augeas,ptoscano\/augeas,hercules-team\/augeas,pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,kunkku\/augeas,mlichvar\/augeas","old_file":"lenses\/rsyslog.aug","new_file":"lenses\/rsyslog.aug","new_contents":"(*\nModule: Rsyslog\n Parses \/etc\/rsyslog.conf\n\nAuthor: Raphael Pinson <raphael.pinsons@camptocamp.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 rsyslog.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/rsyslog.conf. See <filter>.\n\nAbout: Examples\n The <Test_Rsyslog> file contains various examples and tests.\n*)\nmodule Rsyslog =\n\nautoload xfm\n\nlet macro_rx = \/[^,# \\n\\t][^#\\n]*[^,# \\n\\t]|[^,# \\n\\t]\/\nlet macro = [ key \/$[A-Za-z0-9]+\/ . Sep.space . store macro_rx . Util.comment_or_eol ]\n\nlet config_object_param = [ key \/[A-Za-z.]+\/ . Sep.equal . Quote.dquote\n . store \/[^\"]+\/ . Quote.dquote ]\nlet config_object = [ key \/action|global|input|module|parser|timezone\/ . Sep.lbracket\n . config_object_param . ( Sep.space . config_object_param )* . Sep.rbracket . Util.comment_or_eol ]\n\n(* View: users\n Map :omusrmsg: and a list of users, or a single *\n*)\nlet omusrmsg = Util.del_str \":omusrmsg:\" .\n Syslog.label_opt_list_or \"omusrmsg\" (store Syslog.word)\n Syslog.comma \"*\"\n\n(* View: file_tmpl\n File action with a specified template *)\nlet file_tmpl = Syslog.file . [ label \"template\" . Util.del_str \";\" . store Rx.word ]\n\nlet namedpipe = Syslog.pipe . Sep.space . [ label \"pipe\" . store Syslog.file_r ]\n\nlet action = Syslog.action | omusrmsg | file_tmpl | namedpipe\n\n(* View: entry\n An entry contains selectors and an action\n*)\nlet entry = [ label \"entry\" . Syslog.selectors . Syslog.sep_tab .\n [ label \"action\" . action ] . Util.eol ]\n\n(* View: prop_filter\n Parses property-based filters, which start with \":\" and the property name *)\nlet prop_filter =\n let sep = Sep.comma . Util.del_opt_ws \" \"\n in let prop_name = [ Util.del_str \":\" . label \"property\" . store Rx.word ]\n in let prop_oper = [ label \"operation\" . store \/[A-Za-z!-]+\/ ]\n in let prop_val = [ label \"value\" . Quote.do_dquote (store \/[^\\n\"]*\/) ]\n in let prop_act = [ label \"action\" . action ]\n in [ label \"filter\" . prop_name . sep . prop_oper . sep . prop_val .\n Sep.space . prop_act . Util.eol ]\n\nlet entries = ( Syslog.empty | Syslog.comment | entry | macro | config_object | prop_filter )*\n\nlet lns = entries . ( Syslog.program | Syslog.hostname )*\n\nlet filter = incl \"\/etc\/rsyslog.conf\"\n . incl \"\/etc\/rsyslog.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(*\nModule: Rsyslog\n Parses \/etc\/rsyslog.conf\n\nAuthor: Raphael Pinson <raphael.pinsons@camptocamp.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 rsyslog.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/rsyslog.conf. See <filter>.\n\nAbout: Examples\n The <Test_Rsyslog> file contains various examples and tests.\n*)\nmodule Rsyslog =\n\nautoload xfm\n\nlet macro_rx = \/[^,# \\n\\t][^#\\n]*[^,# \\n\\t]|[^,# \\n\\t]\/\nlet macro = [ key \/$[A-Za-z0-9]+\/ . Sep.space . store macro_rx . Util.comment_or_eol ]\n\nlet config_object_param = [ key \/[A-Za-z.]+\/ . Sep.equal . Quote.dquote\n . store \/[^\"]+\/ . Quote.dquote ]\nlet config_object = [ key \/action|global|input|module|parser|timezone\/ . Sep.lbracket\n . config_object_param . ( Sep.space . config_object_param )* . Sep.rbracket . Util.comment_or_eol ]\n\n(* View: users\n Map :omusrmsg: and a list of users, or a single *\n*)\nlet omusrmsg = Util.del_str \":omusrmsg:\" .\n Syslog.label_opt_list_or \"omusrmsg\" (store Syslog.word)\n Syslog.comma \"*\"\n\n(* View: file_tmpl\n File action with a specified template *)\nlet file_tmpl = Syslog.file . [ label \"template\" . Util.del_str \";\" . store Rx.word ]\n\nlet namedpipe = Syslog.pipe . Sep.space . [ label \"pipe\" . store Syslog.file_r ]\n\nlet action = Syslog.action | omusrmsg | file_tmpl | namedpipe\n\n(* View: entry\n An entry contains selectors and an action\n*)\nlet entry = [ label \"entry\" . Syslog.selectors . Syslog.sep_tab .\n [ label \"action\" . action ] . Util.eol ]\n\n(* View: prop_filter\n Parses property-based filters, which start with \":\" and the property name *)\nlet prop_filter =\n let sep = Sep.comma . Util.del_opt_ws \" \"\n in let prop_name = [ Util.del_str \":\" . label \"property\" . store Rx.word ]\n in let prop_oper = [ label \"operation\" . store \/[A-Za-z!-]+\/ ]\n in let prop_val = [ label \"value\" . Quote.do_dquote (store \/[^\\n\"]*\/) ]\n in let prop_act = [ label \"action\" . action ]\n in [ label \"filter\" . prop_name . sep . prop_oper . sep . prop_val .\n Sep.space . prop_act . Util.eol ]\n\nlet entries = ( Syslog.empty | Syslog.comment | entry | macro | config_object | prop_filter )*\n\nlet lns = entries . ( Syslog.program | Syslog.hostname )*\n\nlet filter = incl \"\/etc\/rsyslog.conf\"\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"40fdbcb38780f100f900f3588dd101caf5b41a1c","subject":"Interfaces: accept options containing '_'","message":"Interfaces: accept options containing '_'\n\nBug reported by Jonas Eriksson\n","repos":"mlichvar\/augeas,jjlin\/augeas,lutter\/augeas,MikaelSmith\/augeas,pevalme\/augeas,kumy\/augeas,camptocamp\/augeas,camptocamp\/augeas,kumy\/augeas,jtopjian\/augeas,jasperla\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,jasperla\/augeas,kunkku\/augeas,domcleal\/augeas,kunkku\/augeas,kunkku\/augeas,mlichvar\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,dafugg\/augeas,camptocamp\/augeas,jjlin\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,bkearney\/augeas,manandbytes\/augeas,raphink\/augeas,bkearney\/augeas,dafugg\/augeas,hercules-team\/augeas,ptoscano\/augeas,bkearney\/augeas,jjlin\/augeas,mlichvar\/augeas,raphink\/augeas,camptocamp\/augeas,domcleal\/augeas,mchf\/augeas,hercules-team\/augeas,kumy\/augeas,lutter\/augeas,domcleal\/augeas,pevalme\/augeas,kumy\/augeas,jtopjian\/augeas","old_file":"lenses\/interfaces.aug","new_file":"lenses\/interfaces.aug","new_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man interfaces\n\n*)\n\nmodule Interfaces =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\n\n(* Define separators *)\n\n(* a line can be extended across multiple lines by making the last *)\n(* character a backslash, unless the line is a comment (see below) *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Define fields *)\nlet sto_to_eol = store \/([^\\\\# \\t\\n].*[^\\\\ \\t\\n]|[^\\\\ \\t\\n])\/\nlet sto_to_spc = store \/[^\\\\# \\t\\n]+\/\n\n(* Define comments and empty lines *)\n\n(* note that the comment definition from Util does not support *)\n(* splitting lines with a backlash *)\nlet comment = Util.comment\n\nlet empty = Util.empty\n\n(* Define tree stanza_ids *)\nlet stanza_id (t:string) = key t . sep_spc . sto_to_spc\nlet stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ]\n\n(* Define reseverved words *)\nlet stanza_word = \/(iface|auto|allow-[a-z-]+|mapping)\/\n\n(* Define additional lines for mluti-line stanzas *)\nlet stanza_option = [ del \/[ \\t]*\/ \" \"\n . key ( \/[a-z_-]+\/ - stanza_word )\n . sep_spc\n . sto_to_eol\n . eol ]\n\n(************************************************************************\n * AUTO\n *************************************************************************)\n\nlet array (r:regexp) (t:string) = del r t . label t . counter t\n . [ sep_spc . seq t . sto_to_spc ]+\nlet auto = [ array \/(allow-)?auto\/ \"auto\" . (comment|eol) ]\n\n(************************************************************************\n * HOTPLUG\n *************************************************************************)\n\nlet hotplug = [ stanza_id \"allow-hotplug\" . (comment|eol) ]\n\n(************************************************************************\n * MAPPING\n *************************************************************************)\n\nlet mapping = [ stanza_id \"mapping\"\n . (comment|empty)+\n . stanza_option\n . (stanza_option|comment|empty)* ]\n\n(************************************************************************\n * IFACE\n *************************************************************************)\n\nlet iface = [ stanza_id \"iface\"\n . stanza_param \"family\"\n . stanza_param \"method\"\n . (comment|empty)+\n . ( stanza_option . (stanza_option|comment|empty)* )? ]\n\n(************************************************************************\n * STANZAS\n *************************************************************************)\n\n(* The auto and hotplug stanzas always consist of one line only, while\n iface and mapping can spand along more lines. Comment nodes are\n inserted in the tree as direct children of the root node only when they\n come after an auto or hotplug stanza, otherwise they are considered part\n of a iface or mapping block *)\n\nlet stanza_single = (auto|hotplug) . (comment|empty)*\nlet stanza_multi = iface|mapping\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\n let lns = (comment|empty)* . (stanza_multi | stanza_single)*\n\n let filter = incl \"\/etc\/network\/interfaces\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man interfaces\n\n*)\n\nmodule Interfaces =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\n\n(* Define separators *)\n\n(* a line can be extended across multiple lines by making the last *)\n(* character a backslash, unless the line is a comment (see below) *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Define fields *)\nlet sto_to_eol = store \/([^\\\\# \\t\\n].*[^\\\\ \\t\\n]|[^\\\\ \\t\\n])\/\nlet sto_to_spc = store \/[^\\\\# \\t\\n]+\/\n\n(* Define comments and empty lines *)\n\n(* note that the comment definition from Util does not support *)\n(* splitting lines with a backlash *)\nlet comment = Util.comment\n\nlet empty = Util.empty\n\n(* Define tree stanza_ids *)\nlet stanza_id (t:string) = key t . sep_spc . sto_to_spc\nlet stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ]\n\n(* Define reseverved words *)\nlet stanza_word = \/(iface|auto|allow-[a-z-]+|mapping)\/\n\n(* Define additional lines for mluti-line stanzas *)\nlet stanza_option = [ del \/[ \\t]*\/ \" \" \n . key ( \/[a-z-]+\/ - stanza_word )\n . sep_spc\n . sto_to_eol\n . eol ]\n\n(************************************************************************\n * AUTO\n *************************************************************************)\n\nlet array (r:regexp) (t:string) = del r t . label t . counter t\n . [ sep_spc . seq t . sto_to_spc ]+\nlet auto = [ array \/(allow-)?auto\/ \"auto\" . (comment|eol) ]\n\n(************************************************************************\n * HOTPLUG\n *************************************************************************)\n\nlet hotplug = [ stanza_id \"allow-hotplug\" . (comment|eol) ]\n\n(************************************************************************\n * MAPPING\n *************************************************************************)\n\nlet mapping = [ stanza_id \"mapping\"\n . (comment|empty)+\n . stanza_option\n . (stanza_option|comment|empty)* ]\n\n(************************************************************************\n * IFACE\n *************************************************************************)\n\nlet iface = [ stanza_id \"iface\"\n . stanza_param \"family\"\n . stanza_param \"method\"\n . (comment|empty)+\n . ( stanza_option . (stanza_option|comment|empty)* )? ]\n\n(************************************************************************\n * STANZAS\n *************************************************************************)\n\n(* The auto and hotplug stanzas always consist of one line only, while\n iface and mapping can spand along more lines. Comment nodes are\n inserted in the tree as direct children of the root node only when they\n come after an auto or hotplug stanza, otherwise they are considered part\n of a iface or mapping block *)\n\nlet stanza_single = (auto|hotplug) . (comment|empty)*\nlet stanza_multi = iface|mapping\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\n let lns = (comment|empty)* . (stanza_multi | stanza_single)*\n\n let filter = incl \"\/etc\/network\/interfaces\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"80a1f1f2a3c436cd00bd0561bcc819070b15f4c9","subject":"Make filter a View in sudoers.aug to make it appear properly in doc","message":"Make filter a View in sudoers.aug to make it appear properly in doc\n","repos":"jjlin\/augeas,dafugg\/augeas,ptoscano\/augeas,lutter\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,manandbytes\/augeas,ptoscano\/augeas,dafugg\/augeas,mlichvar\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,kunkku\/augeas,MikaelSmith\/augeas,mchf\/augeas,kumy\/augeas,mlichvar\/augeas,pevalme\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,kumy\/augeas,domcleal\/augeas,dafugg\/augeas,raphink\/augeas,hercules-team\/augeas,mchf\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas,kunkku\/augeas,ptoscano\/augeas,jasperla\/augeas,jtopjian\/augeas,pevalme\/augeas,mlichvar\/augeas,manandbytes\/augeas,kumy\/augeas,jjlin\/augeas,domcleal\/augeas,MikaelSmith\/augeas,jasperla\/augeas,lutter\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cf9338b7111b8cfbcb6c6a5eea776b86106ee3d6","subject":"Debian-based distributions use \/etc\/mdadm\/mdadm.conf","message":"Debian-based distributions use \/etc\/mdadm\/mdadm.conf\n","repos":"hercules-team\/augeas-do-not-use,jasperla\/augeas,jjlin\/augeas,jasperla\/augeas,hercules-team\/augeas,ptoscano\/augeas,jjlin\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,manandbytes\/augeas,mchf\/augeas,jtopjian\/augeas,pevalme\/augeas,pevalme\/augeas,dafugg\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,raphink\/augeas,mlichvar\/augeas,kumy\/augeas,kumy\/augeas,raphink\/augeas,domcleal\/augeas,jjlin\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,domcleal\/augeas,mlichvar\/augeas,domcleal\/augeas,lutter\/augeas,kumy\/augeas,lutter\/augeas,ptoscano\/augeas,kumy\/augeas,lutter\/augeas,mchf\/augeas,pevalme\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,hercules-team\/augeas","old_file":"lenses\/mdadm_conf.aug","new_file":"lenses\/mdadm_conf.aug","new_contents":"(******************************************************************************\nMdadm_conf module for Augeas\n\nAuthor: Matthew Booth <mbooth@redhat.com>\n\nCopyright (C):\n 2011 Red Hat Inc.\n\nReference:\n mdadm(5)\n config.c and policy.c from mdadm-3.2.2\n\nLicense:\n This file is licensed under the LGPLv2+.\n\nThis is a lens for \/etc\/mdadm.conf. It aims to parse every valid configuration\nfile as of version 3.2.2, and many invalid ones too. This last point is a\nfeature, not a bug! madm will generate warnings for invalid configuration which\ndo not prevent correct operation of the tool. Wherever possible, we try to\nallow for this behaviour.\n\nKeywords in mdadm.conf are matched with a case-insensitive prefix match of at\nleast 3 characters. Keys in key\/value pairs are also matched case-insensitively,\nbut require a full match. The exception is POLICY and PART-POLICY, where keys\nare matched case-sensitively.\n\nN.B. We can't use case-insensitive regular expressions in most places due to bug\n#147.\n*******************************************************************************)\n\nmodule Mdadm_conf =\n\n autoload xfm\n\n\n(******************************************************************************\n * PRIMITIVES\n ******************************************************************************)\n\nlet eol = Util.comment_or_eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet value = \/[^ \\t\\n#]+\/\nlet value_no_eq = \/[^ \\t\\n#=]+\/\nlet value_no_eq_sl = \/[^ \\t\\n#=\\\/]+\/\n\nlet continuation = \/\\n[ \\t]+\/\nlet space = \/[ \\t]+\/\nlet value_sep = ( del ( continuation | space . continuation? ) \" \"\n | comment . del space \" \" )\n\n(* We parse specific keys rather than having a catch-all owing to the varying\ncase of the syntax. This means the user can rely on 'array\/uuid' rather than\nadditionally testing for 'array\/UUID'.\n\nIt would be good to have an additional catchall, but I haven't been able to make\nthat work.\n*)\nlet keyvalue (r:regexp) (lc:string) (uc:string) =\n [ del ( r . \/=\/ ) ( uc . \"=\" ) . label lc . store value ]\n\nlet simplevalue (r:regexp) (lc:string) (uc:string) =\n [ del r uc . label lc\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * DEVICES\n ******************************************************************************)\n\nlet dev_re = \/dev(i(ce?)?)?\/i\n\nlet dev_containers_re = \/containers\/i\nlet dev_partitions_re = \/partitions\/i\n\nlet dev_containers = [ del dev_containers_re \"containers\" . label \"containers\" ]\nlet dev_partitions = [ del dev_partitions_re \"partitions\" . label \"partitions\" ]\nlet dev_device = [ label \"name\". store ( value - dev_containers_re - dev_partitions_re) ]\n\n(* Strictly there must be at least 1 device, but we err on the side of parsing\n*)\nlet dev_devices = ( value_sep . ( dev_containers\n | dev_partitions\n | dev_device ) )*\n\nlet device = [ del dev_re \"DEVICE\" . label \"device\" . dev_devices . eol ]\n\n\n(******************************************************************************\n * ARRAY\n ******************************************************************************)\n\nlet array_re = \/arr(ay?)?\/i\n\nlet arr_auto_re = \/auto\/i\nlet arr_bitmap_re = \/bitmap\/i\nlet arr_container_re = \/container\/i\nlet arr_devices_re = \/devices\/i\nlet arr_disks_re = \/disks\/i (* Undocumented *)\nlet arr_level_re = \/level\/i\nlet arr_member_re = \/member\/i\nlet arr_metadata_re = \/metadata\/i\nlet arr_name_re = \/name\/i\nlet arr_num_devices_re = \/num-devices\/i\nlet arr_spare_group_re = \/spare-group\/i\nlet arr_spares_re = \/spares\/i\nlet arr_super_minor_re = \/super-minor\/i\nlet arr_uuid_re = \/uuid\/i\n\nlet arr_devicename = [ store value_no_eq . label \"devicename\" ]\n\nlet arr_auto = keyvalue arr_auto_re \"auto\" \"AUTO\"\nlet arr_bitmap = keyvalue arr_bitmap_re \"bitmap\" \"BITMAP\"\nlet arr_container = keyvalue arr_container_re \"container\" \"CONTAINER\"\nlet arr_devices = keyvalue arr_devices_re \"devices\" \"DEVICES\"\nlet arr_disks = keyvalue arr_disks_re \"disks\" \"DISKS\"\nlet arr_level = keyvalue arr_level_re \"level\" \"LEVEL\"\nlet arr_member = keyvalue arr_member_re \"member\" \"MEMBER\"\nlet arr_metadata = keyvalue arr_metadata_re \"metadata\" \"METADATA\"\nlet arr_name = keyvalue arr_name_re \"name\" \"NAME\"\nlet arr_num_devices = keyvalue arr_num_devices_re \"num-devices\" \"NUM-DEVICES\"\nlet arr_spare_group = keyvalue arr_spare_group_re \"spare-group\" \"SPARE-GROUP\"\nlet arr_spares = keyvalue arr_spares_re \"spares\" \"SPARES\"\nlet arr_super_minor = keyvalue arr_super_minor_re \"super-minor\" \"SUPER-MINOR\"\nlet arr_uuid = keyvalue arr_uuid_re \"uuid\" \"UUID\"\n\nlet arr_options = ( value_sep . ( arr_devicename\n | arr_auto\n | arr_bitmap\n | arr_container\n | arr_devices\n | arr_disks\n | arr_level\n | arr_member\n | arr_metadata\n | arr_name\n | arr_num_devices\n | arr_spare_group\n | arr_spares\n | arr_super_minor\n | arr_uuid ) )*\n\nlet array = [ del array_re \"ARRAY\" . label \"array\" . arr_options . eol ]\n\n\n(******************************************************************************\n * MAILADDR\n ******************************************************************************)\n\nlet mailaddr_re = \/mai(l(a(d(dr?)?)?)?)?\/i\n\n(* We intentially allow multiple mailaddr values here, even though this is\ninvalid and would produce a warning. This is better than not parsing the file.\n*)\nlet mailaddr = simplevalue mailaddr_re \"mailaddr\" \"MAILADDR\"\n\n\n(******************************************************************************\n * MAILFROM\n ******************************************************************************)\n\n(* N.B. MAILFROM can only be abbreviated to 5 characters *)\nlet mailfrom_re = \/mailf(r(om?)?)?\/i\n\nlet mailfrom = [ del mailfrom_re \"MAILFROM\" . label \"mailfrom\"\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * PROGRAM\n ******************************************************************************)\n\nlet program_re = \/pro(g(r(am?)?)?)?\/i\n\nlet program = simplevalue program_re \"program\" \"PROGRAM\"\n\n\n(******************************************************************************\n * CREATE\n ******************************************************************************)\n\nlet create_re = \/cre(a(te?)?)?\/i\n\nlet cre_auto_re = \/auto\/i\nlet cre_owner_re = \/owner\/i\nlet cre_group_re = \/group\/i\nlet cre_mode_re = \/mode\/i\nlet cre_metadata_re = \/metadata\/i\nlet cre_symlinks_re = \/symlinks\/i\n\nlet cre_auto = keyvalue cre_auto_re \"auto\" \"AUTO\"\nlet cre_group = keyvalue cre_group_re \"group\" \"GROUP\"\nlet cre_metadata = keyvalue cre_metadata_re \"metadata\" \"METADATA\"\nlet cre_mode = keyvalue cre_mode_re \"mode\" \"MODE\"\nlet cre_owner = keyvalue cre_owner_re \"owner\" \"OWNER\"\nlet cre_symlinks = keyvalue cre_symlinks_re \"symlinks\" \"SYMLINKS\"\n\nlet cre_options = ( value_sep . ( arr_auto\n | cre_owner\n | cre_group\n | cre_mode\n | cre_metadata\n | cre_symlinks) )*\n\nlet create = [ del create_re \"CREATE\" . label \"create\" . cre_options . eol ]\n\n\n(******************************************************************************\n * HOMEHOST\n ******************************************************************************)\n\nlet homehost_re = \/hom(e(h(o(st?)?)?)?)?\/i\n\nlet homehost = simplevalue homehost_re \"homehost\" \"HOMEHOST\"\n\n\n(******************************************************************************\n * AUTO\n ******************************************************************************)\n\nlet auto_re = \/auto?\/i\n\nlet aut_plus = [ key \"+\" . store value ]\nlet aut_minus = [ key \"-\" . store value ]\nlet aut_homehost = [ del \/homehost\/i \"homehost\" . label \"homehost\" ]\n\nlet aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )*\n\nlet auto = [ del auto_re \"AUTO\" . label \"auto\" . aut_list . eol ]\n\n\n(******************************************************************************\n * POLICY and PART-POLICY\n ******************************************************************************)\n\n(* PART-POLICY is undocumented. A cursory inspection of the parsing code\nsuggests it's parsed the same way as POLICY, but treated slightly differently\nthereafter. *)\n\nlet policy_re = \/pol(i(cy?)?)?\/i\nlet part_policy_re = \/par(t(-(p(o(l(i(cy?)?)?)?)?)?)?)?\/i\n\n(* Unlike everything else, policy keys are matched case sensitive. This means we\ndon't have to mess around with explicit option matching, as the match string is\nfixed for a working configuration. *)\n\nlet pol_option (act:string) =\n [ del ( act . \"=\" ) ( act . \"=\" ) . label act . store value ]\n\nlet pol_options = ( value_sep . [ key value_no_eq_sl . del \"=\" \"=\"\n . store value ] )*\n\nlet policy = [ del policy_re \"POLICY\" . label \"policy\"\n . pol_options . eol ]\nlet part_policy = [ del part_policy_re \"PART-POLICY\" . label \"part-policy\"\n . pol_options . eol ]\n\n\n(******************************************************************************\n * LENS\n ******************************************************************************)\n\nlet lns = (comment\n | empty\n | device\n | array\n | mailaddr\n | mailfrom\n | program\n | create\n | homehost\n | auto\n | policy\n | part_policy )*\n\nlet filter = incl \"\/etc\/mdadm.conf\"\n . incl \"\/etc\/mdadm\/mdadm.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(******************************************************************************\nMdadm_conf module for Augeas\n\nAuthor: Matthew Booth <mbooth@redhat.com>\n\nCopyright (C):\n 2011 Red Hat Inc.\n\nReference:\n mdadm(5)\n config.c and policy.c from mdadm-3.2.2\n\nLicense:\n This file is licensed under the LGPLv2+.\n\nThis is a lens for \/etc\/mdadm.conf. It aims to parse every valid configuration\nfile as of version 3.2.2, and many invalid ones too. This last point is a\nfeature, not a bug! madm will generate warnings for invalid configuration which\ndo not prevent correct operation of the tool. Wherever possible, we try to\nallow for this behaviour.\n\nKeywords in mdadm.conf are matched with a case-insensitive prefix match of at\nleast 3 characters. Keys in key\/value pairs are also matched case-insensitively,\nbut require a full match. The exception is POLICY and PART-POLICY, where keys\nare matched case-sensitively.\n\nN.B. We can't use case-insensitive regular expressions in most places due to bug\n#147.\n*******************************************************************************)\n\nmodule Mdadm_conf =\n\n autoload xfm\n\n\n(******************************************************************************\n * PRIMITIVES\n ******************************************************************************)\n\nlet eol = Util.comment_or_eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet value = \/[^ \\t\\n#]+\/\nlet value_no_eq = \/[^ \\t\\n#=]+\/\nlet value_no_eq_sl = \/[^ \\t\\n#=\\\/]+\/\n\nlet continuation = \/\\n[ \\t]+\/\nlet space = \/[ \\t]+\/\nlet value_sep = ( del ( continuation | space . continuation? ) \" \"\n | comment . del space \" \" )\n\n(* We parse specific keys rather than having a catch-all owing to the varying\ncase of the syntax. This means the user can rely on 'array\/uuid' rather than\nadditionally testing for 'array\/UUID'.\n\nIt would be good to have an additional catchall, but I haven't been able to make\nthat work.\n*)\nlet keyvalue (r:regexp) (lc:string) (uc:string) =\n [ del ( r . \/=\/ ) ( uc . \"=\" ) . label lc . store value ]\n\nlet simplevalue (r:regexp) (lc:string) (uc:string) =\n [ del r uc . label lc\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * DEVICES\n ******************************************************************************)\n\nlet dev_re = \/dev(i(ce?)?)?\/i\n\nlet dev_containers_re = \/containers\/i\nlet dev_partitions_re = \/partitions\/i\n\nlet dev_containers = [ del dev_containers_re \"containers\" . label \"containers\" ]\nlet dev_partitions = [ del dev_partitions_re \"partitions\" . label \"partitions\" ]\nlet dev_device = [ label \"name\". store ( value - dev_containers_re - dev_partitions_re) ]\n\n(* Strictly there must be at least 1 device, but we err on the side of parsing\n*)\nlet dev_devices = ( value_sep . ( dev_containers\n | dev_partitions\n | dev_device ) )*\n\nlet device = [ del dev_re \"DEVICE\" . label \"device\" . dev_devices . eol ]\n\n\n(******************************************************************************\n * ARRAY\n ******************************************************************************)\n\nlet array_re = \/arr(ay?)?\/i\n\nlet arr_auto_re = \/auto\/i\nlet arr_bitmap_re = \/bitmap\/i\nlet arr_container_re = \/container\/i\nlet arr_devices_re = \/devices\/i\nlet arr_disks_re = \/disks\/i (* Undocumented *)\nlet arr_level_re = \/level\/i\nlet arr_member_re = \/member\/i\nlet arr_metadata_re = \/metadata\/i\nlet arr_name_re = \/name\/i\nlet arr_num_devices_re = \/num-devices\/i\nlet arr_spare_group_re = \/spare-group\/i\nlet arr_spares_re = \/spares\/i\nlet arr_super_minor_re = \/super-minor\/i\nlet arr_uuid_re = \/uuid\/i\n\nlet arr_devicename = [ store value_no_eq . label \"devicename\" ]\n\nlet arr_auto = keyvalue arr_auto_re \"auto\" \"AUTO\"\nlet arr_bitmap = keyvalue arr_bitmap_re \"bitmap\" \"BITMAP\"\nlet arr_container = keyvalue arr_container_re \"container\" \"CONTAINER\"\nlet arr_devices = keyvalue arr_devices_re \"devices\" \"DEVICES\"\nlet arr_disks = keyvalue arr_disks_re \"disks\" \"DISKS\"\nlet arr_level = keyvalue arr_level_re \"level\" \"LEVEL\"\nlet arr_member = keyvalue arr_member_re \"member\" \"MEMBER\"\nlet arr_metadata = keyvalue arr_metadata_re \"metadata\" \"METADATA\"\nlet arr_name = keyvalue arr_name_re \"name\" \"NAME\"\nlet arr_num_devices = keyvalue arr_num_devices_re \"num-devices\" \"NUM-DEVICES\"\nlet arr_spare_group = keyvalue arr_spare_group_re \"spare-group\" \"SPARE-GROUP\"\nlet arr_spares = keyvalue arr_spares_re \"spares\" \"SPARES\"\nlet arr_super_minor = keyvalue arr_super_minor_re \"super-minor\" \"SUPER-MINOR\"\nlet arr_uuid = keyvalue arr_uuid_re \"uuid\" \"UUID\"\n\nlet arr_options = ( value_sep . ( arr_devicename\n | arr_auto\n | arr_bitmap\n | arr_container\n | arr_devices\n | arr_disks\n | arr_level\n | arr_member\n | arr_metadata\n | arr_name\n | arr_num_devices\n | arr_spare_group\n | arr_spares\n | arr_super_minor\n | arr_uuid ) )*\n\nlet array = [ del array_re \"ARRAY\" . label \"array\" . arr_options . eol ]\n\n\n(******************************************************************************\n * MAILADDR\n ******************************************************************************)\n\nlet mailaddr_re = \/mai(l(a(d(dr?)?)?)?)?\/i\n\n(* We intentially allow multiple mailaddr values here, even though this is\ninvalid and would produce a warning. This is better than not parsing the file.\n*)\nlet mailaddr = simplevalue mailaddr_re \"mailaddr\" \"MAILADDR\"\n\n\n(******************************************************************************\n * MAILFROM\n ******************************************************************************)\n\n(* N.B. MAILFROM can only be abbreviated to 5 characters *)\nlet mailfrom_re = \/mailf(r(om?)?)?\/i\n\nlet mailfrom = [ del mailfrom_re \"MAILFROM\" . label \"mailfrom\"\n . ( value_sep . [ label \"value\" . store value ] )* . eol ]\n\n\n(******************************************************************************\n * PROGRAM\n ******************************************************************************)\n\nlet program_re = \/pro(g(r(am?)?)?)?\/i\n\nlet program = simplevalue program_re \"program\" \"PROGRAM\"\n\n\n(******************************************************************************\n * CREATE\n ******************************************************************************)\n\nlet create_re = \/cre(a(te?)?)?\/i\n\nlet cre_auto_re = \/auto\/i\nlet cre_owner_re = \/owner\/i\nlet cre_group_re = \/group\/i\nlet cre_mode_re = \/mode\/i\nlet cre_metadata_re = \/metadata\/i\nlet cre_symlinks_re = \/symlinks\/i\n\nlet cre_auto = keyvalue cre_auto_re \"auto\" \"AUTO\"\nlet cre_group = keyvalue cre_group_re \"group\" \"GROUP\"\nlet cre_metadata = keyvalue cre_metadata_re \"metadata\" \"METADATA\"\nlet cre_mode = keyvalue cre_mode_re \"mode\" \"MODE\"\nlet cre_owner = keyvalue cre_owner_re \"owner\" \"OWNER\"\nlet cre_symlinks = keyvalue cre_symlinks_re \"symlinks\" \"SYMLINKS\"\n\nlet cre_options = ( value_sep . ( arr_auto\n | cre_owner\n | cre_group\n | cre_mode\n | cre_metadata\n | cre_symlinks) )*\n\nlet create = [ del create_re \"CREATE\" . label \"create\" . cre_options . eol ]\n\n\n(******************************************************************************\n * HOMEHOST\n ******************************************************************************)\n\nlet homehost_re = \/hom(e(h(o(st?)?)?)?)?\/i\n\nlet homehost = simplevalue homehost_re \"homehost\" \"HOMEHOST\"\n\n\n(******************************************************************************\n * AUTO\n ******************************************************************************)\n\nlet auto_re = \/auto?\/i\n\nlet aut_plus = [ key \"+\" . store value ]\nlet aut_minus = [ key \"-\" . store value ]\nlet aut_homehost = [ del \/homehost\/i \"homehost\" . label \"homehost\" ]\n\nlet aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )*\n\nlet auto = [ del auto_re \"AUTO\" . label \"auto\" . aut_list . eol ]\n\n\n(******************************************************************************\n * POLICY and PART-POLICY\n ******************************************************************************)\n\n(* PART-POLICY is undocumented. A cursory inspection of the parsing code\nsuggests it's parsed the same way as POLICY, but treated slightly differently\nthereafter. *)\n\nlet policy_re = \/pol(i(cy?)?)?\/i\nlet part_policy_re = \/par(t(-(p(o(l(i(cy?)?)?)?)?)?)?)?\/i\n\n(* Unlike everything else, policy keys are matched case sensitive. This means we\ndon't have to mess around with explicit option matching, as the match string is\nfixed for a working configuration. *)\n\nlet pol_option (act:string) =\n [ del ( act . \"=\" ) ( act . \"=\" ) . label act . store value ]\n\nlet pol_options = ( value_sep . [ key value_no_eq_sl . del \"=\" \"=\"\n . store value ] )*\n\nlet policy = [ del policy_re \"POLICY\" . label \"policy\"\n . pol_options . eol ]\nlet part_policy = [ del part_policy_re \"PART-POLICY\" . label \"part-policy\"\n . pol_options . eol ]\n\n\n(******************************************************************************\n * LENS\n ******************************************************************************)\n\nlet lns = (comment\n | empty\n | device\n | array\n | mailaddr\n | mailfrom\n | program\n | create\n | homehost\n | auto\n | policy\n | part_policy )*\n\nlet filter = incl \"\/etc\/mdadm.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a3e2474cc1dca3c6449dd4367e623cb6bf3fefc9","subject":"Relicense pg_hba.aug as LGPLv2+ as the rest of Augeas.","message":"Relicense pg_hba.aug as LGPLv2+ as the rest of Augeas.\n","repos":"mchf\/augeas,jasperla\/augeas,hercules-team\/augeas,kunkku\/augeas,domcleal\/augeas,lutter\/augeas,domcleal\/augeas,dafugg\/augeas,lutter\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,jasperla\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,mlichvar\/augeas,hercules-team\/augeas,kumy\/augeas,jtopjian\/augeas,mlichvar\/augeas,kumy\/augeas,pevalme\/augeas,kumy\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,pevalme\/augeas,manandbytes\/augeas,lutter\/augeas,jjlin\/augeas,dafugg\/augeas,ptoscano\/augeas,kumy\/augeas,raphink\/augeas,jtopjian\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,domcleal\/augeas,mchf\/augeas,dafugg\/augeas,kunkku\/augeas,manandbytes\/augeas,mlichvar\/augeas,raphink\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/pg_hba.aug","new_file":"lenses\/pg_hba.aug","new_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:\\.]+(\\\/[0-9]+|[ \\t]+[0-9\\.]+)\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Pg_Hba\n Parses PostgreSQL's pg_hba.conf\n\nAuthor: Aurelien Bompard <aurelien@bompard.org>\n\nAbout: Reference\n The file format is described in PostgreSQL's documentation:\n http:\/\/www.postgresql.org\/docs\/current\/static\/auth-pg-hba-conf.html\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Configuration files\n This lens applies to pg_hba.conf. See <filter> for exact locations.\n*)\n\n\nmodule Pg_Hba =\n autoload xfm\n\n (* Group: Generic primitives *)\n\n let eol = Util.eol\n let word = Rx.neg1\n (* Variable: ipaddr\n CIDR or ip+netmask *)\n let ipaddr = \/[0-9a-fA-F:\\.]+(\\\/[0-9]+|[ \\t]+[0-9\\.]+)\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns Sep.comma\n\n (* Group: Columns definitions *)\n\n (* View: database\n TODO: support for quoted strings *)\n let database = comma_sep_list \"database\"\n (* View: user\n TODO: support for quoted strings *)\n let user = comma_sep_list \"user\"\n (* View: address *)\n let address = [ label \"address\" . store ipaddr ]\n (* View: option\n part of <method> *)\n let option = [ label \"option\" . store word ]\n (* View: method\n can contain an <option> *)\n let method = [ label \"method\" . store Rx.word . ( Sep.tab . option )? ]\n\n (* Group: Records definitions *)\n\n (* View: record_local\n when type is \"local\", there is no \"address\" field *)\n let record_local = [ label \"type\" . store \"local\" ] . Sep.tab .\n database . Sep.tab . user . Sep.tab . method\n\n (* Variable: remtypes\n non-local connection types *)\n let remtypes = \"host\" | \"hostssl\" | \"hostnossl\"\n\n (* View: record_remote *)\n let record_remote = [ label \"type\" . store remtypes ] . Sep.tab .\n database . Sep.tab . user . Sep.tab .\n address . Sep.tab . method\n\n (* View: record\n A sequence of <record_local> or <record_remote> entries *)\n let record = [ seq \"entries\" . (record_local | record_remote) . eol ]\n\n (* View: filter\n The pg_hba.conf conf file *)\n let filter = (incl \"\/var\/lib\/pgsql\/data\/pg_hba.conf\" .\n incl \"\/etc\/postgresql\/*\/*\/pg_hba.conf\" )\n\n (* View: lns\n The pg_hba.conf lens *)\n let lns = ( record | Util.comment | Util.empty ) *\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"96db38b21c8308d3938a0fa4619f7f9ddb2d675d","subject":"Add \"indomU\" Debian setting to grub.aug (Fix ticket #162)","message":"Add \"indomU\" Debian setting to grub.aug (Fix ticket #162)\n","repos":"MikaelSmith\/augeas,kumy\/augeas,hercules-team\/augeas,pevalme\/augeas,manandbytes\/augeas,ptoscano\/augeas,kumy\/augeas,mchf\/augeas,raphink\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jjlin\/augeas,jjlin\/augeas,domcleal\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,dafugg\/augeas,kumy\/augeas,raphink\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,pevalme\/augeas,MikaelSmith\/augeas,dafugg\/augeas,jtopjian\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,lutter\/augeas,dafugg\/augeas,kunkku\/augeas,jasperla\/augeas,manandbytes\/augeas,mlichvar\/augeas,mchf\/augeas,domcleal\/augeas,jasperla\/augeas,kunkku\/augeas,jjlin\/augeas","old_file":"lenses\/grub.aug","new_file":"lenses\/grub.aug","new_contents":"module Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n let eol = Util.eol\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n let spc = Util.del_ws_spc\n let opt_ws = Util.del_opt_ws \"\"\n let dels (s:string) = Util.del_str s\n let eq = dels \"=\"\n let switch (n:regexp) = dels \"--\" . key n\n let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n let empty = Util.empty\n\n let command (kw:string) (indent:string) =\n Util.del_opt_ws indent . key kw\n\n let kw_arg (kw:string) (indent:string) (dflt_sep:string) =\n [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]\n\n let kw_boot_arg (kw:string) = kw_arg kw \"\\t\" \" \"\n let kw_menu_arg (kw:string) = kw_arg kw \"\" \" \"\n let password_arg = [ key \"password\" .\n (spc . [ switch \"md5\" ])? .\n spc . store (\/[^ \\t\\n]+\/ - \"--md5\") .\n (spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n dels \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n spc . [ label \"normal\" . color_spec ] .\n (spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n let serial =\n [ command \"serial\" \"\" .\n [ spc . switch_arg \/unit|port|speed|word|parity|stop|device\/ ]* .\n eol ]\n\n let terminal =\n [ command \"terminal\" \"\" .\n ([ spc . switch \/dumb|no-echo|no-edit|silent\/ ]\n |[ spc . switch_arg \/timeout|lines\/ ])* .\n [ spc . key \/console|serial|hercules\/ ]* . eol ]\n\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"gfxmenu\"\n | serial\n | terminal\n | password_arg\n | color\n\n let title = del \/title[ \\t=]+\/ \"title \" . value_to_eol . eol\n\n (* Parse the file name and args on a kernel or module line *)\n let kernel_args =\n let arg = Rx.word - \/type|no-mem-option\/ in\n store \/\\\/[^ \\t\\n]*\/ .\n (spc . [ key arg . (eq. store \/([^ \\t\\n])*\/)?])* . eol\n\n let module_line =\n [ command \"module\" \"\\t\" . spc . kernel_args ]\n\n let kernel =\n [ command \"kernel\" \"\\t\" .\n (spc .\n ([switch \"type\" . eq . store \/[a-z]+\/]\n |[switch \"no-mem-option\"]))* .\n spc . kernel_args ]\n\n let chainloader =\n [ command \"chainloader\" \"\\t\" .\n [ spc . switch \"force\" ]? . spc . store Rx.no_spaces . eol ]\n\n let savedefault =\n [ command \"savedefault\" \"\\t\" . (spc . store Rx.integer)? . eol ]\n\n let boot_setting = kw_boot_arg \"root\"\n | kernel\n | kw_boot_arg \"initrd\"\n | kw_boot_arg \"rootnoverify\"\n | chainloader\n | kw_boot_arg \"uuid\"\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | savedefault\n | module_line\n\n let boot =\n let line = ((boot_setting|comment)* . boot_setting)? in\n [ label \"title\" . title . line ]\n\n let debian_header = \"## ## Start Default Options ##\\n\"\n let debian_footer = \"## ## End Default Options ##\\n\"\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n let debian_value_sep = del \/[ \\t]*=\/ \"=\"\n let debian_kw_arg (kw:regexp) =\n [ Util.del_opt_ws \"\" . key kw . debian_value_sep\n . value_to_eol? . eol ]\n\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n | \"indomU\"\n\n let debian_setting = debian_kw_arg debian_setting_re\n\n let debian_entry = del \"#\" \"#\" . debian_setting\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n let lns = (comment | empty | menu_setting | boot | debian)*\n let xfm = transform lns (incl \"\/boot\/grub\/menu.lst\"\n . incl \"\/etc\/grub.conf\")\n","old_contents":"module Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n let eol = Util.eol\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n let spc = Util.del_ws_spc\n let opt_ws = Util.del_opt_ws \"\"\n let dels (s:string) = Util.del_str s\n let eq = dels \"=\"\n let switch (n:regexp) = dels \"--\" . key n\n let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n let empty = Util.empty\n\n let command (kw:string) (indent:string) =\n Util.del_opt_ws indent . key kw\n\n let kw_arg (kw:string) (indent:string) (dflt_sep:string) =\n [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]\n\n let kw_boot_arg (kw:string) = kw_arg kw \"\\t\" \" \"\n let kw_menu_arg (kw:string) = kw_arg kw \"\" \" \"\n let password_arg = [ key \"password\" .\n (spc . [ switch \"md5\" ])? .\n spc . store (\/[^ \\t\\n]+\/ - \"--md5\") .\n (spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n dels \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n spc . [ label \"normal\" . color_spec ] .\n (spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n let serial =\n [ command \"serial\" \"\" .\n [ spc . switch_arg \/unit|port|speed|word|parity|stop|device\/ ]* .\n eol ]\n\n let terminal =\n [ command \"terminal\" \"\" .\n ([ spc . switch \/dumb|no-echo|no-edit|silent\/ ]\n |[ spc . switch_arg \/timeout|lines\/ ])* .\n [ spc . key \/console|serial|hercules\/ ]* . eol ]\n\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"gfxmenu\"\n | serial\n | terminal\n | password_arg\n | color\n\n let title = del \/title[ \\t=]+\/ \"title \" . value_to_eol . eol\n\n (* Parse the file name and args on a kernel or module line *)\n let kernel_args =\n let arg = Rx.word - \/type|no-mem-option\/ in\n store \/\\\/[^ \\t\\n]*\/ .\n (spc . [ key arg . (eq. store \/([^ \\t\\n])*\/)?])* . eol\n\n let module_line =\n [ command \"module\" \"\\t\" . spc . kernel_args ]\n\n let kernel =\n [ command \"kernel\" \"\\t\" .\n (spc .\n ([switch \"type\" . eq . store \/[a-z]+\/]\n |[switch \"no-mem-option\"]))* .\n spc . kernel_args ]\n\n let chainloader =\n [ command \"chainloader\" \"\\t\" .\n [ spc . switch \"force\" ]? . spc . store Rx.no_spaces . eol ]\n\n let savedefault =\n [ command \"savedefault\" \"\\t\" . (spc . store Rx.integer)? . eol ]\n\n let boot_setting = kw_boot_arg \"root\"\n | kernel\n | kw_boot_arg \"initrd\"\n | kw_boot_arg \"rootnoverify\"\n | chainloader\n | kw_boot_arg \"uuid\"\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | savedefault\n | module_line\n\n let boot =\n let line = ((boot_setting|comment)* . boot_setting)? in\n [ label \"title\" . title . line ]\n\n let debian_header = \"## ## Start Default Options ##\\n\"\n let debian_footer = \"## ## End Default Options ##\\n\"\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n let debian_value_sep = del \/[ \\t]*=\/ \"=\"\n let debian_kw_arg (kw:regexp) =\n [ Util.del_opt_ws \"\" . key kw . debian_value_sep\n . value_to_eol? . eol ]\n\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n\n let debian_setting = debian_kw_arg debian_setting_re\n\n let debian_entry = del \"#\" \"#\" . debian_setting\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n let lns = (comment | empty | menu_setting | boot | debian)*\n let xfm = transform lns (incl \"\/boot\/grub\/menu.lst\"\n . incl \"\/etc\/grub.conf\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5628653bb1d7640e9c6b52a63d4823e031663ceb","subject":"Fstab: remove unneeded brackets","message":"Fstab: remove unneeded brackets\n","repos":"ptoscano\/augeas,mlichvar\/augeas,jjlin\/augeas,mchf\/augeas,kunkku\/augeas,manandbytes\/augeas,hercules-team\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,kunkku\/augeas,kunkku\/augeas,manandbytes\/augeas,jjlin\/augeas,ptoscano\/augeas,ptoscano\/augeas,pevalme\/augeas,jjlin\/augeas,lutter\/augeas,mlichvar\/augeas,pevalme\/augeas,lutter\/augeas,mlichvar\/augeas,dafugg\/augeas,dafugg\/augeas,mchf\/augeas,hercules-team\/augeas","old_file":"lenses\/fstab.aug","new_file":"lenses\/fstab.aug","new_contents":"(* Parsing \/etc\/fstab *)\n\nmodule Fstab =\n autoload xfm\n\n let sep_tab = Sep.tab\n let sep_spc = Sep.space\n let comma = Sep.comma\n let eol = Util.eol\n\n let comment = Util.comment\n let empty = Util.empty\n\n let file = \/[^# \\t\\n]+\/\n\n (* An option label can't contain comma, comment, equals, or space *)\n let optlabel = \/[^,#= \\n\\t]+\/\n let spec = \/[^,# \\n\\t][^ \\n\\t]*\/\n\n let comma_sep_list (l:string) =\n let value = [ label \"value\" . Util.del_str \"=\" . ( store Rx.neg1 )? ] in\n let lns = [ label l . store optlabel . value? ] in\n Build.opt_list lns comma\n\n let record = [ seq \"mntent\" .\n [ label \"spec\" . store spec ] . sep_tab .\n [ label \"file\" . store file ] . sep_tab .\n comma_sep_list \"vfstype\" .\n (sep_tab . comma_sep_list \"opt\" .\n (sep_tab . [ label \"dump\" . store \/[0-9]+\/ ] .\n ( sep_spc . [ label \"passno\" . store \/[0-9]+\/ ])? )? )?\n . Util.comment_or_eol ]\n\n let lns = ( empty | comment | record ) *\n let filter = incl \"\/etc\/fstab\"\n . incl \"\/etc\/mtab\"\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing \/etc\/fstab *)\n\nmodule Fstab =\n autoload xfm\n\n let sep_tab = Sep.tab\n let sep_spc = Sep.space\n let comma = Sep.comma\n let eol = Util.eol\n\n let comment = Util.comment\n let empty = Util.empty\n\n let file = \/[^# \\t\\n]+\/\n\n (* An option label can't contain comma, comment, equals, or space *)\n let optlabel = \/[^,#= \\n\\t]+\/\n let spec = \/[^,# \\n\\t][^ \\n\\t]*\/\n\n let comma_sep_list (l:string) =\n let value = [ label \"value\" . Util.del_str \"=\" . ( store Rx.neg1 )? ] in\n let lns = [ label l . store optlabel . value? ] in\n Build.opt_list lns comma\n\n let record = [ seq \"mntent\" .\n [ label \"spec\" . store spec ] . sep_tab .\n [ label \"file\" . store file ] . sep_tab .\n comma_sep_list \"vfstype\" .\n (sep_tab . comma_sep_list \"opt\" .\n (sep_tab . [ label \"dump\" . store \/[0-9]+\/ ] .\n ( sep_spc . [ label \"passno\" . store \/[0-9]+\/ ])? )? )?\n . Util.comment_or_eol ]\n\n let lns = ( empty | comment | record ) *\n let filter = (incl \"\/etc\/fstab\")\n . (incl \"\/etc\/mtab\")\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4d604bc1c7194289258ce1cfc6322199c4940663","subject":"Exclude \/etc\/yum\/pluginconf.d\/versionlock.list from yum.aug","message":"Exclude \/etc\/yum\/pluginconf.d\/versionlock.list from yum.aug\n\nThe versionlock plugin puts a file in \/etc\/yum\/pluginconf.d that is\nnot a yum config file so yum.aug shouldn't try to parse it.\n","repos":"mchf\/augeas,hercules-team\/augeas,jjlin\/augeas,kumy\/augeas,mlichvar\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,hercules-team\/augeas,manandbytes\/augeas,mchf\/augeas,manandbytes\/augeas,dafugg\/augeas,domcleal\/augeas,jtopjian\/augeas,lutter\/augeas,kunkku\/augeas,lutter\/augeas,GeoffWilliams\/augeas,raphink\/augeas,kunkku\/augeas,jtopjian\/augeas,pevalme\/augeas,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,dafugg\/augeas,dafugg\/augeas,pevalme\/augeas,jasperla\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,raphink\/augeas,lutter\/augeas,domcleal\/augeas,mlichvar\/augeas,kumy\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,pevalme\/augeas,MikaelSmith\/augeas","old_file":"lenses\/yum.aug","new_file":"lenses\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n let key_re = \/[^#;:= \\t\\n[\\\/]+\/ - \/baseurl|gpgkey\/\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section =\n let list_baseurl = kv_list \"baseurl\" in\n let list_gpgkey = kv_list \"gpgkey\" in\n [ sechead . ( entry*\n | entry* . list_baseurl . entry*\n | entry* . list_gpgkey . entry*\n | entry* . list_baseurl . entry* . list_gpgkey . entry*\n | entry* . list_gpgkey . entry* . list_baseurl . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n let key_re = \/[^#;:= \\t\\n[\\\/]+\/ - \/baseurl|gpgkey\/\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section =\n let list_baseurl = kv_list \"baseurl\" in\n let list_gpgkey = kv_list \"gpgkey\" in\n [ sechead . ( entry*\n | entry* . list_baseurl . entry*\n | entry* . list_gpgkey . entry*\n | entry* . list_baseurl . entry* . list_gpgkey . entry*\n | entry* . list_gpgkey . entry* . list_baseurl . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d3bf85dce429fa4d9b5a4b677393161b6dca9f44","subject":"Add test for ticket 313","message":"Add test for ticket 313\n","repos":"kunkku\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,kunkku\/augeas,jasperla\/augeas,raphink\/augeas,jjlin\/augeas,jjlin\/augeas,pevalme\/augeas,dafugg\/augeas,dafugg\/augeas,manandbytes\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,ptoscano\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,lutter\/augeas,lutter\/augeas,manandbytes\/augeas,kumy\/augeas,jtopjian\/augeas,kumy\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,mchf\/augeas,ptoscano\/augeas,pevalme\/augeas,hercules-team\/augeas,pevalme\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,mchf\/augeas,kumy\/augeas,mlichvar\/augeas,jjlin\/augeas,jtopjian\/augeas,raphink\/augeas,kunkku\/augeas,ptoscano\/augeas","old_file":"lenses\/tests\/test_pg_hba.aug","new_file":"lenses\/tests\/test_pg_hba.aug","new_contents":"module Test_pg_hba =\n\n (* Main test *)\n let conf =\"# TYPE DATABASE USER CIDR-ADDRESS METHOD\n\nlocal all all ident sameuser\n# IPv4 local connections:\nhost all all 127.0.0.1\/32 md5\n# Remote connections by hostname:\nhost all all foo.example.com md5\n# Remote connections by suffix of hostname\/fqdn:\nhost all all .example.com md5\n# IPv6 local connections:\nhost all all ::1\/128 md5\n\"\n\n test Pg_Hba.lns get conf =\n { \"#comment\" = \"TYPE DATABASE USER CIDR-ADDRESS METHOD\" }\n {}\n { \"1\"\n { \"type\" = \"local\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"method\" = \"ident\"\n { \"option\" = \"sameuser\" } }\n }\n { \"#comment\" = \"IPv4 local connections:\" }\n { \"2\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"127.0.0.1\/32\" }\n { \"method\" = \"md5\" }\n }\n { \"#comment\" = \"Remote connections by hostname:\" }\n { \"3\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"foo.example.com\" }\n { \"method\" = \"md5\" }\n }\n { \"#comment\" = \"Remote connections by suffix of hostname\/fqdn:\" }\n { \"4\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \".example.com\" }\n { \"method\" = \"md5\" }\n }\n { \"#comment\" = \"IPv6 local connections:\" }\n { \"5\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"::1\/128\" }\n { \"method\" = \"md5\" }\n }\n\n(* ------------------------------------------------------------- *)\n\n (* Simple local test *)\n test Pg_Hba.lns get \"local all all trust\\n\" =\n { \"1\"\n { \"type\" = \"local\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"method\" = \"trust\" }\n }\n\n (* Remote test with comma-sparated database names *)\n test Pg_Hba.lns get \"hostssl db1,db2,db3 +pgusers 127.0.0.1\/32 trust\\n\" =\n { \"1\"\n { \"type\" = \"hostssl\" }\n { \"database\" = \"db1\" }\n { \"database\" = \"db2\" }\n { \"database\" = \"db3\" }\n { \"user\" = \"+pgusers\" }\n { \"address\" = \"127.0.0.1\/32\" }\n { \"method\" = \"trust\" }\n }\n\n (* Test with comma-sparated user names *)\n test Pg_Hba.lns get \"hostnossl sameuser u1,u2,u3 127.0.0.1\/32 trust\\n\" =\n { \"1\"\n { \"type\" = \"hostnossl\" }\n { \"database\" = \"sameuser\" }\n { \"user\" = \"u1\" }\n { \"user\" = \"u2\" }\n { \"user\" = \"u3\" }\n { \"address\" = \"127.0.0.1\/32\" }\n { \"method\" = \"trust\" }\n }\n\n (* Test with quoted database and user names *)\n test Pg_Hba.lns get \"host \\\"sameuser\\\" \\\"all\\\" 127.0.0.1\/32 trust\\n\" =\n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"\\\"sameuser\\\"\" }\n { \"user\" = \"\\\"all\\\"\" }\n { \"address\" = \"127.0.0.1\/32\" }\n { \"method\" = \"trust\" }\n }\n\n (* Test with IP + netmask address format *)\n test Pg_Hba.lns get \"host all all 192.168.1.1 255.255.0.0 trust\\n\" =\n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"192.168.1.1 255.255.0.0\" }\n { \"method\" = \"trust\" }\n }\n \n (* Test with fqdn as address *)\n test Pg_Hba.lns get \"host all all foo.example.com md5\\n\" = \n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"foo.example.com\" }\n { \"method\" = \"md5\" }\n }\n\n (* Test with fqdn suffix as address *)\n test Pg_Hba.lns get \"host all all .example.com md5\\n\" = \n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \".example.com\" }\n { \"method\" = \"md5\" }\n }\n\n (* Local types may not have and address *)\n test Pg_Hba.lns get \"local all all 127.0.0.1\/32 trust\\n\" = *\n\n (* Remote types must have an address *)\n test Pg_Hba.lns get \"host all all trust\\n\" = *\n\n (* The space between the IP and the netmask must not be considered as a\n column separator (\"method\" is missing here) *)\n test Pg_Hba.lns get \"host all all 192.168.1.1 255.255.0.0\\n\" = *\n\n (* Ticket #313: support authentication method options *)\n test Pg_Hba.lns get \"host all all .dev.example.com gss include_realm=0 krb_realm=EXAMPLE.COM map=somemap\nhost all all .dev.example.com ldap ldapserver=auth.example.com ldaptls=1 ldapprefix=\\\"uid=\\\" ldapsuffix=\\\",ou=people,dc=example,dc=com\\\"\\n\" =\n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \".dev.example.com\" }\n { \"method\" = \"gss\"\n { \"options\"\n { \"include_realm\" = \"0\" }\n { \"krb_realm\" = \"EXAMPLE.COM\" }\n { \"map\" = \"somemap\" } } } }\n { \"2\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \".dev.example.com\" }\n { \"method\" = \"ldap\"\n { \"options\"\n { \"ldapserver\" = \"auth.example.com\" }\n { \"ldaptls\" = \"1\" }\n { \"ldapprefix\" = \"uid=\" }\n { \"ldapsuffix\" = \",ou=people,dc=example,dc=com\" } } } }\n\n test Pg_Hba.lns get \"host all all .dev.example.com ldap ldapserver=auth.example.com ldaptls=1 ldapprefix=\\\"uid=\\\" ldapsuffix=\\\",ou=people,dc=example,dc=com\\\"\\n\" = ?\n\n (* Unsupported yet *)\n (* test Pg_Hba.lns get \"host \\\"db with spaces\\\" \\\"user with spaces\\\" 127.0.0.1\/32 trust\\n\" =? *)\n (* test Pg_Hba.lns get \"host \\\"db,with,commas\\\" \\\"user,with,commas\\\" 127.0.0.1\/32 trust\\n\" =? *)\n","old_contents":"module Test_pg_hba =\n\n (* Main test *)\n let conf =\"# TYPE DATABASE USER CIDR-ADDRESS METHOD\n\nlocal all all ident sameuser\n# IPv4 local connections:\nhost all all 127.0.0.1\/32 md5\n# Remote connections by hostname:\nhost all all foo.example.com md5\n# Remote connections by suffix of hostname\/fqdn:\nhost all all .example.com md5\n# IPv6 local connections:\nhost all all ::1\/128 md5\n\"\n\n test Pg_Hba.lns get conf =\n { \"#comment\" = \"TYPE DATABASE USER CIDR-ADDRESS METHOD\" }\n {}\n { \"1\"\n { \"type\" = \"local\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"method\" = \"ident\"\n { \"option\" = \"sameuser\" } }\n }\n { \"#comment\" = \"IPv4 local connections:\" }\n { \"2\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"127.0.0.1\/32\" }\n { \"method\" = \"md5\" }\n }\n { \"#comment\" = \"Remote connections by hostname:\" }\n { \"3\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"foo.example.com\" }\n { \"method\" = \"md5\" }\n }\n { \"#comment\" = \"Remote connections by suffix of hostname\/fqdn:\" }\n { \"4\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \".example.com\" }\n { \"method\" = \"md5\" }\n }\n { \"#comment\" = \"IPv6 local connections:\" }\n { \"5\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"::1\/128\" }\n { \"method\" = \"md5\" }\n }\n\n(* ------------------------------------------------------------- *)\n\n (* Simple local test *)\n test Pg_Hba.lns get \"local all all trust\\n\" =\n { \"1\"\n { \"type\" = \"local\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"method\" = \"trust\" }\n }\n\n (* Remote test with comma-sparated database names *)\n test Pg_Hba.lns get \"hostssl db1,db2,db3 +pgusers 127.0.0.1\/32 trust\\n\" =\n { \"1\"\n { \"type\" = \"hostssl\" }\n { \"database\" = \"db1\" }\n { \"database\" = \"db2\" }\n { \"database\" = \"db3\" }\n { \"user\" = \"+pgusers\" }\n { \"address\" = \"127.0.0.1\/32\" }\n { \"method\" = \"trust\" }\n }\n\n (* Test with comma-sparated user names *)\n test Pg_Hba.lns get \"hostnossl sameuser u1,u2,u3 127.0.0.1\/32 trust\\n\" =\n { \"1\"\n { \"type\" = \"hostnossl\" }\n { \"database\" = \"sameuser\" }\n { \"user\" = \"u1\" }\n { \"user\" = \"u2\" }\n { \"user\" = \"u3\" }\n { \"address\" = \"127.0.0.1\/32\" }\n { \"method\" = \"trust\" }\n }\n\n (* Test with quoted database and user names *)\n test Pg_Hba.lns get \"host \\\"sameuser\\\" \\\"all\\\" 127.0.0.1\/32 trust\\n\" =\n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"\\\"sameuser\\\"\" }\n { \"user\" = \"\\\"all\\\"\" }\n { \"address\" = \"127.0.0.1\/32\" }\n { \"method\" = \"trust\" }\n }\n\n (* Test with IP + netmask address format *)\n test Pg_Hba.lns get \"host all all 192.168.1.1 255.255.0.0 trust\\n\" =\n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"192.168.1.1 255.255.0.0\" }\n { \"method\" = \"trust\" }\n }\n \n (* Test with fqdn as address *)\n test Pg_Hba.lns get \"host all all foo.example.com md5\\n\" = \n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \"foo.example.com\" }\n { \"method\" = \"md5\" }\n }\n\n (* Test with fqdn suffix as address *)\n test Pg_Hba.lns get \"host all all .example.com md5\\n\" = \n { \"1\"\n { \"type\" = \"host\" }\n { \"database\" = \"all\" }\n { \"user\" = \"all\" }\n { \"address\" = \".example.com\" }\n { \"method\" = \"md5\" }\n }\n\n (* Local types may not have and address *)\n test Pg_Hba.lns get \"local all all 127.0.0.1\/32 trust\\n\" = *\n\n (* Remote types must have an address *)\n test Pg_Hba.lns get \"host all all trust\\n\" = *\n\n (* The space between the IP and the netmask must not be considered as a\n column separator (\"method\" is missing here) *)\n test Pg_Hba.lns get \"host all all 192.168.1.1 255.255.0.0\\n\" = *\n\n (* Unsupported yet *)\n (* test Pg_Hba.lns get \"host \\\"db with spaces\\\" \\\"user with spaces\\\" 127.0.0.1\/32 trust\\n\" =? *)\n (* test Pg_Hba.lns get \"host \\\"db,with,commas\\\" \\\"user,with,commas\\\" 127.0.0.1\/32 trust\\n\" =? *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6a4925231d34a2b45b301989bc47c7fc782f4b24","subject":"Really test Avahi.lns in test_avahi.aug","message":"Really test Avahi.lns in test_avahi.aug\n","repos":"kumy\/augeas,manandbytes\/augeas,dafugg\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas,ptoscano\/augeas,kunkku\/augeas,hercules-team\/augeas,pevalme\/augeas,manandbytes\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,raphink\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,kumy\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,MikaelSmith\/augeas,raphink\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jjlin\/augeas,jtopjian\/augeas,mlichvar\/augeas,lutter\/augeas,jasperla\/augeas,mlichvar\/augeas,pevalme\/augeas,jjlin\/augeas,jjlin\/augeas,jtopjian\/augeas,mchf\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,kunkku\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_avahi.aug","new_file":"lenses\/tests\/test_avahi.aug","new_contents":"module Test_avahi =\n\n let conf = \"\n[server]\nhost-name=web\ndomain=example.com\n\n[wide-area]\nenable-wide-area=yes\n\"\n\n test Avahi.lns get conf =\n {}\n { \"server\"\n { \"host-name\" = \"web\" }\n { \"domain\" = \"example.com\" }\n {} }\n { \"wide-area\"\n { \"enable-wide-area\" = \"yes\" } }\n\n test Avahi.lns put conf after\n set \"server\/use-ipv4\" \"yes\";\n set \"server\/clients-max\" \"4096\"\n = \"\n[server]\nhost-name=web\ndomain=example.com\n\nuse-ipv4=yes\nclients-max=4096\n[wide-area]\nenable-wide-area=yes\n\"\n\n","old_contents":"module Test_avahi =\n\n let conf = \"\n[server]\nhost-name=web\ndomain=example.com\n\n[wide-area]\nenable-wide-area=yes\n\"\n\n test Avahi.lns get conf =\n {}\n { \"server\"\n { \"host-name\" = \"web\" }\n { \"domain\" = \"example.com\" }\n {} }\n { \"wide-area\"\n { \"enable-wide-area\" = \"yes\" } }\n\n test Puppet.lns put conf after\n set \"server\/use-ipv4\" \"yes\";\n set \"server\/clients-max\" \"4096\"\n = \"\n[server]\nhost-name=web\ndomain=example.com\n\nuse-ipv4=yes\nclients-max=4096\n[wide-area]\nenable-wide-area=yes\n\"\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6f5fd98a02ebe45e0dc116d188b0b5e97a90a9d6","subject":"* lenses\/tests\/test_sysconfig.aug: use a variable 'lns' for Sysconfig.lns","message":"* lenses\/tests\/test_sysconfig.aug: use a variable 'lns' for Sysconfig.lns\n","repos":"mchf\/augeas,kumy\/augeas,kunkku\/augeas,kumy\/augeas,kumy\/augeas,ptoscano\/augeas,jtopjian\/augeas,manandbytes\/augeas,dafugg\/augeas,pevalme\/augeas,jjlin\/augeas,jjlin\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,GeoffWilliams\/augeas,raphink\/augeas,kunkku\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,kunkku\/augeas,jtopjian\/augeas,hercules-team\/augeas,pevalme\/augeas,jjlin\/augeas,pevalme\/augeas,raphink\/augeas,mlichvar\/augeas,jasperla\/augeas,lutter\/augeas,mlichvar\/augeas,dafugg\/augeas,lutter\/augeas","old_file":"lenses\/tests\/test_sysconfig.aug","new_file":"lenses\/tests\/test_sysconfig.aug","new_contents":"(* Test for sysconfig lens *)\nmodule Test_sysconfig =\n\n let lns = Sysconfig.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\" }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"-q never\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"foo 'bar'\" }\n\n test lns get \"var=\\\"eth0\\\"\\n\" =\n { \"var\" = \"eth0\" }\n\n test lns get \"var='eth0'\\n\" =\n { \"var\" = \"eth0\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"Some \\\"funny\\\" value\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n (* We don't handle backticks *)\n test lns get\n \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" = *\n\n (* We don't handle comments at the end of a line yet *)\n test lns get \"var=ab #c\\n\" = *\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Check we put quotes in when changes require them *)\n test lns put \"var=\\\"v\\\"\\n\" after rm \"\/foo\" =\n \"var=\\\"v\\\"\\n\"\n\n test lns put \"var=v\\n\" after set \"\/var\" \"v w\"=\n \"var=\\\"v w\\\"\\n\"\n\n test lns put \"var='v'\\n\" after set \"\/var\" \"v w\"=\n \"var='v w'\\n\"\n\n test lns put \"var=v\\n\" after set \"\/var\" \"v'w\"=\n \"var=\\\"v'w\\\"\\n\"\n\n test lns put \"var=v\\n\" after set \"\/var\" \"v\\\"w\"=\n \"var='v\\\"w'\\n\"\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for sysconfig lens *)\nmodule Test_sysconfig =\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test Sysconfig.lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\" }\n\n test Sysconfig.lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT\n\"\n test Sysconfig.lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Sysconfig.lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test Sysconfig.lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"-q never\" }\n\n test Sysconfig.lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test Sysconfig.lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test Sysconfig.lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"foo 'bar'\" }\n\n test Sysconfig.lns get \"var=\\\"eth0\\\"\\n\" =\n { \"var\" = \"eth0\" }\n\n test Sysconfig.lns get \"var='eth0'\\n\" =\n { \"var\" = \"eth0\" }\n\n test Sysconfig.lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"Some \\\"funny\\\" value\" }\n\n test Sysconfig.lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test Sysconfig.lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test Sysconfig.lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n (* We don't handle backticks *)\n test Sysconfig.lns get\n \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" = *\n\n (* We don't handle comments at the end of a line yet *)\n test Sysconfig.lns get \"var=ab #c\\n\" = *\n\n (* Bug 109: allow a bare export *)\n test Sysconfig.lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Check we put quotes in when changes require them *)\n test Sysconfig.lns put \"var=\\\"v\\\"\\n\" after rm \"\/foo\" =\n \"var=\\\"v\\\"\\n\"\n\n test Sysconfig.lns put \"var=v\\n\" after set \"\/var\" \"v w\"=\n \"var=\\\"v w\\\"\\n\"\n\n test Sysconfig.lns put \"var='v'\\n\" after set \"\/var\" \"v w\"=\n \"var='v w'\\n\"\n\n test Sysconfig.lns put \"var=v\\n\" after set \"\/var\" \"v'w\"=\n \"var=\\\"v'w\\\"\\n\"\n\n test Sysconfig.lns put \"var=v\\n\" after set \"\/var\" \"v\\\"w\"=\n \"var='v\\\"w'\\n\"\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a49b2bbe4cfc5dffa75f4563f06a226e8441073b","subject":"Ntp: allow deprecated 'authenticate' setting","message":"Ntp: allow deprecated 'authenticate' setting\n","repos":"manandbytes\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,jasperla\/augeas,lutter\/augeas,pevalme\/augeas,raphink\/augeas,dafugg\/augeas,pevalme\/augeas,jtopjian\/augeas,kunkku\/augeas,jjlin\/augeas,ptoscano\/augeas,raphink\/augeas,manandbytes\/augeas,pevalme\/augeas,jasperla\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,dafugg\/augeas,kunkku\/augeas,jjlin\/augeas,hercules-team\/augeas,lutter\/augeas,mlichvar\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,mchf\/augeas,domcleal\/augeas,jtopjian\/augeas,domcleal\/augeas,lutter\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,kunkku\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,kumy\/augeas,mchf\/augeas,kumy\/augeas,jjlin\/augeas,ptoscano\/augeas","old_file":"lenses\/ntp.aug","new_file":"lenses\/ntp.aug","new_contents":"(* NTP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* Status: basic settings supported *)\n\nmodule Ntp =\n autoload xfm\n\n\n (* Define useful shortcuts *)\n\n let eol = del \/[ \\t]*\/ \"\" . [ label \"#comment\" . store \/#.*\/]?\n . Util.del_str \"\\n\"\n let sep_spc = Util.del_ws_spc\n let word = \/[^,# \\n\\t]+\/\n let num = \/[0-9]+\/\n\n\n (* define comments and empty lines *)\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"#\" .\n store \/([^ \\t\\n][^\\n]*)?\/ . del \"\\n\" \"\\n\" ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n let kv (k:regexp) (v:regexp) =\n [ key k . sep_spc. store v . eol ]\n\n (* Define generic record *)\n let record (kw:regexp) (value:lens) =\n [ key kw . sep_spc . store word . value . eol ]\n\n (* Define a command record; see confopt.html#cfg in the ntp docs *)\n let command_record =\n let opt = [ sep_spc . key \/minpoll|maxpoll|ttl|version|key\/ .\n sep_spc . store word ]\n | [ sep_spc . key (\/autokey|burst|iburst|noselect|preempt\/ |\n \/prefer|true|dynamic\/) ] in\n let cmd = \/server|peer|broadcast|manycastclient\/\n | \/multicastclient|manycastserver\/ in\n record cmd opt*\n\n let broadcastclient =\n [ key \"broadcastclient\" . [ sep_spc . key \"novolley\" ]? . eol ]\n\n (* Define a fudge record *)\n let fudge_opt_re = \"refid\" | \"stratum\"\n let fudge_opt = [ sep_spc . key fudge_opt_re . sep_spc . store word ]\n let fudge_record = record \"fudge\" fudge_opt?\n\n (* Define simple settings, see miscopt.html in ntp docs *)\n let flags =\n let flags_re = \/auth|bclient|calibrate|kernel|monitor|ntp|pps|stats\/ in\n let flag = [ label \"flag\" . store flags_re ] in\n [ key \/enable|disable\/ . (sep_spc . flag)* . eol ]\n\n let simple_setting (k:regexp) = kv k word\n\n (* Still incomplete, misses logconfig, phone, setvar, tos,\n trap, ttl *)\n let simple_settings =\n kv \"broadcastdelay\" Rx.decimal\n | flags\n | simple_setting \/driftfile|leapfile|logfile|includefile\/\n\t | simple_setting \"statsdir\"\n\n (* Misc commands, see miscopt.html in ntp docs *)\n\n (* Define restrict *)\n let restrict_record =\n let action = [ label \"action\" . sep_spc . store word ] in\n [ key \"restrict\" . sep_spc .\n [ label \"ipv6\" . Util.del_str \"-6\" . sep_spc ]? .\n store (word - \"-6\") . action* . eol ]\n\n (* Define statistics *)\n let statistics_flag (kw:string) = [ sep_spc . key kw ]\n\n let statistics_opts = statistics_flag \"loopstats\"\n | statistics_flag \"peerstats\"\n\t\t\t| statistics_flag \"clockstats\"\n\t\t\t| statistics_flag \"rawstats\"\n\n let statistics_record = [ key \"statistics\" . statistics_opts* . eol ]\n\n\n (* Define filegen *)\n let filegen = del \/filegen[ \\t]+\/ \"filegen \" . store word\n let filegen_opt (kw:string) = [ sep_spc . key kw . sep_spc . store word ]\n (* let filegen_flag (kw:string) = [ label kw . sep_spc . store word ] *)\n let filegen_select (kw:string) (select:regexp) = [ label kw . sep_spc . store select ]\n\n let filegen_opts = filegen_opt \"file\"\n | filegen_opt \"type\"\n\t\t | filegen_select \"enable\" \/(en|dis)able\/\n\t\t | filegen_select \"link\" \/(no)?link\/\n\n let filegen_record = [ label \"filegen\" . filegen . filegen_opts* . eol ]\n\n (* Authentication commands, see authopt.html#cmd; incomplete *)\n let auth_command =\n [ key \/controlkey|keys|keysdir|requestkey|authenticate\/ .\n sep_spc . store word . eol ]\n | [ key \/autokey|revoke\/ . [sep_spc . store word]? . eol ]\n | [ key \/trustedkey\/ . [ sep_spc . label \"key\" . store word ]+ . eol ]\n\n (* tinker [step step | panic panic | dispersion dispersion |\n stepout stepout | minpoll minpoll | allan allan | huffpuff huffpuff] *)\n let tinker =\n let arg_names = \/step|panic|dispersion|stepout|minpoll|allan|huffpuff\/ in\n let arg = [ key arg_names . sep_spc . store Rx.decimal ] in\n [ key \"tinker\" . (sep_spc . arg)* . eol ]\n\n (* Define lens *)\n\n let lns = ( comment | empty | command_record | fudge_record\n | restrict_record | simple_settings | statistics_record\n | filegen_record | broadcastclient\n | auth_command | tinker )*\n\n let filter = (incl \"\/etc\/ntp.conf\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* NTP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* Status: basic settings supported *)\n\nmodule Ntp =\n autoload xfm\n\n\n (* Define useful shortcuts *)\n\n let eol = del \/[ \\t]*\/ \"\" . [ label \"#comment\" . store \/#.*\/]?\n . Util.del_str \"\\n\"\n let sep_spc = Util.del_ws_spc\n let word = \/[^,# \\n\\t]+\/\n let num = \/[0-9]+\/\n\n\n (* define comments and empty lines *)\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"#\" .\n store \/([^ \\t\\n][^\\n]*)?\/ . del \"\\n\" \"\\n\" ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n let kv (k:regexp) (v:regexp) =\n [ key k . sep_spc. store v . eol ]\n\n (* Define generic record *)\n let record (kw:regexp) (value:lens) =\n [ key kw . sep_spc . store word . value . eol ]\n\n (* Define a command record; see confopt.html#cfg in the ntp docs *)\n let command_record =\n let opt = [ sep_spc . key \/minpoll|maxpoll|ttl|version|key\/ .\n sep_spc . store word ]\n | [ sep_spc . key (\/autokey|burst|iburst|noselect|preempt\/ |\n \/prefer|true|dynamic\/) ] in\n let cmd = \/server|peer|broadcast|manycastclient\/\n | \/multicastclient|manycastserver\/ in\n record cmd opt*\n\n let broadcastclient =\n [ key \"broadcastclient\" . [ sep_spc . key \"novolley\" ]? . eol ]\n\n (* Define a fudge record *)\n let fudge_opt_re = \"refid\" | \"stratum\"\n let fudge_opt = [ sep_spc . key fudge_opt_re . sep_spc . store word ]\n let fudge_record = record \"fudge\" fudge_opt?\n\n (* Define simple settings, see miscopt.html in ntp docs *)\n let flags =\n let flags_re = \/auth|bclient|calibrate|kernel|monitor|ntp|pps|stats\/ in\n let flag = [ label \"flag\" . store flags_re ] in\n [ key \/enable|disable\/ . (sep_spc . flag)* . eol ]\n\n let simple_setting (k:regexp) = kv k word\n\n (* Still incomplete, misses logconfig, phone, setvar, tos,\n trap, ttl *)\n let simple_settings =\n kv \"broadcastdelay\" Rx.decimal\n | flags\n | simple_setting \/driftfile|leapfile|logfile|includefile\/\n\t | simple_setting \"statsdir\"\n\n (* Misc commands, see miscopt.html in ntp docs *)\n\n (* Define restrict *)\n let restrict_record =\n let action = [ label \"action\" . sep_spc . store word ] in\n [ key \"restrict\" . sep_spc .\n [ label \"ipv6\" . Util.del_str \"-6\" . sep_spc ]? .\n store (word - \"-6\") . action* . eol ]\n\n (* Define statistics *)\n let statistics_flag (kw:string) = [ sep_spc . key kw ]\n\n let statistics_opts = statistics_flag \"loopstats\"\n | statistics_flag \"peerstats\"\n\t\t\t| statistics_flag \"clockstats\"\n\t\t\t| statistics_flag \"rawstats\"\n\n let statistics_record = [ key \"statistics\" . statistics_opts* . eol ]\n\n\n (* Define filegen *)\n let filegen = del \/filegen[ \\t]+\/ \"filegen \" . store word\n let filegen_opt (kw:string) = [ sep_spc . key kw . sep_spc . store word ]\n (* let filegen_flag (kw:string) = [ label kw . sep_spc . store word ] *)\n let filegen_select (kw:string) (select:regexp) = [ label kw . sep_spc . store select ]\n\n let filegen_opts = filegen_opt \"file\"\n | filegen_opt \"type\"\n\t\t | filegen_select \"enable\" \/(en|dis)able\/\n\t\t | filegen_select \"link\" \/(no)?link\/\n\n let filegen_record = [ label \"filegen\" . filegen . filegen_opts* . eol ]\n\n (* Authentication commands, see authopt.html#cmd; incomplete *)\n let auth_command =\n [ key \/controlkey|keys|keysdir|requestkey\/ .\n sep_spc . store word . eol ]\n | [ key \/autokey|revoke\/ . [sep_spc . store word]? . eol ]\n | [ key \/trustedkey\/ . [ sep_spc . label \"key\" . store word ]+ . eol ]\n\n (* tinker [step step | panic panic | dispersion dispersion |\n stepout stepout | minpoll minpoll | allan allan | huffpuff huffpuff] *)\n let tinker =\n let arg_names = \/step|panic|dispersion|stepout|minpoll|allan|huffpuff\/ in\n let arg = [ key arg_names . sep_spc . store Rx.decimal ] in\n [ key \"tinker\" . (sep_spc . arg)* . eol ]\n\n (* Define lens *)\n\n let lns = ( comment | empty | command_record | fudge_record\n | restrict_record | simple_settings | statistics_record\n | filegen_record | broadcastclient\n | auth_command | tinker )*\n\n let filter = (incl \"\/etc\/ntp.conf\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"395794b6ff80b1f39b7c8c7f49987de62d13e610","subject":"Fix examples note in inifile.aug","message":"Fix examples note in inifile.aug\n","repos":"domcleal\/augeas,jtopjian\/augeas,jasperla\/augeas,kunkku\/augeas,raphink\/augeas,dafugg\/augeas,pevalme\/augeas,kunkku\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,hercules-team\/augeas,jtopjian\/augeas,kumy\/augeas,ptoscano\/augeas,mchf\/augeas,domcleal\/augeas,pevalme\/augeas,jjlin\/augeas,manandbytes\/augeas,jasperla\/augeas,MikaelSmith\/augeas,jjlin\/augeas,lutter\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,kumy\/augeas,mchf\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,dafugg\/augeas,ptoscano\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,mlichvar\/augeas,raphink\/augeas,jjlin\/augeas,MikaelSmith\/augeas,lutter\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,manandbytes\/augeas,ptoscano\/augeas,pevalme\/augeas","old_file":"lenses\/inifile.aug","new_file":"lenses\/inifile.aug","new_contents":"(*\nModule: IniFile\n Generic module to create INI files lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: TODO\n Things to add in the future\n - Support double quotes in value\n\nAbout: Lens usage\n This lens is made to provide generic primitives to construct INI File lenses.\n See <Puppet>, <PHP>, <MySQL> or <Dput> for examples of real life lenses using it.\n\nAbout: Examples\n The <Test_IniFile> file contains various examples and tests.\n*)\n\nmodule IniFile =\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Internal primitives *)\n\n(*\nVariable: eol\n End of line, inherited from <Util.eol>\n*)\nlet eol = Util.eol\n\n(*\nView: empty\n Empty line, an <eol> subnode\n*)\nlet empty = [ eol ]\n\n\n(* Group: Separators *)\n\n\n\n(*\nVariable: sep\n Generic separator\n\n Parameters:\n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep (pat:regexp) (default:string)\n = Sep.opt_space . del pat default\n\n(*\nVariable: sep_re\n The default regexp for a separator\n*)\n\nlet sep_re = \/[=:]\/\n\n(*\nVariable: sep_default\n The default separator value\n*)\nlet sep_default = \"=\"\n\n\n(* Group: Stores *)\n\n\n(*\nVariable: sto_to_eol\n Store until end of line\n*)\nlet sto_to_eol = Sep.opt_space . store Rx.space_in\n\n(*\nVariable: to_comment_re\n Regex until comment\n*)\nlet to_comment_re = \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n(*\nVariable: sto_to_comment\n Store until comment\n*)\nlet sto_to_comment = Sep.opt_space . store to_comment_re\n\nlet sto_multiline = Sep.opt_space\n . store (to_comment_re\n . (\/[ \\t]*\\n\/ . Rx.space . to_comment_re)*)\n\n\n(* Group: Define comment and defaults *)\n\n(*\nView: comment\n Map comments into \"#comment\" nodes\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment \"#\" \"#\"\n let comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment (pat:regexp) (default:string)\n = [ label \"#comment\" . sep pat default\n\t\t . sto_to_eol? . eol ]\n(*\nVariable: comment_re\n Default regexp for <comment> pattern\n*)\n\nlet comment_re = \/[;#]\/\n\n(*\nVariable: comment_default\n Default value for <comment> pattern\n*)\nlet comment_default = \";\"\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Group: entry includes comments *)\n\n(*\nView: entry\n Generic INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry setting sep comment\n*)\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment\n\n\nlet entry_multiline (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_multiline? . (comment|eol) ] | comment\n\n\n(*\nView: indented_entry\n Generic INI File entry that might be indented with an arbitrary\n amount of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.indented_entry setting sep comment\n*)\nlet indented_entry (kw:regexp) (sep:lens) (comment:lens)\n = [ Util.del_opt_ws \"\" .\n key kw . sep . sto_to_comment? .\n (comment|eol)\n ]\n | comment\n\n(*\nVariable: entry_re\n Default regexp for <entry> keyword\n*)\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9._-]+\/ )\n\n\n(************************************************************************\n * Group: RECORD\n *************************************************************************)\n\n(* Group: Title definition *)\n\n(*\nView: title\n Title for <record>. This maps the title of a record as a node in the abstract tree.\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title\n Title for <record>. This maps the title of a record as a node in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet indented_title (kw:regexp)\n = Util.indent . title kw\n\n(*\nView: title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree.\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet indented_title_label (name:string) (kw:regexp)\n = Util.indent . title_label name kw\n\n\n(*\nVariable: record_re\n Default regexp for <title> keyword pattern\n*)\nlet record_re = ( \/[^]\\n\\\/]+\/ - \/#comment\/ )\n\n(*\nVariable: record_label_re\n Default regexp for <title_label> keyword pattern\n*)\nlet record_label_re = \/[^]\\n]+\/\n\n\n(* Group: Record definition *)\n\n(*\nView: record_noempty\n INI File Record with no empty lines allowed.\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n*)\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\n\n(*\nView: record\n Generic INI File record\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n\n Sample Usage:\n > let record = IniFile.record title entry\n*)\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n\n(*\n\nGroup: Lens definition\n\nView: lns_noempty\n Generic INI File lens with no empty lines\n\n Parameters:\n record:lens - record lens to use. See <record_noempty>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns_noempty record comment\n*)\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\n\n(*\nView: lns\n Generic INI File lens\n\n Parameters:\n record:lens - record lens to use. See <record>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns record comment\n*)\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n","old_contents":"(*\nModule: IniFile\n Generic module to create INI files lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: TODO\n Things to add in the future\n - Support double quotes in value\n\nAbout: Lens usage\n This lens is made to provide generic primitives to construct INI File lenses.\n See <Puppet>, <PHP>, <MySQL> or <Dput> for examples of real life lenses using it.\n\nAbout: Examples\n The <Test_Reprepro_Uploaders> file contains various examples and tests.\n*)\n\nmodule IniFile =\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Internal primitives *)\n\n(*\nVariable: eol\n End of line, inherited from <Util.eol>\n*)\nlet eol = Util.eol\n\n(*\nView: empty\n Empty line, an <eol> subnode\n*)\nlet empty = [ eol ]\n\n\n(* Group: Separators *)\n\n\n\n(*\nVariable: sep\n Generic separator\n\n Parameters:\n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep (pat:regexp) (default:string)\n = Sep.opt_space . del pat default\n\n(*\nVariable: sep_re\n The default regexp for a separator\n*)\n\nlet sep_re = \/[=:]\/\n\n(*\nVariable: sep_default\n The default separator value\n*)\nlet sep_default = \"=\"\n\n\n(* Group: Stores *)\n\n\n(*\nVariable: sto_to_eol\n Store until end of line\n*)\nlet sto_to_eol = Sep.opt_space . store Rx.space_in\n\n(*\nVariable: to_comment_re\n Regex until comment\n*)\nlet to_comment_re = \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n(*\nVariable: sto_to_comment\n Store until comment\n*)\nlet sto_to_comment = Sep.opt_space . store to_comment_re\n\nlet sto_multiline = Sep.opt_space\n . store (to_comment_re\n . (\/[ \\t]*\\n\/ . Rx.space . to_comment_re)*)\n\n\n(* Group: Define comment and defaults *)\n\n(*\nView: comment\n Map comments into \"#comment\" nodes\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment \"#\" \"#\"\n let comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment (pat:regexp) (default:string)\n = [ label \"#comment\" . sep pat default\n\t\t . sto_to_eol? . eol ]\n(*\nVariable: comment_re\n Default regexp for <comment> pattern\n*)\n\nlet comment_re = \/[;#]\/\n\n(*\nVariable: comment_default\n Default value for <comment> pattern\n*)\nlet comment_default = \";\"\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Group: entry includes comments *)\n\n(*\nView: entry\n Generic INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry setting sep comment\n*)\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment\n\n\nlet entry_multiline (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_multiline? . (comment|eol) ] | comment\n\n\n(*\nView: indented_entry\n Generic INI File entry that might be indented with an arbitrary\n amount of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.indented_entry setting sep comment\n*)\nlet indented_entry (kw:regexp) (sep:lens) (comment:lens)\n = [ Util.del_opt_ws \"\" .\n key kw . sep . sto_to_comment? .\n (comment|eol)\n ]\n | comment\n\n(*\nVariable: entry_re\n Default regexp for <entry> keyword\n*)\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9._-]+\/ )\n\n\n(************************************************************************\n * Group: RECORD\n *************************************************************************)\n\n(* Group: Title definition *)\n\n(*\nView: title\n Title for <record>. This maps the title of a record as a node in the abstract tree.\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title\n Title for <record>. This maps the title of a record as a node in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet indented_title (kw:regexp)\n = Util.indent . title kw\n\n(*\nView: title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree.\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\n(*\nView: indented_title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree. The title may be indented with arbitrary amounts of whitespace\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet indented_title_label (name:string) (kw:regexp)\n = Util.indent . title_label name kw\n\n\n(*\nVariable: record_re\n Default regexp for <title> keyword pattern\n*)\nlet record_re = ( \/[^]\\n\\\/]+\/ - \/#comment\/ )\n\n(*\nVariable: record_label_re\n Default regexp for <title_label> keyword pattern\n*)\nlet record_label_re = \/[^]\\n]+\/\n\n\n(* Group: Record definition *)\n\n(*\nView: record_noempty\n INI File Record with no empty lines allowed.\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n*)\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\n\n(*\nView: record\n Generic INI File record\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n\n Sample Usage:\n > let record = IniFile.record title entry\n*)\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n\n(*\n\nGroup: Lens definition\n\nView: lns_noempty\n Generic INI File lens with no empty lines\n\n Parameters:\n record:lens - record lens to use. See <record_noempty>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns_noempty record comment\n*)\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\n\n(*\nView: lns\n Generic INI File lens\n\n Parameters:\n record:lens - record lens to use. See <record>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns record comment\n*)\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"22fafc545c3f1f0a52fc1a59228154a8a83d2682","subject":"Ignore allow.pamlist from pam.aug","message":"Ignore allow.pamlist from pam.aug\n","repos":"GeoffWilliams\/augeas,kumy\/augeas,mlichvar\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jjlin\/augeas,lutter\/augeas,dafugg\/augeas,raphink\/augeas,jjlin\/augeas,ptoscano\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,manandbytes\/augeas,pevalme\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,manandbytes\/augeas,mlichvar\/augeas,mchf\/augeas,jtopjian\/augeas,domcleal\/augeas,lutter\/augeas,jasperla\/augeas,hercules-team\/augeas,kumy\/augeas,kunkku\/augeas,MikaelSmith\/augeas,mchf\/augeas,jasperla\/augeas,mlichvar\/augeas,raphink\/augeas,domcleal\/augeas,dafugg\/augeas,dafugg\/augeas,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,GeoffWilliams\/augeas,kumy\/augeas","old_file":"lenses\/pam.aug","new_file":"lenses\/pam.aug","new_contents":"(*\nModule: Pam\n Parses \/etc\/pam.conf and \/etc\/pam.d\/* service files\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man pam.conf` where\n possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens autoloads \/etc\/pam.d\/* for service specific files. See <filter>.\n It provides a lens for \/etc\/pam.conf, which is used in the PamConf module.\n*)\nmodule Pam =\n autoload xfm\n\n let eol = Util.eol\n let indent = Util.indent\n\n (* For the control syntax of [key=value ..] we could split the key value *)\n (* pairs into an array and generate a subtree control\/N\/KEY = VALUE *)\n let control = \/(\\[[^]#\\n]*\\]|[^[ \\t][^ \\t]*)\/\n let word = \/[^# \\t\\n]+\/\n (* Allowed types *)\n let types = \/(auth|session|account|password)\/i\n\n (* This isn't entirely right: arguments enclosed in [ .. ] are allowed *)\n (* and should be parsed as one *)\n let argument = \/[^#\\n \\t]+\/\n\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n\n\n (* Not mentioned in the man page, but Debian uses the syntax *)\n (* @include module *)\n (* quite a bit *)\n let include = [ indent . Util.del_str \"@\" . key \"include\" .\n Util.del_ws_spc . store word . eol ]\n\n (* Shared with PamConf *)\n let record = [ label \"optional\" . del \"-\" \"-\" ]? .\n [ label \"type\" . store types ] .\n Util.del_ws_tab .\n [ label \"control\" . store control] .\n Util.del_ws_tab .\n [ label \"module\" . store word ] .\n [ Util.del_ws_tab . label \"argument\" . store argument ]* .\n comment_or_eol\n\n let record_svc = [ seq \"record\" . indent . record ]\n\n let lns = ( empty | comment | include | record_svc ) *\n\n let filter = incl \"\/etc\/pam.d\/*\"\n . excl \"\/etc\/pam.d\/allow.pamlist\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Pam\n Parses \/etc\/pam.conf and \/etc\/pam.d\/* service files\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man pam.conf` where\n possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens autoloads \/etc\/pam.d\/* for service specific files. See <filter>.\n It provides a lens for \/etc\/pam.conf, which is used in the PamConf module.\n*)\nmodule Pam =\n autoload xfm\n\n let eol = Util.eol\n let indent = Util.indent\n\n (* For the control syntax of [key=value ..] we could split the key value *)\n (* pairs into an array and generate a subtree control\/N\/KEY = VALUE *)\n let control = \/(\\[[^]#\\n]*\\]|[^[ \\t][^ \\t]*)\/\n let word = \/[^# \\t\\n]+\/\n (* Allowed types *)\n let types = \/(auth|session|account|password)\/i\n\n (* This isn't entirely right: arguments enclosed in [ .. ] are allowed *)\n (* and should be parsed as one *)\n let argument = \/[^#\\n \\t]+\/\n\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n\n\n (* Not mentioned in the man page, but Debian uses the syntax *)\n (* @include module *)\n (* quite a bit *)\n let include = [ indent . Util.del_str \"@\" . key \"include\" .\n Util.del_ws_spc . store word . eol ]\n\n (* Shared with PamConf *)\n let record = [ label \"optional\" . del \"-\" \"-\" ]? .\n [ label \"type\" . store types ] .\n Util.del_ws_tab .\n [ label \"control\" . store control] .\n Util.del_ws_tab .\n [ label \"module\" . store word ] .\n [ Util.del_ws_tab . label \"argument\" . store argument ]* .\n comment_or_eol\n\n let record_svc = [ seq \"record\" . indent . record ]\n\n let lns = ( empty | comment | include | record_svc ) *\n\n let filter = incl \"\/etc\/pam.d\/*\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"48fd6595d6742f03d5f5e81aa21b66e2d8593b05","subject":"Add Build.block_setdefault","message":"Add Build.block_setdefault\n","repos":"ptoscano\/augeas,mlichvar\/augeas,manandbytes\/augeas,ptoscano\/augeas,jasperla\/augeas,jtopjian\/augeas,jjlin\/augeas,kunkku\/augeas,kumy\/augeas,lutter\/augeas,dafugg\/augeas,jtopjian\/augeas,hercules-team\/augeas,raphink\/augeas,kumy\/augeas,dafugg\/augeas,kunkku\/augeas,jjlin\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,mchf\/augeas,lutter\/augeas,kunkku\/augeas,jjlin\/augeas,domcleal\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,pevalme\/augeas,jasperla\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,mchf\/augeas,ptoscano\/augeas,dafugg\/augeas,MikaelSmith\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,mlichvar\/augeas,raphink\/augeas,kumy\/augeas,domcleal\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas","old_file":"lenses\/build.aug","new_file":"lenses\/build.aug","new_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n(************************************************************************\n * View: block_generic\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>\n * entry_noindent:lens - the entry to be stored inside the block,\n * without indentation.\n * This entry should not include <Util.empty>\n * entry_noeol:lens - the entry to be stored inside the block,\n * without eol.\n * This entry should not include <Util.empty>\n * entry_noindent_noeol:lens - the entry to be stored inside the block,\n * without indentation or eol.\n * This entry should not include <Util.empty>\n * comment:lens - the comment lens used in the block\n * comment_noindent:lens - the comment lens used in the block,\n * without indentation.\n * default_lbracket:string - default value for the left bracket\n * default_rbracket:string - default value for the right bracket\n ************************************************************************)\nlet block_generic\n (entry:lens) (entry_noindent:lens)\n (entry_noeol:lens) (entry_noindent_noeol:lens)\n (comment:lens) (comment_noindent:lens)\n (default_lbracket:string)\n (default_rbracket:string) =\n let block_single = entry_noindent_noeol | comment_noindent\n in let block_start = entry_noindent | comment_noindent\n in let block_middle = (Util.empty | entry | comment)*\n in let block_end = entry_noeol | comment\n in del \/[ \\t\\n]*\\{[ \\t\\n]*\/ default_lbracket\n . ( ( block_start . block_middle . block_end )\n | block_single )\n . del \/[ \\t\\n]*\\}\/ default_rbracket\n\n(************************************************************************\n * View: block_setdefault\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n * default_lbracket:string - default value for the left bracket\n * default_rbracket:string - default value for the right bracket\n ************************************************************************)\nlet block_setdefault (entry:lens)\n (default_lbracket:string)\n (default_rbracket:string) =\n block_generic (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n default_lbracket default_rbracket\n\n(************************************************************************\n * View: block\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block (entry:lens) = block_setdefault entry \" {\\n\" \"}\"\n\n(************************************************************************\n * View: named_block\n * A named <block> enclosed in brackets\n *\n * Parameters:\n * kw:regexp - the regexp for the block name\n * entry:lens - the entry to be stored inside the block\n * this entry should not include <Util.empty>\n ************************************************************************)\nlet named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]\n\n","old_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n(************************************************************************\n * View: block_generic\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>\n * entry_noindent:lens - the entry to be stored inside the block,\n * without indentation.\n * This entry should not include <Util.empty>\n * entry_noeol:lens - the entry to be stored inside the block,\n * without eol.\n * This entry should not include <Util.empty>\n * entry_noindent_noeol:lens - the entry to be stored inside the block,\n * without indentation or eol.\n * This entry should not include <Util.empty>\n * comment:lens - the comment lens used in the block\n * comment_noindent:lens - the comment lens used in the block,\n * without indentation.\n * default_lbracket:string - default value for the left bracket\n * default_rbracket:string - default value for the right bracket\n ************************************************************************)\nlet block_generic\n (entry:lens) (entry_noindent:lens)\n (entry_noeol:lens) (entry_noindent_noeol:lens)\n (comment:lens) (comment_noindent:lens)\n (default_lbracket:string)\n (default_rbracket:string) =\n let block_single = entry_noindent_noeol | comment_noindent\n in let block_start = entry_noindent | comment_noindent\n in let block_middle = (Util.empty | entry | comment)*\n in let block_end = entry_noeol | comment\n in del \/[ \\t\\n]*\\{[ \\t\\n]*\/ default_lbracket\n . ( ( block_start . block_middle . block_end )\n | block_single )\n . del \/[ \\t\\n]*\\}\/ default_rbracket\n\n(************************************************************************\n * View: block\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block (entry:lens) = block_generic (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n \" {\\n\" \"}\"\n\n(************************************************************************\n * View: named_block\n * A named <block> enclosed in brackets\n *\n * Parameters:\n * kw:regexp - the regexp for the block name\n * entry:lens - the entry to be stored inside the block\n * this entry should not include <Util.empty>\n ************************************************************************)\nlet named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ff3b1319e00353719fc4ca266d0f549c93443eff","subject":"Prefer comments over kv","message":"Prefer comments over kv\n","repos":"hercules-team\/augeas,bkearney\/augeas,jtopjian\/augeas,manandbytes\/augeas,kumy\/augeas,ptoscano\/augeas,dafugg\/augeas,bkearney\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,pevalme\/augeas,camptocamp\/augeas,camptocamp\/augeas,dafugg\/augeas,ptoscano\/augeas,mlichvar\/augeas,mlichvar\/augeas,camptocamp\/augeas,mchf\/augeas,kunkku\/augeas,jtopjian\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,mchf\/augeas,mlichvar\/augeas,kumy\/augeas,camptocamp\/augeas,raphink\/augeas,kumy\/augeas,lutter\/augeas,manandbytes\/augeas,kunkku\/augeas,jasperla\/augeas,pevalme\/augeas,raphink\/augeas,ptoscano\/augeas,dafugg\/augeas,pevalme\/augeas,bkearney\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,domcleal\/augeas,domcleal\/augeas,kumy\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use","old_file":"tests\/grammars\/accept\/inistyle.aug","new_file":"tests\/grammars\/accept\/inistyle.aug","new_contents":"# Parsing inistyle files\n\ngrammar inistyle {\n token EOL \/\\n\/ = '\\n'\n\n token INDENT \/[ \\t]+\/ = '\\t'\n\n token EQ \/\\s*=\\s*\/ = '='\n\n token OPT_WS \/[ \\t]*\/ = ''\n\n file: ( comment | section ) * {\n @0 { 'yum' }\n }\n\n comment: OPT_WS ( \/#.*\/ | 'REM' | 'rem' )? EOL\n\n section: '[' ... ']' EOL ( comment | kv ) * {\n @1 { $2 }\n }\n\n kv: ... EQ ... EOL {\n @$3 { $1 = $3 }\n }\n\n # FIXME: need to deal with continuation lines in values\n # Using something like this in the 'kv' rule may work\n # (when referencing rules from actions is implemented)\n value: ... ( \/\\n[ \\t]+\/ ... )*\n\n}\n","old_contents":"# Parsing inistyle files\n\ngrammar inistyle {\n token EOL \/\\n\/ = '\\n'\n\n token INDENT \/[ \\t]+\/ = '\\t'\n\n token EQ \/\\s*=\\s*\/ = '='\n\n token OPT_WS \/[ \\t]*\/ = ''\n\n file: ( comment | section ) * {\n @0 { 'yum' }\n }\n\n comment: OPT_WS ( \/#.*\/ | 'REM' | 'rem' )? EOL\n\n section: '[' ... ']' EOL ( kv | comment ) * {\n @1 { $2 }\n }\n\n kv: ... EQ ... EOL {\n @$3 { $1 = $3 }\n }\n\n # FIXME: need to deal with continuation lines in values\n # Using something like this in the 'kv' rule may work\n # (when referencing rules from actions is implemented)\n value: ... ( \/\\n[ \\t]+\/ ... )*\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a3cf1da107feb56330cb35c57c52486ac226bb34","subject":"Remove trailing whitespace","message":"Remove trailing whitespace\n","repos":"hercules-team\/augeas-do-not-use,mlichvar\/augeas,lutter\/augeas,raphink\/augeas,ptoscano\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,domcleal\/augeas,MikaelSmith\/augeas,kunkku\/augeas,domcleal\/augeas,domcleal\/augeas,jjlin\/augeas,jasperla\/augeas,jjlin\/augeas,ptoscano\/augeas,kumy\/augeas,dafugg\/augeas,hercules-team\/augeas,kunkku\/augeas,jjlin\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,mchf\/augeas,kunkku\/augeas,pevalme\/augeas,manandbytes\/augeas,kumy\/augeas,manandbytes\/augeas,lutter\/augeas,dafugg\/augeas,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,kumy\/augeas,jtopjian\/augeas,mchf\/augeas,jasperla\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,pevalme\/augeas","old_file":"lenses\/tests\/test_nsswitch.aug","new_file":"lenses\/tests\/test_nsswitch.aug","new_contents":"module Test_nsswitch =\n\n let conf = \"# Sample nsswitch.conf\npasswd: compat\n\nhosts: files mdns4_minimal [NOTFOUND=return] dns mdns4\nnetworks: nis [!UNAVAIL=return success=continue] files\nprotocols: db files\nnetgroup: nis\n\"\n\ntest Nsswitch.lns get conf =\n { \"#comment\" = \"Sample nsswitch.conf\" }\n { \"database\" = \"passwd\"\n { \"service\" = \"compat\" } }\n {}\n { \"database\" = \"hosts\"\n { \"service\" = \"files\" }\n { \"service\" = \"mdns4_minimal\" }\n { \"reaction\"\n { \"status\" = \"NOTFOUND\"\n { \"action\" = \"return\" } } }\n { \"service\" = \"dns\" }\n { \"service\" = \"mdns4\" } }\n { \"database\" = \"networks\"\n { \"service\" = \"nis\" }\n { \"reaction\"\n { \"status\" = \"UNAVAIL\"\n { \"negate\" }\n { \"action\" = \"return\" } }\n { \"status\" = \"success\"\n { \"action\" = \"continue\" } } }\n { \"service\" = \"files\" } }\n { \"database\" = \"protocols\"\n { \"service\" = \"db\" }\n { \"service\" = \"files\" } }\n { \"database\" = \"netgroup\"\n { \"service\" = \"nis\" } }\n\n\n","old_contents":"module Test_nsswitch =\n\n let conf = \"# Sample nsswitch.conf\npasswd: compat\n\nhosts: files mdns4_minimal [NOTFOUND=return] dns mdns4\nnetworks: nis [!UNAVAIL=return success=continue] files\nprotocols: db files\nnetgroup: nis\n\"\n\ntest Nsswitch.lns get conf =\n { \"#comment\" = \"Sample nsswitch.conf\" }\n { \"database\" = \"passwd\"\n { \"service\" = \"compat\" } }\n {}\n { \"database\" = \"hosts\"\n { \"service\" = \"files\" }\n { \"service\" = \"mdns4_minimal\" }\n { \"reaction\"\n { \"status\" = \"NOTFOUND\"\n { \"action\" = \"return\" } } }\n { \"service\" = \"dns\" }\n { \"service\" = \"mdns4\" } }\n { \"database\" = \"networks\"\n { \"service\" = \"nis\" }\n { \"reaction\"\n { \"status\" = \"UNAVAIL\"\n { \"negate\" }\n { \"action\" = \"return\" } }\n { \"status\" = \"success\"\n { \"action\" = \"continue\" } } }\n { \"service\" = \"files\" } }\n { \"database\" = \"protocols\"\n { \"service\" = \"db\" }\n { \"service\" = \"files\" } }\n { \"database\" = \"netgroup\"\n { \"service\" = \"nis\" } }\n \n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f9801ce4a12c25fda1f42273f98d2ee902dc50fe","subject":"Quote: improve lens usage","message":"Quote: improve lens usage\n","repos":"kumy\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,manandbytes\/augeas,pevalme\/augeas,manandbytes\/augeas,mchf\/augeas,MikaelSmith\/augeas,kumy\/augeas,lutter\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,kumy\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,kumy\/augeas,mchf\/augeas,raphink\/augeas,pevalme\/augeas,hercules-team\/augeas,kunkku\/augeas,jjlin\/augeas,mlichvar\/augeas,lutter\/augeas,ptoscano\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,MikaelSmith\/augeas,dafugg\/augeas,mlichvar\/augeas,mlichvar\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,jjlin\/augeas,pevalme\/augeas","old_file":"lenses\/quote.aug","new_file":"lenses\/quote.aug","new_contents":"(*\nModule: Quote\n Generic module providing useful primitives for quoting\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n This is a generic module which doesn't apply to files directly.\n You can use its definitions to build lenses that require quoted values.\n It provides several levels of definitions, allowing to define more or less fine-grained quoted values:\n\n - the quote separators are separators that are useful to define quoted values;\n - the quoting functions are useful wrappers to easily enclose a lens in various kinds of quotes (single, double, any, optional or not);\n - the quoted values definitions are common quoted patterns. They use the quoting functions in order to provide useful shortcuts for commonly met needs. In particular, the <quote_spaces> (and similar) function force values that contain spaces to be quoted, but allow values without spaces to be unquoted.\n\nAbout: Examples\n The <Test_Quote> file contains various examples and tests.\n*)\n\nmodule Quote =\n\n(* Group: QUOTE SEPARATORS *)\n\n(* Variable: dquote\n A double quote *)\nlet dquote = Util.del_str \"\\\"\"\n\n(* Variable: dquote_opt\n An optional double quote, default to double *)\nlet dquote_opt = del \/\"?\/ \"\\\"\"\n\n(* Variable: dquote_opt_nil\n An optional double quote, default to nothing *)\nlet dquote_opt_nil = del \/\"?\/ \"\"\n\n(* Variable: squote\n A single quote *)\nlet squote = Util.del_str \"'\"\n\n(* Variable: squote_opt\n An optional single quote, default to single *)\nlet squote_opt = del \/'?\/ \"'\"\n\n(* Variable: squote_opt_nil\n An optional single quote, default to nothing *)\nlet squote_opt_nil = del \/'?\/ \"\"\n\n(* Variable: quote\n A quote, either double or single, default to double *)\nlet quote = del \/[\"']\/ \"\\\"\"\n\n(* Variable: quote_opt\n An optional quote, either double or single, default to double *)\nlet quote_opt = del \/[\"']?\/ \"\\\"\"\n\n(* Variable: quote_opt_nil\n An optional quote, either double or single, default to nothing *)\nlet quote_opt_nil = del \/[\"']?\/ \"\"\n\n\n(* Group: QUOTING FUNCTIONS *)\n\n(*\nView: do_dquote\n Enclose a lens in <dquote>s\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote (body:lens) =\n square dquote body dquote\n\n(*\nView: do_dquote_opt\n Enclose a lens in optional <dquote>s,\n use <dquote>s by default.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote_opt (body:lens) =\n square dquote_opt body dquote_opt\n\n(*\nView: do_dquote_opt_nil\n Enclose a lens in optional <dquote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote_opt_nil (body:lens) =\n square dquote_opt_nil body dquote_opt_nil\n\n(*\nView: do_squote\n Enclose a lens in <squote>s\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote (body:lens) =\n square squote body squote\n\n(*\nView: do_squote_opt\n Enclose a lens in optional <squote>s,\n use <squote>s by default.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote_opt (body:lens) =\n square squote_opt body squote_opt\n\n(*\nView: do_squote_opt_nil\n Enclose a lens in optional <squote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote_opt_nil (body:lens) =\n square squote_opt_nil body squote_opt_nil\n\n(*\nView: do_quote\n Enclose a lens in <quote>s.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote (body:lens) =\n square quote body quote\n\n(*\nView: do_quote\n Enclose a lens in options <quote>s.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote_opt (body:lens) =\n square quote_opt body quote_opt\n\n(*\nView: do_quote\n Enclose a lens in options <quote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote_opt_nil (body:lens) =\n square quote_opt_nil body quote_opt_nil\n\n\n(* Group: QUOTED VALUES *)\n\n(* View: double\n A double-quoted value *)\nlet double =\n let body = store \/[^\\n]*\/\n in do_dquote body\n\n(* Variable: double_opt_re\n The regexp to store when value\n is optionally double-quoted *)\nlet double_opt_re = \/[^\\n\\t \"]([^\\n\"]*[^\\n\\t \"])?\/\n\n(* View: double_opt\n An optionaly double-quoted value\n Double quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet double_opt =\n let body = store double_opt_re\n in do_dquote_opt body\n\n(* View: single\n A single-quoted value *)\nlet single =\n let body = store \/[^\\n]*\/\n in do_squote body\n\n(* Variable: single_opt_re\n The regexp to store when value\n is optionally single-quoted *)\nlet single_opt_re = \/[^\\n\\t ']([^\\n']*[^\\n\\t '])?\/\n\n(* View: single_opt\n An optionaly single-quoted value\n Single quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet single_opt =\n let body = store single_opt_re\n in do_squote_opt body\n\n(* View: any\n A quoted value *)\nlet any =\n let body = store \/[^\\n]*\/\n in do_quote body\n\n(* Variable: any_opt_re\n The regexp to store when value\n is optionally single- or double-quoted *)\nlet any_opt_re = \/[^\\n\\t \"']([^\\n\"']*[^\\n\\t \"'])?\/\n\n(* View: any_opt\n An optionaly quoted value\n Double or single quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet any_opt =\n let body = store any_opt_re\n in do_quote_opt body\n\n(*\nView: quote_spaces\n Make quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet quote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_quote_opt (store \/[^\"' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_quote (store \/[^\"' \\t\\n]*[ \\t][^\"' \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet dquote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\" \\t\\n]*[ \\t][^\" \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n\n(*\nView: squote_spaces\n Make single quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet squote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_squote_opt (store \/[^' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_squote (store \/[^' \\t\\n]*[ \\t][^' \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n","old_contents":"(*\nModule: Quote\n Generic module providing useful primitives for quoting\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n This is a generic module which doesn't apply to files directly.\n You can use its definitions to build lenses that requires quoted values.\n It provides several levels of definitions, allowing to define more or less fine-grained quoted values.\n\nAbout: Examples\n The <Test_Quote> file contains various examples and tests.\n*)\n\nmodule Quote =\n\n(* Group: QUOTE SEPARATORS *)\n\n(* Variable: dquote\n A double quote *)\nlet dquote = Util.del_str \"\\\"\"\n\n(* Variable: dquote_opt\n An optional double quote, default to double *)\nlet dquote_opt = del \/\"?\/ \"\\\"\"\n\n(* Variable: dquote_opt_nil\n An optional double quote, default to nothing *)\nlet dquote_opt_nil = del \/\"?\/ \"\"\n\n(* Variable: squote\n A single quote *)\nlet squote = Util.del_str \"'\"\n\n(* Variable: squote_opt\n An optional single quote, default to single *)\nlet squote_opt = del \/'?\/ \"'\"\n\n(* Variable: squote_opt_nil\n An optional single quote, default to nothing *)\nlet squote_opt_nil = del \/'?\/ \"\"\n\n(* Variable: quote\n A quote, either double or single, default to double *)\nlet quote = del \/[\"']\/ \"\\\"\"\n\n(* Variable: quote_opt\n An optional quote, either double or single, default to double *)\nlet quote_opt = del \/[\"']?\/ \"\\\"\"\n\n(* Variable: quote_opt_nil\n An optional quote, either double or single, default to nothing *)\nlet quote_opt_nil = del \/[\"']?\/ \"\"\n\n\n(* Group: QUOTING FUNCTIONS *)\n\n(*\nView: do_dquote\n Enclose a lens in <dquote>s\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote (body:lens) =\n square dquote body dquote\n\n(*\nView: do_dquote_opt\n Enclose a lens in optional <dquote>s,\n use <dquote>s by default.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote_opt (body:lens) =\n square dquote_opt body dquote_opt\n\n(*\nView: do_dquote_opt_nil\n Enclose a lens in optional <dquote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote_opt_nil (body:lens) =\n square dquote_opt_nil body dquote_opt_nil\n\n(*\nView: do_squote\n Enclose a lens in <squote>s\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote (body:lens) =\n square squote body squote\n\n(*\nView: do_squote_opt\n Enclose a lens in optional <squote>s,\n use <squote>s by default.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote_opt (body:lens) =\n square squote_opt body squote_opt\n\n(*\nView: do_squote_opt_nil\n Enclose a lens in optional <squote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote_opt_nil (body:lens) =\n square squote_opt_nil body squote_opt_nil\n\n(*\nView: do_quote\n Enclose a lens in <quote>s.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote (body:lens) =\n square quote body quote\n\n(*\nView: do_quote\n Enclose a lens in options <quote>s.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote_opt (body:lens) =\n square quote_opt body quote_opt\n\n(*\nView: do_quote\n Enclose a lens in options <quote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote_opt_nil (body:lens) =\n square quote_opt_nil body quote_opt_nil\n\n\n(* Group: QUOTED VALUES *)\n\n(* View: double\n A double-quoted value *)\nlet double =\n let body = store \/[^\\n]*\/\n in do_dquote body\n\n(* Variable: double_opt_re\n The regexp to store when value\n is optionally double-quoted *)\nlet double_opt_re = \/[^\\n\\t \"]([^\\n\"]*[^\\n\\t \"])?\/\n\n(* View: double_opt\n An optionaly double-quoted value\n Double quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet double_opt =\n let body = store double_opt_re\n in do_dquote_opt body\n\n(* View: single\n A single-quoted value *)\nlet single =\n let body = store \/[^\\n]*\/\n in do_squote body\n\n(* Variable: single_opt_re\n The regexp to store when value\n is optionally single-quoted *)\nlet single_opt_re = \/[^\\n\\t ']([^\\n']*[^\\n\\t '])?\/\n\n(* View: single_opt\n An optionaly single-quoted value\n Single quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet single_opt =\n let body = store single_opt_re\n in do_squote_opt body\n\n(* View: any\n A quoted value *)\nlet any =\n let body = store \/[^\\n]*\/\n in do_quote body\n\n(* Variable: any_opt_re\n The regexp to store when value\n is optionally single- or double-quoted *)\nlet any_opt_re = \/[^\\n\\t \"']([^\\n\"']*[^\\n\\t \"'])?\/\n\n(* View: any_opt\n An optionaly quoted value\n Double or single quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet any_opt =\n let body = store any_opt_re\n in do_quote_opt body\n\n(*\nView: quote_spaces\n Make quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet quote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_quote_opt (store \/[^\"' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_quote (store \/[^\"' \\t\\n]*[ \\t][^\"' \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet dquote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\" \\t\\n]*[ \\t][^\" \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n\n(*\nView: squote_spaces\n Make single quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet squote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_squote_opt (store \/[^' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_squote (store \/[^' \\t\\n]*[ \\t][^' \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"74e9959dafe3cfdc4f5fb16848beb15aa4c470bc","subject":"\/etc\/default\/whoopsie is an IniFile","message":"\/etc\/default\/whoopsie is an IniFile\n","repos":"domcleal\/augeas,mchf\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,ptoscano\/augeas,lutter\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,raphink\/augeas,kunkku\/augeas,hercules-team\/augeas,pevalme\/augeas,jasperla\/augeas,domcleal\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,raphink\/augeas,lutter\/augeas,MikaelSmith\/augeas,domcleal\/augeas,dafugg\/augeas,mlichvar\/augeas,pevalme\/augeas,kumy\/augeas,jasperla\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,ptoscano\/augeas,jjlin\/augeas,mchf\/augeas,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,manandbytes\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,jtopjian\/augeas,jtopjian\/augeas,manandbytes\/augeas,ptoscano\/augeas,dafugg\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+ | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+ | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"451c0196b31ec23e00e0f6ee9ec8e2763e85b320","subject":"logrotate: support dateyesterday option (GH #367)","message":"logrotate: support dateyesterday option (GH #367)\n","repos":"hercules-team\/augeas,pevalme\/augeas,mchf\/augeas,ptoscano\/augeas,mlichvar\/augeas,pevalme\/augeas,mlichvar\/augeas,manandbytes\/augeas,mchf\/augeas,kunkku\/augeas,kunkku\/augeas,manandbytes\/augeas,pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,lutter\/augeas,mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas,lutter\/augeas,lutter\/augeas","old_file":"lenses\/logrotate.aug","new_file":"lenses\/logrotate.aug","new_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Sep.space\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = Rx.relinteger\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = \/\\\/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n let indent = del Rx.opt_space \"\\t\"\n\n (* define omments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) = [ label kw . store select ]\n let value_to_eol (kw:string) (value:regexp) = Build.key_value kw sep_val (store value)\n let flag_to_eol (kw:string) = Build.flag kw\n let list_to_eol (kw:string) = [ key kw . list_item+ ]\n\n\n (* Defaults *)\n\n let create =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"create\" .\n ( mode | mode . owner | mode . owner . group )? ]\n\n let su =\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"su\" .\n ( owner | owner . group )? ]\n\n let tabooext = [ key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ ]\n\n let attrs = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/\n | value_to_eol \"rotate\" num\n | create\n | flag_to_eol \"nocreate\"\n | su\n | value_to_eol \"include\" word\n | select_to_eol \"missingok\" \/(no)?missingok\/\n | select_to_eol \"compress\" \/(no)?compress\/\n | select_to_eol \"delaycompress\" \/(no)?delaycompress\/\n | select_to_eol \"ifempty\" \/(not)?ifempty\/\n | select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/\n | value_to_eol \"size\" size\n | tabooext\n | value_to_eol \"olddir\" word\n | flag_to_eol \"noolddir\"\n | value_to_eol \"mail\" word\n | flag_to_eol \"mailfirst\"\n | flag_to_eol \"maillast\"\n | flag_to_eol \"nomail\"\n | value_to_eol \"errors\" word\n | value_to_eol \"extension\" word\n | select_to_eol \"dateext\" \/(no)?dateext\/\n | value_to_eol \"dateformat\" word\n | flag_to_eol \"dateyesterday\"\n | value_to_eol \"compresscmd\" word\n | value_to_eol \"uncompresscmd\" word\n | value_to_eol \"compressext\" word\n | list_to_eol \"compressoptions\"\n | select_to_eol \"copy\" \/(no)?copy\/\n | select_to_eol \"copytruncate\" \/(no)?copytruncate\/\n | value_to_eol \"maxage\" num\n | value_to_eol \"minsize\" size\n | value_to_eol \"maxsize\" size\n | select_to_eol \"shred\" \/(no)?shred\/\n | value_to_eol \"shredcycles\" num\n | value_to_eol \"start\" num\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . Util.del_str \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ key hook_names . eol .\n hook_lines? .\n del \/[ \\t]*endscript\/ \"\\tendscript\" ]\n\n (* Define rule *)\n\n let body = Build.block_newlines\n (indent . (attrs | hooks) . eol)\n Util.comment\n\n let rule =\n let filename_entry = [ label \"file\" . store filename ] in\n let filename_sep = del \/[ \\t\\n]+\/ \" \" in\n let filenames = Build.opt_list filename_entry filename_sep in\n [ label \"rule\" . Util.indent . filenames . body . eol ]\n\n let lns = ( comment | empty | (attrs . eol) | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Sep.space\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.eol\n let num = Rx.relinteger\n let word = \/[^,#= \\n\\t{}]+\/\n let filename = \/\\\/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n let indent = del Rx.opt_space \"\\t\"\n\n (* define omments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) = [ label kw . store select ]\n let value_to_eol (kw:string) (value:regexp) = Build.key_value kw sep_val (store value)\n let flag_to_eol (kw:string) = Build.flag kw\n let list_to_eol (kw:string) = [ key kw . list_item+ ]\n\n\n (* Defaults *)\n\n let create =\n let mode = sep_spc . [ label \"mode\" . store num ] in\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"create\" .\n ( mode | mode . owner | mode . owner . group )? ]\n\n let su =\n let owner = sep_spc . [ label \"owner\" . store word ] in\n let group = sep_spc . [ label \"group\" . store word ] in\n [ key \"su\" .\n ( owner | owner . group )? ]\n\n let tabooext = [ key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ ]\n\n let attrs = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/\n | value_to_eol \"rotate\" num\n | create\n | flag_to_eol \"nocreate\"\n | su\n | value_to_eol \"include\" word\n | select_to_eol \"missingok\" \/(no)?missingok\/\n | select_to_eol \"compress\" \/(no)?compress\/\n | select_to_eol \"delaycompress\" \/(no)?delaycompress\/\n | select_to_eol \"ifempty\" \/(not)?ifempty\/\n | select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/\n | value_to_eol \"size\" size\n | tabooext\n | value_to_eol \"olddir\" word\n | flag_to_eol \"noolddir\"\n | value_to_eol \"mail\" word\n | flag_to_eol \"mailfirst\"\n | flag_to_eol \"maillast\"\n | flag_to_eol \"nomail\"\n | value_to_eol \"errors\" word\n | value_to_eol \"extension\" word\n | select_to_eol \"dateext\" \/(no)?dateext\/\n | value_to_eol \"dateformat\" word\n | value_to_eol \"compresscmd\" word\n | value_to_eol \"uncompresscmd\" word\n | value_to_eol \"compressext\" word\n | list_to_eol \"compressoptions\"\n | select_to_eol \"copy\" \/(no)?copy\/\n | select_to_eol \"copytruncate\" \/(no)?copytruncate\/\n | value_to_eol \"maxage\" num\n | value_to_eol \"minsize\" size\n | value_to_eol \"maxsize\" size\n | select_to_eol \"shred\" \/(no)?shred\/\n | value_to_eol \"shredcycles\" num\n | value_to_eol \"start\" num\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . Util.del_str \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ key hook_names . eol .\n hook_lines? .\n del \/[ \\t]*endscript\/ \"\\tendscript\" ]\n\n (* Define rule *)\n\n let body = Build.block_newlines\n (indent . (attrs | hooks) . eol)\n Util.comment\n\n let rule =\n let filename_entry = [ label \"file\" . store filename ] in\n let filename_sep = del \/[ \\t\\n]+\/ \" \" in\n let filenames = Build.opt_list filename_entry filename_sep in\n [ label \"rule\" . Util.indent . filenames . body . eol ]\n\n let lns = ( comment | empty | (attrs . eol) | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"505929c0b07ba49a447090397055ea2b68eb169c","subject":"* lenses\/tests\/test_logrotate.aug: add test for files separated by newlines","message":"* lenses\/tests\/test_logrotate.aug: add test for files separated by newlines\n\nThis test the fix for bug #104, commit fe0453ce.\n","repos":"mchf\/augeas,jasperla\/augeas,MikaelSmith\/augeas,pevalme\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,lutter\/augeas,pevalme\/augeas,kunkku\/augeas,manandbytes\/augeas,jtopjian\/augeas,mlichvar\/augeas,domcleal\/augeas,manandbytes\/augeas,kumy\/augeas,jjlin\/augeas,kunkku\/augeas,pevalme\/augeas,dafugg\/augeas,jtopjian\/augeas,mlichvar\/augeas,lutter\/augeas,mchf\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kunkku\/augeas,domcleal\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jjlin\/augeas,jasperla\/augeas,lutter\/augeas,domcleal\/augeas,dafugg\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,hercules-team\/augeas,dafugg\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,ptoscano\/augeas,raphink\/augeas,ptoscano\/augeas","old_file":"lenses\/tests\/test_logrotate.aug","new_file":"lenses\/tests\/test_logrotate.aug","new_contents":"module Test_logrotate =\n\n let conf = \"# see man logrotate for details\n# rotate log files weekly\nweekly\n\n# keep 4 weeks worth of backlogs\nrotate 4\n\n# create new (empty) log files after rotating old ones\ncreate\n\n# uncomment this if you want your log files compressed\n#compress\n\ntabooext + .old .orig .ignore\n\n# packages drop log rotation information into this directory\ninclude \/etc\/logrotate.d\n\n# no packages own wtmp, or btmp -- we'll rotate them here\n\/var\/log\/wtmp\n\/var\/log\/wtmp2\n{\n missingok\n monthly\n create 0664 root utmp\n rotate 1\n}\n\n\/var\/log\/btmp \/var\/log\/btmp* {\n missingok\n # ftpd doesn't handle SIGHUP properly\n monthly\n create 0664 root utmp\n rotate 1\n}\n\/var\/log\/vsftpd.log {\n # ftpd doesn't handle SIGHUP properly\n nocompress\n missingok\n notifempty\n rotate 4\n weekly\n}\n\n\/var\/log\/apache2\/*.log {\n weekly\n missingok\n rotate 52\n compress\n delaycompress\n notifempty\n create 640 root adm\n sharedscripts\n prerotate\n if [ -f \/var\/run\/apache2.pid ]; then\n \/etc\/init.d\/apache2 restart > \/dev\/null\n fi\n endscript\n}\n\"\n\n test Logrotate.lns get conf =\n { \"#comment\" = \"see man logrotate for details\" }\n { \"#comment\" = \"rotate log files weekly\" }\n { \"schedule\" = \"weekly\" }\n {}\n { \"#comment\" = \"keep 4 weeks worth of backlogs\" }\n { \"rotate\" = \"4\" }\n {}\n { \"#comment\" = \"create new (empty) log files after rotating old ones\" }\n { \"create\" }\n {}\n { \"#comment\" = \"uncomment this if you want your log files compressed\" }\n { \"#comment\" = \"compress\" }\n {}\n { \"tabooext\" = \"+\" { \".old\" } { \".orig\" } { \".ignore\" } }\n {}\n { \"#comment\" = \"packages drop log rotation information into this directory\" }\n { \"include\" = \"\/etc\/logrotate.d\" }\n {}\n { \"#comment\" = \"no packages own wtmp, or btmp -- we'll rotate them here\" }\n { \"rule\"\n { \"file\" = \"\/var\/log\/wtmp\" }\n { \"file\" = \"\/var\/log\/wtmp2\" }\n { \"missingok\" = \"missingok\" }\n { \"schedule\" = \"monthly\" }\n { \"create\"\n { \"mode\" = \"0664\" }\n { \"owner\" = \"root\" }\n { \"group\" = \"utmp\" } }\n { \"rotate\" = \"1\" } }\n {}\n { \"rule\"\n { \"file\" = \"\/var\/log\/btmp\" }\n\t { \"file\" = \"\/var\/log\/btmp*\" }\n { \"missingok\" = \"missingok\" }\n\t { \"#comment\" = \"ftpd doesn't handle SIGHUP properly\" }\n { \"schedule\" = \"monthly\" }\n { \"create\"\n { \"mode\" = \"0664\" }\n { \"owner\" = \"root\" }\n { \"group\" = \"utmp\" } }\n { \"rotate\" = \"1\" } }\n { \"rule\"\n { \"file\" = \"\/var\/log\/vsftpd.log\" }\n { \"#comment\" = \"ftpd doesn't handle SIGHUP properly\" }\n { \"compress\" = \"nocompress\" }\n { \"missingok\" = \"missingok\" }\n { \"ifempty\" = \"notifempty\" }\n { \"rotate\" = \"4\" }\n { \"schedule\" = \"weekly\" } }\n {}\n { \"rule\"\n { \"file\" = \"\/var\/log\/apache2\/*.log\" }\n { \"schedule\" = \"weekly\" }\n { \"missingok\" = \"missingok\" }\n { \"rotate\" = \"52\" }\n { \"compress\" = \"compress\" }\n { \"delaycompress\" = \"delaycompress\" }\n { \"ifempty\" = \"notifempty\" }\n { \"create\"\n { \"mode\" = \"640\" }\n { \"owner\" = \"root\" }\n { \"group\" = \"adm\" } }\n { \"sharedscripts\" = \"sharedscripts\" }\n { \"prerotate\" = \" if [ -f \/var\/run\/apache2.pid ]; then\n \/etc\/init.d\/apache2 restart > \/dev\/null\n fi\" } }\n\n test Logrotate.lns get \"\/var\/log\/file {\\n dateext\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/var\/log\/file\" }\n { \"dateext\" = \"dateext\" } }\n\n (* Make sure 'minsize 1M' works *)\n test Logrotate.lns get \"\/avr\/log\/wtmp {\\n minsize 1M\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/avr\/log\/wtmp\" }\n { \"minsize\" = \"1M\" } }\n\n (* '=' is a legal separator, file names can be indented *)\n test Logrotate.lns get \" \\t \/file {\\n size=5M\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/file\" }\n { \"size\" = \"5M\" } }\n\n (* Can leave owner\/group off a create statement *)\n test Logrotate.lns get \"\/file {\n\tcreate 600\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/file\" }\n { \"create\"\n { \"mode\" = \"600\" } } }\n\n test Logrotate.lns put \"\/file {\\n\tcreate 600\\n}\\n\" after\n set \"\/rule\/create\/owner\" \"user\"\n = \"\/file {\\n\tcreate 600 user\\n}\\n\"\n\n (* The newline at the end of a script is optional *)\n test Logrotate.lns put \"\/file {\\n size=5M\\n}\\n\" after\n set \"\/rule\/prerotate\" \"\\tfoobar\"\n =\n\"\/file {\n size=5M\n\\tprerotate\n\\tfoobar\n\\tendscript\\n}\\n\"\n\n test Logrotate.lns put \"\/file {\\n size=5M\\n}\\n\" after\n set \"\/rule\/prerotate\" \"\\tfoobar\\n\"\n =\n\"\/file {\n size=5M\n\\tprerotate\n\\tfoobar\\n\n\\tendscript\\n}\\n\"\n\n(* Bug #101: whitespace at the end of the line *)\ntest Logrotate.lns get \"\/file {\\n missingok \\t\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/file\" }\n { \"missingok\" = \"missingok\" } }\n\n(* Bug #104: file names can be separated by newlines *)\nlet conf2 = \"\/var\/log\/mail.info\n\/var\/log\/mail.warn\n\/var\/log\/mail.err\n{\n weekly\n}\n\"\ntest Logrotate.lns get conf2 =\n { \"rule\"\n { \"file\" = \"\/var\/log\/mail.info\" }\n { \"file\" = \"\/var\/log\/mail.warn\" }\n { \"file\" = \"\/var\/log\/mail.err\" }\n { \"schedule\" = \"weekly\" } }\n","old_contents":"module Test_logrotate =\n\n let conf = \"# see man logrotate for details\n# rotate log files weekly\nweekly\n\n# keep 4 weeks worth of backlogs\nrotate 4\n\n# create new (empty) log files after rotating old ones\ncreate\n\n# uncomment this if you want your log files compressed\n#compress\n\ntabooext + .old .orig .ignore\n\n# packages drop log rotation information into this directory\ninclude \/etc\/logrotate.d\n\n# no packages own wtmp, or btmp -- we'll rotate them here\n\/var\/log\/wtmp\n\/var\/log\/wtmp2\n{\n missingok\n monthly\n create 0664 root utmp\n rotate 1\n}\n\n\/var\/log\/btmp \/var\/log\/btmp* {\n missingok\n # ftpd doesn't handle SIGHUP properly\n monthly\n create 0664 root utmp\n rotate 1\n}\n\/var\/log\/vsftpd.log {\n # ftpd doesn't handle SIGHUP properly\n nocompress\n missingok\n notifempty\n rotate 4\n weekly\n}\n\n\/var\/log\/apache2\/*.log {\n weekly\n missingok\n rotate 52\n compress\n delaycompress\n notifempty\n create 640 root adm\n sharedscripts\n prerotate\n if [ -f \/var\/run\/apache2.pid ]; then\n \/etc\/init.d\/apache2 restart > \/dev\/null\n fi\n endscript\n}\n\"\n\n test Logrotate.lns get conf =\n { \"#comment\" = \"see man logrotate for details\" }\n { \"#comment\" = \"rotate log files weekly\" }\n { \"schedule\" = \"weekly\" }\n {}\n { \"#comment\" = \"keep 4 weeks worth of backlogs\" }\n { \"rotate\" = \"4\" }\n {}\n { \"#comment\" = \"create new (empty) log files after rotating old ones\" }\n { \"create\" }\n {}\n { \"#comment\" = \"uncomment this if you want your log files compressed\" }\n { \"#comment\" = \"compress\" }\n {}\n { \"tabooext\" = \"+\" { \".old\" } { \".orig\" } { \".ignore\" } }\n {}\n { \"#comment\" = \"packages drop log rotation information into this directory\" }\n { \"include\" = \"\/etc\/logrotate.d\" }\n {}\n { \"#comment\" = \"no packages own wtmp, or btmp -- we'll rotate them here\" }\n { \"rule\"\n { \"file\" = \"\/var\/log\/wtmp\" }\n { \"file\" = \"\/var\/log\/wtmp2\" }\n { \"missingok\" = \"missingok\" }\n { \"schedule\" = \"monthly\" }\n { \"create\"\n { \"mode\" = \"0664\" }\n { \"owner\" = \"root\" }\n { \"group\" = \"utmp\" } }\n { \"rotate\" = \"1\" } }\n {}\n { \"rule\"\n { \"file\" = \"\/var\/log\/btmp\" }\n\t { \"file\" = \"\/var\/log\/btmp*\" }\n { \"missingok\" = \"missingok\" }\n\t { \"#comment\" = \"ftpd doesn't handle SIGHUP properly\" }\n { \"schedule\" = \"monthly\" }\n { \"create\"\n { \"mode\" = \"0664\" }\n { \"owner\" = \"root\" }\n { \"group\" = \"utmp\" } }\n { \"rotate\" = \"1\" } }\n { \"rule\"\n { \"file\" = \"\/var\/log\/vsftpd.log\" }\n { \"#comment\" = \"ftpd doesn't handle SIGHUP properly\" }\n { \"compress\" = \"nocompress\" }\n { \"missingok\" = \"missingok\" }\n { \"ifempty\" = \"notifempty\" }\n { \"rotate\" = \"4\" }\n { \"schedule\" = \"weekly\" } }\n {}\n { \"rule\"\n { \"file\" = \"\/var\/log\/apache2\/*.log\" }\n { \"schedule\" = \"weekly\" }\n { \"missingok\" = \"missingok\" }\n { \"rotate\" = \"52\" }\n { \"compress\" = \"compress\" }\n { \"delaycompress\" = \"delaycompress\" }\n { \"ifempty\" = \"notifempty\" }\n { \"create\"\n { \"mode\" = \"640\" }\n { \"owner\" = \"root\" }\n { \"group\" = \"adm\" } }\n { \"sharedscripts\" = \"sharedscripts\" }\n { \"prerotate\" = \" if [ -f \/var\/run\/apache2.pid ]; then\n \/etc\/init.d\/apache2 restart > \/dev\/null\n fi\" } }\n\n test Logrotate.lns get \"\/var\/log\/file {\\n dateext\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/var\/log\/file\" }\n { \"dateext\" = \"dateext\" } }\n\n (* Make sure 'minsize 1M' works *)\n test Logrotate.lns get \"\/avr\/log\/wtmp {\\n minsize 1M\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/avr\/log\/wtmp\" }\n { \"minsize\" = \"1M\" } }\n\n (* '=' is a legal separator, file names can be indented *)\n test Logrotate.lns get \" \\t \/file {\\n size=5M\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/file\" }\n { \"size\" = \"5M\" } }\n\n (* Can leave owner\/group off a create statement *)\n test Logrotate.lns get \"\/file {\n\tcreate 600\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/file\" }\n { \"create\"\n { \"mode\" = \"600\" } } }\n\n test Logrotate.lns put \"\/file {\\n\tcreate 600\\n}\\n\" after\n set \"\/rule\/create\/owner\" \"user\"\n = \"\/file {\\n\tcreate 600 user\\n}\\n\"\n\n (* The newline at the end of a script is optional *)\n test Logrotate.lns put \"\/file {\\n size=5M\\n}\\n\" after\n set \"\/rule\/prerotate\" \"\\tfoobar\"\n =\n\"\/file {\n size=5M\n\\tprerotate\n\\tfoobar\n\\tendscript\\n}\\n\"\n\n test Logrotate.lns put \"\/file {\\n size=5M\\n}\\n\" after\n set \"\/rule\/prerotate\" \"\\tfoobar\\n\"\n =\n\"\/file {\n size=5M\n\\tprerotate\n\\tfoobar\\n\n\\tendscript\\n}\\n\"\n\n(* Bug #101: whitespace at the end of the line *)\ntest Logrotate.lns get \"\/file {\\n missingok \\t\\n}\\n\" =\n { \"rule\"\n { \"file\" = \"\/file\" }\n { \"missingok\" = \"missingok\" } }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"299d5a5b26b0e7ccf6a671f1a8a0ef97921016c7","subject":"Fix typo in previous commit","message":"Fix typo in previous commit\n\nAdjust comment and remove duplicated test case for primary statement in\ndhcpd.conf lens.\n","repos":"hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,pevalme\/augeas,MikaelSmith\/augeas,kumy\/augeas,raphink\/augeas,jjlin\/augeas,raphink\/augeas,kunkku\/augeas,hercules-team\/augeas,jjlin\/augeas,manandbytes\/augeas,mchf\/augeas,dafugg\/augeas,jtopjian\/augeas,kunkku\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,kumy\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,mlichvar\/augeas,kumy\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,lutter\/augeas,jasperla\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,dafugg\/augeas,kumy\/augeas,ptoscano\/augeas,mchf\/augeas,jtopjian\/augeas,lutter\/augeas,jjlin\/augeas,lutter\/augeas,dafugg\/augeas,manandbytes\/augeas","old_file":"lenses\/tests\/test_dhcpd.aug","new_file":"lenses\/tests\/test_dhcpd.aug","new_contents":"module Test_dhcpd =\n\nlet lns = Dhcpd.lns\n\nlet conf = \"#\n# Sample configuration file for ISC dhcpd for Debian\n#\n# Attention: If \/etc\/ltsp\/dhcpd.conf exists, that will be used as\n# configuration file instead of this file.\n#\n# $Id: dhcpd.conf,v 1.1.1.1 2002\/05\/21 00:07:44 peloy Exp $\n#\n\n# The ddns-updates-style parameter controls whether or not the server will\n# attempt to do a DNS update when a lease is confirmed. We default to the\n# behavior of the version 2 packages ('none', since DHCP v2 didn't\n# have support for DDNS.)\nddns-update-style none;\n\n# option definitions common to all supported networks...\noption domain-name \\\"example.org\\\";\noption domain-name-servers ns1.example.org, ns2.example.org;\n\ndefault-lease-time 600;\nmax-lease-time 7200;\n\n# If this DHCP server is the official DHCP server for the local\n# network, the authoritative directive should be uncommented.\nauthoritative;\n\n# Use this to send dhcp log messages to a different log file (you also\n# have to hack syslog.conf to complete the redirection).\nlog-facility local7;\n\n# No service will be given on this subnet, but declaring it helps the\n# DHCP server to understand the network topology.\n\nsubnet 10.152.187.0 netmask 255.255.255.0 {\n}\n\n# This is a very basic subnet declaration.\n\nsubnet 10.254.239.0 netmask 255.255.255.224 {\n range 10.254.239.10 10.254.239.20;\n option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;\n}\n\n# This declaration allows BOOTP clients to get dynamic addresses,\n# which we don't really recommend.\n\nsubnet 10.254.239.32 netmask 255.255.255.224 {\n range dynamic-bootp 10.254.239.40 10.254.239.60;\n option broadcast-address 10.254.239.31;\n option routers rtr-239-32-1.example.org;\n}\n\n# A slightly different configuration for an internal subnet.\nsubnet 10.5.5.0 netmask 255.255.255.224 {\n range 10.5.5.26 10.5.5.30;\n option domain-name-servers ns1.internal.example.org;\n option domain-name \\\"internal.example.org\\\";\n option routers 10.5.5.1;\n option broadcast-address 10.5.5.31;\n default-lease-time 600;\n max-lease-time 7200;\n}\n\n# Hosts which require special configuration options can be listed in\n# host statements. If no address is specified, the address will be\n# allocated dynamically (if possible), but the host-specific information\n# will still come from the host declaration.\n\nhost passacaglia {\n hardware ethernet 0:0:c0:5d:bd:95;\n filename \\\"vmunix.passacaglia\\\";\n server-name \\\"toccata.fugue.com\\\";\n}\n\n# Fixed IP addresses can also be specified for hosts. These addresses\n# should not also be listed as being available for dynamic assignment.\n# Hosts for which fixed IP addresses have been specified can boot using\n# BOOTP or DHCP. Hosts for which no fixed address is specified can only\n# be booted with DHCP, unless there is an address range on the subnet\n# to which a BOOTP client is connected which has the dynamic-bootp flag\n# set.\nhost fantasia {\n hardware ethernet 08:00:07:26:c0:a5;\n fixed-address fantasia.fugue.com;\n}\n\n# You can declare a class of clients and then do address allocation\n# based on that. The example below shows a case where all clients\n# in a certain class get addresses on the 10.17.224\/24 subnet, and all\n# other clients get addresses on the 10.0.29\/24 subnet.\n\n#class \\\"foo\\\" {\n# match if substring (option vendor-class-identifier, 0, 4) = \\\"SUNW\\\";\n#}\n\nshared-network 224-29 {\n subnet 10.17.224.0 netmask 255.255.255.0 {\n option routers rtr-224.example.org;\n }\n subnet 10.0.29.0 netmask 255.255.255.0 {\n option routers rtr-29.example.org;\n }\n pool {\n allow members of \\\"foo\\\";\n range 10.17.224.10 10.17.224.250;\n }\n pool {\n deny members of \\\"foo\\\";\n range 10.0.29.10 10.0.29.230;\n }\n}\n\"\n\ntest lns get \"authoritative;\" = { \"authoritative\" }\ntest lns get \"ddns-update-style none;\" = { \"ddns-update-style\" = \"none\" }\ntest lns get \"option domain-name \\\"example.org\\\";\" =\n { \"option\"\n { \"domain-name\"\n { \"arg\" = \"example.org\" }\n }\n }\n\ntest lns get \"option domain-name-servers ns1.example.org, ns2.example.org;\" =\n { \"option\"\n { \"domain-name-servers\"\n { \"arg\" = \"ns1.example.org\" }\n { \"arg\" = \"ns2.example.org\" }\n }\n }\n\ntest lns get \"default-lease-time 600;\" = { \"default-lease-time\" = \"600\" }\ntest lns get \"range 10.254.239.60;\" =\n{ \"range\"\n { \"to\" = \"10.254.239.60\" }\n }\n\ntest lns get \"range dynamic-bootp 10.254.239.60;\" =\n { \"range\"\n { \"flag\" = \"dynamic-bootp\" }\n { \"to\" = \"10.254.239.60\" }\n }\n\ntest lns get \"range dynamic-bootp 10.254.239.40 10.254.239.60;\" =\n { \"range\"\n { \"flag\" = \"dynamic-bootp\" }\n { \"from\" = \"10.254.239.40\" }\n { \"to\" = \"10.254.239.60\" }\n }\n\ntest lns get \"subnet 10.152.187.0 netmask 255.255.255.0 {}\\n\" =\n { \"subnet\"\n { \"network\" = \"10.152.187.0\" }\n { \"netmask\" = \"255.255.255.0\" }\n }\n\ntest lns get \" pool {\n pool {\n\n }\n}\n\" =\n { \"pool\"\n { \"pool\" }\n }\n\ntest lns get \"group { host some-host {hardware ethernet 00:00:aa:bb:cc:dd;\nfixed-address 10.1.1.1;}}\" =\n { \"group\"\n { \"host\" = \"some-host\"\n { \"hardware\"\n { \"type\" = \"ethernet\" }\n { \"address\" = \"00:00:aa:bb:cc:dd\" }\n }\n { \"fixed-address\" = \"10.1.1.1\" }\n }\n }\n\ntest Dhcpd.stmt_secu get \"allow members of \\\"foo\\\";\" = { \"allow-members-of\" = \"foo\" }\ntest Dhcpd.stmt_option get \"option voip-boot-server code 66 = string;\" =\n { \"rfc-code\"\n { \"label\" = \"voip-boot-server\" }\n { \"code\" = \"66\" }\n { \"type\" = \"string\" }\n }\n\ntest Dhcpd.lns get \"authoritative;\nlog-facility local7;\nddns-update-style none;\ndefault-lease-time 21600;\nmax-lease-time 43200;\n\n# Additional options for VOIP\noption voip-boot-server code 66 = string;\noption voip-vlan-id code 128 = string;\n\" =\n { \"authoritative\" }\n { \"log-facility\" = \"local7\" }\n { \"ddns-update-style\" = \"none\" }\n { \"default-lease-time\" = \"21600\" }\n { \"max-lease-time\" = \"43200\"\n { \"#comment\" = \"Additional options for VOIP\" }\n }\n { \"rfc-code\"\n { \"label\" = \"voip-boot-server\" }\n { \"code\" = \"66\" }\n { \"type\" = \"string\" }\n }\n { \"rfc-code\"\n { \"label\" = \"voip-vlan-id\" }\n { \"code\" = \"128\" }\n { \"type\" = \"string\" }\n }\n\n\ntest Dhcpd.lns get \"\noption domain-name-servers 10.1.1.1, 10.11.2.1, 10.1.3.1;\nnext-server 10.1.1.1;\n\nfailover peer \\\"redondance01\\\" {\n primary;\n address 10.1.1.1;\n port 647;\n peer address 10.1.1.1;\n peer port 647;\n max-response-delay 20;\n max-unacked-updates 10;\n mclt 3600; #comment.\n split 128; #comment.\n load balance max seconds 3;\n }\n\" =\n { }\n { \"option\"\n { \"domain-name-servers\"\n { \"arg\" = \"10.1.1.1\" }\n { \"arg\" = \"10.11.2.1\" }\n { \"arg\" = \"10.1.3.1\" }\n }\n }\n { \"next-server\" = \"10.1.1.1\" }\n { \"failover peer\" = \"\\\"redondance01\\\"\"\n { \"primary\" }\n { \"address\" = \"10.1.1.1\" }\n { \"port\" = \"647\" }\n { \"peer address\" = \"10.1.1.1\" }\n { \"peer port\" = \"647\" }\n { \"max-response-delay\" = \"20\" }\n { \"max-unacked-updates\" = \"10\" }\n { \"mclt\" = \"3600\"\n { \"#comment\" = \"comment.\" }\n }\n { \"split\" = \"128\"\n { \"#comment\" = \"comment.\" }\n }\n { \"load balance max seconds\" = \"3\" }\n }\n\ntest Dhcpd.lns get \"\noption CallManager code 150 = ip-address;\noption slp-directory-agent true 10.1.1.1, 10.2.2.2;\noption slp-service-scope true \\\"SLP-GLOBAL\\\";\noption nds-context \\\"EXAMPLE\\\";\noption nds-tree-name \\\"EXAMPLE\\\";\n\" =\n { }\n { \"rfc-code\"\n { \"label\" = \"CallManager\" }\n { \"code\" = \"150\" }\n { \"type\" = \"ip-address\" }\n }\n { \"option\"\n { \"slp-directory-agent\" = \"true\"\n { \"arg\" = \"10.1.1.1\" }\n { \"arg\" = \"10.2.2.2\" }\n }\n }\n { \"option\"\n { \"slp-service-scope\" = \"true\"\n { \"arg\" = \"SLP-GLOBAL\" }\n }\n }\n { \"option\"\n { \"nds-context\"\n { \"arg\" = \"EXAMPLE\" }\n }\n }\n { \"option\"\n { \"nds-tree-name\"\n { \"arg\" = \"EXAMPLE\" }\n }\n }\n\n\ntest Dhcpd.lns get \"option voip-vlan-id \\\"VLAN=1234;\\\";\" =\n { \"option\"\n { \"voip-vlan-id\"\n { \"arg\" = \"VLAN=1234;\" }\n }\n }\n\ntest Dhcpd.lns get \"option domain-name \\\"x.example.com y.example.com z.example.com\\\";\" =\n { \"option\"\n { \"domain-name\"\n { \"arg\" = \"x.example.com y.example.com z.example.com\" }\n }\n }\n\ntest Dhcpd.lns get \"include \\\"\/etc\/dhcpd.master\\\";\" =\n { \"include\" = \"\/etc\/dhcpd.master\" }\n\ntest Dhcpd.lns put \"\\n\" after set \"\/include\" \"\/etc\/dhcpd.master\" =\n \"\\ninclude \\\"\/etc\/dhcpd.master\\\";\\n\"\n\ntest Dhcpd.fct_args get \"(option dhcp-client-identifier, 1, 3)\" =\n { \"args\"\n { \"arg\" = \"option dhcp-client-identifier\" }\n { \"arg\" = \"1\" }\n { \"arg\" = \"3\" }\n }\n\ntest Dhcpd.stmt_match get \"match if substring (option dhcp-client-identifier, 1, 3) = \\\"RAS\\\";\" =\n { \"match\"\n { \"function\" = \"substring\"\n { \"args\"\n { \"arg\" = \"option dhcp-client-identifier\" }\n { \"arg\" = \"1\" }\n { \"arg\" = \"3\" }\n }\n }\n { \"value\" = \"RAS\" }\n }\n\ntest Dhcpd.lns get \"match pick-first-value (option dhcp-client-identifier, hardware);\" =\n { \"match\"\n { \"function\" = \"pick-first-value\"\n { \"args\"\n { \"arg\" = \"option dhcp-client-identifier\" }\n { \"arg\" = \"hardware\" }\n }\n }\n }\n\ntest Dhcpd.fct_args get \"(16, 32, \\\"\\\", substring(hardware, 0, 4))\" =\n { \"args\"\n { \"arg\" = \"16\" }\n { \"arg\" = \"32\" }\n { \"arg\" = \"\\\"\\\"\" }\n { \"arg\" = \"substring(hardware, 0, 4)\" }\n }\n\ntest Dhcpd.stmt_match get \"match if binary-to-ascii(16, 32, \\\"\\\", substring(hardware, 0, 4)) = \\\"1525400\\\";\" =\n { \"match\"\n { \"function\" = \"binary-to-ascii\"\n { \"args\"\n { \"arg\" = \"16\" }\n { \"arg\" = \"32\" }\n { \"arg\" = \"\\\"\\\"\" }\n { \"arg\" = \"substring(hardware, 0, 4)\" }\n }\n }\n { \"value\" = \"1525400\" }\n }\n\ntest Dhcpd.lns get \"subclass \\\"allocation-class-1\\\" 1:8:0:2b:4c:39:ad;\" =\n { \"subclass\"\n { \"name\" = \"allocation-class-1\" }\n { \"value\" = \"1:8:0:2b:4c:39:ad\" }\n }\n\n(* overall test *)\ntest Dhcpd.lns put conf after rm \"\/x\" = conf\n\n(* bug #293: primary should support argument *)\nlet input293 = \"zone EXAMPLE.ORG. {\n primary 127.0.0.1;\n}\"\n\ntest Dhcpd.lns get input293 = \n { \"zone\" = \"EXAMPLE.ORG.\"\n { \"primary\" = \"127.0.0.1\" }\n }\n\n","old_contents":"module Test_dhcpd =\n\nlet lns = Dhcpd.lns\n\nlet conf = \"#\n# Sample configuration file for ISC dhcpd for Debian\n#\n# Attention: If \/etc\/ltsp\/dhcpd.conf exists, that will be used as\n# configuration file instead of this file.\n#\n# $Id: dhcpd.conf,v 1.1.1.1 2002\/05\/21 00:07:44 peloy Exp $\n#\n\n# The ddns-updates-style parameter controls whether or not the server will\n# attempt to do a DNS update when a lease is confirmed. We default to the\n# behavior of the version 2 packages ('none', since DHCP v2 didn't\n# have support for DDNS.)\nddns-update-style none;\n\n# option definitions common to all supported networks...\noption domain-name \\\"example.org\\\";\noption domain-name-servers ns1.example.org, ns2.example.org;\n\ndefault-lease-time 600;\nmax-lease-time 7200;\n\n# If this DHCP server is the official DHCP server for the local\n# network, the authoritative directive should be uncommented.\nauthoritative;\n\n# Use this to send dhcp log messages to a different log file (you also\n# have to hack syslog.conf to complete the redirection).\nlog-facility local7;\n\n# No service will be given on this subnet, but declaring it helps the\n# DHCP server to understand the network topology.\n\nsubnet 10.152.187.0 netmask 255.255.255.0 {\n}\n\n# This is a very basic subnet declaration.\n\nsubnet 10.254.239.0 netmask 255.255.255.224 {\n range 10.254.239.10 10.254.239.20;\n option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;\n}\n\n# This declaration allows BOOTP clients to get dynamic addresses,\n# which we don't really recommend.\n\nsubnet 10.254.239.32 netmask 255.255.255.224 {\n range dynamic-bootp 10.254.239.40 10.254.239.60;\n option broadcast-address 10.254.239.31;\n option routers rtr-239-32-1.example.org;\n}\n\n# A slightly different configuration for an internal subnet.\nsubnet 10.5.5.0 netmask 255.255.255.224 {\n range 10.5.5.26 10.5.5.30;\n option domain-name-servers ns1.internal.example.org;\n option domain-name \\\"internal.example.org\\\";\n option routers 10.5.5.1;\n option broadcast-address 10.5.5.31;\n default-lease-time 600;\n max-lease-time 7200;\n}\n\n# Hosts which require special configuration options can be listed in\n# host statements. If no address is specified, the address will be\n# allocated dynamically (if possible), but the host-specific information\n# will still come from the host declaration.\n\nhost passacaglia {\n hardware ethernet 0:0:c0:5d:bd:95;\n filename \\\"vmunix.passacaglia\\\";\n server-name \\\"toccata.fugue.com\\\";\n}\n\n# Fixed IP addresses can also be specified for hosts. These addresses\n# should not also be listed as being available for dynamic assignment.\n# Hosts for which fixed IP addresses have been specified can boot using\n# BOOTP or DHCP. Hosts for which no fixed address is specified can only\n# be booted with DHCP, unless there is an address range on the subnet\n# to which a BOOTP client is connected which has the dynamic-bootp flag\n# set.\nhost fantasia {\n hardware ethernet 08:00:07:26:c0:a5;\n fixed-address fantasia.fugue.com;\n}\n\n# You can declare a class of clients and then do address allocation\n# based on that. The example below shows a case where all clients\n# in a certain class get addresses on the 10.17.224\/24 subnet, and all\n# other clients get addresses on the 10.0.29\/24 subnet.\n\n#class \\\"foo\\\" {\n# match if substring (option vendor-class-identifier, 0, 4) = \\\"SUNW\\\";\n#}\n\nshared-network 224-29 {\n subnet 10.17.224.0 netmask 255.255.255.0 {\n option routers rtr-224.example.org;\n }\n subnet 10.0.29.0 netmask 255.255.255.0 {\n option routers rtr-29.example.org;\n }\n pool {\n allow members of \\\"foo\\\";\n range 10.17.224.10 10.17.224.250;\n }\n pool {\n deny members of \\\"foo\\\";\n range 10.0.29.10 10.0.29.230;\n }\n}\n\"\n\ntest lns get \"authoritative;\" = { \"authoritative\" }\ntest lns get \"ddns-update-style none;\" = { \"ddns-update-style\" = \"none\" }\ntest lns get \"option domain-name \\\"example.org\\\";\" =\n { \"option\"\n { \"domain-name\"\n { \"arg\" = \"example.org\" }\n }\n }\n\ntest lns get \"option domain-name-servers ns1.example.org, ns2.example.org;\" =\n { \"option\"\n { \"domain-name-servers\"\n { \"arg\" = \"ns1.example.org\" }\n { \"arg\" = \"ns2.example.org\" }\n }\n }\n\ntest lns get \"default-lease-time 600;\" = { \"default-lease-time\" = \"600\" }\ntest lns get \"range 10.254.239.60;\" =\n{ \"range\"\n { \"to\" = \"10.254.239.60\" }\n }\n\ntest lns get \"range dynamic-bootp 10.254.239.60;\" =\n { \"range\"\n { \"flag\" = \"dynamic-bootp\" }\n { \"to\" = \"10.254.239.60\" }\n }\n\ntest lns get \"range dynamic-bootp 10.254.239.40 10.254.239.60;\" =\n { \"range\"\n { \"flag\" = \"dynamic-bootp\" }\n { \"from\" = \"10.254.239.40\" }\n { \"to\" = \"10.254.239.60\" }\n }\n\ntest lns get \"subnet 10.152.187.0 netmask 255.255.255.0 {}\\n\" =\n { \"subnet\"\n { \"network\" = \"10.152.187.0\" }\n { \"netmask\" = \"255.255.255.0\" }\n }\n\ntest lns get \" pool {\n pool {\n\n }\n}\n\" =\n { \"pool\"\n { \"pool\" }\n }\n\ntest lns get \"group { host some-host {hardware ethernet 00:00:aa:bb:cc:dd;\nfixed-address 10.1.1.1;}}\" =\n { \"group\"\n { \"host\" = \"some-host\"\n { \"hardware\"\n { \"type\" = \"ethernet\" }\n { \"address\" = \"00:00:aa:bb:cc:dd\" }\n }\n { \"fixed-address\" = \"10.1.1.1\" }\n }\n }\n\ntest Dhcpd.stmt_secu get \"allow members of \\\"foo\\\";\" = { \"allow-members-of\" = \"foo\" }\ntest Dhcpd.stmt_option get \"option voip-boot-server code 66 = string;\" =\n { \"rfc-code\"\n { \"label\" = \"voip-boot-server\" }\n { \"code\" = \"66\" }\n { \"type\" = \"string\" }\n }\n\ntest Dhcpd.lns get \"authoritative;\nlog-facility local7;\nddns-update-style none;\ndefault-lease-time 21600;\nmax-lease-time 43200;\n\n# Additional options for VOIP\noption voip-boot-server code 66 = string;\noption voip-vlan-id code 128 = string;\n\" =\n { \"authoritative\" }\n { \"log-facility\" = \"local7\" }\n { \"ddns-update-style\" = \"none\" }\n { \"default-lease-time\" = \"21600\" }\n { \"max-lease-time\" = \"43200\"\n { \"#comment\" = \"Additional options for VOIP\" }\n }\n { \"rfc-code\"\n { \"label\" = \"voip-boot-server\" }\n { \"code\" = \"66\" }\n { \"type\" = \"string\" }\n }\n { \"rfc-code\"\n { \"label\" = \"voip-vlan-id\" }\n { \"code\" = \"128\" }\n { \"type\" = \"string\" }\n }\n\n\ntest Dhcpd.lns get \"\noption domain-name-servers 10.1.1.1, 10.11.2.1, 10.1.3.1;\nnext-server 10.1.1.1;\n\nfailover peer \\\"redondance01\\\" {\n primary;\n address 10.1.1.1;\n port 647;\n peer address 10.1.1.1;\n peer port 647;\n max-response-delay 20;\n max-unacked-updates 10;\n mclt 3600; #comment.\n split 128; #comment.\n load balance max seconds 3;\n }\n\" =\n { }\n { \"option\"\n { \"domain-name-servers\"\n { \"arg\" = \"10.1.1.1\" }\n { \"arg\" = \"10.11.2.1\" }\n { \"arg\" = \"10.1.3.1\" }\n }\n }\n { \"next-server\" = \"10.1.1.1\" }\n { \"failover peer\" = \"\\\"redondance01\\\"\"\n { \"primary\" }\n { \"address\" = \"10.1.1.1\" }\n { \"port\" = \"647\" }\n { \"peer address\" = \"10.1.1.1\" }\n { \"peer port\" = \"647\" }\n { \"max-response-delay\" = \"20\" }\n { \"max-unacked-updates\" = \"10\" }\n { \"mclt\" = \"3600\"\n { \"#comment\" = \"comment.\" }\n }\n { \"split\" = \"128\"\n { \"#comment\" = \"comment.\" }\n }\n { \"load balance max seconds\" = \"3\" }\n }\n\ntest Dhcpd.lns get \"\noption CallManager code 150 = ip-address;\noption slp-directory-agent true 10.1.1.1, 10.2.2.2;\noption slp-service-scope true \\\"SLP-GLOBAL\\\";\noption nds-context \\\"EXAMPLE\\\";\noption nds-tree-name \\\"EXAMPLE\\\";\n\" =\n { }\n { \"rfc-code\"\n { \"label\" = \"CallManager\" }\n { \"code\" = \"150\" }\n { \"type\" = \"ip-address\" }\n }\n { \"option\"\n { \"slp-directory-agent\" = \"true\"\n { \"arg\" = \"10.1.1.1\" }\n { \"arg\" = \"10.2.2.2\" }\n }\n }\n { \"option\"\n { \"slp-service-scope\" = \"true\"\n { \"arg\" = \"SLP-GLOBAL\" }\n }\n }\n { \"option\"\n { \"nds-context\"\n { \"arg\" = \"EXAMPLE\" }\n }\n }\n { \"option\"\n { \"nds-tree-name\"\n { \"arg\" = \"EXAMPLE\" }\n }\n }\n\n\ntest Dhcpd.lns get \"option voip-vlan-id \\\"VLAN=1234;\\\";\" =\n { \"option\"\n { \"voip-vlan-id\"\n { \"arg\" = \"VLAN=1234;\" }\n }\n }\n\ntest Dhcpd.lns get \"option domain-name \\\"x.example.com y.example.com z.example.com\\\";\" =\n { \"option\"\n { \"domain-name\"\n { \"arg\" = \"x.example.com y.example.com z.example.com\" }\n }\n }\n\ntest Dhcpd.lns get \"include \\\"\/etc\/dhcpd.master\\\";\" =\n { \"include\" = \"\/etc\/dhcpd.master\" }\n\ntest Dhcpd.lns put \"\\n\" after set \"\/include\" \"\/etc\/dhcpd.master\" =\n \"\\ninclude \\\"\/etc\/dhcpd.master\\\";\\n\"\n\ntest Dhcpd.fct_args get \"(option dhcp-client-identifier, 1, 3)\" =\n { \"args\"\n { \"arg\" = \"option dhcp-client-identifier\" }\n { \"arg\" = \"1\" }\n { \"arg\" = \"3\" }\n }\n\ntest Dhcpd.stmt_match get \"match if substring (option dhcp-client-identifier, 1, 3) = \\\"RAS\\\";\" =\n { \"match\"\n { \"function\" = \"substring\"\n { \"args\"\n { \"arg\" = \"option dhcp-client-identifier\" }\n { \"arg\" = \"1\" }\n { \"arg\" = \"3\" }\n }\n }\n { \"value\" = \"RAS\" }\n }\n\ntest Dhcpd.lns get \"match pick-first-value (option dhcp-client-identifier, hardware);\" =\n { \"match\"\n { \"function\" = \"pick-first-value\"\n { \"args\"\n { \"arg\" = \"option dhcp-client-identifier\" }\n { \"arg\" = \"hardware\" }\n }\n }\n }\n\ntest Dhcpd.fct_args get \"(16, 32, \\\"\\\", substring(hardware, 0, 4))\" =\n { \"args\"\n { \"arg\" = \"16\" }\n { \"arg\" = \"32\" }\n { \"arg\" = \"\\\"\\\"\" }\n { \"arg\" = \"substring(hardware, 0, 4)\" }\n }\n\ntest Dhcpd.stmt_match get \"match if binary-to-ascii(16, 32, \\\"\\\", substring(hardware, 0, 4)) = \\\"1525400\\\";\" =\n { \"match\"\n { \"function\" = \"binary-to-ascii\"\n { \"args\"\n { \"arg\" = \"16\" }\n { \"arg\" = \"32\" }\n { \"arg\" = \"\\\"\\\"\" }\n { \"arg\" = \"substring(hardware, 0, 4)\" }\n }\n }\n { \"value\" = \"1525400\" }\n }\n\ntest Dhcpd.lns get \"subclass \\\"allocation-class-1\\\" 1:8:0:2b:4c:39:ad;\" =\n { \"subclass\"\n { \"name\" = \"allocation-class-1\" }\n { \"value\" = \"1:8:0:2b:4c:39:ad\" }\n }\n\n(* overall test *)\ntest Dhcpd.lns put conf after rm \"\/x\" = conf\n\n(* bug #293: primary should support primary with argument *)\nlet input293 = \"zone EXAMPLE.ORG. {\n primary 127.0.0.1;\n}\"\n\ntest Dhcpd.lns get input293 = \n { \"zone\" = \"EXAMPLE.ORG.\"\n { \"primary\" = \"127.0.0.1\" }\n }\n\ntest Dhcpd.lns get input293 = \n { \"zone\" = \"EXAMPLE.ORG.\"\n { \"primary\" = \"127.0.0.1\" }\n }\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7efe87199ec254a5cfd2c34968220c4dc4e05643","subject":"Fix NagiosCfg lense so \/etc\/nagios\/nrpe.cfg is parsed by Nrpe and not NagiosCfg","message":"Fix NagiosCfg lense so \/etc\/nagios\/nrpe.cfg is parsed by Nrpe and not NagiosCfg\n\nCurrently NagiosCfg lense is in charge of parsing all files under \/etc\/nagios\/*.cfg\nbut \/etc\/nagios\/commands.cfg. \/etc\/nagios\/nrpe.cfg should be also added as an exception\nsince it needs to be parsed by the Nrpe lense. This issue currently causes the following\nerror : \"Lenses @NagiosCfg and @Nrpe could be used to load this file\"\n","repos":"lutter\/augeas,jjlin\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,mlichvar\/augeas,jjlin\/augeas,pevalme\/augeas,jjlin\/augeas,pevalme\/augeas,jtopjian\/augeas,mlichvar\/augeas,kunkku\/augeas,manandbytes\/augeas,jtopjian\/augeas,kunkku\/augeas,dafugg\/augeas,mchf\/augeas,ptoscano\/augeas,manandbytes\/augeas,raphink\/augeas,ptoscano\/augeas,jasperla\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,lutter\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,mlichvar\/augeas,mchf\/augeas,raphink\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,hercules-team\/augeas,dafugg\/augeas","old_file":"lenses\/nagioscfg.aug","new_file":"lenses\/nagioscfg.aug","new_contents":"(*\nModule: NagiosConfig\n Parses \/etc\/{nagios{3,},icinga\/*.cfg\n\nAuthors: Sebastien Aperghis-Tramoni <sebastien@aperghis.net>\n Rapha\u00ebl Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/{nagios{3,},icinga\/*.cfg. See <filter>.\n*)\n\nmodule NagiosCfg =\nautoload xfm\n\n(************************************************************************\n * Group: Utility variables\/functions\n ************************************************************************)\n(* View: param_def\n define a field *)\nlet param_def =\n let space_in = \/[^ \\t\\n][^\\n=]*[^ \\t\\n]|[^ \\t\\n]\/\n in key \/[A-Za-z0-9_]+\/\n . Sep.space_equal\n . store space_in\n\n(* View: macro_def\n Macro line, as used in resource.cfg *)\nlet macro_def =\n let macro = \/\\$[A-Za-z0-9]+\\$\/\n in let macro_decl = Rx.word | Rx.fspath\n in key macro . Sep.space_equal . store macro_decl\n\n(************************************************************************\n * Group: Entries\n ************************************************************************)\n(* View: param\n Params can have sub params *)\nlet param =\n [ Util.indent . param_def\n . [ Sep.space . param_def ]*\n . Util.eol ]\n\n(* View: macro *)\nlet macro = [ Util.indent . macro_def . Util.eol ]\n\n(************************************************************************\n * Group: Lens\n ************************************************************************)\n(* View: entry\n Define the accepted entries, such as param for regular configuration\n files, and macro for resources.cfg .*)\nlet entry = param\n\t | macro\n\n(* View: lns\n main structure *)\nlet lns = ( Util.empty | Util.comment | entry )*\n\n(* View: filter *)\nlet filter = incl \"\/etc\/nagios3\/*.cfg\"\n . incl \"\/etc\/nagios\/*.cfg\"\n\t . incl \"\/etc\/icinga\/*.cfg\"\n\t . excl \"\/etc\/nagios3\/commands.cfg\"\n\t . excl \"\/etc\/nagios\/commands.cfg\"\n\t . excl \"\/etc\/nagios\/nrpe.cfg\"\n\t . incl \"\/etc\/icinga\/commands.cfg\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: NagiosConfig\n Parses \/etc\/{nagios{3,},icinga\/*.cfg\n\nAuthors: Sebastien Aperghis-Tramoni <sebastien@aperghis.net>\n Rapha\u00ebl Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/{nagios{3,},icinga\/*.cfg. See <filter>.\n*)\n\nmodule NagiosCfg =\nautoload xfm\n\n(************************************************************************\n * Group: Utility variables\/functions\n ************************************************************************)\n(* View: param_def\n define a field *)\nlet param_def =\n let space_in = \/[^ \\t\\n][^\\n=]*[^ \\t\\n]|[^ \\t\\n]\/\n in key \/[A-Za-z0-9_]+\/\n . Sep.space_equal\n . store space_in\n\n(* View: macro_def\n Macro line, as used in resource.cfg *)\nlet macro_def =\n let macro = \/\\$[A-Za-z0-9]+\\$\/\n in let macro_decl = Rx.word | Rx.fspath\n in key macro . Sep.space_equal . store macro_decl\n\n(************************************************************************\n * Group: Entries\n ************************************************************************)\n(* View: param\n Params can have sub params *)\nlet param =\n [ Util.indent . param_def\n . [ Sep.space . param_def ]*\n . Util.eol ]\n\n(* View: macro *)\nlet macro = [ Util.indent . macro_def . Util.eol ]\n\n(************************************************************************\n * Group: Lens\n ************************************************************************)\n(* View: entry\n Define the accepted entries, such as param for regular configuration\n files, and macro for resources.cfg .*)\nlet entry = param\n\t | macro\n\n(* View: lns\n main structure *)\nlet lns = ( Util.empty | Util.comment | entry )*\n\n(* View: filter *)\nlet filter = incl \"\/etc\/nagios3\/*.cfg\"\n . incl \"\/etc\/nagios\/*.cfg\"\n\t . incl \"\/etc\/icinga\/*.cfg\"\n\t . excl \"\/etc\/nagios3\/commands.cfg\"\n\t . excl \"\/etc\/nagios\/commands.cfg\"\n\t . incl \"\/etc\/icinga\/commands.cfg\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"38ed79462c7bde5f17068778c9d429560486c3a0","subject":"Fix test_phpvars.aug as per using Util.empty_c_style","message":"Fix test_phpvars.aug as per using Util.empty_c_style\n","repos":"hercules-team\/augeas-do-not-use,ptoscano\/augeas,kumy\/augeas,kunkku\/augeas,ptoscano\/augeas,jasperla\/augeas,domcleal\/augeas,raphink\/augeas,jjlin\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,kumy\/augeas,lutter\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,dafugg\/augeas,jjlin\/augeas,pevalme\/augeas,MikaelSmith\/augeas,dafugg\/augeas,ptoscano\/augeas,mchf\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,mlichvar\/augeas,domcleal\/augeas,raphink\/augeas,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,hercules-team\/augeas,jtopjian\/augeas,kunkku\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,manandbytes\/augeas,lutter\/augeas,mchf\/augeas,lutter\/augeas,jtopjian\/augeas,dafugg\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_phpvars.aug","new_file":"lenses\/tests\/test_phpvars.aug","new_contents":"module Test_phpvars =\n\nlet conf = \"<?pHp\n\/**\/\n\/**\n * Multi line comment\n *\n *\/\n\n\/* One line comment *\/\n\n\/\/ Inline comment\n# Bash-style comment\nglobal $version;\nglobal $config_version;\n$config_version = '1.4.0';\n$theme=array();\n\n$theme[0]['NAME'] = 'Default'; \/\/ end-of line comment\n$theme[0][\\\"PATH\\\"] = SM_PATH . 'themes\/default_theme.php';\n$theme[0]['XPATH'] = '\/some\/\/x\/path' ;\ndefine ('MYVAR', ROOT . 'some value'); # end-of line comment\ninclude_once( ROOT . \\\"\/path\/to\/conf\\\"\t );\n@include SM_PATH . 'config\/config_local.php';\n ?>\n\"\n\ntest Phpvars.lns get conf =\n { }\n { \"#mcomment\"\n { \"1\" = \"*\" }\n { \"2\" = \"* Multi line comment\" }\n { \"3\" = \"*\" }\n }\n { }\n { \"#mcomment\"\n { \"1\" = \"One line comment\" }\n }\n { }\n { \"#comment\" = \"Inline comment\" }\n { \"#comment\" = \"Bash-style comment\" }\n { \"global\" = \"version\" }\n { \"global\" = \"config_version\" }\n { \"$config_version\" = \"'1.4.0'\" }\n { \"$theme\" = \"array()\" }\n { }\n { \"$theme[0]['NAME']\" = \"'Default'\"\n { \"#comment\" = \"end-of line comment\" } }\n { \"$theme[0][\\\"PATH\\\"]\" = \"SM_PATH . 'themes\/default_theme.php'\" }\n { \"$theme[0]['XPATH']\" = \"'\/some\/\/x\/path'\" }\n { \"define\" = \"MYVAR\"\n { \"value\" = \"ROOT . 'some value'\" }\n { \"#comment\" = \"end-of line comment\" } }\n { \"include_once\" = \"ROOT . \\\"\/path\/to\/conf\\\"\" }\n { \"@include\" = \"SM_PATH . 'config\/config_local.php'\" }\n","old_contents":"module Test_phpvars =\n\nlet conf = \"<?pHp\n\/**\/\n\/**\n * Multi line comment\n *\n *\/\n\n\/* One line comment *\/\n\n\/\/ Inline comment\n# Bash-style comment\nglobal $version;\nglobal $config_version;\n$config_version = '1.4.0';\n$theme=array();\n\n$theme[0]['NAME'] = 'Default'; \/\/ end-of line comment\n$theme[0][\\\"PATH\\\"] = SM_PATH . 'themes\/default_theme.php';\n$theme[0]['XPATH'] = '\/some\/\/x\/path' ;\ndefine ('MYVAR', ROOT . 'some value'); # end-of line comment\ninclude_once( ROOT . \\\"\/path\/to\/conf\\\"\t );\n@include SM_PATH . 'config\/config_local.php';\n ?>\n\"\n\ntest Phpvars.lns get conf =\n { \"#mcomment\" }\n { \"#mcomment\"\n { \"1\" = \"*\" }\n { \"2\" = \"* Multi line comment\" }\n { \"3\" = \"*\" }\n }\n { }\n { \"#mcomment\"\n { \"1\" = \"One line comment\" }\n }\n { }\n { \"#comment\" = \"Inline comment\" }\n { \"#comment\" = \"Bash-style comment\" }\n { \"global\" = \"version\" }\n { \"global\" = \"config_version\" }\n { \"$config_version\" = \"'1.4.0'\" }\n { \"$theme\" = \"array()\" }\n { }\n { \"$theme[0]['NAME']\" = \"'Default'\"\n { \"#comment\" = \"end-of line comment\" } }\n { \"$theme[0][\\\"PATH\\\"]\" = \"SM_PATH . 'themes\/default_theme.php'\" }\n { \"$theme[0]['XPATH']\" = \"'\/some\/\/x\/path'\" }\n { \"define\" = \"MYVAR\"\n { \"value\" = \"ROOT . 'some value'\" }\n { \"#comment\" = \"end-of line comment\" } }\n { \"include_once\" = \"ROOT . \\\"\/path\/to\/conf\\\"\" }\n { \"@include\" = \"SM_PATH . 'config\/config_local.php'\" }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7830adc726d2da9f3d350aa3a74a7a865f57bd4f","subject":"Shellvars: exclude \/etc\/sysconfig\/ip*tables.save files","message":"Shellvars: exclude \/etc\/sysconfig\/ip*tables.save files\n","repos":"kunkku\/augeas,jasperla\/augeas,mlichvar\/augeas,manandbytes\/augeas,pevalme\/augeas,jjlin\/augeas,jjlin\/augeas,dafugg\/augeas,mlichvar\/augeas,dafugg\/augeas,jtopjian\/augeas,mlichvar\/augeas,mchf\/augeas,lutter\/augeas,kunkku\/augeas,raphink\/augeas,mchf\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,pevalme\/augeas,hercules-team\/augeas,jjlin\/augeas,raphink\/augeas,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,dafugg\/augeas,ptoscano\/augeas,jasperla\/augeas,hercules-team\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | (dquot | squot)+ | bquot | dbquot | dollar_assign) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\",\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | (dquot | squot)+ | bquot | dbquot | dollar_assign) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4594b6535ddd3acdc00e40deec06b12b8d7d5523","subject":"MySQL: include \/etc\/my.cnf.d\/*.cnf (fix #353)","message":"MySQL: include \/etc\/my.cnf.d\/*.cnf (fix #353)\n","repos":"mlichvar\/augeas,manandbytes\/augeas,pevalme\/augeas,mchf\/augeas,mchf\/augeas,ptoscano\/augeas,pevalme\/augeas,hercules-team\/augeas,mlichvar\/augeas,hercules-team\/augeas,kunkku\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,ptoscano\/augeas,lutter\/augeas,manandbytes\/augeas,lutter\/augeas","old_file":"lenses\/mysql.aug","new_file":"lenses\/mysql.aug","new_contents":"(* MySQL module for Augeas *)\n(* Author: Tim Stoop <tim@kumina.nl> *)\n(* Heavily based on php.aug by Raphael Pinson *)\n(* <raphink@gmail.com> *)\n(* *)\n\nmodule MySQL =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\nlet entry =\n let bare = Quote.do_dquote_opt_nil (store \/[^#;\" \\t\\r\\n]+([ \\t]+[^#;\" \\t\\r\\n]+)*\/)\n in let quoted = Quote.do_dquote (store \/[^\"\\r\\n]*[#;]+[^\"\\r\\n]*\/)\n in [ Util.indent . key IniFile.entry_re . sep . Sep.opt_space . bare . (comment|IniFile.eol) ]\n | [ Util.indent . key IniFile.entry_re . sep . Sep.opt_space . quoted . (comment|IniFile.eol) ]\n | [ Util.indent . key IniFile.entry_re . store \/\/ . (comment|IniFile.eol) ]\n | comment\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.indented_title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet includedir = Build.key_value_line \/!include(dir)?\/ Sep.space (store Rx.fspath)\n . (comment|IniFile.empty)*\n\nlet lns = (comment|IniFile.empty)* . (record|includedir)*\n\nlet filter = (incl \"\/etc\/mysql\/my.cnf\")\n . (incl \"\/etc\/mysql\/conf.d\/*.cnf\")\n . (incl \"\/etc\/my.cnf\")\n . (incl \"\/etc\/my.cnf.d\/*.cnf\")\n\nlet xfm = transform lns filter\n\n","old_contents":"(* MySQL module for Augeas *)\n(* Author: Tim Stoop <tim@kumina.nl> *)\n(* Heavily based on php.aug by Raphael Pinson *)\n(* <raphink@gmail.com> *)\n(* *)\n\nmodule MySQL =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\nlet entry =\n let bare = Quote.do_dquote_opt_nil (store \/[^#;\" \\t\\r\\n]+([ \\t]+[^#;\" \\t\\r\\n]+)*\/)\n in let quoted = Quote.do_dquote (store \/[^\"\\r\\n]*[#;]+[^\"\\r\\n]*\/)\n in [ Util.indent . key IniFile.entry_re . sep . Sep.opt_space . bare . (comment|IniFile.eol) ]\n | [ Util.indent . key IniFile.entry_re . sep . Sep.opt_space . quoted . (comment|IniFile.eol) ]\n | [ Util.indent . key IniFile.entry_re . store \/\/ . (comment|IniFile.eol) ]\n | comment\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.indented_title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet includedir = Build.key_value_line \/!include(dir)?\/ Sep.space (store Rx.fspath)\n . (comment|IniFile.empty)*\n\nlet lns = (comment|IniFile.empty)* . (record|includedir)*\n\nlet filter = (incl \"\/etc\/mysql\/my.cnf\")\n . (incl \"\/etc\/mysql\/conf.d\/*.cnf\")\n . (incl \"\/etc\/my.cnf\")\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7b1f6094b869e32966abee4962f08a4795444f16","subject":"Nsswitch: add extra databases used on Solaris","message":"Nsswitch: add extra databases used on Solaris\n","repos":"domcleal\/augeas,ptoscano\/augeas,jtopjian\/augeas,jasperla\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,domcleal\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kumy\/augeas,manandbytes\/augeas,hercules-team\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,hercules-team\/augeas,kumy\/augeas,kunkku\/augeas,mlichvar\/augeas,pevalme\/augeas,mchf\/augeas,lutter\/augeas,lutter\/augeas,domcleal\/augeas,kumy\/augeas,mchf\/augeas,ptoscano\/augeas,pevalme\/augeas,jtopjian\/augeas,jjlin\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,kumy\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kunkku\/augeas,dafugg\/augeas,jjlin\/augeas,mlichvar\/augeas,dafugg\/augeas,manandbytes\/augeas,mlichvar\/augeas,pevalme\/augeas","old_file":"lenses\/nsswitch.aug","new_file":"lenses\/nsswitch.aug","new_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n let database_kw = \"aliases\"\n | \"auth_attr\"\n | \"automount\"\n | \"bootparams\"\n | \"ethers\"\n | \"group\"\n | \"group_compat\"\n | \"hosts\"\n | \"ipnodes\"\n | \"netgroup\"\n | \"netmasks\"\n | \"networks\"\n | \"passwd\"\n | \"passwd_compat\"\n | \"printers\"\n | \"prof_attr\"\n | \"project\"\n | \"protocols\"\n | \"publickey\"\n | \"rpc\"\n | \"sendmailvars\"\n | \"services\"\n | \"shadow\"\n | \"shadow_compat\"\n | \"sudoers\"\n | \"tnrhtp\"\n | \"tnrhdb\"\n in [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Nsswitch\n Parses \/etc\/nsswitch.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man nsswitch.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/nsswitch.conf. See <filter>.\n*)\n\nmodule Nsswitch =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: sep_colon\n The separator for database entries *)\nlet sep_colon = del \/:[ \\t]*\/ \": \"\n\n(* View: service\n The service specification like `files', `db', or `nis' *)\nlet service = [ label \"service\" . store Rx.word ]\n\n(* View: reaction\n The reaction on lookup result like `[NOTFOUND=return]'\n TODO: Use case-insensitive regexps when ticket #147 is fixed.\n*)\nlet reaction =\n let status_kw = \/[Ss][Uu][Cc][Cc][Ee][Ss][Ss]\/\n | \/[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]\/\n | \/[Uu][Nn][Aa][Vv][Aa][Ii][Ll]\/\n | \/[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]\/\n in let action_kw = \/[Rr][Ee][Tt][Uu][Rr][Nn]\/\n | \/[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]\/\n in let negate = [ Util.del_str \"!\" . label \"negate\" ]\n in let reaction_entry = [ label \"status\" . negate?\n . store status_kw\n . Util.del_str \"=\"\n . [ label \"action\" . store action_kw ] ]\n in Util.del_str \"[\"\n . [ label \"reaction\"\n . (Build.opt_list reaction_entry Sep.space) ]\n . Util.del_str \"]\"\n\n(* View: database *)\nlet database = \n let database_kw = \"aliases\"\n | \"automount\"\n | \"bootparams\"\n | \"ethers\"\n | \"group\"\n | \"hosts\"\n | \"netgroup\"\n | \"netmasks\"\n | \"networks\"\n | \"passwd\"\n | \"protocols\"\n | \"publickey\"\n | \"rpc\"\n | \"sendmailvars\"\n | \"services\"\n | \"shadow\"\n | \"sudoers\"\n | \"passwd_compat\"\n | \"group_compat\"\n | \"shadow_compat\"\n in [ label \"database\" . store database_kw\n . sep_colon\n . (Build.opt_list\n (service|reaction)\n Sep.space)\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( empty | comment | database )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/nsswitch.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"64053878b81bc0e24fee28697bdeef375aa8de63","subject":"* lenses\/tests\/test_fstab.aug: test that we parse SELinux context correctly","message":"* lenses\/tests\/test_fstab.aug: test that we parse SELinux context correctly\n","repos":"MikaelSmith\/augeas,pevalme\/augeas,jjlin\/augeas,kumy\/augeas,kumy\/augeas,ptoscano\/augeas,lutter\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,jtopjian\/augeas,kunkku\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,domcleal\/augeas,pevalme\/augeas,manandbytes\/augeas,domcleal\/augeas,raphink\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,lutter\/augeas,jjlin\/augeas,manandbytes\/augeas,kumy\/augeas,mchf\/augeas,raphink\/augeas,hercules-team\/augeas,pevalme\/augeas,dafugg\/augeas,jasperla\/augeas,lutter\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,kunkku\/augeas,mchf\/augeas,kumy\/augeas,jtopjian\/augeas","old_file":"lenses\/tests\/test_fstab.aug","new_file":"lenses\/tests\/test_fstab.aug","new_contents":"module Test_fstab =\n\n let simple = \"\/dev\/vg00\/lv00\\t \/\\t ext3\\t defaults 1 1\\n\"\n\n let simple_tree =\n { \"1\"\n { \"spec\" = \"\/dev\/vg00\/lv00\" }\n { \"file\" = \"\/\" }\n { \"vfstype\" = \"ext3\" }\n { \"opt\" = \"defaults\" }\n { \"dump\" = \"1\" }\n { \"passno\" = \"1\" } }\n\n let trailing_ws = \"\/dev\/vg00\/lv00\\t \/\\t ext3\\t defaults 1 1 \\t\\n\"\n\n let gen_no_passno(passno:string) =\n \"LABEL=\/boot\\t \/boot\\t ext3\\t defaults 1\" . passno . \" \\t\\n\"\n let no_passno = gen_no_passno \"\"\n\n let no_passno_tree =\n { \"1\"\n { \"spec\" = \"LABEL=\/boot\" }\n { \"file\" = \"\/boot\" }\n { \"vfstype\" = \"ext3\" }\n { \"opt\" = \"defaults\" }\n { \"dump\" = \"1\" } }\n\n let no_dump = \"\/dev\/vg00\/lv00\\t \/\\t ext3\\t defaults\\n\"\n\n let no_dump_tree =\n { \"1\"\n { \"spec\" = \"\/dev\/vg00\/lv00\" }\n { \"file\" = \"\/\" }\n { \"vfstype\" = \"ext3\" }\n { \"opt\" = \"defaults\" } }\n\n\n let multi_opts = \"devpts\\t \/dev\/pts\\t devpts gid=5,mode=620,fscontext=system_u:object_r:removable_t 0 0\\n\"\n\n let multi_opts_tree =\n { \"1\"\n { \"spec\" = \"devpts\" }\n { \"file\" = \"\/dev\/pts\" }\n { \"vfstype\" = \"devpts\" }\n { \"opt\" = \"gid\"\n { \"value\" = \"5\" } }\n { \"opt\" = \"mode\"\n { \"value\" = \"620\" } }\n { \"opt\" = \"fscontext\"\n { \"value\" = \"system_u:object_r:removable_t\" } }\n { \"dump\" = \"0\" }\n { \"passno\" = \"0\" } }\n\n test Fstab.lns get simple = simple_tree\n\n test Fstab.lns get trailing_ws = simple_tree\n\n test Fstab.lns get no_passno = no_passno_tree\n\n test Fstab.lns put no_passno after set \"\/1\/passno\" \"1\" = gen_no_passno \" 1\"\n\n test Fstab.lns get no_dump = no_dump_tree\n\n test Fstab.lns get multi_opts = multi_opts_tree\n\n test Fstab.lns get \"\/dev\/hdc \/media\/cdrom0 udf,iso9660 user,noauto\\t0\\t0\\n\" =\n { \"1\"\n { \"spec\" = \"\/dev\/hdc\" }\n { \"file\" = \"\/media\/cdrom0\" }\n { \"vfstype\" = \"udf\" }\n { \"vfstype\" = \"iso9660\" }\n { \"opt\" = \"user\" }\n { \"opt\" = \"noauto\" }\n { \"dump\" = \"0\" }\n { \"passno\" = \"0\" } }\n\n (* Allow # in the spec *)\n test Fstab.lns get \"sshfs#jon@10.0.0.2:\/home \/media\/server fuse uid=1000,gid=100,port=1022 0 0\\n\" =\n { \"1\"\n { \"spec\" = \"sshfs#jon@10.0.0.2:\/home\" }\n { \"file\" = \"\/media\/server\" }\n { \"vfstype\" = \"fuse\" }\n { \"opt\" = \"uid\"\n { \"value\" = \"1000\" } }\n { \"opt\" = \"gid\"\n { \"value\" = \"100\" } }\n { \"opt\" = \"port\"\n { \"value\" = \"1022\" } }\n { \"dump\" = \"0\" }\n { \"passno\" = \"0\" } }\n\n (* Bug #191 *)\n test Fstab.lns get \"tmpfs \/dev\/shm tmpfs rw,rootcontext=\\\"system_u:object_r:tmpfs_t:s0\\\" 0 0\\n\" =\n { \"1\"\n { \"spec\" = \"tmpfs\" }\n { \"file\" = \"\/dev\/shm\" }\n { \"vfstype\" = \"tmpfs\" }\n { \"opt\" = \"rw\" }\n { \"opt\" = \"rootcontext\"\n { \"value\" = \"\\\"system_u:object_r:tmpfs_t:s0\\\"\" } }\n { \"dump\" = \"0\" }\n { \"passno\" = \"0\" } }\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"module Test_fstab =\n\n let simple = \"\/dev\/vg00\/lv00\\t \/\\t ext3\\t defaults 1 1\\n\"\n\n let simple_tree =\n { \"1\"\n { \"spec\" = \"\/dev\/vg00\/lv00\" }\n { \"file\" = \"\/\" }\n { \"vfstype\" = \"ext3\" }\n { \"opt\" = \"defaults\" }\n { \"dump\" = \"1\" }\n { \"passno\" = \"1\" } }\n\n let trailing_ws = \"\/dev\/vg00\/lv00\\t \/\\t ext3\\t defaults 1 1 \\t\\n\"\n\n let gen_no_passno(passno:string) =\n \"LABEL=\/boot\\t \/boot\\t ext3\\t defaults 1\" . passno . \" \\t\\n\"\n let no_passno = gen_no_passno \"\"\n\n let no_passno_tree =\n { \"1\"\n { \"spec\" = \"LABEL=\/boot\" }\n { \"file\" = \"\/boot\" }\n { \"vfstype\" = \"ext3\" }\n { \"opt\" = \"defaults\" }\n { \"dump\" = \"1\" } }\n\n let no_dump = \"\/dev\/vg00\/lv00\\t \/\\t ext3\\t defaults\\n\"\n\n let no_dump_tree =\n { \"1\"\n { \"spec\" = \"\/dev\/vg00\/lv00\" }\n { \"file\" = \"\/\" }\n { \"vfstype\" = \"ext3\" }\n { \"opt\" = \"defaults\" } }\n\n\n let multi_opts = \"devpts\\t \/dev\/pts\\t devpts gid=5,mode=620,fscontext=system_u:object_r:removable_t 0 0\\n\"\n\n let multi_opts_tree =\n { \"1\"\n { \"spec\" = \"devpts\" }\n { \"file\" = \"\/dev\/pts\" }\n { \"vfstype\" = \"devpts\" }\n { \"opt\" = \"gid\"\n { \"value\" = \"5\" } }\n { \"opt\" = \"mode\"\n { \"value\" = \"620\" } }\n { \"opt\" = \"fscontext\"\n { \"value\" = \"system_u:object_r:removable_t\" } }\n { \"dump\" = \"0\" }\n { \"passno\" = \"0\" } }\n\n test Fstab.lns get simple = simple_tree\n\n test Fstab.lns get trailing_ws = simple_tree\n\n test Fstab.lns get no_passno = no_passno_tree\n\n test Fstab.lns put no_passno after set \"\/1\/passno\" \"1\" = gen_no_passno \" 1\"\n\n test Fstab.lns get no_dump = no_dump_tree\n\n test Fstab.lns get multi_opts = multi_opts_tree\n\n test Fstab.lns get \"\/dev\/hdc \/media\/cdrom0 udf,iso9660 user,noauto\\t0\\t0\\n\" =\n { \"1\"\n { \"spec\" = \"\/dev\/hdc\" }\n { \"file\" = \"\/media\/cdrom0\" }\n { \"vfstype\" = \"udf\" }\n { \"vfstype\" = \"iso9660\" }\n { \"opt\" = \"user\" }\n { \"opt\" = \"noauto\" }\n { \"dump\" = \"0\" }\n { \"passno\" = \"0\" } }\n\n (* Allow # in the spec *)\n test Fstab.lns get \"sshfs#jon@10.0.0.2:\/home \/media\/server fuse uid=1000,gid=100,port=1022 0 0\\n\" =\n { \"1\"\n { \"spec\" = \"sshfs#jon@10.0.0.2:\/home\" }\n { \"file\" = \"\/media\/server\" }\n { \"vfstype\" = \"fuse\" }\n { \"opt\" = \"uid\"\n { \"value\" = \"1000\" } }\n { \"opt\" = \"gid\"\n { \"value\" = \"100\" } }\n { \"opt\" = \"port\"\n { \"value\" = \"1022\" } }\n { \"dump\" = \"0\" }\n { \"passno\" = \"0\" } }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"11984a8dd43c2f9e0e0fde4555e94c8b590628c7","subject":"vmware_config: use square lens to manage quotes","message":"vmware_config: use square lens to manage quotes\n","repos":"ptoscano\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,pevalme\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,jasperla\/augeas,jjlin\/augeas,lutter\/augeas,mlichvar\/augeas,mlichvar\/augeas,kunkku\/augeas,dafugg\/augeas,pevalme\/augeas,jtopjian\/augeas,hercules-team\/augeas,dafugg\/augeas,ptoscano\/augeas,lutter\/augeas,kunkku\/augeas,raphink\/augeas,manandbytes\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,mchf\/augeas,kumy\/augeas,hercules-team\/augeas,mchf\/augeas,lutter\/augeas,kunkku\/augeas,MikaelSmith\/augeas,raphink\/augeas,kumy\/augeas,kumy\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,ptoscano\/augeas","old_file":"lenses\/vmware_config.aug","new_file":"lenses\/vmware_config.aug","new_contents":"(*\nModule: VWware_Config\n Parses \/etc\/vmware\/config\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/vmware\/config. See <filter>.\n\nAbout: Examples\n The <Test_VMware_Config> file contains various examples and tests.\n*)\nmodule VMware_Config =\n\nautoload xfm\n\n(* View: entry *)\nlet entry =\n let quote = del \/\"?\/ \"\\\"\"\n in let body = store \/[^\\n\\t \"]([^\\n\"]*[^\\n\\t \"])?\/\n in let sto = square quote body quote\n in Build.key_value_line Rx.word Sep.space_equal sto\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/vmware\/config\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: VWware_Config\n Parses \/etc\/vmware\/config\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/vmware\/config. See <filter>.\n\nAbout: Examples\n The <Test_VMware_Config> file contains various examples and tests.\n*)\nmodule VMware_Config =\n\nautoload xfm\n\n(* View: entry *)\nlet entry =\n let sto = del \/\"?\/ \"\\\"\" . store \/[^\\n\\t \"]([^\\n\"]*[^\\n\\t \"])?\/ . del \/\"?\/ \"\\\"\"\n in Build.key_value_line Rx.word Sep.space_equal sto\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | entry)*\n\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/vmware\/config\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c0150d45a8797260962d060138260626c9565b52","subject":"Use Build.opt_list in sudoers.aug","message":"Use Build.opt_list in sudoers.aug\n","repos":"domcleal\/augeas,kunkku\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas,raphink\/augeas,kumy\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,pevalme\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,dafugg\/augeas,jtopjian\/augeas,pevalme\/augeas,jjlin\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,dafugg\/augeas,lutter\/augeas,mchf\/augeas,kumy\/augeas,lutter\/augeas,jjlin\/augeas,hercules-team\/augeas,kunkku\/augeas,MikaelSmith\/augeas,domcleal\/augeas,kunkku\/augeas,mlichvar\/augeas,kumy\/augeas,jasperla\/augeas,kumy\/augeas,jasperla\/augeas,domcleal\/augeas,mchf\/augeas,raphink\/augeas,ptoscano\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Sep.space\n\n(* Variable: sep_cont *)\nlet sep_cont = Sep.cl_or_space\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = Sep.cl_or_opt_space\n\n(* Variable: sep_cont_opt_build *)\nlet sep_cont_opt_build (sep:string) =\n del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (\" \" . sep . \" \")\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt_build \",\"\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt_build \"=\"\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt_build \":\"\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\]([^,=:#()\\n\\\\]|\\\\\\\\[=:,\\\\])*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces and NIS domains and allowed*)\nlet sto_to_com_user =\n let nis_re = \/([A-Z]([-A-Z0-9]|(\\\\\\\\[ \\t]))*+\\\\\\\\\\\\\\\\)\/\n in let user_re = \/[%+@a-z]([-a-z0-9]|(\\\\\\\\[ \\t]))*\/\n in store (nis_re? . user_re)\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\]+|\"[^\", \\t\\n\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n Build.opt_list (alias_field kw sto) sep_com\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\" | \"closefrom_override\"\n | \"closefrom_override\" | \"compress_io\" | \"fast_glob\"\n | \"log_input\" | \"log_output\" | \"pwfeedback\"\n | \"umask_override\" | \"use_pty\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list> for listing\n * users and\/or groups used to run a command\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')' |\n * > '(:' Runas_List ')' |\n * > '(' Runas_List ':' Runas_List ')'\n *************************************************************************)\nlet runas_spec_user = alias_list \"runas_user\" sto_to_com\nlet runas_spec_group = Util.del_str \":\" . indent\n . alias_list \"runas_group\" sto_to_com\n\nlet runas_spec_usergroup = runas_spec_user . indent . runas_spec_group\n\nlet runas_spec = Util.del_str \"(\"\n . (runas_spec_user\n | runas_spec_group\n | runas_spec_usergroup )\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = Build.opt_list cmnd_spec sep_com\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . Build.opt_list spec_list sep_col\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Sep.space\n\n(* Variable: sep_cont *)\nlet sep_cont = Sep.cl_or_space\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = Sep.cl_or_opt_space\n\n(* Variable: sep_cont_opt_build *)\nlet sep_cont_opt_build (sep:string) =\n del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (\" \" . sep . \" \")\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt_build \",\"\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt_build \"=\"\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt_build \":\"\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\]([^,=:#()\\n\\\\]|\\\\\\\\[=:,\\\\])*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\])|[^,=:#() \\t\\n\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces and NIS domains and allowed*)\nlet sto_to_com_user =\n let nis_re = \/([A-Z]([-A-Z0-9]|(\\\\\\\\[ \\t]))*+\\\\\\\\\\\\\\\\)\/\n in let user_re = \/[%+@a-z]([-a-z0-9]|(\\\\\\\\[ \\t]))*\/\n in store (nis_re? . user_re)\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\]+|\"[^\", \\t\\n\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n Build.opt_list (alias_field kw sto) sep_com\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\" | \"closefrom_override\"\n | \"closefrom_override\" | \"compress_io\" | \"fast_glob\"\n | \"log_input\" | \"log_output\" | \"pwfeedback\"\n | \"umask_override\" | \"use_pty\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list> for listing\n * users and\/or groups used to run a command\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')' |\n * > '(:' Runas_List ')' |\n * > '(' Runas_List ':' Runas_List ')'\n *************************************************************************)\nlet runas_spec_user = alias_list \"runas_user\" sto_to_com\nlet runas_spec_group = Util.del_str \":\" . indent\n . alias_list \"runas_group\" sto_to_com\n\nlet runas_spec_usergroup = runas_spec_user . indent . runas_spec_group\n\nlet runas_spec = Util.del_str \"(\"\n . (runas_spec_user\n | runas_spec_group\n | runas_spec_usergroup )\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8a6b85b1a1e108f98c2c5b9f9caf277eccdec57b","subject":"Add some unit tests for sendmail_list lens","message":"Add some unit tests for sendmail_list lens\n","repos":"smoeding\/puppet-sendmail","old_file":"lib\/augeas\/lenses\/tests\/test_sendmail_list.aug","new_file":"lib\/augeas\/lenses\/tests\/test_sendmail_list.aug","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"bsd-2-clause","lang":"Augeas"} {"commit":"bcc6492d068676a9408052b3624f55f0d73a4014","subject":"Nrpe: optimize regexp substractions","message":"Nrpe: optimize regexp substractions\n","repos":"kunkku\/augeas,manandbytes\/augeas,raphink\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,mchf\/augeas,dafugg\/augeas,jasperla\/augeas,pevalme\/augeas,dafugg\/augeas,jjlin\/augeas,MikaelSmith\/augeas,kunkku\/augeas,dafugg\/augeas,kumy\/augeas,manandbytes\/augeas,kumy\/augeas,jasperla\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas,jjlin\/augeas,kumy\/augeas,ptoscano\/augeas,mchf\/augeas,lutter\/augeas,kumy\/augeas,ptoscano\/augeas,jtopjian\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas,lutter\/augeas,mlichvar\/augeas,mlichvar\/augeas,pevalme\/augeas,pevalme\/augeas,MikaelSmith\/augeas,raphink\/augeas","old_file":"lenses\/nrpe.aug","new_file":"lenses\/nrpe.aug","new_contents":"(*\nModule: Nrpe\n Parses nagios-nrpe configuration files.\n\nAuthor: Marc Fournier <marc.fournier@camptocamp.com>\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n*)\n\nmodule Nrpe =\n autoload xfm\n\n\nlet eol = Util.eol\nlet eq = Sep.equal\n\n(* View: word *)\nlet word = \/[^=\\n\\t ]+\/\n\n(* View: item_re *)\nlet item_re = \/[^#=\\n\\t\\\/ ]+\/ - (\/command\\[[^]\\\/\\n]+\\]\/ | \"include\" | \"include_dir\")\n\n(* View: command\n nrpe.cfg usually has many entries defining commands to run\n\n > command[check_foo]=\/path\/to\/nagios\/plugin -w 123 -c 456\n > command[check_bar]=\/path\/to\/another\/nagios\/plugin --option\n*)\nlet command =\n let obrkt = del \/\\[\/ \"[\" in\n let cbrkt = del \/\\]\/ \"]\" in\n [ key \"command\" .\n [ obrkt . key \/[^]\\\/\\n]+\/ . cbrkt . eq\n . store \/[^\\n]+\/ . del \/\\n\/ \"\\n\" ]\n ]\n\n\n(* View: item\n regular entries\n\n > allow_bash_command_substitution=0\n*)\nlet item = [ key item_re . eq . store word . eol ]\n\n(* View: include\n An include entry.\n\n nrpe.cfg can include more than one file or directory of files\n\n > include=\/path\/to\/file1.cfg\n > include=\/path\/to\/file2.cfg\n*)\nlet include = [ key \"include\" .\n [ label \"file\" . eq . store word . eol ]\n]\n\n(* View: include_dir\n > include_dir=\/path\/to\/dir\/\n*)\nlet include_dir = [ key \"include_dir\" .\n [ label \"dir\" . eq . store word . eol ]\n]\n\n\n(* View: comment\n Nrpe comments must start at beginning of line *)\nlet comment = Util.comment_generic \/#[ \\t]*\/ \"# \"\n\n(* blank lines and empty comments *)\nlet empty = Util.empty\n\n(* View: lns\n The Nrpe lens *)\nlet lns = ( command | include | include_dir | item | comment | empty ) *\n\n(* View: filter\n File filter *)\nlet filter = incl \"\/etc\/nrpe.cfg\" .\n incl \"\/etc\/nagios\/nrpe.cfg\"\n\nlet xfm = transform lns (filter)\n\n","old_contents":"(*\nModule: Nrpe\n Parses nagios-nrpe configuration files.\n\nAuthor: Marc Fournier <marc.fournier@camptocamp.com>\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n*)\n\nmodule Nrpe =\n autoload xfm\n\n\nlet eol = Util.eol\nlet eq = Sep.equal\n\n(* View: word *)\nlet word = \/[^=\\n\\t ]+\/\n\n(* View: item_re *)\nlet item_re = \/[^#=\\n\\t\\\/ ]+\/ - \/command\\[[^]\\\/\\n]+\\]\/ - \"include\" - \"include_dir\"\n\n(* View: command\n nrpe.cfg usually has many entries defining commands to run\n\n > command[check_foo]=\/path\/to\/nagios\/plugin -w 123 -c 456\n > command[check_bar]=\/path\/to\/another\/nagios\/plugin --option\n*)\nlet command =\n let obrkt = del \/\\[\/ \"[\" in\n let cbrkt = del \/\\]\/ \"]\" in\n [ key \"command\" .\n [ obrkt . key \/[^]\\\/\\n]+\/ . cbrkt . eq\n . store \/[^\\n]+\/ . del \/\\n\/ \"\\n\" ]\n ]\n\n\n(* View: item\n regular entries\n\n > allow_bash_command_substitution=0\n*)\nlet item = [ key item_re . eq . store word . eol ]\n\n(* View: include\n An include entry.\n\n nrpe.cfg can include more than one file or directory of files\n\n > include=\/path\/to\/file1.cfg\n > include=\/path\/to\/file2.cfg\n*)\nlet include = [ key \"include\" .\n [ label \"file\" . eq . store word . eol ]\n]\n\n(* View: include_dir\n > include_dir=\/path\/to\/dir\/\n*)\nlet include_dir = [ key \"include_dir\" .\n [ label \"dir\" . eq . store word . eol ]\n]\n\n\n(* View: comment\n Nrpe comments must start at beginning of line *)\nlet comment = Util.comment_generic \/#[ \\t]*\/ \"# \"\n\n(* blank lines and empty comments *)\nlet empty = Util.empty\n\n(* View: lns\n The Nrpe lens *)\nlet lns = ( command | include | include_dir | item | comment | empty ) *\n\n(* View: filter\n File filter *)\nlet filter = incl \"\/etc\/nrpe.cfg\" .\n incl \"\/etc\/nagios\/nrpe.cfg\"\n\nlet xfm = transform lns (filter)\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"80bbf23347c212964c7065e10687e7bb5c13014c","subject":"Csv: remove unused caret from comment regexp","message":"Csv: remove unused caret from comment regexp\n\nFixes #396\n","repos":"ptoscano\/augeas,lutter\/augeas,kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,manandbytes\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas,pevalme\/augeas,kunkku\/augeas,mlichvar\/augeas,manandbytes\/augeas,lutter\/augeas,mchf\/augeas,mlichvar\/augeas,mlichvar\/augeas,mchf\/augeas,lutter\/augeas","old_file":"lenses\/csv.aug","new_file":"lenses\/csv.aug","new_contents":"(*\nModule: CSV\n Generic CSV lens collection\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n https:\/\/tools.ietf.org\/html\/rfc4180\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n\nAbout: Examples\n The <Test_CSV> file contains various examples and tests.\n\nCaveats:\n No support for files without an ending CRLF\n*)\nmodule CSV =\n\n(* View: eol *)\nlet eol = Util.del_str \"\\n\"\n\n(* View: comment *)\nlet comment = Util.comment\n | [ del \/#[ \\t]*\\r?\\n\/ \"#\\n\" ]\n\n(* View: entry\n An entry of fields, quoted or not *)\nlet entry (sep_str:string) =\n let field = [ seq \"field\" . store (\/[^\"#\\r\\n]\/ - sep_str)* ]\n | [ seq \"field\" . store \/(\"[^\"#]*\")+\/ ]\n in let sep = Util.del_str sep_str\n in [ seq \"entry\" . counter \"field\" . Build.opt_list field sep . eol ]\n\n(* View: lns\n The generic lens, taking the separator as a parameter *)\nlet lns_generic (sep:string) = (comment | entry sep)*\n\n(* View: lns\n The comma-separated value lens *)\nlet lns = lns_generic \",\"\n\n(* View: lns_semicol\n A semicolon-separated value lens *)\nlet lns_semicol = lns_generic \";\"\n","old_contents":"(*\nModule: CSV\n Generic CSV lens collection\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n https:\/\/tools.ietf.org\/html\/rfc4180\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n\nAbout: Examples\n The <Test_CSV> file contains various examples and tests.\n\nCaveats:\n No support for files without an ending CRLF\n*)\nmodule CSV =\n\n(* View: eol *)\nlet eol = Util.del_str \"\\n\"\n\n(* View: comment *)\nlet comment = Util.comment\n | [ del \/^#[ \\t]*\\r?\\n\/ \"#\\n\" ]\n\n(* View: entry\n An entry of fields, quoted or not *)\nlet entry (sep_str:string) =\n let field = [ seq \"field\" . store (\/[^\"#\\r\\n]\/ - sep_str)* ]\n | [ seq \"field\" . store \/(\"[^\"#]*\")+\/ ]\n in let sep = Util.del_str sep_str\n in [ seq \"entry\" . counter \"field\" . Build.opt_list field sep . eol ]\n\n(* View: lns\n The generic lens, taking the separator as a parameter *)\nlet lns_generic (sep:string) = (comment | entry sep)*\n\n(* View: lns\n The comma-separated value lens *)\nlet lns = lns_generic \",\"\n\n(* View: lns_semicol\n A semicolon-separated value lens *)\nlet lns_semicol = lns_generic \";\"\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"361f772f6fa020a1451b758c7afc15320b1c9a3c","subject":"qemu: fix double space in augeas file","message":"qemu: fix double space in augeas file\n\nSigned-off-by: J\u00e1n Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>\nReviewed-by: John Ferlan <87558058f6f829e5ec976c8ef960720af4ff9c7d@redhat.com>\n","repos":"eskultety\/libvirt,jfehlig\/libvirt,olafhering\/libvirt,olafhering\/libvirt,libvirt\/libvirt,nertpinx\/libvirt,jardasgit\/libvirt,jfehlig\/libvirt,andreabolognani\/libvirt,eskultety\/libvirt,zippy2\/libvirt,nertpinx\/libvirt,nertpinx\/libvirt,nertpinx\/libvirt,andreabolognani\/libvirt,crobinso\/libvirt,jfehlig\/libvirt,fabianfreyer\/libvirt,libvirt\/libvirt,andreabolognani\/libvirt,fabianfreyer\/libvirt,fabianfreyer\/libvirt,andreabolognani\/libvirt,eskultety\/libvirt,olafhering\/libvirt,andreabolognani\/libvirt,eskultety\/libvirt,libvirt\/libvirt,olafhering\/libvirt,crobinso\/libvirt,zippy2\/libvirt,jardasgit\/libvirt,jardasgit\/libvirt,jfehlig\/libvirt,fabianfreyer\/libvirt,fabianfreyer\/libvirt,libvirt\/libvirt,nertpinx\/libvirt,jardasgit\/libvirt,jardasgit\/libvirt,crobinso\/libvirt,crobinso\/libvirt,zippy2\/libvirt,eskultety\/libvirt,zippy2\/libvirt","old_file":"src\/qemu\/libvirtd_qemu.aug","new_file":"src\/qemu\/libvirtd_qemu.aug","new_contents":"(* \/etc\/libvirt\/qemu.conf *)\n\nmodule Libvirtd_qemu =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n let unlimited_val = del \/\\\"\/ \"\\\"\" . store \/unlimited\/ . del \/\\\"\/ \"\\\"\"\n let limits_entry (kw:string) = [ key kw . value_sep . unlimited_val ] | [ key kw . value_sep . int_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let default_tls_entry = str_entry \"default_tls_x509_cert_dir\"\n | bool_entry \"default_tls_x509_verify\"\n | str_entry \"default_tls_x509_secret_uuid\"\n\n let vnc_entry = str_entry \"vnc_listen\"\n | bool_entry \"vnc_auto_unix_socket\"\n | bool_entry \"vnc_tls\"\n | str_entry \"vnc_tls_x509_cert_dir\"\n | bool_entry \"vnc_tls_x509_verify\"\n | str_entry \"vnc_password\"\n | bool_entry \"vnc_sasl\"\n | str_entry \"vnc_sasl_dir\"\n | bool_entry \"vnc_allow_host_audio\"\n\n let spice_entry = str_entry \"spice_listen\"\n | bool_entry \"spice_tls\"\n | str_entry \"spice_tls_x509_cert_dir\"\n | bool_entry \"spice_auto_unix_socket\"\n | str_entry \"spice_password\"\n | bool_entry \"spice_sasl\"\n | str_entry \"spice_sasl_dir\"\n\n let chardev_entry = bool_entry \"chardev_tls\"\n | str_entry \"chardev_tls_x509_cert_dir\"\n | bool_entry \"chardev_tls_x509_verify\"\n | str_entry \"chardev_tls_x509_secret_uuid\"\n\n let migrate_entry = str_entry \"migrate_tls_x509_cert_dir\"\n | bool_entry \"migrate_tls_x509_verify\"\n | str_entry \"migrate_tls_x509_secret_uuid\"\n\n let nogfx_entry = bool_entry \"nographics_allow_host_audio\"\n\n let remote_display_entry = int_entry \"remote_display_port_min\"\n | int_entry \"remote_display_port_max\"\n | int_entry \"remote_websocket_port_min\"\n | int_entry \"remote_websocket_port_max\"\n\n let security_entry = str_entry \"security_driver\"\n | bool_entry \"security_default_confined\"\n | bool_entry \"security_require_confined\"\n | str_entry \"user\"\n | str_entry \"group\"\n | bool_entry \"dynamic_ownership\"\n | str_array_entry \"cgroup_controllers\"\n | str_array_entry \"cgroup_device_acl\"\n | int_entry \"seccomp_sandbox\"\n | str_array_entry \"namespaces\"\n\n let save_entry = str_entry \"save_image_format\"\n | str_entry \"dump_image_format\"\n | str_entry \"snapshot_image_format\"\n | str_entry \"auto_dump_path\"\n | bool_entry \"auto_dump_bypass_cache\"\n | bool_entry \"auto_start_bypass_cache\"\n\n let process_entry = str_entry \"hugetlbfs_mount\"\n | bool_entry \"clear_emulator_capabilities\"\n | str_entry \"bridge_helper\"\n | str_entry \"pr_helper\"\n | bool_entry \"set_process_name\"\n | int_entry \"max_processes\"\n | int_entry \"max_files\"\n | limits_entry \"max_core\"\n | bool_entry \"dump_guest_core\"\n | str_entry \"stdio_handler\"\n\n let device_entry = bool_entry \"mac_filter\"\n | bool_entry \"relaxed_acs_check\"\n | bool_entry \"allow_disk_format_probing\"\n | str_entry \"lock_manager\"\n\n let rpc_entry = int_entry \"max_queued\"\n | int_entry \"keepalive_interval\"\n | int_entry \"keepalive_count\"\n\n let network_entry = str_entry \"migration_address\"\n | int_entry \"migration_port_min\"\n | int_entry \"migration_port_max\"\n | str_entry \"migration_host\"\n\n let log_entry = bool_entry \"log_timestamp\"\n\n let nvram_entry = str_array_entry \"nvram\"\n\n let gluster_debug_level_entry = int_entry \"gluster_debug_level\"\n\n let memory_entry = str_entry \"memory_backing_dir\"\n\n let vxhs_entry = bool_entry \"vxhs_tls\"\n | str_entry \"vxhs_tls_x509_cert_dir\"\n\n let nbd_entry = bool_entry \"nbd_tls\"\n | str_entry \"nbd_tls_x509_cert_dir\"\n\n let swtpm_user_entry = str_entry \"swtpm_user\"\n let swtpm_group_entry = str_entry \"swtpm_group\"\n\n (* Each entry in the config is one of the following ... *)\n let entry = default_tls_entry\n | vnc_entry\n | spice_entry\n | chardev_entry\n | migrate_entry\n | nogfx_entry\n | remote_display_entry\n | security_entry\n | save_entry\n | process_entry\n | device_entry\n | rpc_entry\n | network_entry\n | log_entry\n | nvram_entry\n | gluster_debug_level_entry\n | memory_entry\n | vxhs_entry\n | nbd_entry\n | swtpm_user_entry\n | swtpm_group_entry\n\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/qemu.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* \/etc\/libvirt\/qemu.conf *)\n\nmodule Libvirtd_qemu =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n let unlimited_val = del \/\\\"\/ \"\\\"\" . store \/unlimited\/ . del \/\\\"\/ \"\\\"\"\n let limits_entry (kw:string) = [ key kw . value_sep . unlimited_val ] | [ key kw . value_sep . int_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let default_tls_entry = str_entry \"default_tls_x509_cert_dir\"\n | bool_entry \"default_tls_x509_verify\"\n | str_entry \"default_tls_x509_secret_uuid\"\n\n let vnc_entry = str_entry \"vnc_listen\"\n | bool_entry \"vnc_auto_unix_socket\"\n | bool_entry \"vnc_tls\"\n | str_entry \"vnc_tls_x509_cert_dir\"\n | bool_entry \"vnc_tls_x509_verify\"\n | str_entry \"vnc_password\"\n | bool_entry \"vnc_sasl\"\n | str_entry \"vnc_sasl_dir\"\n | bool_entry \"vnc_allow_host_audio\"\n\n let spice_entry = str_entry \"spice_listen\"\n | bool_entry \"spice_tls\"\n | str_entry \"spice_tls_x509_cert_dir\"\n | bool_entry \"spice_auto_unix_socket\"\n | str_entry \"spice_password\"\n | bool_entry \"spice_sasl\"\n | str_entry \"spice_sasl_dir\"\n\n let chardev_entry = bool_entry \"chardev_tls\"\n | str_entry \"chardev_tls_x509_cert_dir\"\n | bool_entry \"chardev_tls_x509_verify\"\n | str_entry \"chardev_tls_x509_secret_uuid\"\n\n let migrate_entry = str_entry \"migrate_tls_x509_cert_dir\"\n | bool_entry \"migrate_tls_x509_verify\"\n | str_entry \"migrate_tls_x509_secret_uuid\"\n\n let nogfx_entry = bool_entry \"nographics_allow_host_audio\"\n\n let remote_display_entry = int_entry \"remote_display_port_min\"\n | int_entry \"remote_display_port_max\"\n | int_entry \"remote_websocket_port_min\"\n | int_entry \"remote_websocket_port_max\"\n\n let security_entry = str_entry \"security_driver\"\n | bool_entry \"security_default_confined\"\n | bool_entry \"security_require_confined\"\n | str_entry \"user\"\n | str_entry \"group\"\n | bool_entry \"dynamic_ownership\"\n | str_array_entry \"cgroup_controllers\"\n | str_array_entry \"cgroup_device_acl\"\n | int_entry \"seccomp_sandbox\"\n | str_array_entry \"namespaces\"\n\n let save_entry = str_entry \"save_image_format\"\n | str_entry \"dump_image_format\"\n | str_entry \"snapshot_image_format\"\n | str_entry \"auto_dump_path\"\n | bool_entry \"auto_dump_bypass_cache\"\n | bool_entry \"auto_start_bypass_cache\"\n\n let process_entry = str_entry \"hugetlbfs_mount\"\n | bool_entry \"clear_emulator_capabilities\"\n | str_entry \"bridge_helper\"\n | str_entry \"pr_helper\"\n | bool_entry \"set_process_name\"\n | int_entry \"max_processes\"\n | int_entry \"max_files\"\n | limits_entry \"max_core\"\n | bool_entry \"dump_guest_core\"\n | str_entry \"stdio_handler\"\n\n let device_entry = bool_entry \"mac_filter\"\n | bool_entry \"relaxed_acs_check\"\n | bool_entry \"allow_disk_format_probing\"\n | str_entry \"lock_manager\"\n\n let rpc_entry = int_entry \"max_queued\"\n | int_entry \"keepalive_interval\"\n | int_entry \"keepalive_count\"\n\n let network_entry = str_entry \"migration_address\"\n | int_entry \"migration_port_min\"\n | int_entry \"migration_port_max\"\n | str_entry \"migration_host\"\n\n let log_entry = bool_entry \"log_timestamp\"\n\n let nvram_entry = str_array_entry \"nvram\"\n\n let gluster_debug_level_entry = int_entry \"gluster_debug_level\"\n\n let memory_entry = str_entry \"memory_backing_dir\"\n\n let vxhs_entry = bool_entry \"vxhs_tls\"\n | str_entry \"vxhs_tls_x509_cert_dir\"\n\n let nbd_entry = bool_entry \"nbd_tls\"\n | str_entry \"nbd_tls_x509_cert_dir\"\n\n let swtpm_user_entry = str_entry \"swtpm_user\"\n let swtpm_group_entry = str_entry \"swtpm_group\"\n\n (* Each entry in the config is one of the following ... *)\n let entry = default_tls_entry\n | vnc_entry\n | spice_entry\n | chardev_entry\n | migrate_entry\n | nogfx_entry\n | remote_display_entry\n | security_entry\n | save_entry\n | process_entry\n | device_entry\n | rpc_entry\n | network_entry\n | log_entry\n | nvram_entry\n | gluster_debug_level_entry\n | memory_entry\n | vxhs_entry\n | nbd_entry\n | swtpm_user_entry\n | swtpm_group_entry\n\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/qemu.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"48f9c2e664875679e7a4ad33c5417e123dc486b5","subject":"Util.stdexcl: exclude .augsave and .augnew files","message":"Util.stdexcl: exclude .augsave and .augnew files\n","repos":"manandbytes\/augeas,pevalme\/augeas,dafugg\/augeas,jtopjian\/augeas,dafugg\/augeas,lutter\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,mchf\/augeas,raphink\/augeas,lutter\/augeas,dafugg\/augeas,jasperla\/augeas,mlichvar\/augeas,camptocamp\/augeas,GeoffWilliams\/augeas,bkearney\/augeas,jasperla\/augeas,pevalme\/augeas,kunkku\/augeas,jjlin\/augeas,kumy\/augeas,bkearney\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,camptocamp\/augeas,jjlin\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,bkearney\/augeas,mlichvar\/augeas,hercules-team\/augeas,ptoscano\/augeas,ptoscano\/augeas,hercules-team\/augeas,kumy\/augeas,raphink\/augeas,domcleal\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,ptoscano\/augeas,kunkku\/augeas,bkearney\/augeas,kumy\/augeas,domcleal\/augeas,kumy\/augeas,kunkku\/augeas,pevalme\/augeas,jtopjian\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the GPL.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment and empty\n This is a general definition of comment and empty.\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are \n ignored together with empty lines\n\nView: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = \n [ indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \" \n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(*\nView: empty\n Map empty lines, including empty comments\n*)\n let empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the GPL.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment and empty\n This is a general definition of comment and empty.\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are \n ignored together with empty lines\n\nView: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = \n [ indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \" \n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(*\nView: empty\n Map empty lines, including empty comments\n*)\n let empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") . (excl \"*.rpmnew\") . (excl \"*.rpmsave\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0a98def646ad3735f618a83d9eef0197f14d7c09","subject":"Fai_Diskconfig: Optimize regexp substractions","message":"Fai_Diskconfig: Optimize regexp substractions\n","repos":"raphink\/augeas,kumy\/augeas,jasperla\/augeas,MikaelSmith\/augeas,lutter\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,mlichvar\/augeas,jtopjian\/augeas,hercules-team\/augeas,jtopjian\/augeas,kunkku\/augeas,jjlin\/augeas,lutter\/augeas,kunkku\/augeas,kunkku\/augeas,kumy\/augeas,dafugg\/augeas,dafugg\/augeas,mlichvar\/augeas,manandbytes\/augeas,mchf\/augeas,jasperla\/augeas,ptoscano\/augeas,mlichvar\/augeas,mchf\/augeas,ptoscano\/augeas,dafugg\/augeas,pevalme\/augeas,raphink\/augeas,pevalme\/augeas,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas,MikaelSmith\/augeas","old_file":"lenses\/fai_diskconfig.aug","new_file":"lenses\/fai_diskconfig.aug","new_contents":"(*\nModule: FAI_DiskConfig\n Parses disk_config files for FAI\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to the FAI wiki where possible:\n http:\/\/wiki.fai-project.org\/wiki\/Setup-storage#New_configuration_file_syntax\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Examples\n The <Test_FAI_DiskConfig> file contains various examples and tests.\n*)\n\nmodule FAI_DiskConfig =\n\n(* autoload xfm *)\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: space *)\nlet space = Sep.space\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: tag\n A generic tag beginning with a colon *)\nlet tag (re:regexp) = [ Util.del_str \":\" . key re ]\n\n(* Variable: generic_opt\n A generic key\/value option *)\nlet generic_opt (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . store kw ]\n\n(* Variable: generic_opt_list\n A generic key\/list option *)\nlet generic_opt_list (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . counter \"locallist\"\n . Build.opt_list [seq \"locallist\" . store kw] Sep.comma ]\n\n\n(************************************************************************\n * Group: RECORDS\n *************************************************************************)\n\n\n(* Group: volume *)\n\n(* Variable: mountpoint_kw *)\nlet mountpoint_kw = \"-\" (* do not mount *)\n | \"swap\" (* swap space *)\n (* fully qualified path; if :encrypt is given, the partition\n * will be encrypted, the key is generated automatically *)\n | \/\\\/[^: \\t\\n]*\/\n\n(* Variable: encrypt\n encrypt tag *)\nlet encrypt = tag \"encrypt\"\n\n(* Variable: mountpoint *)\nlet mountpoint = [ label \"mountpoint\" . store mountpoint_kw\n (* encrypt is only for the fspath, but we parse it anyway *)\n . encrypt?]\n\n(* Variable: resize\n resize tag *)\nlet resize = tag \"resize\"\n\n(* Variable: size_kw\n Regexps for size *)\nlet size_kw = \/[0-9]+[kMGTP%]?(-([0-9]+[kMGTP%]?)?)?\/\n | \/-[0-9]+[kMGTP%]?\/\n\n(* Variable: size *)\nlet size = [ label \"size\" . store size_kw . resize? ]\n\n(* Variable: filesystem_kw\n Regexps for filesystem *)\nlet filesystem_kw = \"-\"\n | \"swap\"\n (* NOTE: Restraining this regexp would improve perfs *)\n | (Rx.no_spaces - (\"-\" | \"swap\")) (* mkfs.xxx must exist *)\n\n(* Variable: filesystem *)\nlet filesystem = [ label \"filesystem\" . store filesystem_kw ]\n\n\n(* Variable: mount_option_value *)\nlet mount_option_value = [ label \"value\" . Util.del_str \"=\"\n . store \/[^,= \\t\\n]+\/ ]\n\n(* Variable: mount_option\n Counting options *)\nlet mount_option = [ seq \"mount_option\"\n . store \/[^,= \\t\\n]+\/\n . mount_option_value? ]\n\n(* Variable: mount_options\n An array of <mount_option>s *)\nlet mount_options = [ label \"mount_options\"\n . counter \"mount_option\"\n . Build.opt_list mount_option Sep.comma ]\n\n(* Variable: fs_option *)\nlet fs_option =\n [ key \/createopts|tuneopts\/\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: fs_options\n An array of <fs_option>s *)\nlet fs_options =\n (* options to append to mkfs.xxx and to the filesystem-specific\n * tuning tool *)\n [ label \"fs_options\" . Build.opt_list fs_option Sep.space ]\n\n(* Variable: volume_full *)\nlet volume_full (type:lens) (third_field:lens) =\n [ type . space\n . mountpoint .space\n (* The third field changes depending on types *)\n . third_field . space\n . filesystem . space\n . mount_options\n . (space . fs_options)?\n . eol ]\n\n(* Variable: name\n LVM volume group name *)\nlet name = [ label \"name\" . store \/[^\\\/ \\t\\n]+\/ ]\n\n(* Variable: partition\n An optional partition number for <disk> *)\nlet partition = [ label \"partition\" . Util.del_str \".\" . store \/[0-9]+\/ ]\n\n(* Variable: disk *)\nlet disk = [ label \"disk\" . store \/[^., \\t\\n]+\/ . partition? ]\n\n(* Variable: vg_option\n An option for <volume_vg> *)\nlet vg_option =\n [ key \"pvcreateopts\"\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: volume_vg *)\nlet volume_vg = [ key \"vg\"\n . space . name\n . space . disk\n . (space . vg_option)?\n . eol ]\n\n(* Variable: spare_missing *)\nlet spare_missing = tag \/spare|missing\/\n\n(* Variable: disk_with_opt\n A <disk> with a spare\/missing option for raids *)\nlet disk_with_opt = [ label \"disk\" . store \/[^:., \\t\\n]+\/ . partition?\n . spare_missing* ]\n\n(* Variable: disk_list\n A list of <disk_with_opt>s *)\nlet disk_list = Build.opt_list disk_with_opt Sep.comma\n\n(* Variable: type_label_lv *)\nlet type_label_lv = label \"lv\"\n . [ label \"vg\" . store (\/[^# \\t\\n-]+\/ - \"raw\") ]\n . Util.del_str \"-\"\n . [ label \"name\" . store \/[^ \\t\\n]+\/ ]\n\n(* Variable: volume_tmpfs *)\nlet volume_tmpfs =\n [ key \"tmpfs\" . space\n . mountpoint .space\n . size . space\n . mount_options\n . (space . fs_options)?\n . eol ]\n\n(* Variable: volume_lvm *)\nlet volume_lvm = volume_full type_label_lv size (* lvm logical volume: vg name and lv name *)\n | volume_vg\n\n(* Variable: volume_raid *)\nlet volume_raid = volume_full (key \/raid[0156]\/) disk_list (* raid level *)\n\n(* Variable: device *)\nlet device = [ label \"device\" . store Rx.fspath ]\n\n(* Variable: volume_cryptsetup *)\nlet volume_cryptsetup = volume_full (key (\"swap\"|\"tmp\"|\"luks\")) device\n\n(* Variable: volume *)\nlet volume = volume_full (key \"primary\") size (* for physical disks only *)\n | volume_full (key \"logical\") size (* for physical disks only *)\n | volume_full (key \"raw-disk\") size\n\n(* Variable: volume_or_comment\n A succesion of <volume>s and <comment>s *)\nlet volume_or_comment (vol:lens) =\n (vol|empty|comment)* . vol\n\n(* Variable: disk_config_entry *)\nlet disk_config_entry (kw:regexp) (opt:lens) (vol:lens) =\n [ key \"disk_config\" . space . store kw\n . (space . opt)* . eol\n . (volume_or_comment vol)? ]\n\n(* Variable: lvmoption *)\nlet lvmoption =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt \"preserve_reinstall\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* attempt to resize partitions *)\n | generic_opt \"resize\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: raidoption *)\nlet raidoption =\n (* preserve partitions -- always *)\n generic_opt_list \"preserve_always\" (Rx.integer | \"all\")\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt_list \"preserve_reinstall\" Rx.integer\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: option *)\nlet option =\n (* preserve partitions -- always *)\n generic_opt_list \"preserve_always\" (Rx.integer | \"all\")\n (* preserve partitions -- unless the system is installed\n for the first time *)\n | generic_opt_list \"preserve_reinstall\" Rx.integer\n (* attempt to resize partitions *)\n | generic_opt_list \"resize\" Rx.integer\n (* write a disklabel - default is msdos *)\n | generic_opt \"disklabel\" \/msdos|gpt\/\n (* mark a partition bootable, default is \/ *)\n | generic_opt \"bootable\" Rx.integer\n (* do not assume the disk to be a physical device, use with xen *)\n | [ key \"virtual\" ]\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n | generic_opt_list \"always_format\" Rx.integer\n | generic_opt \"sameas\" Rx.fspath\n\nlet cryptoption =\n [ key \"randinit\" ]\n\n(* Variable: disk_config *)\nlet disk_config =\n let excludes = \"lvm\" | \"raid\" | \"end\" | \/disk[0-9]+\/\n | \"cryptsetup\" | \"tmpfs\" in\n let other_label = Rx.fspath - excludes in\n disk_config_entry \"lvm\" lvmoption volume_lvm\n | disk_config_entry \"raid\" raidoption volume_raid\n | disk_config_entry \"tmpfs\" option volume_tmpfs\n | disk_config_entry \"end\" option volume (* there shouldn't be an option here *)\n | disk_config_entry \/disk[0-9]+\/ option volume\n | disk_config_entry \"cryptsetup\" cryptoption volume_cryptsetup\n | disk_config_entry other_label option volume\n\n(* Variable: lns\n The disk_config lens *)\nlet lns = (disk_config|comment|empty)*\n\n\n(* let xfm = transform lns Util.stdexcl *)\n","old_contents":"(*\nModule: FAI_DiskConfig\n Parses disk_config files for FAI\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to the FAI wiki where possible:\n http:\/\/wiki.fai-project.org\/wiki\/Setup-storage#New_configuration_file_syntax\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Examples\n The <Test_FAI_DiskConfig> file contains various examples and tests.\n*)\n\nmodule FAI_DiskConfig =\n\n(* autoload xfm *)\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: space *)\nlet space = Sep.space\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: tag\n A generic tag beginning with a colon *)\nlet tag (re:regexp) = [ Util.del_str \":\" . key re ]\n\n(* Variable: generic_opt\n A generic key\/value option *)\nlet generic_opt (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . store kw ]\n\n(* Variable: generic_opt_list\n A generic key\/list option *)\nlet generic_opt_list (type:string) (kw:regexp) =\n [ key type . Util.del_str \":\" . counter \"locallist\"\n . Build.opt_list [seq \"locallist\" . store kw] Sep.comma ]\n\n\n(************************************************************************\n * Group: RECORDS\n *************************************************************************)\n\n\n(* Group: volume *)\n\n(* Variable: mountpoint_kw *)\nlet mountpoint_kw = \"-\" (* do not mount *)\n | \"swap\" (* swap space *)\n (* fully qualified path; if :encrypt is given, the partition\n * will be encrypted, the key is generated automatically *)\n | \/\\\/[^: \\t\\n]*\/\n\n(* Variable: encrypt\n encrypt tag *)\nlet encrypt = tag \"encrypt\"\n\n(* Variable: mountpoint *)\nlet mountpoint = [ label \"mountpoint\" . store mountpoint_kw\n (* encrypt is only for the fspath, but we parse it anyway *)\n . encrypt?]\n\n(* Variable: resize\n resize tag *)\nlet resize = tag \"resize\"\n\n(* Variable: size_kw\n Regexps for size *)\nlet size_kw = \/[0-9]+[kMGTP%]?(-([0-9]+[kMGTP%]?)?)?\/\n | \/-[0-9]+[kMGTP%]?\/\n\n(* Variable: size *)\nlet size = [ label \"size\" . store size_kw . resize? ]\n\n(* Variable: filesystem_kw\n Regexps for filesystem *)\nlet filesystem_kw = \"-\"\n | \"swap\"\n (* NOTE: Restraining this regexp would improve perfs *)\n | (Rx.no_spaces - \"-\" - \"swap\") (* mkfs.xxx must exist *)\n\n(* Variable: filesystem *)\nlet filesystem = [ label \"filesystem\" . store filesystem_kw ]\n\n\n(* Variable: mount_option_value *)\nlet mount_option_value = [ label \"value\" . Util.del_str \"=\"\n . store \/[^,= \\t\\n]+\/ ]\n\n(* Variable: mount_option\n Counting options *)\nlet mount_option = [ seq \"mount_option\"\n . store \/[^,= \\t\\n]+\/\n . mount_option_value? ]\n\n(* Variable: mount_options\n An array of <mount_option>s *)\nlet mount_options = [ label \"mount_options\"\n . counter \"mount_option\"\n . Build.opt_list mount_option Sep.comma ]\n\n(* Variable: fs_option *)\nlet fs_option =\n [ key \/createopts|tuneopts\/\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: fs_options\n An array of <fs_option>s *)\nlet fs_options =\n (* options to append to mkfs.xxx and to the filesystem-specific\n * tuning tool *)\n [ label \"fs_options\" . Build.opt_list fs_option Sep.space ]\n\n(* Variable: volume_full *)\nlet volume_full (type:lens) (third_field:lens) =\n [ type . space\n . mountpoint .space\n (* The third field changes depending on types *)\n . third_field . space\n . filesystem . space\n . mount_options\n . (space . fs_options)?\n . eol ]\n\n(* Variable: name\n LVM volume group name *)\nlet name = [ label \"name\" . store \/[^\\\/ \\t\\n]+\/ ]\n\n(* Variable: partition\n An optional partition number for <disk> *)\nlet partition = [ label \"partition\" . Util.del_str \".\" . store \/[0-9]+\/ ]\n\n(* Variable: disk *)\nlet disk = [ label \"disk\" . store \/[^., \\t\\n]+\/ . partition? ]\n\n(* Variable: vg_option\n An option for <volume_vg> *)\nlet vg_option =\n [ key \"pvcreateopts\"\n . Util.del_str \"=\\\"\" . store \/[^\"\\n]*\/ . Util.del_str \"\\\"\" ]\n\n(* Variable: volume_vg *)\nlet volume_vg = [ key \"vg\"\n . space . name\n . space . disk\n . (space . vg_option)?\n . eol ]\n\n(* Variable: spare_missing *)\nlet spare_missing = tag \/spare|missing\/\n\n(* Variable: disk_with_opt\n A <disk> with a spare\/missing option for raids *)\nlet disk_with_opt = [ label \"disk\" . store \/[^:., \\t\\n]+\/ . partition?\n . spare_missing* ]\n\n(* Variable: disk_list\n A list of <disk_with_opt>s *)\nlet disk_list = Build.opt_list disk_with_opt Sep.comma\n\n(* Variable: type_label_lv *)\nlet type_label_lv = label \"lv\"\n . [ label \"vg\" . store (\/[^# \\t\\n-]+\/ - \"raw\") ]\n . Util.del_str \"-\"\n . [ label \"name\" . store \/[^ \\t\\n]+\/ ]\n\n(* Variable: volume_tmpfs *)\nlet volume_tmpfs =\n [ key \"tmpfs\" . space\n . mountpoint .space\n . size . space\n . mount_options\n . (space . fs_options)?\n . eol ]\n\n(* Variable: volume_lvm *)\nlet volume_lvm = volume_full type_label_lv size (* lvm logical volume: vg name and lv name *)\n | volume_vg\n\n(* Variable: volume_raid *)\nlet volume_raid = volume_full (key \/raid[0156]\/) disk_list (* raid level *)\n\n(* Variable: device *)\nlet device = [ label \"device\" . store Rx.fspath ]\n\n(* Variable: volume_cryptsetup *)\nlet volume_cryptsetup = volume_full (key (\"swap\"|\"tmp\"|\"luks\")) device\n\n(* Variable: volume *)\nlet volume = volume_full (key \"primary\") size (* for physical disks only *)\n | volume_full (key \"logical\") size (* for physical disks only *)\n | volume_full (key \"raw-disk\") size\n\n(* Variable: volume_or_comment\n A succesion of <volume>s and <comment>s *)\nlet volume_or_comment (vol:lens) =\n (vol|empty|comment)* . vol\n\n(* Variable: disk_config_entry *)\nlet disk_config_entry (kw:regexp) (opt:lens) (vol:lens) =\n [ key \"disk_config\" . space . store kw\n . (space . opt)* . eol\n . (volume_or_comment vol)? ]\n\n(* Variable: lvmoption *)\nlet lvmoption =\n (* preserve partitions -- always *)\n generic_opt \"preserve_always\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt \"preserve_reinstall\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* attempt to resize partitions *)\n | generic_opt \"resize\" \/[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+(,[^\\\/, \\t\\n-]+-[^\\\/, \\t\\n-]+)*\/\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: raidoption *)\nlet raidoption =\n (* preserve partitions -- always *)\n generic_opt_list \"preserve_always\" (Rx.integer | \"all\")\n (* preserve partitions -- unless the system is installed\n * for the first time *)\n | generic_opt_list \"preserve_reinstall\" Rx.integer\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n\n(* Variable: option *)\nlet option =\n (* preserve partitions -- always *)\n generic_opt_list \"preserve_always\" (Rx.integer | \"all\")\n (* preserve partitions -- unless the system is installed\n for the first time *)\n | generic_opt_list \"preserve_reinstall\" Rx.integer\n (* attempt to resize partitions *)\n | generic_opt_list \"resize\" Rx.integer\n (* write a disklabel - default is msdos *)\n | generic_opt \"disklabel\" \/msdos|gpt\/\n (* mark a partition bootable, default is \/ *)\n | generic_opt \"bootable\" Rx.integer\n (* do not assume the disk to be a physical device, use with xen *)\n | [ key \"virtual\" ]\n (* when creating the fstab, the key used for defining the device\n * may be the device (\/dev\/xxx), a label given using -L, or the uuid *)\n | generic_opt \"fstabkey\" \/device|label|uuid\/\n | generic_opt_list \"always_format\" Rx.integer\n | generic_opt \"sameas\" Rx.fspath\n\nlet cryptoption =\n [ key \"randinit\" ]\n\n(* Variable: disk_config *)\nlet disk_config =\n let other_label = Rx.fspath - \"lvm\" - \"raid\" - \"end\" - \/disk[0-9]+\/\n - \"cryptsetup\" - \"tmpfs\" in\n disk_config_entry \"lvm\" lvmoption volume_lvm\n | disk_config_entry \"raid\" raidoption volume_raid\n | disk_config_entry \"tmpfs\" option volume_tmpfs\n | disk_config_entry \"end\" option volume (* there shouldn't be an option here *)\n | disk_config_entry \/disk[0-9]+\/ option volume\n | disk_config_entry \"cryptsetup\" cryptoption volume_cryptsetup\n | disk_config_entry other_label option volume\n\n(* Variable: lns\n The disk_config lens *)\nlet lns = (disk_config|comment|empty)*\n\n\n(* let xfm = transform lns Util.stdexcl *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d64235ee24803801865a52ecc9c30a9c0daa8732","subject":"Cleanly handle comments","message":"Cleanly handle comments\n","repos":"camptocamp\/augeas,lutter\/augeas,kunkku\/augeas,kumy\/augeas,manandbytes\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,jtopjian\/augeas,ptoscano\/augeas,bkearney\/augeas,raphink\/augeas,kumy\/augeas,kumy\/augeas,MikaelSmith\/augeas,mchf\/augeas,hercules-team\/augeas,lutter\/augeas,raphink\/augeas,kunkku\/augeas,jjlin\/augeas,pevalme\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,mchf\/augeas,ptoscano\/augeas,jjlin\/augeas,kunkku\/augeas,hercules-team\/augeas,camptocamp\/augeas,bkearney\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,dafugg\/augeas,jtopjian\/augeas,jasperla\/augeas,jasperla\/augeas,mlichvar\/augeas,camptocamp\/augeas,camptocamp\/augeas,pevalme\/augeas,jjlin\/augeas,bkearney\/augeas,domcleal\/augeas,dafugg\/augeas,manandbytes\/augeas,bkearney\/augeas","old_file":"spec\/inittab.aug","new_file":"spec\/inittab.aug","new_contents":"# Parsing \/etc\/inittab\n\nmap\n grammar inittab\n include '\/etc\/inittab' '\/system\/config\/inittab'\nend\n\ngrammar inittab\n\n token SEP ':'\n token EOL '\\n'\n token COMMENT \/[ \\t]*(#.*?)?\\n\/ = '# \\n'\n\n file: ( comment | record ) *\n\n comment: [ COMMENT ]\n\n record: [ seq 'record' . \n [ label 'id' . store ..? ] .\n SEP .\n [ label 'runlevels' . store ..? ] .\n SEP .\n [ label 'action' . store ..? ] .\n SEP .\n [ label 'process' . store ..? ] .\n EOL\n ]\nend\n","old_contents":"# Parsing \/etc\/inittab\n\nmap\n grammar inittab\n include '\/etc\/inittab' '\/system\/config\/inittab'\nend\n\ngrammar inittab\n\n token SEP ':'\n token EOL '\\n'\n\n file: ( comment | record ) *\n\n comment: ( \/#.*?\\n\/ | \/[ \\t]*\\n\/ )\n\n record: [ seq 'record' . \n [ label 'id' . store ..? ] .\n SEP .\n [ label 'runlevels' . store ..? ] .\n SEP .\n [ label 'action' . store ..? ] .\n SEP .\n [ label 'process' . store ..? ] .\n EOL\n ]\nend\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"50686146c56b6d34edbb415f4139634fdf43f626","subject":"Quote: Improve documentation for functions","message":"Quote: Improve documentation for functions\n","repos":"mchf\/augeas,dafugg\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,pevalme\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,manandbytes\/augeas,lutter\/augeas,kumy\/augeas,kumy\/augeas,mlichvar\/augeas,jjlin\/augeas,jtopjian\/augeas,ptoscano\/augeas,dafugg\/augeas,mlichvar\/augeas,hercules-team\/augeas,kunkku\/augeas,raphink\/augeas,hercules-team\/augeas,manandbytes\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,kumy\/augeas,jtopjian\/augeas,pevalme\/augeas,mlichvar\/augeas,kumy\/augeas,kunkku\/augeas,dafugg\/augeas,mchf\/augeas,jasperla\/augeas,lutter\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,jjlin\/augeas,lutter\/augeas","old_file":"lenses\/quote.aug","new_file":"lenses\/quote.aug","new_contents":"(*\nModule: Quote\n Generic module providing useful primitives for quoting\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Quote> file contains various examples and tests.\n*)\n\nmodule Quote =\n\n(* Group: QUOTE SEPARATORS *)\n\n(* Variable: dquote\n A double quote *)\nlet dquote = Util.del_str \"\\\"\"\n\n(* Variable: dquote_opt\n An optional double quote, default to double *)\nlet dquote_opt = del \/\"?\/ \"\\\"\"\n\n(* Variable: dquote_opt_nil\n An optional double quote, default to nothing *)\nlet dquote_opt_nil = del \/\"?\/ \"\"\n\n(* Variable: squote\n A single quote *)\nlet squote = Util.del_str \"'\"\n\n(* Variable: squote_opt\n An optional single quote, default to single *)\nlet squote_opt = del \/'?\/ \"'\"\n\n(* Variable: squote_opt_nil\n An optional single quote, default to nothing *)\nlet squote_opt_nil = del \/'?\/ \"\"\n\n(* Variable: quote\n A quote, either double or single, default to double *)\nlet quote = del \/[\"']\/ \"\\\"\"\n\n(* Variable: quote_opt\n An optional quote, either double or single, default to double *)\nlet quote_opt = del \/[\"']?\/ \"\\\"\"\n\n(* Variable: quote_opt_nil\n An optional quote, either double or single, default to nothing *)\nlet quote_opt_nil = del \/[\"']?\/ \"\"\n\n\n(* Group: QUOTING FUNCTIONS *)\n\n(*\nView: do_dquote\n Enclose a lens in <dquote>s\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote (body:lens) =\n square dquote body dquote\n\n(*\nView: do_dquote_opt\n Enclose a lens in optional <dquote>s,\n use <dquote>s by default.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote_opt (body:lens) =\n square dquote_opt body dquote_opt\n\n(*\nView: do_dquote_opt_nil\n Enclose a lens in optional <dquote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_dquote_opt_nil (body:lens) =\n square dquote_opt_nil body dquote_opt_nil\n\n(*\nView: do_squote\n Enclose a lens in <squote>s\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote (body:lens) =\n square squote body squote\n\n(*\nView: do_squote_opt\n Enclose a lens in optional <squote>s,\n use <squote>s by default.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote_opt (body:lens) =\n square squote_opt body squote_opt\n\n(*\nView: do_squote_opt_nil\n Enclose a lens in optional <squote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_squote_opt_nil (body:lens) =\n square squote_opt_nil body squote_opt_nil\n\n(*\nView: do_quote\n Enclose a lens in <quote>s.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote (body:lens) =\n square quote body quote\n\n(*\nView: do_quote\n Enclose a lens in options <quote>s.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote_opt (body:lens) =\n square quote_opt body quote_opt\n\n(*\nView: do_quote\n Enclose a lens in options <quote>s,\n default to no quotes.\n\n Parameters:\n body:lens - the lens to be enclosed\n*)\nlet do_quote_opt_nil (body:lens) =\n square quote_opt_nil body quote_opt_nil\n\n\n(* Group: QUOTED VALUES *)\n\n(* View: double\n A double-quoted value *)\nlet double =\n let body = store \/[^\\n]*\/\n in do_dquote body\n\n(* Variable: double_opt_re\n The regexp to store when value\n is optionally double-quoted *)\nlet double_opt_re = \/[^\\n\\t \"]([^\\n\"]*[^\\n\\t \"])?\/\n\n(* View: double_opt\n An optionaly double-quoted value\n Double quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet double_opt =\n let body = store double_opt_re\n in do_dquote_opt body\n\n(* View: single\n A single-quoted value *)\nlet single =\n let body = store \/[^\\n]*\/\n in do_squote body\n\n(* Variable: single_opt_re\n The regexp to store when value\n is optionally single-quoted *)\nlet single_opt_re = \/[^\\n\\t ']([^\\n']*[^\\n\\t '])?\/\n\n(* View: single_opt\n An optionaly single-quoted value\n Single quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet single_opt =\n let body = store single_opt_re\n in do_squote_opt body\n\n(* View: any\n A quoted value *)\nlet any =\n let body = store \/[^\\n]*\/\n in do_quote body\n\n(* Variable: any_opt_re\n The regexp to store when value\n is optionally single- or double-quoted *)\nlet any_opt_re = \/[^\\n\\t \"']([^\\n\"']*[^\\n\\t \"'])?\/\n\n(* View: any_opt\n An optionaly quoted value\n Double or single quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet any_opt =\n let body = store any_opt_re\n in do_quote_opt body\n\n(*\nView: quote_spaces\n Make quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet quote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_quote_opt (store \/[^\"' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_quote (store \/[^\"' \\t\\n]*[ \\t][^\"' \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet dquote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\" \\t\\n]*[ \\t][^\" \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n\n(*\nView: squote_spaces\n Make single quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nParameters:\n lns:lens - the lens to be enclosed\n*)\nlet squote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_squote_opt (store \/[^' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_squote (store \/[^' \\t\\n]*[ \\t][^' \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n","old_contents":"(*\nModule: Quote\n Generic module providing useful primitives for quoting\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Examples\n The <Test_Quote> file contains various examples and tests.\n*)\n\nmodule Quote =\n\n(* Group: QUOTE SEPARATORS *)\n\n(* Variable: dquote\n A double quote *)\nlet dquote = Util.del_str \"\\\"\"\n\n(* Variable: dquote_opt\n An optional double quote, default to double *)\nlet dquote_opt = del \/\"?\/ \"\\\"\"\n\n(* Variable: dquote_opt_nil\n An optional double quote, default to nothing *)\nlet dquote_opt_nil = del \/\"?\/ \"\"\n\n(* Variable: squote\n A single quote *)\nlet squote = Util.del_str \"'\"\n\n(* Variable: squote_opt\n An optional single quote, default to single *)\nlet squote_opt = del \/'?\/ \"'\"\n\n(* Variable: squote_opt_nil\n An optional single quote, default to nothing *)\nlet squote_opt_nil = del \/'?\/ \"\"\n\n(* Variable: quote\n A quote, either double or single, default to double *)\nlet quote = del \/[\"']\/ \"\\\"\"\n\n(* Variable: quote_opt\n An optional quote, either double or single, default to double *)\nlet quote_opt = del \/[\"']?\/ \"\\\"\"\n\n(* Variable: quote_opt_nil\n An optional quote, either double or single, default to nothing *)\nlet quote_opt_nil = del \/[\"']?\/ \"\"\n\n\n(* Group: QUOTING FUNCTIONS *)\n\n(* View: do_dquote *)\nlet do_dquote (body:lens) =\n square dquote body dquote\n\n(* View: do_dquote_opt *)\nlet do_dquote_opt (body:lens) =\n square dquote_opt body dquote_opt\n\n(* View: do_dquote_opt *)\nlet do_dquote_opt_nil (body:lens) =\n square dquote_opt_nil body dquote_opt_nil\n\n(* View: do_squote *)\nlet do_squote (body:lens) =\n square squote body squote\n\n(* View: do_squote_opt *)\nlet do_squote_opt (body:lens) =\n square squote_opt body squote_opt\n\n(* View: do_squote_opt_nil *)\nlet do_squote_opt_nil (body:lens) =\n square squote_opt_nil body squote_opt_nil\n\n(* View: do_quote *)\nlet do_quote (body:lens) =\n square quote body quote\n\n(* View: do_quote_opt *)\nlet do_quote_opt (body:lens) =\n square quote_opt body quote_opt\n\n(* View: do_quote_opt_nil *)\nlet do_quote_opt_nil (body:lens) =\n square quote_opt_nil body quote_opt_nil\n\n\n(* Group: QUOTED VALUES *)\n\n(* View: double\n A double-quoted value *)\nlet double =\n let body = store \/[^\\n]*\/\n in do_dquote body\n\n(* Variable: double_opt_re\n The regexp to store when value\n is optionally double-quoted *)\nlet double_opt_re = \/[^\\n\\t \"]([^\\n\"]*[^\\n\\t \"])?\/\n\n(* View: double_opt\n An optionaly double-quoted value\n Double quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet double_opt =\n let body = store double_opt_re\n in do_dquote_opt body\n\n(* View: single\n A single-quoted value *)\nlet single =\n let body = store \/[^\\n]*\/\n in do_squote body\n\n(* Variable: single_opt_re\n The regexp to store when value\n is optionally single-quoted *)\nlet single_opt_re = \/[^\\n\\t ']([^\\n']*[^\\n\\t '])?\/\n\n(* View: single_opt\n An optionaly single-quoted value\n Single quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet single_opt =\n let body = store single_opt_re\n in do_squote_opt body\n\n(* View: any\n A quoted value *)\nlet any =\n let body = store \/[^\\n]*\/\n in do_quote body\n\n(* Variable: any_opt_re\n The regexp to store when value\n is optionally single- or double-quoted *)\nlet any_opt_re = \/[^\\n\\t \"']([^\\n\"']*[^\\n\\t \"'])?\/\n\n(* View: any_opt\n An optionaly quoted value\n Double or single quotes are not allowed in value\n Value cannot begin or end with spaces *)\nlet any_opt =\n let body = store any_opt_re\n in do_quote_opt body\n\n(* View: quote_spaces\n Make quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces. *)\nlet quote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_quote_opt (store \/[^\"' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_quote (store \/[^\"' \\t\\n]*[ \\t][^\"' \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n\n(* View: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces. *)\nlet dquote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\" \\t\\n]*[ \\t][^\" \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n\n(* View: squote_spaces\n Make single quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces. *)\nlet squote_spaces (lns:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_squote_opt (store \/[^' \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_squote (store \/[^' \\t\\n]*[ \\t][^' \\t\\n]*\/)\n in [ lns . bare ] | [ lns . quoted ]\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"034eac6ffaa94850c19cda6bb4b3613fbb8d12de","subject":"* lenses\/rx.aug (fspath): simplistic regex for filesystem paths","message":"* lenses\/rx.aug (fspath): simplistic regex for filesystem paths\n","repos":"ptoscano\/augeas,jtopjian\/augeas,mchf\/augeas,mlichvar\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,bkearney\/augeas,kunkku\/augeas,domcleal\/augeas,kunkku\/augeas,bkearney\/augeas,jjlin\/augeas,domcleal\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,lutter\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,dafugg\/augeas,kumy\/augeas,raphink\/augeas,domcleal\/augeas,bkearney\/augeas,dafugg\/augeas,kumy\/augeas,kumy\/augeas,lutter\/augeas,dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,lutter\/augeas,kumy\/augeas,MikaelSmith\/augeas,raphink\/augeas,jtopjian\/augeas,pevalme\/augeas,mchf\/augeas,ptoscano\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas,ptoscano\/augeas,bkearney\/augeas","old_file":"lenses\/rx.aug","new_file":"lenses\/rx.aug","new_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Spaces *)\nlet space = \/[ \\t]+\/\nlet opt_space = \/[ \\t]*\/\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\nlet no_spaces = \/[^ \\t\\n]+\/\n\n(* Generic fields *)\nlet word = \/[A-Za-z0-9_.-]+\/\nlet integer = \/[0-9]+\/\nlet decimal = \/[0-9]+[.,][0-9]+\/\n\n(* A filesystem path *)\nlet fspath = \/[^ \\t\\n]+\/\n\n(* All but... *)\n(* Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n\n(*\n * IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\nlet ipv4 =\n let dot = \".\" in\n let digits = \/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/ in\n digits . dot . digits . dot . digits . dot . digits\n\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\nlet ip = ipv4 | ipv6\n","old_contents":"(*\nModule: Rx\n Generic regexps to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Rx =\n\n(* Spaces *)\nlet space = \/[ \\t]+\/\nlet opt_space = \/[ \\t]*\/\nlet space_in = \/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/\nlet no_spaces = \/[^ \\t\\n]+\/\n\n(* Generic fields *)\nlet word = \/[A-Za-z0-9_.-]+\/\nlet integer = \/[0-9]+\/\nlet decimal = \/[0-9]+[.,][0-9]+\/\n\n(* All but... *)\n(* Anything but a space, a comma or a comment sign *)\nlet neg1 = \/[^,# \\n\\t]+\/\n\n\n(*\n * IPs\n * Cf. http:\/\/blog.mes-stats.fr\/2008\/10\/09\/regex-ipv4-et-ipv6\/ (in fr)\n *)\nlet ipv4 =\n let dot = \".\" in\n let digits = \/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/ in\n digits . dot . digits . dot . digits . dot . digits\n\nlet ipv6 =\n \/(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})\/\n | ( \/([0-9A-Fa-f]{1,4}:){6}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/([0-9A-Fa-f]{1,4}:){0,5}:\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\\.){3}\/\n . \/(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\/\n )\n | ( \/[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}\/\n . \/[0-9A-Fa-f]{1,4}\/\n )\n | \/(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})\/\n | \/(([0-9A-Fa-f]{1,4}:){1,7}:)\/\n\nlet ip = ipv4 | ipv6\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a85508b42239d82e23e201d732c08f37f3520c5d","subject":"Ssh: only look for *.conf files in \/etc\/ssh\/ssh_config.d","message":"Ssh: only look for *.conf files in \/etc\/ssh\/ssh_config.d\n\nThe previous commit would have slurped in all files in that directory, but\nonly *.conf files are important.\n\nPatch by Ian Mortimer\n","repos":"ptoscano\/augeas,manandbytes\/augeas,manandbytes\/augeas,mlichvar\/augeas,pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,pevalme\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,pevalme\/augeas,mchf\/augeas,mlichvar\/augeas,hercules-team\/augeas,lutter\/augeas,lutter\/augeas,lutter\/augeas,mchf\/augeas","old_file":"lenses\/ssh.aug","new_file":"lenses\/ssh.aug","new_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n let eol = Util.doseol\n let spc = Util.del_ws_spc\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store Rx.space_in\n let value_to_spc = store Rx.no_spaces\n let value_to_comma = store \/[^, \\t\\r\\n]+\/\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n let array_entry (k:regexp) =\n [ indent . key k . counter \"array_entry\"\n . [ spc . seq \"array_entry\" . value_to_spc]* . eol ]\n\n let commas_entry (k:regexp) =\n let value = [ seq \"commas_entry\" . value_to_comma]\n in [ indent . key k . counter \"commas_entry\" . spc .\n Build.opt_list value comma . eol ]\n\n let spaces_entry (k:regexp) =\n let value = [ seq \"spaces_entry\" . value_to_spc ]\n in [ indent . key k . counter \"spaces_entry\" . spc .\n Build.opt_list value spc . eol ]\n\n let fw_entry (k:regexp) = [ indent . key k . spc .\n\t [ key \/[^ \\t\\r\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let send_env = array_entry \/SendEnv\/i\n\n let proxy_command = [ indent . key \/ProxyCommand\/i . spc . value_to_eol . eol ]\n\n let remote_fw = fw_entry \/RemoteForward\/i\n let local_fw = fw_entry \/LocalForward\/i\n\n let ciphers = commas_entry \/Ciphers\/i\n let macs\t= commas_entry \/MACs\/i\n let algorithms = commas_entry \/(HostKey|Kex)Algorithms\/i\n let pubkey_accepted_key_types = commas_entry \/PubkeyAcceptedKeyTypes\/i\n\n let global_knownhosts_file = spaces_entry \/GlobalKnownHostsFile\/i\n\n let special_entry = send_env\n\t | proxy_command\n\t | remote_fw\n\t | local_fw\n\t | macs\n\t | ciphers\n\t | algorithms\n\t | pubkey_accepted_key_types\n | global_knownhosts_file\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers|(HostKey|Kex)Algorithms|PubkeyAcceptedKeyTypes|GlobalKnownHostsFile\/i\n\n\n let other_entry = [ indent . key key_re\n . spc . value_to_spc . eol ]\n\n let entry = comment | empty\n | special_entry\n\t | other_entry\n\n let host = [ key \/Host\/i . spc . value_to_eol . eol . entry* ]\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\") .\n incl \"\/etc\/ssh\/ssh_config.d\/*.conf\")\n","old_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n let eol = Util.doseol\n let spc = Util.del_ws_spc\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store Rx.space_in\n let value_to_spc = store Rx.no_spaces\n let value_to_comma = store \/[^, \\t\\r\\n]+\/\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n let array_entry (k:regexp) =\n [ indent . key k . counter \"array_entry\"\n . [ spc . seq \"array_entry\" . value_to_spc]* . eol ]\n\n let commas_entry (k:regexp) =\n let value = [ seq \"commas_entry\" . value_to_comma]\n in [ indent . key k . counter \"commas_entry\" . spc .\n Build.opt_list value comma . eol ]\n\n let spaces_entry (k:regexp) =\n let value = [ seq \"spaces_entry\" . value_to_spc ]\n in [ indent . key k . counter \"spaces_entry\" . spc .\n Build.opt_list value spc . eol ]\n\n let fw_entry (k:regexp) = [ indent . key k . spc .\n\t [ key \/[^ \\t\\r\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let send_env = array_entry \/SendEnv\/i\n\n let proxy_command = [ indent . key \/ProxyCommand\/i . spc . value_to_eol . eol ]\n\n let remote_fw = fw_entry \/RemoteForward\/i\n let local_fw = fw_entry \/LocalForward\/i\n\n let ciphers = commas_entry \/Ciphers\/i\n let macs\t= commas_entry \/MACs\/i\n let algorithms = commas_entry \/(HostKey|Kex)Algorithms\/i\n let pubkey_accepted_key_types = commas_entry \/PubkeyAcceptedKeyTypes\/i\n\n let global_knownhosts_file = spaces_entry \/GlobalKnownHostsFile\/i\n\n let special_entry = send_env\n\t | proxy_command\n\t | remote_fw\n\t | local_fw\n\t | macs\n\t | ciphers\n\t | algorithms\n\t | pubkey_accepted_key_types\n | global_knownhosts_file\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers|(HostKey|Kex)Algorithms|PubkeyAcceptedKeyTypes|GlobalKnownHostsFile\/i\n\n\n let other_entry = [ indent . key key_re\n . spc . value_to_spc . eol ]\n\n let entry = comment | empty\n | special_entry\n\t | other_entry\n\n let host = [ key \/Host\/i . spc . value_to_eol . eol . entry* ]\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\") .\n incl \"\/etc\/ssh\/ssh_config.d\/*\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8950169c9732835671e2a358d100c56645d7bd0a","subject":"Xorg: autoload from \/etc\/X11\/xorg.conf.d\/*.conf","message":"Xorg: autoload from \/etc\/X11\/xorg.conf.d\/*.conf\n\nBased on patch by manugupta\n\nFixes bug #197\n","repos":"kumy\/augeas,jasperla\/augeas,lutter\/augeas,jjlin\/augeas,lutter\/augeas,raphink\/augeas,manandbytes\/augeas,pevalme\/augeas,kunkku\/augeas,jtopjian\/augeas,dafugg\/augeas,pevalme\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mchf\/augeas,jtopjian\/augeas,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas,kumy\/augeas,manandbytes\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,domcleal\/augeas,mchf\/augeas,dafugg\/augeas,jjlin\/augeas,MikaelSmith\/augeas,lutter\/augeas,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,jasperla\/augeas,dafugg\/augeas,kunkku\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/xorg.aug","new_file":"lenses\/xorg.aug","new_contents":"(*\nModule: Xorg\n Parses \/etc\/X11\/xorg.conf\n\nAuthors: Raphael Pinson <raphink@gmail.com>\n Matthew Booth <mbooth@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man xorg.conf` where\n possible.\n\nThe definitions from `man xorg.conf` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Configuration files\n This lens applies to \/etc\/X11\/xorg.conf. See <filter>.\n*)\n\nmodule Xorg =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: to_eol\n * Match everything from here to eol, cropping whitespace at both ends\n *)\nlet to_eol = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Fields and values *)\n\n(* Variable: entries_re\n * This is a list of all patterns which have specific handlers, and should\n * therefore not be matched by the generic handler\n *)\nlet entries_re = \/([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth|[dD]evice)\/\n\n(* Variable: generic_entry_re *)\nlet generic_entry_re = \/[^# \\t\\n\\\/]+\/ - entries_re\n\n(* Variable: quoted_string_val *)\nlet quoted_string_val = del \"\\\"\" \"\\\"\" . store \/[^\"\\n]+\/ . del \"\\\"\" \"\\\"\"\n (* \" relax, emacs *)\n\n(* Variable: int *)\nlet int = \/[0-9]+\/\n\n\n(************************************************************************\n * Group: ENTRIES AND OPTIONS\n *************************************************************************)\n\n\n(* View: entry_int\n * This matches an entry which takes a single integer for an argument\n *)\nlet entry_int (canon:string) (re:regexp) =\n [ indent . del re canon . label canon . sep_spc . store int . eol ]\n\n(* View: entry_rgb\n * This matches an entry which takes 3 integers as arguments representing red,\n * green and blue components\n *)\nlet entry_rgb (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"red\" . sep_spc . store int ]\n . [ label \"green\" . sep_spc . store int ]\n . [ label \"blue\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_xy\n * This matches an entry which takes 2 integers as arguments representing X and\n * Y coordinates\n *)\nlet entry_xy (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"x\" . sep_spc . store int ]\n . [ label \"y\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_str\n * This matches an entry which takes a single quoted string\n *)\nlet entry_str (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . sep_spc . quoted_string_val . eol ]\n\n(* View: entry_generic\n * An entry without a specific handler. Store everything after the keyword,\n * cropping whitespace at both ends.\n *)\nlet entry_generic = [ indent . key generic_entry_re\n . sep_spc . store to_eol . eol ]\n\n(* View: option *)\nlet option = [ indent . del \/[oO]ption\/ \"Option\" . label \"Option\" . sep_spc\n . quoted_string_val\n . [ label \"value\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: screen\n * The Screen entry of ServerLayout\n *)\nlet screen = [ indent . del \/[sS]creen\/ \"Screen\" . label \"Screen\" . sep_spc\n . [ label \"num\" . store int . sep_spc ]?\n . quoted_string_val\n . [ sep_spc . label \"position\" . store to_eol ]?\n . eol ]\n\n(* View: input_device *)\nlet input_device = [ indent . del \/[iI]nput[dD]evice\/ \"InputDevice\"\n . label \"InputDevice\" . sep_spc . quoted_string_val\n . [ label \"option\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: driver *)\nlet driver = entry_str \"Driver\" \/[dD]river\/\n\n(* View: identifier *)\nlet identifier = entry_str \"Identifier\" \/[iI]dentifier\/\n\n(* View: videoram *)\nlet videoram = entry_int \"VideoRam\" \/[vV]ideo[rR]am\/\n\n(* View: default_depth *)\nlet default_depth = entry_int \"DefaultDepth\" \/[dD]efault[dD]epth\/\n\n(* View: device *)\nlet device = entry_str \"Device\" \/[dD]evice\/\n\n(************************************************************************\n * Group: DISPLAY SUBSECTION\n *************************************************************************)\n\n\n(* View: display_modes *)\nlet display_modes = [ indent . del \/[mM]odes\/ \"Modes\" . label \"Modes\"\n . [ label \"mode\" . sep_spc . quoted_string_val ]+\n . eol ]\n\n(*************************************************************************\n * View: display_entry\n * Known values for entries in the Display subsection\n *\n * Definition:\n * > Depth depth\n * > FbBpp bpp\n * > Weight red-weight green-weight blue-weight\n * > Virtual xdim ydim\n * > ViewPort x0 y0\n * > Modes \"mode-name\" ...\n * > Visual \"visual-name\"\n * > Black red green blue\n * > White red green blue\n * > Options\n *)\n\nlet display_entry = entry_int \"Depth\" \/[dD]epth\/ |\n entry_int \"FbBpp\" \/[fF]b[bB]pp\/ |\n entry_rgb \"Weight\" \/[wW]eight\/ |\n entry_xy \"Virtual\" \/[vV]irtual\/ |\n entry_xy \"ViewPort\" \/[vV]iew[pP]ort\/ |\n display_modes |\n entry_str \"Visual\" \/[vV]isual\/ |\n entry_rgb \"Black\" \/[bB]lack\/ |\n entry_rgb \"White\" \/[wW]hite\/ |\n entry_str \"Options\" \/[oO]ptions\/ |\n empty |\n comment\n\n(* View: display *)\nlet display = [ indent . del \"SubSection\" \"SubSection\" . sep_spc\n . sep_dquote . key \"Display\" . sep_dquote\n . eol\n . display_entry*\n . indent . del \"EndSubSection\" \"EndSubSection\" . eol ]\n\n\n(************************************************************************\n * Group: SECTIONS\n *************************************************************************)\n\n\n(************************************************************************\n * Variable: section_re\n * Known values for Section names\n *\n * Definition:\n * > The section names are:\n * >\n * > Files File pathnames\n * > ServerFlags Server flags\n * > Module Dynamic module loading\n * > Extensions Extension Enabling\n * > InputDevice Input device description\n * > InputClass Input Class description\n * > Device Graphics device description\n * > VideoAdaptor Xv video adaptor description\n * > Monitor Monitor description\n * > Modes Video modes descriptions\n * > Screen Screen configuration\n * > ServerLayout Overall layout\n * > DRI DRI-specific configuration\n * > Vendor Vendor-specific configuration\n *************************************************************************)\nlet section_re = \/(Extensions|Files|ServerFlags|Module|InputDevice|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor)\/\n\n\n(************************************************************************\n * Variable: secton_re_obsolete\n * The following obsolete section names are still recognised for\n * compatibility purposes. In new config files, the InputDevice\n * section should be used instead.\n *\n * Definition:\n * > Keyboard Keyboard configuration\n * > Pointer Pointer\/mouse configuration\n *************************************************************************)\nlet section_re_obsolete = \/(Keyboard|Pointer)\/\n\n(* View: section_entry *)\nlet section_entry = option |\n screen |\n display |\n input_device |\n driver |\n identifier |\n videoram |\n default_depth |\n device |\n entry_generic |\n empty | comment\n\n(************************************************************************\n * View: section\n * A section in xorg.conf\n *\n * Definition:\n * > Section \"SectionName\"\n * > SectionEntry\n * > ...\n * > EndSection\n *************************************************************************)\nlet section = [ indent . del \"Section\" \"Section\"\n . sep_spc . sep_dquote\n . key (section_re|section_re_obsolete) . sep_dquote\n . eol\n . section_entry*\n . indent . del \"EndSection\" \"EndSection\" . eol ]\n\n(*\n * View: lns\n * The xorg.conf lens\n *)\nlet lns = ( empty | comment | section )*\n\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/X11\/xorg.conf\") .\n (incl \"\/etc\/X11\/xorg.conf.d\/*.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Xorg\n Parses \/etc\/X11\/xorg.conf\n\nAuthors: Raphael Pinson <raphink@gmail.com>\n Matthew Booth <mbooth@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man xorg.conf` where\n possible.\n\nThe definitions from `man xorg.conf` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Configuration files\n This lens applies to \/etc\/X11\/xorg.conf. See <filter>.\n*)\n\nmodule Xorg =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: to_eol\n * Match everything from here to eol, cropping whitespace at both ends\n *)\nlet to_eol = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Fields and values *)\n\n(* Variable: entries_re\n * This is a list of all patterns which have specific handlers, and should\n * therefore not be matched by the generic handler\n *)\nlet entries_re = \/([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth|[dD]evice)\/\n\n(* Variable: generic_entry_re *)\nlet generic_entry_re = \/[^# \\t\\n\\\/]+\/ - entries_re\n\n(* Variable: quoted_string_val *)\nlet quoted_string_val = del \"\\\"\" \"\\\"\" . store \/[^\"\\n]+\/ . del \"\\\"\" \"\\\"\"\n (* \" relax, emacs *)\n\n(* Variable: int *)\nlet int = \/[0-9]+\/\n\n\n(************************************************************************\n * Group: ENTRIES AND OPTIONS\n *************************************************************************)\n\n\n(* View: entry_int\n * This matches an entry which takes a single integer for an argument\n *)\nlet entry_int (canon:string) (re:regexp) =\n [ indent . del re canon . label canon . sep_spc . store int . eol ]\n\n(* View: entry_rgb\n * This matches an entry which takes 3 integers as arguments representing red,\n * green and blue components\n *)\nlet entry_rgb (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"red\" . sep_spc . store int ]\n . [ label \"green\" . sep_spc . store int ]\n . [ label \"blue\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_xy\n * This matches an entry which takes 2 integers as arguments representing X and\n * Y coordinates\n *)\nlet entry_xy (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"x\" . sep_spc . store int ]\n . [ label \"y\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_str\n * This matches an entry which takes a single quoted string\n *)\nlet entry_str (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . sep_spc . quoted_string_val . eol ]\n\n(* View: entry_generic\n * An entry without a specific handler. Store everything after the keyword,\n * cropping whitespace at both ends.\n *)\nlet entry_generic = [ indent . key generic_entry_re\n . sep_spc . store to_eol . eol ]\n\n(* View: option *)\nlet option = [ indent . del \/[oO]ption\/ \"Option\" . label \"Option\" . sep_spc\n . quoted_string_val\n . [ label \"value\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: screen\n * The Screen entry of ServerLayout\n *)\nlet screen = [ indent . del \/[sS]creen\/ \"Screen\" . label \"Screen\" . sep_spc\n . [ label \"num\" . store int . sep_spc ]?\n . quoted_string_val\n . [ sep_spc . label \"position\" . store to_eol ]?\n . eol ]\n\n(* View: input_device *)\nlet input_device = [ indent . del \/[iI]nput[dD]evice\/ \"InputDevice\"\n . label \"InputDevice\" . sep_spc . quoted_string_val\n . [ label \"option\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: driver *)\nlet driver = entry_str \"Driver\" \/[dD]river\/\n\n(* View: identifier *)\nlet identifier = entry_str \"Identifier\" \/[iI]dentifier\/\n\n(* View: videoram *)\nlet videoram = entry_int \"VideoRam\" \/[vV]ideo[rR]am\/\n\n(* View: default_depth *)\nlet default_depth = entry_int \"DefaultDepth\" \/[dD]efault[dD]epth\/\n\n(* View: device *)\nlet device = entry_str \"Device\" \/[dD]evice\/\n\n(************************************************************************\n * Group: DISPLAY SUBSECTION\n *************************************************************************)\n\n\n(* View: display_modes *)\nlet display_modes = [ indent . del \/[mM]odes\/ \"Modes\" . label \"Modes\"\n . [ label \"mode\" . sep_spc . quoted_string_val ]+\n . eol ]\n\n(*************************************************************************\n * View: display_entry\n * Known values for entries in the Display subsection\n *\n * Definition:\n * > Depth depth\n * > FbBpp bpp\n * > Weight red-weight green-weight blue-weight\n * > Virtual xdim ydim\n * > ViewPort x0 y0\n * > Modes \"mode-name\" ...\n * > Visual \"visual-name\"\n * > Black red green blue\n * > White red green blue\n * > Options\n *)\n\nlet display_entry = entry_int \"Depth\" \/[dD]epth\/ |\n entry_int \"FbBpp\" \/[fF]b[bB]pp\/ |\n entry_rgb \"Weight\" \/[wW]eight\/ |\n entry_xy \"Virtual\" \/[vV]irtual\/ |\n entry_xy \"ViewPort\" \/[vV]iew[pP]ort\/ |\n display_modes |\n entry_str \"Visual\" \/[vV]isual\/ |\n entry_rgb \"Black\" \/[bB]lack\/ |\n entry_rgb \"White\" \/[wW]hite\/ |\n entry_str \"Options\" \/[oO]ptions\/ |\n empty |\n comment\n\n(* View: display *)\nlet display = [ indent . del \"SubSection\" \"SubSection\" . sep_spc\n . sep_dquote . key \"Display\" . sep_dquote\n . eol\n . display_entry*\n . indent . del \"EndSubSection\" \"EndSubSection\" . eol ]\n\n\n(************************************************************************\n * Group: SECTIONS\n *************************************************************************)\n\n\n(************************************************************************\n * Variable: section_re\n * Known values for Section names\n *\n * Definition:\n * > The section names are:\n * >\n * > Files File pathnames\n * > ServerFlags Server flags\n * > Module Dynamic module loading\n * > InputDevice Input device description\n * > Device Graphics device description\n * > VideoAdaptor Xv video adaptor description\n * > Monitor Monitor description\n * > Modes Video modes descriptions\n * > Screen Screen configuration\n * > ServerLayout Overall layout\n * > DRI DRI-specific configuration\n * > Vendor Vendor-specific configuration\n *************************************************************************)\nlet section_re = \/(Extensions|Files|ServerFlags|Module|InputDevice|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor)\/\n\n\n(************************************************************************\n * Variable: secton_re_obsolete\n * The following obsolete section names are still recognised for\n * compatibility purposes. In new config files, the InputDevice\n * section should be used instead.\n *\n * Definition:\n * > Keyboard Keyboard configuration\n * > Pointer Pointer\/mouse configuration\n *************************************************************************)\nlet section_re_obsolete = \/(Keyboard|Pointer)\/\n\n(* View: section_entry *)\nlet section_entry = option |\n screen |\n display |\n input_device |\n driver |\n identifier |\n videoram |\n default_depth |\n device |\n entry_generic |\n empty | comment\n\n(************************************************************************\n * View: section\n * A section in xorg.conf\n *\n * Definition:\n * > Section \"SectionName\"\n * > SectionEntry\n * > ...\n * > EndSection\n *************************************************************************)\nlet section = [ indent . del \"Section\" \"Section\"\n . sep_spc . sep_dquote\n . key (section_re|section_re_obsolete) . sep_dquote\n . eol\n . section_entry*\n . indent . del \"EndSection\" \"EndSection\" . eol ]\n\n(*\n * View: lns\n * The xorg.conf lens\n *)\nlet lns = ( empty | comment | section )*\n\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/X11\/xorg.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"60fce0b22e422bbfd1bb700740c9648d209c0228","subject":"switched the httpd.aug to the version from 1.2","message":"switched the httpd.aug to the version from 1.2\n","repos":"mrb\/letsencrypt,mrb\/letsencrypt,lbeltrame\/letsencrypt,letsencrypt\/letsencrypt,brentdax\/letsencrypt,Sveder\/letsencrypt,twstrike\/le_for_patching,dietsche\/letsencrypt,lbeltrame\/letsencrypt,VladimirTyrin\/letsencrypt,martindale\/letsencrypt,martindale\/letsencrypt,lmcro\/letsencrypt,DavidGarciaCat\/letsencrypt,kuba\/letsencrypt,letsencrypt\/letsencrypt,thanatos\/lets-encrypt-preview,stweil\/letsencrypt,sjerdo\/letsencrypt,piru\/letsencrypt,twstrike\/le_for_patching,brentdax\/letsencrypt,stweil\/letsencrypt,DavidGarciaCat\/letsencrypt,thanatos\/lets-encrypt-preview,wteiken\/letsencrypt,sjerdo\/letsencrypt,jtl999\/certbot,goofwear\/letsencrypt,TheBoegl\/letsencrypt,Sveder\/letsencrypt,jtl999\/certbot,bsmr-misc-forks\/letsencrypt,lmcro\/letsencrypt,mitnk\/letsencrypt,kuba\/letsencrypt,xgin\/letsencrypt,bsmr-misc-forks\/letsencrypt,wteiken\/letsencrypt,jsha\/letsencrypt,VladimirTyrin\/letsencrypt,jsha\/letsencrypt,mitnk\/letsencrypt,xgin\/letsencrypt,dietsche\/letsencrypt,goofwear\/letsencrypt,piru\/letsencrypt,TheBoegl\/letsencrypt","old_file":"letsencrypt-apache\/letsencrypt_apache\/httpd.aug","new_file":"letsencrypt-apache\/letsencrypt_apache\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\r\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\r\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^\\\\ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n (* opt_eol includes empty lines *)\n let opt_eol = del \/([ \\t]*#?\\r?\\n)*\/ \"\\n\" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . opt_eol . ((body|comment) . (body|empty|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"7b42b548ad93b1c64acb2bb5ba6d2b8eda8015c8","subject":"Shellvars: parse \/etc\/rc.conf.local which is found on OpenBSD.","message":"Shellvars: parse \/etc\/rc.conf.local which is found on OpenBSD.\n\nFixes ticket #320\n","repos":"hercules-team\/augeas-do-not-use,jjlin\/augeas,hercules-team\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,kunkku\/augeas,ptoscano\/augeas,pevalme\/augeas,dafugg\/augeas,mchf\/augeas,kunkku\/augeas,jasperla\/augeas,mchf\/augeas,pevalme\/augeas,kumy\/augeas,hercules-team\/augeas,jtopjian\/augeas,manandbytes\/augeas,lutter\/augeas,jtopjian\/augeas,kumy\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,mlichvar\/augeas,jasperla\/augeas,kumy\/augeas,manandbytes\/augeas,kumy\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,lutter\/augeas,pevalme\/augeas,lutter\/augeas,raphink\/augeas,ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,mlichvar\/augeas,jjlin\/augeas,jjlin\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3b1dcefe032fe5a6039f890af257a5b242d00778","subject":"Yum: also read files in \/etc\/yum\/pluginconf.d","message":"Yum: also read files in \/etc\/yum\/pluginconf.d\n","repos":"dafugg\/augeas,lutter\/augeas,raphink\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,kunkku\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,MikaelSmith\/augeas,jjlin\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,kumy\/augeas,kumy\/augeas,bkearney\/augeas,domcleal\/augeas,hercules-team\/augeas,domcleal\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,hercules-team\/augeas,bkearney\/augeas,lutter\/augeas,pevalme\/augeas,kumy\/augeas,jjlin\/augeas,jtopjian\/augeas,raphink\/augeas,manandbytes\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,lutter\/augeas,ptoscano\/augeas,pevalme\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,mchf\/augeas,bkearney\/augeas,manandbytes\/augeas,bkearney\/augeas,mchf\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,jasperla\/augeas,domcleal\/augeas,jjlin\/augeas","old_file":"lenses\/yum.aug","new_file":"lenses\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n let key_re = \/[^#;:= \\t\\n[\\\/]+\/ - \"baseurl\"\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/[ \\t]*(,[ \\t]*|\\n[ \\t]+)\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section = [ sechead . (entry* | entry* . (kv_list \"baseurl\") . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n let key_re = \/[^#;:= \\t\\n[\\\/]+\/ - \"baseurl\"\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/[ \\t]*(,[ \\t]*|\\n[ \\t]+)\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section = [ sechead . (entry* | entry* . (kv_list \"baseurl\") . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\") . (incl \"\/etc\/yum.repos.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7086741abd5e7080e1f5af572d8d28dcdbe14a62","subject":"Sudoers: add CSW paths, \/opt\/csw\/etc and \/etc\/opt\/csw\/sudoers","message":"Sudoers: add CSW paths, \/opt\/csw\/etc and \/etc\/opt\/csw\/sudoers\n","repos":"ptoscano\/augeas,pevalme\/augeas,mlichvar\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,mchf\/augeas,domcleal\/augeas,pevalme\/augeas,kumy\/augeas,kumy\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,manandbytes\/augeas,mchf\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas,jtopjian\/augeas,hercules-team\/augeas,ptoscano\/augeas,manandbytes\/augeas,domcleal\/augeas,dafugg\/augeas,raphink\/augeas,dafugg\/augeas,jjlin\/augeas,lutter\/augeas,jjlin\/augeas,raphink\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kunkku\/augeas,jtopjian\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . (incl \"\/opt\/csw\/etc\/sudoers\")\n . (incl \"\/etc\/opt\/csw\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\",# \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store (\/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ - \/include(dir)?.*\/) in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: comment_eol\nRequires a space before the # *)\nlet comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\nA <comment_eol> or <eol> *)\nlet comment_or_eol = comment_eol | (del \/([ \\t]+#\\n|[ \\t]*\\n)\/ \"\\n\")\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(* View: includedir *)\nlet includedir =\n [ key \/#include(dir)?\/ . Sep.space . store Rx.fspath . eol ]\n\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: parameter_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . comment_or_eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . comment_or_eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <includedirs>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | includedir | alias | defaults | spec )*\n\n(* View: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/usr\/local\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . (incl \"\/usr\/local\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3f71171a95178878ef583a67870c08b3807a9e65","subject":"Shellvars: add tests for semicolon handling","message":"Shellvars: add tests for semicolon handling\n","repos":"ptoscano\/augeas,kunkku\/augeas,dafugg\/augeas,mlichvar\/augeas,mlichvar\/augeas,mlichvar\/augeas,manandbytes\/augeas,lutter\/augeas,jjlin\/augeas,jjlin\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,ptoscano\/augeas,kumy\/augeas,MikaelSmith\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jasperla\/augeas,manandbytes\/augeas,mchf\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,jjlin\/augeas,lutter\/augeas,ptoscano\/augeas,hercules-team\/augeas,pevalme\/augeas,raphink\/augeas,mchf\/augeas,kumy\/augeas,lutter\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,pevalme\/augeas,kunkku\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\" = \"f\" } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\" = \"f\" } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\" = \"*debug*\"\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\" = \"${!LC_*}\" }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { }\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\" = \"ONBOOT\"\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\" = \"FOO\" }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\" = \"f\" } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\" = \"f\" } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\" = \"*debug*\"\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\" = \"${!LC_*}\" }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { }\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f625d429c04fda636c934ab340c33610c4910fa9","subject":"Fix indentation in augeas lens","message":"Fix indentation in augeas lens\n","repos":"roman-mueller\/puppet-puppetserver,olivierHa\/puppet-puppetserver,camptocamp\/puppet-puppetserver,camptocamp\/puppet-puppetserver,olivierHa\/puppet-puppetserver,roman-mueller\/puppet-puppetserver","old_file":"files\/lenses\/trapperkeeper.aug","new_file":"files\/lenses\/trapperkeeper.aug","new_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del \/[ \\t]*\/ \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n let opt_dquot = del \/\"?\/ \"\"\n\n(* View: simple *)\nlet simple = [ Util.indent . key Rx.word . sep_with_spc\n . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot\n . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . key Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . key Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\"\n . incl \"\/etc\/puppetlabs\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del \/[ \\t]*\/ \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n let opt_dquot = del \/\"?\/ \"\"\n\n(* View: simple *)\nlet simple = [ Util.indent . key Rx.word . sep_with_spc\n . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot\n . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . key Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . key Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\" . incl \"\/etc\/puppetlabs\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"89e05d3ec75fbce12c95ca0bad92f4ff9f935d1d","subject":"Support '+' in canonical maps (Fix #220)","message":"Support '+' in canonical maps (Fix #220)\n","repos":"camptocamp\/puppet-postfix,camptocamp\/puppet-postfix,alexjfisher\/puppet-postfix,alexjfisher\/puppet-postfix","old_file":"files\/lenses\/postfix_canonical.aug","new_file":"files\/lenses\/postfix_canonical.aug","new_contents":"(*\nModule: Postfix_Canonical\n Parses \/etc\/postfix\/*canonical\n\nAuthor: James Brown <jbrown@uber.com> based on work by Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 canonical` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/postfix\/*canonical. See <filter>.\n\nAbout: Examples\n The <Test_Postfix_Canonical> file contains various examples and tests.\n*)\n\nmodule Postfix_Canonical =\n\nautoload xfm\n\n(* Variable: space_or_eol_re *)\nlet space_or_eol_re = \/([ \\t]*\\n)?[ \\t]+\/\n\n(* View: space_or_eol *)\nlet space_or_eol (sep:regexp) (default:string) =\n del (space_or_eol_re? . sep . space_or_eol_re?) default \n\n(* View: word *)\nlet word = store \/[A-Za-z0-9@\\*.+-]+\/\n\n(* View: comma *)\nlet comma = space_or_eol \",\" \", \"\n\n(* View: destination *)\nlet destination = [ label \"destination\" . word ]\n\n(* View: record *)\nlet record = [ label \"pattern\" . word\n . space_or_eol Rx.space \" \" . destination\n . Util.eol ]\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | record)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/postfix\/*canonical\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Postfix_Canonical\n Parses \/etc\/postfix\/*canonical\n\nAuthor: James Brown <jbrown@uber.com> based on work by Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 canonical` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/postfix\/*canonical. See <filter>.\n\nAbout: Examples\n The <Test_Postfix_Canonical> file contains various examples and tests.\n*)\n\nmodule Postfix_Canonical =\n\nautoload xfm\n\n(* Variable: space_or_eol_re *)\nlet space_or_eol_re = \/([ \\t]*\\n)?[ \\t]+\/\n\n(* View: space_or_eol *)\nlet space_or_eol (sep:regexp) (default:string) =\n del (space_or_eol_re? . sep . space_or_eol_re?) default \n\n(* View: word *)\nlet word = store \/[A-Za-z0-9@\\*.-]+\/\n\n(* View: comma *)\nlet comma = space_or_eol \",\" \", \"\n\n(* View: destination *)\nlet destination = [ label \"destination\" . word ]\n\n(* View: record *)\nlet record = [ label \"pattern\" . word\n . space_or_eol Rx.space \" \" . destination\n . Util.eol ]\n\n(* View: lns *)\nlet lns = (Util.empty | Util.comment | record)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/postfix\/*canonical\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"6ee9e915d1e2a2dea01f2d2136cfe290d2349e10","subject":"Add a few files to shellvars.aug","message":"Add a few files to shellvars.aug\n","repos":"dafugg\/augeas,kunkku\/augeas,hercules-team\/augeas,jtopjian\/augeas,ptoscano\/augeas,dafugg\/augeas,raphink\/augeas,jtopjian\/augeas,kunkku\/augeas,mlichvar\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,MikaelSmith\/augeas,raphink\/augeas,mlichvar\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,mchf\/augeas,kumy\/augeas,hercules-team\/augeas,ptoscano\/augeas,domcleal\/augeas,jasperla\/augeas,pevalme\/augeas,mchf\/augeas,kumy\/augeas,domcleal\/augeas,jjlin\/augeas,kumy\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,ptoscano\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,lutter\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jasperla\/augeas,MikaelSmith\/augeas,pevalme\/augeas,manandbytes\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif? . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/updatedb.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif? . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c9916e010c1bd3545477c6f4c1cdf2fb062f0ca7","subject":"fix augeas lens on puppetserver.conf for issue #11","message":"fix augeas lens on puppetserver.conf for issue #11\n\nBUT IT WILL NOW BREAK IF YOU TRY TO USE THE LENS ON ca.conf\n","repos":"mmckinst\/puppet-puppetserver","old_file":"files\/lenses\/trapperkeeper.aug","new_file":"files\/lenses\/trapperkeeper.aug","new_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del \/[ \\t]*\/ \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n let opt_dquot = del \/\"?\/ \"\"\n\n(* View: simple *)\nlet simple = [ Util.indent . key Rx.word . sep_with_spc\n . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot\n . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . key Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . key Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\"\n . incl \"\/etc\/puppetlabs\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del \/[ \\t]*\/ \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n let opt_dquot = del \/\"?\/ \"\"\n\n(* View: simple *)\nlet simple = [ Util.indent . key Rx.word . sep_with_spc\n . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot\n . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . opt_dquot . store \/[^,\"\\[ \\t\\n]+\/ . opt_dquot ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . key Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . key Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\"\n . incl \"\/etc\/puppetlabs\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"9c52a0b258f77394c9ade6c032e00b49bd01f949","subject":"Mke2fs: add old_bitmaps option in [options] (#662)","message":"Mke2fs: add old_bitmaps option in [options] (#662)\n\nSeen it used by mke2fs(8), so it must be handled as well.","repos":"hercules-team\/augeas,mlichvar\/augeas,ptoscano\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,ptoscano\/augeas,mlichvar\/augeas","old_file":"lenses\/mke2fs.aug","new_file":"lenses\/mke2fs.aug","new_contents":"(*\nModule: Mke2fs\n Parses \/etc\/mke2fs.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 mke2fs.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/mke2fs.conf. See <filter>.\n*)\n\n\nmodule Mke2fs =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n\n(* View: sep *)\nlet sep = IniFile.sep \/=[ \\t]*\/ \"=\"\n\n(* View: empty *)\nlet empty = IniFile.empty\n\n(* View: boolean\n The configuration parser of e2fsprogs recognizes different values\n for booleans, so list all the recognized values *)\nlet boolean = (\"y\"|\"yes\"|\"true\"|\"t\"|\"1\"|\"on\"|\"n\"|\"no\"|\"false\"|\"nil\"|\"0\"|\"off\")\n\n\n(************************************************************************\n * Group: RECORD TYPES\n *************************************************************************)\n\n\n(* View: entry\n A generic entry for lens lns *)\nlet entry (kw:regexp) (lns:lens) = Build.key_value_line kw sep lns\n\n\n(* View: list_sto\n A list of values with given lens *)\nlet list_sto (kw:regexp) (lns:lens) = counter \"item\" .\n entry kw\n (Build.opt_list \n [lns]\n Sep.comma)\n\n(* View: entry_sto\n Store a regexp as entry value *)\nlet entry_sto (kw:regexp) (val:regexp) = entry kw (store val)\n\n\n(************************************************************************\n * Group: COMMON ENTRIES\n *************************************************************************)\n\n(* View: common_entries_list\n Entries with a list value *)\nlet common_entries_list = (\"base_features\"|\"default_features\"|\"default_mntopts\")\n\n(* View: common_entries_int\n Entries with an integer value *)\nlet common_entries_int = (\"cluster_size\"|\"flex_bg_size\"|\"force_undo\"\n |\"inode_ratio\"|\"inode_size\"|\"num_backup_sb\")\n\n(* View: common_entries_bool\n Entries with a boolean value *)\nlet common_entries_bool = (\"auto_64-bit_support\"|\"discard\"\n |\"enable_periodic_fsck\"|\"lazy_itable_init\"\n |\"lazy_journal_init\"|\"packed_meta_blocks\")\n\n(* View: common_entries_string\n Entries with a string value *)\nlet common_entries_string = (\"encoding\"|\"journal_location\")\n\n(* View: common_entries_double\n Entries with a double value *)\nlet common_entries_double = (\"reserved_ratio\")\n\n(* View: common_entry\n Entries shared between <defaults> and <fs_types> sections *)\nlet common_entry = list_sto common_entries_list (key Rx.word)\n | entry_sto common_entries_int Rx.integer\n | entry_sto common_entries_bool boolean\n | entry_sto common_entries_string Rx.word\n | entry_sto common_entries_double Rx.decimal\n | entry_sto \"blocksize\" (\"-\"? . Rx.integer)\n | entry_sto \"hash_alg\" (\"legacy\"|\"half_md4\"|\"tea\")\n | entry_sto \"errors\" (\"continue\"|\"remount-ro\"|\"panic\")\n | list_sto \"features\"\n ([del \/\\^\/ \"^\" . label \"disable\"]?\n . key Rx.word)\n | list_sto \"options\"\n (key Rx.word . Util.del_str \"=\"\n . store Rx.word)\n\n(************************************************************************\n * Group: DEFAULTS SECTION\n *************************************************************************)\n\n(* View: defaults_entry\n Possible entries under the <defaults> section *)\nlet defaults_entry = entry_sto \"fs_type\" Rx.word\n | entry_sto \"undo_dir\" Rx.fspath\n \n(* View: defaults_title\n Title for the <defaults> section *)\nlet defaults_title = IniFile.title \"defaults\"\n\n(* View: defaults\n A defaults section *)\nlet defaults = IniFile.record defaults_title\n ((Util.indent . (defaults_entry|common_entry)) | comment)\n\n\n(************************************************************************\n * Group: FS_TYPES SECTION\n *************************************************************************)\n\n(* View: fs_types_record\n Fs group records under the <fs_types> section *)\nlet fs_types_record = [ label \"filesystem\"\n . Util.indent . store Rx.word\n . del \/[ \\t]*=[ \\t]*\\{[ \\t]*\\n\/ \" = {\\n\"\n . ((Util.indent . common_entry) | empty | comment)*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \" }\\n\" ]\n\n(* View: fs_types_title\n Title for the <fs_types> section *)\nlet fs_types_title = IniFile.title \"fs_types\"\n\n(* View: fs_types\n A fs_types section *)\nlet fs_types = IniFile.record fs_types_title\n (fs_types_record | comment)\n\n\n(************************************************************************\n * Group: OPTIONS SECTION\n *************************************************************************)\n\n(* View: options_entries_int\n Entries with an integer value *)\nlet options_entries_int = (\"proceed_delay\"|\"sync_kludge\")\n\n(* View: options_entries_bool\n Entries with a boolean value *)\nlet options_entries_bool = (\"old_bitmaps\")\n\n(* View: options_entry\n Possible entries under the <options> section *)\nlet options_entry = entry_sto options_entries_int Rx.integer\n | entry_sto options_entries_bool boolean\n\n(* View: defaults_title\n Title for the <options> section *)\nlet options_title = IniFile.title \"options\"\n\n(* View: options\n A options section *)\nlet options = IniFile.record options_title\n ((Util.indent . options_entry) | comment)\n\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns\n The mke2fs lens\n*)\nlet lns = (empty|comment)* . (defaults|fs_types|options)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/mke2fs.conf\"\n\nlet xfm = transform lns filter\n\n\n","old_contents":"(*\nModule: Mke2fs\n Parses \/etc\/mke2fs.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 mke2fs.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/mke2fs.conf. See <filter>.\n*)\n\n\nmodule Mke2fs =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n\n(* View: sep *)\nlet sep = IniFile.sep \/=[ \\t]*\/ \"=\"\n\n(* View: empty *)\nlet empty = IniFile.empty\n\n(* View: boolean\n The configuration parser of e2fsprogs recognizes different values\n for booleans, so list all the recognized values *)\nlet boolean = (\"y\"|\"yes\"|\"true\"|\"t\"|\"1\"|\"on\"|\"n\"|\"no\"|\"false\"|\"nil\"|\"0\"|\"off\")\n\n\n(************************************************************************\n * Group: RECORD TYPES\n *************************************************************************)\n\n\n(* View: entry\n A generic entry for lens lns *)\nlet entry (kw:regexp) (lns:lens) = Build.key_value_line kw sep lns\n\n\n(* View: list_sto\n A list of values with given lens *)\nlet list_sto (kw:regexp) (lns:lens) = counter \"item\" .\n entry kw\n (Build.opt_list \n [lns]\n Sep.comma)\n\n(* View: entry_sto\n Store a regexp as entry value *)\nlet entry_sto (kw:regexp) (val:regexp) = entry kw (store val)\n\n\n(************************************************************************\n * Group: COMMON ENTRIES\n *************************************************************************)\n\n(* View: common_entries_list\n Entries with a list value *)\nlet common_entries_list = (\"base_features\"|\"default_features\"|\"default_mntopts\")\n\n(* View: common_entries_int\n Entries with an integer value *)\nlet common_entries_int = (\"cluster_size\"|\"flex_bg_size\"|\"force_undo\"\n |\"inode_ratio\"|\"inode_size\"|\"num_backup_sb\")\n\n(* View: common_entries_bool\n Entries with a boolean value *)\nlet common_entries_bool = (\"auto_64-bit_support\"|\"discard\"\n |\"enable_periodic_fsck\"|\"lazy_itable_init\"\n |\"lazy_journal_init\"|\"packed_meta_blocks\")\n\n(* View: common_entries_string\n Entries with a string value *)\nlet common_entries_string = (\"encoding\"|\"journal_location\")\n\n(* View: common_entries_double\n Entries with a double value *)\nlet common_entries_double = (\"reserved_ratio\")\n\n(* View: common_entry\n Entries shared between <defaults> and <fs_types> sections *)\nlet common_entry = list_sto common_entries_list (key Rx.word)\n | entry_sto common_entries_int Rx.integer\n | entry_sto common_entries_bool boolean\n | entry_sto common_entries_string Rx.word\n | entry_sto common_entries_double Rx.decimal\n | entry_sto \"blocksize\" (\"-\"? . Rx.integer)\n | entry_sto \"hash_alg\" (\"legacy\"|\"half_md4\"|\"tea\")\n | entry_sto \"errors\" (\"continue\"|\"remount-ro\"|\"panic\")\n | list_sto \"features\"\n ([del \/\\^\/ \"^\" . label \"disable\"]?\n . key Rx.word)\n | list_sto \"options\"\n (key Rx.word . Util.del_str \"=\"\n . store Rx.word)\n\n(************************************************************************\n * Group: DEFAULTS SECTION\n *************************************************************************)\n\n(* View: defaults_entry\n Possible entries under the <defaults> section *)\nlet defaults_entry = entry_sto \"fs_type\" Rx.word\n | entry_sto \"undo_dir\" Rx.fspath\n \n(* View: defaults_title\n Title for the <defaults> section *)\nlet defaults_title = IniFile.title \"defaults\"\n\n(* View: defaults\n A defaults section *)\nlet defaults = IniFile.record defaults_title\n ((Util.indent . (defaults_entry|common_entry)) | comment)\n\n\n(************************************************************************\n * Group: FS_TYPES SECTION\n *************************************************************************)\n\n(* View: fs_types_record\n Fs group records under the <fs_types> section *)\nlet fs_types_record = [ label \"filesystem\"\n . Util.indent . store Rx.word\n . del \/[ \\t]*=[ \\t]*\\{[ \\t]*\\n\/ \" = {\\n\"\n . ((Util.indent . common_entry) | empty | comment)*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \" }\\n\" ]\n\n(* View: fs_types_title\n Title for the <fs_types> section *)\nlet fs_types_title = IniFile.title \"fs_types\"\n\n(* View: fs_types\n A fs_types section *)\nlet fs_types = IniFile.record fs_types_title\n (fs_types_record | comment)\n\n\n(************************************************************************\n * Group: OPTIONS SECTION\n *************************************************************************)\n\n(* View: options_entries_int\n Entries with an integer value *)\nlet options_entries_int = (\"proceed_delay\"|\"sync_kludge\")\n\n(* View: options_entry\n Possible entries under the <options> section *)\nlet options_entry = entry_sto options_entries_int Rx.integer\n\n(* View: defaults_title\n Title for the <options> section *)\nlet options_title = IniFile.title \"options\"\n\n(* View: options\n A options section *)\nlet options = IniFile.record options_title\n ((Util.indent . options_entry) | comment)\n\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns\n The mke2fs lens\n*)\nlet lns = (empty|comment)* . (defaults|fs_types|options)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/mke2fs.conf\"\n\nlet xfm = transform lns filter\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ec1384f578fd3f591bff473dc7b874c3caae9506","subject":"Rewrite xinetd.aug with Build, Sep, Rx","message":"Rewrite xinetd.aug with Build, Sep, Rx\n","repos":"jjlin\/augeas,ptoscano\/augeas,kumy\/augeas,mlichvar\/augeas,mchf\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,kunkku\/augeas,lutter\/augeas,kunkku\/augeas,raphink\/augeas,jasperla\/augeas,mlichvar\/augeas,kumy\/augeas,dafugg\/augeas,lutter\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,raphink\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,MikaelSmith\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,mchf\/augeas,jasperla\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,kumy\/augeas,ptoscano\/augeas,kunkku\/augeas,manandbytes\/augeas,ptoscano\/augeas,kumy\/augeas,dafugg\/augeas,pevalme\/augeas,jjlin\/augeas,jtopjian\/augeas,jjlin\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,lutter\/augeas","old_file":"lenses\/xinetd.aug","new_file":"lenses\/xinetd.aug","new_contents":"(*\n * Module: Xinetd\n * Parses xinetd configuration files\n *\n * The structure of the lens and allowed attributes are ripped directly\n * from xinetd's parser in xinetd\/parse.c in xinetd's source checkout\n * The downside of being so precise here is that if attributes are added\n * they need to be added here, too. Writing a catchall entry, and getting\n * to typecheck correctly would be a huge pain.\n *\n * A really enterprising soul could tighten this down even further by\n * restricting the acceptable values for each attribute.\n *\n * Author: David Lutterkort\n *)\n\nmodule Xinetd =\n autoload xfm\n\n let op = ([ label \"add\" . Util.delim \"+=\" ]\n |[ label \"del\" . Util.delim \"-=\" ]\n | Sep.space_equal)\n\n let value = store Rx.no_spaces\n\n let indent = del Rx.opt_space \"\\t\"\n\n let attr_one (n:regexp) =\n Build.key_value n Sep.space_equal value\n\n let attr_lst (n:regexp) (op_eq: lens) =\n let value_entry = [ label \"value\" . value ] in\n Build.key_value n op_eq (Build.opt_list value_entry Sep.space)\n\n let attr_lst_eq (n:regexp) = attr_lst n Sep.space_equal\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Variable: service_attr\n * Note:\n * It is much faster to combine, for example, all the attr_one\n * attributes into one regexp and pass that to a lens instead of\n * using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter\n * causes the type checker to work _very_ hard.\n *)\n let service_attr =\n attr_one (\"socket_type\" | \"protocol\" | \"wait\" | \"user\" | \"group\"\n |\"server\" | \"instances\" | \"rpc_version\" | \"rpc_number\"\n | \"id\" | \"port\" | \"nice\" | \"banner\" | \"bind\" | \"interface\"\n | \"per_source\" | \"groups\" | \"banner_success\" | \"banner_fail\"\n | \"disable\" | \"max_load\" | \"rlimit_as\" | \"rlimit_cpu\"\n | \"rlimit_data\" | \"rlimit_rss\" | \"rlimit_stack\" | \"v6only\"\n | \"deny_time\" | \"umask\" | \"mdns\" | \"libwrap\")\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\"server_args\" | \"log_type\" | \"access_times\" | \"type\"\n | \"flags\" | \"redirect\" | \"cps\")\n |attr_lst_op ( \"log_on_success\" | \"log_on_failure\"| \"only_from\"\n | \"no_access\" | \"env\" | \"passenv\")\n\n let default_attr =\n attr_one ( \"instances\" | \"banner\" | \"bind\" | \"interface\" | \"per_source\"\n | \"groups\" | \"banner_success\" | \"banner_fail\" | \"max_load\"\n | \"v6only\" | \"umask\" | \"mdns\")\n |attr_lst_eq \"cps\" (* really only two values, not a whole list *)\n |attr_lst_op ( \"log_type\" | \"log_on_success\" | \"log_on_failure\" | \"disabled\"\n | \"no_access\" | \"only_from\" | \"passenv\" | \"enabled\" )\n\n (* View: body\n * Note:\n * We would really like to say \"the body can contain any of a list\n * of a list of attributes, each of them at most once\"; but that\n * would require that we build a lens that matches the permutation\n * of all attributes; with around 40 individual attributes, that's\n * not computationally feasible, even if we didn't have to worry\n * about how to write that down. The resulting regular expressions\n * would simply be prohibitively large.\n *)\n let body (attr:lens) =\n let entry = indent . attr . Util.eol in\n let comment = indent . Util.comment_noindent in\n Build.block_generic entry entry entry entry (* ignore noindent and noeol *)\n comment comment (* ignore noindent and noeol *)\n \/[ \\t\\n]+\\{[ \\t]*\\n\/ \/[ \\t]*\\}\/ (* force newlines *)\n \"\\n{\\n\" \"}\" (* force newlines *)\n\n (* View: includes\n * Note:\n * It would be nice if we could use the directories given in include and\n * includedir directives to parse additional files instead of hardcoding\n * all the places where xinetd config files can be found; but that is\n * currently not possible, and implementing that has a good amount of\n * hairy corner cases to consider.\n *)\n let includes =\n Build.key_value_line \/include(dir)?\/ Sep.space (store Rx.no_spaces)\n\n let service =\n let sto_re = \/[^# \\t\\n\\\/]+\/ in\n Build.key_value_line \"service\" Sep.space (store sto_re . body service_attr)\n\n let defaults = [ key \"defaults\" . body default_attr . Util.eol ]\n\n let lns = ( Util.empty | Util.comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\n * Module: Xinetd\n * Parses xinetd configuration files\n *\n * The structure of the lens and allowed attributes are ripped directly\n * from xinetd's parser in xinetd\/parse.c in xinetd's source checkout\n * The downside of being so precise here is that if attributes are added\n * they need to be added here, too. Writing a catchall entry, and getting\n * to typecheck correctly would be a huge pain.\n *\n * A really enterprising soul could tighten this down even further by\n * restricting the acceptable values for each attribute.\n *\n * Author: David Lutterkort\n *)\n\nmodule Xinetd =\n autoload xfm\n\n let comment = Util.comment\n let empty = Util.empty\n\n let name = key \/[^ \\t\\n\\\/=+-]+\/\n let bol_spc = del \/[ \\t]*\/ \"\\t\"\n let spc = del \/[ \\t]+\/ \" \"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let op_delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/) (\" \" . op . \" \")\n let eq = op_delim \"=\"\n\n let op = ([ label \"add\" . op_delim \"+=\" ]\n |[ label \"del\" . op_delim \"-=\" ]\n | eq)\n\n let value = store \/[^ \\t\\n]+\/\n\n let attr_one (n:regexp) =\n [ bol_spc . key n . eq . value . eol ]\n\n let attr_lst (n:regexp) (op_eq: lens) =\n [ bol_spc . key n . op_eq .\n [label \"value\" . value] . [label \"value\" . spc . value]* .\n eol ]\n\n let attr_lst_eq (n:regexp) = attr_lst n eq\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Variable: service_attr\n * Note:\n * It is much faster to combine, for example, all the attr_one\n * attributes into one regexp and pass that to a lens instead of\n * using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter\n * causes the type checker to work _very_ hard.\n *)\n\n let service_attr =\n attr_one (\"socket_type\" | \"protocol\" | \"wait\" | \"user\" | \"group\"\n |\"server\" | \"instances\" | \"rpc_version\" | \"rpc_number\"\n | \"id\" | \"port\" | \"nice\" | \"banner\" | \"bind\" | \"interface\"\n | \"per_source\" | \"groups\" | \"banner_success\" | \"banner_fail\"\n | \"disable\" | \"max_load\" | \"rlimit_as\" | \"rlimit_cpu\"\n | \"rlimit_data\" | \"rlimit_rss\" | \"rlimit_stack\" | \"v6only\"\n | \"deny_time\" | \"umask\" | \"mdns\" | \"libwrap\")\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\"server_args\" | \"log_type\" | \"access_times\" | \"type\"\n | \"flags\" | \"redirect\" | \"cps\")\n |attr_lst_op ( \"log_on_success\" | \"log_on_failure\"| \"only_from\"\n | \"no_access\" | \"env\" | \"passenv\")\n\n let default_attr =\n attr_one ( \"instances\" | \"banner\" | \"bind\" | \"interface\" | \"per_source\"\n | \"groups\" | \"banner_success\" | \"banner_fail\" | \"max_load\"\n | \"v6only\" | \"umask\" | \"mdns\")\n |attr_lst_eq \"cps\" (* really only two values, not a whole list *)\n |attr_lst_op ( \"log_type\" | \"log_on_success\" | \"log_on_failure\" | \"disabled\"\n | \"no_access\" | \"only_from\" | \"passenv\" | \"enabled\" )\n\n (* View: body\n * Note:\n * We would really like to say \"the body can contain any of a list\n * of a list of attributes, each of them at most once\"; but that\n * would require that we build a lens that matches the permutation\n * of all attributes; with around 40 individual attributes, that's\n * not computationally feasible, even if we didn't have to worry\n * about how to write that down. The resulting regular expressions\n * would simply be prohibitively large.\n *)\n let body (attr:lens) = del \/\\n\\{[ \\t]*\\n\/ \"\\n{\\n\"\n . (empty|comment|attr)*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n (* View: includes\n * Note:\n * It would be nice if we could use the directories given in include and\n * includedir directives to parse additional files instead of hardcoding\n * all the places where xinetd config files can be found; but that is\n * currently not possible, and implementing that has a good amount of\n * hairy corner cases to consider.\n *)\n let includes = [ key \/include|includedir\/\n . Util.del_ws_spc . store \/[^ \\t\\n]+\/ . eol ]\n\n let service =\n let sto_re = \/[^# \\t\\n\\\/]+\/ in\n [ key \"service\" . Sep.space . store sto_re . body service_attr ]\n\n let defaults = [ key \"defaults\" . del \/[ \\t]*\/ \"\" . body default_attr ]\n\n let lns = ( empty | comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"508cf2bde5338a1fd19daa2cd176694e61ebe6b5","subject":"Spacevars: add two more filse to parse by default","message":"Spacevars: add two more filse to parse by default\n\nFixes ticket #202\n","repos":"lutter\/augeas,mchf\/augeas,manandbytes\/augeas,hercules-team\/augeas,dafugg\/augeas,hercules-team\/augeas,jasperla\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,domcleal\/augeas,jtopjian\/augeas,dafugg\/augeas,manandbytes\/augeas,mlichvar\/augeas,dafugg\/augeas,jjlin\/augeas,pevalme\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas,pevalme\/augeas,kumy\/augeas,ptoscano\/augeas,kunkku\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,kumy\/augeas,raphink\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,mchf\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas,jasperla\/augeas,domcleal\/augeas,ptoscano\/augeas,jjlin\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,jjlin\/augeas","old_file":"lenses\/spacevars.aug","new_file":"lenses\/spacevars.aug","new_contents":"(* Spacevars module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man interfaces\n This is a generic lens for simple key\/value configuration files where\n keys and values are separated by a sequence of spaces or tabs.\n\n*)\n\nmodule Spacevars =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\n\nlet entry (kw:regexp)\n = [ key kw . spc . sto_to_eol . eol ]\nlet entry_re = \/[A-Za-z0-9\\._-]+(\\[[0-9]+\\])?\/\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns (entry:lens) = (comment|empty|entry) *\n\nlet simple_lns = lns (entry entry_re)\n\n(* configuration files that can be parsed without customizing the lens *)\nlet filter = Util.stdexcl\n . incl \"\/etc\/havp\/havp.config\"\n . incl \"\/etc\/ldap.conf\"\n . incl \"\/etc\/ldap\/ldap.conf\"\n . incl \"\/etc\/libnss-ldap.conf\"\n . incl \"\/etc\/pam_ldap.conf\"\n\nlet xfm = transform simple_lns filter\n","old_contents":"(* Spacevars module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man interfaces\n This is a generic lens for simple key\/value configuration files where\n keys and values are separated by a sequence of spaces or tabs.\n\n*)\n\nmodule Spacevars =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\n\nlet entry (kw:regexp)\n = [ key kw . spc . sto_to_eol . eol ]\nlet entry_re = \/[A-Za-z0-9\\._-]+(\\[[0-9]+\\])?\/\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns (entry:lens) = (comment|empty|entry) *\n\nlet simple_lns = lns (entry entry_re)\n\n(* configuration files that can be parsed without customizing the lens *)\nlet filter = Util.stdexcl\n . incl \"\/etc\/havp\/havp.config\"\n . incl \"\/etc\/ldap.conf\"\n . incl \"\/etc\/ldap\/ldap.conf\"\n\nlet xfm = transform simple_lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5b289aa498c0c26ae46dc419050e36c8b20a2a91","subject":"Inifile: support empty comments","message":"Inifile: support empty comments\n\nEmpty comments are lines beginning with \";\" or \"#\" but without any more text\n","repos":"camptocamp\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,camptocamp\/augeas,dafugg\/augeas,jjlin\/augeas,jasperla\/augeas,kunkku\/augeas,pevalme\/augeas,camptocamp\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,camptocamp\/augeas,mchf\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,bkearney\/augeas,jtopjian\/augeas,kumy\/augeas,mchf\/augeas,hercules-team\/augeas,bkearney\/augeas,pevalme\/augeas,ptoscano\/augeas,bkearney\/augeas,hercules-team\/augeas,bkearney\/augeas,kumy\/augeas,kumy\/augeas,lutter\/augeas,mlichvar\/augeas,kunkku\/augeas,kumy\/augeas,lutter\/augeas,dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,raphink\/augeas,jjlin\/augeas,manandbytes\/augeas,manandbytes\/augeas,domcleal\/augeas,dafugg\/augeas,mlichvar\/augeas,mlichvar\/augeas,jtopjian\/augeas,pevalme\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/inifile.aug","new_file":"lenses\/inifile.aug","new_contents":"(* IniFile generic module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* TODO: Support double quotes in value *)\n\nmodule IniFile =\n\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Internal primitives *)\nlet eol = Util.eol\nlet empty = [ eol ]\n\n\n(* Define sep and defaults *)\nlet sep (pat:regexp) (default:string) \n = Util.del_opt_ws \"\" . del pat default\nlet sep_re = \/[=:]\/\nlet sep_default = \"=\"\n\n\n(* Define sto_* *)\nlet sto_to_eol = Util.del_opt_ws \"\"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet sto_to_comment = Util.del_opt_ws \"\"\n . store \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n\n(* Define comment and defaults *)\nlet comment (pat:regexp) (default:string)\n = [ label \"#comment\" . sep pat default\n\t\t . sto_to_eol? . eol ]\nlet comment_re = \/[;#]\/\nlet comment_default = \";\"\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\n(* entry includes comments *)\n\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9\\._-]+\/ - \/#comment\/ )\n\n\n(************************************************************************\n * RECORD \n *************************************************************************)\n\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\nlet record_re = ( \/[^]\\n\\\/]+\/ - \/#comment\/ ) \nlet record_label_re = \/[^]\\n]+\/\n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n","old_contents":"(* IniFile generic module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* TODO: Support double quotes in value *)\n\nmodule IniFile =\n\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Internal primitives *)\nlet eol = Util.eol\nlet empty = [ eol ]\n\n\n(* Define sep and defaults *)\nlet sep (pat:regexp) (default:string) \n = Util.del_opt_ws \"\" . del pat default\nlet sep_re = \/[=:]\/\nlet sep_default = \"=\"\n\n\n(* Define sto_* *)\nlet sto_to_eol = Util.del_opt_ws \"\"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet sto_to_comment = Util.del_opt_ws \"\"\n . store \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n\n(* Define comment and defaults *)\nlet comment (pat:regexp) (default:string)\n = [ label \"#comment\" . sep pat default\n\t\t . sto_to_eol . eol ]\nlet comment_re = \/[;#]\/\nlet comment_default = \";\"\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\n(* entry includes comments *)\n\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9\\._-]+\/ - \/#comment\/ )\n\n\n(************************************************************************\n * RECORD \n *************************************************************************)\n\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\nlet record_re = ( \/[^]\\n\\\/]+\/ - \/#comment\/ ) \nlet record_label_re = \/[^]\\n]+\/\n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f568a2f04ee385f40b5ad7bec269d078cf240244","subject":"Support \\r\\n in xml.aug","message":"Support \\r\\n in xml.aug\n","repos":"kumy\/augeas,raphink\/augeas,mlichvar\/augeas,hercules-team\/augeas,mlichvar\/augeas,mchf\/augeas,pevalme\/augeas,domcleal\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,pevalme\/augeas,ptoscano\/augeas,kumy\/augeas,jjlin\/augeas,domcleal\/augeas,jasperla\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,lutter\/augeas,kumy\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,mchf\/augeas,jtopjian\/augeas,mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,kunkku\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,dafugg\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,jtopjian\/augeas,lutter\/augeas,kumy\/augeas,manandbytes\/augeas,jasperla\/augeas","old_file":"lenses\/xml.aug","new_file":"lenses\/xml.aug","new_contents":"(* XML lens for Augeas\n Author: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\n Reference: http:\/\/www.w3.org\/TR\/2006\/REC-xml11-20060816\/\n*)\n\nmodule Xml =\n\nautoload xfm\n\n(************************************************************************\n * Utilities lens\n *************************************************************************)\n\nlet dels (s:string) = del s s\nlet spc = \/[ \\t\\r\\n]+\/\nlet osp = \/[ \\t\\r\\n]*\/\nlet sep_spc = del \/[ \\t\\r\\n]+\/ \" \"\nlet sep_osp = del \/[ \\t\\r\\n]*\/ \"\"\nlet sep_eq = del \/[ \\t\\r\\n]*=[ \\t\\r\\n]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\nlet char = \/.|(\\r?\\n)\/\n(* if we hide the quotes, then we can only accept single or double quotes *)\n(* otherwise a put ambiguity is raised *)\nlet sto_dquote = dels \"\\\"\" . store \/[^\"]*\/ . dels \"\\\"\"\nlet sto_squote = dels \"'\" . store \/[^']*\/ . dels \"'\"\n\nlet comment = [ label \"#comment\" .\n dels \"<!--\" .\n store \/([^-]|-[^-])*\/ .\n dels \"-->\" ]\n\nlet pi_target = nmtoken - \/[Xx][Mm][Ll]\/\nlet empty = Util.empty\nlet del_end = del \/>[\\r?\\n]?\/ \">\\n\"\nlet del_end_simple = dels \">\"\n\n(* This is siplified version of processing instruction\n * pi has to not start or end with a white space and the string\n * must not contain \"?>\". We restrict too much by not allowing any\n * \"?\" nor \">\" in PI\n *)\nlet pi = \/[^ \\r\\n\\t]|[^ \\r\\n\\t][^?>]*[^ \\r\\n\\t]\/\n\n(************************************************************************\n * Attributes\n *************************************************************************)\n\n\nlet decl = [ label \"#decl\" . sep_spc .\n store \/[^> \\t\\n\\r]|[^> \\t\\n\\r][^>\\t\\n\\r]*[^> \\t\\n\\r]\/ ]\n\nlet decl_def (r:regexp) (b:lens) = [ dels \"<\" . key r .\n sep_spc . store word .\n b . sep_osp . del_end_simple ]\n\nlet elem_def = decl_def \/!ELEMENT\/ decl\n\nlet enum = \"(\" . osp . nmtoken . ( osp . \"|\" . osp . nmtoken )* . osp . \")\"\n\nlet att_type = \/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS\/ |\n enum\n\nlet id_def = [ sep_spc . key \/PUBLIC\/ .\n [ label \"#literal\" . sep_spc . sto_dquote ]* ] |\n [ sep_spc . key \/SYSTEM\/ . sep_spc . sto_dquote ]\n\nlet notation_def = decl_def \/!NOTATION\/ id_def\n\nlet att_def = counter \"att_id\" .\n [ sep_spc . seq \"att_id\" .\n [ label \"#name\" . store word . sep_spc ] .\n [ label \"#type\" . store att_type . sep_spc ] .\n ([ key \/#REQUIRED|#IMPLIED\/ ] |\n [ label \"#FIXED\" . del \/#FIXED[ \\r\\n\\t]*|\/ \"\" . sto_dquote ]) ]*\n\nlet att_list_def = decl_def \/!ATTLIST\/ att_def\n\nlet entity_def = decl_def \/!ENTITY\/ ([sep_spc . label \"#decl\" . sto_dquote ])\n\nlet decl_def_item = elem_def | entity_def | att_list_def | notation_def\n\nlet decl_outer = sep_osp . del \/\\[[ \\n\\t\\r]*\/ \"[\\n\" .\n (decl_def_item . sep_osp )* . dels \"]\"\n\n(* let dtd_def = [ sep_spc . key \"SYSTEM\" . sep_spc . sto_dquote ] *)\n\nlet doctype = decl_def \/!DOCTYPE\/ (decl_outer|id_def)\n\nlet attributes = [ label \"#attribute\" .\n [ sep_spc . key nmtoken . sep_eq . sto_dquote ]+ ]\n\nlet prolog = [ label \"#declaration\" .\n dels \"<?xml\" .\n attributes .\n sep_osp .\n dels \"?>\" ]\n\n\n(************************************************************************\n * Tags\n *************************************************************************)\n\n(* we consider entities as simple text *)\nlet text_re = \/[^<]+\/ - \/([^<]*\\]\\]>[^<]*)\/\nlet text = [ label \"#text\" . store text_re ]\nlet cdata = [ label \"#CDATA\" . dels \"<![CDATA[\" .\n store (char* - (char* . \"]]>\" . char*)) . dels \"]]>\" ]\n\nlet element (body:lens) =\n let h = attributes? . sep_osp . dels \">\" . body* . dels \"<\/\" in\n [ dels \"<\" . square nmtoken h . sep_osp . del_end ]\n\nlet empty_element = [ dels \"<\" . key nmtoken . value \"#empty\" .\n attributes? . sep_osp . del \/\\\/>[\\r?\\n]?\/ \"\/>\\n\" ]\n\nlet pi_instruction = [ dels \"<?\" . label \"#pi\" .\n [ label \"#target\" . store pi_target ] .\n [ sep_spc . label \"#instruction\" . store pi ]? .\n sep_osp . del \/\\?>\/ \"?>\" ]\n\n(* Typecheck is weaker on rec lens, detected by unfolding *)\n(*\nlet content1 = element text\nlet rec content2 = element (content1|text|comment)\n*)\n\nlet rec content = element (text|comment|content|empty_element|pi_instruction)\n\n(* Constraints are weaker here, but it's better than being too strict *)\nlet doc = (sep_osp . (prolog | comment | doctype | pi_instruction))* .\n ((sep_osp . content) | (sep_osp . empty_element)) .\n (sep_osp . (comment | pi_instruction ))* . sep_osp\n\nlet lns = doc\n\nlet filter = (incl \"\/etc\/xml\/*.xml\")\n . (incl \"\/etc\/xml\/catalog\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* XML lens for Augeas\n Author: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\n Reference: http:\/\/www.w3.org\/TR\/2006\/REC-xml11-20060816\/\n*)\n\nmodule Xml =\n\nautoload xfm\n\n(************************************************************************\n * Utilities lens\n *************************************************************************)\n\nlet dels (s:string) = del s s\nlet spc = \/[ \\t\\n]+\/\nlet osp = \/[ \\t\\n]*\/\nlet sep_spc = del \/[ \\t\\n]+\/ \" \"\nlet sep_osp = del \/[ \\t\\n]*\/ \"\"\nlet sep_eq = del \/[ \\t\\n]*=[ \\t\\n]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\nlet char = \/.|\\n\/\n(* if we hide the quotes, then we can only accept single or double quotes *)\n(* otherwise a put ambiguity is raised *)\nlet sto_dquote = dels \"\\\"\" . store \/[^\"]*\/ . dels \"\\\"\"\nlet sto_squote = dels \"'\" . store \/[^']*\/ . dels \"'\"\n\nlet comment = [ label \"#comment\" .\n dels \"<!--\" .\n store \/([^-]|-[^-])*\/ .\n dels \"-->\" ]\n\nlet pi_target = nmtoken - \/[Xx][Mm][Ll]\/\nlet empty = Util.empty\nlet del_end = del \/>[\\n]?\/ \">\\n\"\nlet del_end_simple = dels \">\"\n\n(* This is siplified version of processing instruction\n * pi has to not start or end with a white space and the string\n * must not contain \"?>\". We restrict too much by not allowing any\n * \"?\" nor \">\" in PI\n *)\nlet pi = \/[^ \\n\\t]|[^ \\n\\t][^?>]*[^ \\n\\t]\/\n\n(************************************************************************\n * Attributes\n *************************************************************************)\n\n\nlet decl = [ label \"#decl\" . sep_spc .\n store \/[^> \\t\\n\\r]|[^> \\t\\n\\r][^>\\t\\n\\r]*[^> \\t\\n\\r]\/ ]\n\nlet decl_def (r:regexp) (b:lens) = [ dels \"<\" . key r .\n sep_spc . store word .\n b . sep_osp . del_end_simple ]\n\nlet elem_def = decl_def \/!ELEMENT\/ decl\n\nlet enum = \"(\" . osp . nmtoken . ( osp . \"|\" . osp . nmtoken )* . osp . \")\"\n\nlet att_type = \/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS\/ |\n enum\n\nlet id_def = [ sep_spc . key \/PUBLIC\/ .\n [ label \"#literal\" . sep_spc . sto_dquote ]* ] |\n [ sep_spc . key \/SYSTEM\/ . sep_spc . sto_dquote ]\n\nlet notation_def = decl_def \/!NOTATION\/ id_def\n\nlet att_def = counter \"att_id\" .\n [ sep_spc . seq \"att_id\" .\n [ label \"#name\" . store word . sep_spc ] .\n [ label \"#type\" . store att_type . sep_spc ] .\n ([ key \/#REQUIRED|#IMPLIED\/ ] |\n [ label \"#FIXED\" . del \/#FIXED[ \\n\\t]*|\/ \"\" . sto_dquote ]) ]*\n\nlet att_list_def = decl_def \/!ATTLIST\/ att_def\n\nlet entity_def = decl_def \/!ENTITY\/ ([sep_spc . label \"#decl\" . sto_dquote ])\n\nlet decl_def_item = elem_def | entity_def | att_list_def | notation_def\n\nlet decl_outer = sep_osp . del \/\\[[ \\n\\t\\r]*\/ \"[\\n\" .\n (decl_def_item . sep_osp )* . dels \"]\"\n\n(* let dtd_def = [ sep_spc . key \"SYSTEM\" . sep_spc . sto_dquote ] *)\n\nlet doctype = decl_def \/!DOCTYPE\/ (decl_outer|id_def)\n\nlet attributes = [ label \"#attribute\" .\n [ sep_spc . key nmtoken . sep_eq . sto_dquote ]+ ]\n\nlet prolog = [ label \"#declaration\" .\n dels \"<?xml\" .\n attributes .\n sep_osp .\n dels \"?>\" ]\n\n\n(************************************************************************\n * Tags\n *************************************************************************)\n\n(* we consider entities as simple text *)\nlet text_re = \/[^<]+\/ - \/([^<]*\\]\\]>[^<]*)\/\nlet text = [ label \"#text\" . store text_re ]\nlet cdata = [ label \"#CDATA\" . dels \"<![CDATA[\" .\n store (char* - (char* . \"]]>\" . char*)) . dels \"]]>\" ]\n\nlet element (body:lens) =\n let h = attributes? . sep_osp . dels \">\" . body* . dels \"<\/\" in\n [ dels \"<\" . square nmtoken h . sep_osp . del_end ]\n\nlet empty_element = [ dels \"<\" . key nmtoken . value \"#empty\" .\n attributes? . sep_osp . del \/\\\/>[\\n]?\/ \"\/>\\n\" ]\n\nlet pi_instruction = [ dels \"<?\" . label \"#pi\" .\n [ label \"#target\" . store pi_target ] .\n [ sep_spc . label \"#instruction\" . store pi ]? .\n sep_osp . del \/\\?>\/ \"?>\" ]\n\n(* Typecheck is weaker on rec lens, detected by unfolding *)\n(*\nlet content1 = element text\nlet rec content2 = element (content1|text|comment)\n*)\n\nlet rec content = element (text|comment|content|empty_element|pi_instruction)\n\n(* Constraints are weaker here, but it's better than being too strict *)\nlet doc = (sep_osp . (prolog | comment | doctype | pi_instruction))* .\n ((sep_osp . content) | (sep_osp . empty_element)) .\n (sep_osp . (comment | pi_instruction ))* . sep_osp\n\nlet lns = doc\n\nlet filter = (incl \"\/etc\/xml\/*.xml\")\n . (incl \"\/etc\/xml\/catalog\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"262e5eab6e467960caf7f1cfb0d7efe120851faa","subject":"Build: remove unused indent definition","message":"Build: remove unused indent definition\n","repos":"pevalme\/augeas,mlichvar\/augeas,pevalme\/augeas,jjlin\/augeas,mchf\/augeas,jtopjian\/augeas,jtopjian\/augeas,jasperla\/augeas,jjlin\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,lutter\/augeas,mlichvar\/augeas,mchf\/augeas,jasperla\/augeas,dafugg\/augeas,dafugg\/augeas,mlichvar\/augeas,raphink\/augeas,manandbytes\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,lutter\/augeas,kunkku\/augeas,raphink\/augeas,ptoscano\/augeas,manandbytes\/augeas,ptoscano\/augeas,dafugg\/augeas,pevalme\/augeas,kunkku\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,jjlin\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/build.aug","new_file":"lenses\/build.aug","new_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n\n(************************************************************************\n * Group: BLOCK CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: block_generic\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should include <Util.empty>\n * or its equivalent if necessary.\n * entry_noindent:lens - the entry to be stored inside the block,\n * without indentation.\n * This entry should not include <Util.empty>\n * entry_noeol:lens - the entry to be stored inside the block,\n * without eol.\n * This entry should not include <Util.empty>\n * entry_noindent_noeol:lens - the entry to be stored inside the block,\n * without indentation or eol.\n * This entry should not include <Util.empty>\n * comment:lens - the comment lens used in the block\n * comment_noindent:lens - the comment lens used in the block,\n * without indentation.\n * ldelim_re:regexp - regexp for the left delimiter\n * rdelim_re:regexp - regexp for the right delimiter\n * ldelim_default:string - default value for the left delimiter\n * rdelim_default:string - default value for the right delimiter\n ************************************************************************)\nlet block_generic\n (entry:lens) (entry_noindent:lens)\n (entry_noeol:lens) (entry_noindent_noeol:lens)\n (comment:lens) (comment_noindent:lens)\n (ldelim_re:regexp) (rdelim_re:regexp)\n (ldelim_default:string) (rdelim_default:string) =\n let block_single = entry_noindent_noeol | comment_noindent\n in let block_start = entry_noindent | comment_noindent\n in let block_middle = (entry | comment)*\n in let block_end = entry_noeol | comment\n in del ldelim_re ldelim_default\n . ( ( block_start . block_middle . block_end )\n | block_single )\n . del rdelim_re rdelim_default\n\n(************************************************************************\n * View: block_setdefault\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n * ldelim_re:regexp - regexp for the left delimiter\n * rdelim_re:regexp - regexp for the left delimiter\n * ldelim_default:string - default value for the left delimiter\n * rdelim_default:string - default value for the right delimiter\n ************************************************************************)\nlet block_setdelim (entry:lens)\n (ldelim_re:regexp)\n (rdelim_re:regexp)\n (ldelim_default:string)\n (rdelim_default:string) =\n block_generic (Util.empty | Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n ldelim_re rdelim_re\n ldelim_default rdelim_default\n\n(* Variable: block_ldelim_re *)\nlet block_ldelim_re = \/[ \\t\\n]+\\{[ \\t\\n]*\/\n\n(* Variable: block_rdelim_re *)\nlet block_rdelim_re = \/[ \\t\\n]*\\}\/\n\n(* Variable: block_ldelim_default *)\nlet block_ldelim_default = \" {\\n\"\n\n(* Variable: block_rdelim_default *)\nlet block_rdelim_default = \"}\"\n\n(************************************************************************\n * View: block\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block (entry:lens) = block_setdelim entry\n block_ldelim_re block_rdelim_re\n block_ldelim_default block_rdelim_default\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * View: named_block\n * A named <block> enclosed in brackets\n *\n * Parameters:\n * kw:regexp - the regexp for the block name\n * entry:lens - the entry to be stored inside the block\n * this entry should not include <Util.empty>\n ************************************************************************)\nlet named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]\n\n\n(************************************************************************\n * Group: COMBINATORICS\n ************************************************************************)\n\n(************************************************************************\n * View: combine_two_ord\n * Combine two lenses, ensuring first lens is first\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n ************************************************************************)\nlet combine_two_ord (a:lens) (b:lens) = a . b\n\n(************************************************************************\n * View: combine_two\n * Combine two lenses\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n ************************************************************************)\nlet combine_two (a:lens) (b:lens) =\n combine_two_ord a b | combine_two_ord b a\n\n(************************************************************************\n * View: combine_two_opt_ord\n * Combine two lenses optionally, ensuring first lens is first\n * (a, and optionally b)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n ************************************************************************)\nlet combine_two_opt_ord (a:lens) (b:lens) = a . b?\n\n(************************************************************************\n * View: combine_two_opt\n * Combine two lenses optionally\n * (either a, b, or both, in any order)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n ************************************************************************)\nlet combine_two_opt (a:lens) (b:lens) =\n combine_two_opt_ord a b | combine_two_opt_ord b a\n\n(************************************************************************\n * View: combine_three_ord\n * Combine three lenses, ensuring first lens is first\n * (a followed by either b, c, in any order)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n * c:lens - the third lens\n ************************************************************************)\nlet combine_three_ord (a:lens) (b:lens) (c:lens) =\n combine_two_ord a (combine_two b c)\n\n(************************************************************************\n * View: combine_three\n * Combine three lenses\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n * c:lens - the third lens\n ************************************************************************)\nlet combine_three (a:lens) (b:lens) (c:lens) =\n combine_three_ord a b c\n | combine_three_ord b a c\n | combine_three_ord c b a\n\n\n(************************************************************************\n * View: combine_three_opt_ord\n * Combine three lenses optionally, ensuring first lens is first\n * (a followed by either b, c, or any of them, in any order)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n * c:lens - the third lens\n ************************************************************************)\nlet combine_three_opt_ord (a:lens) (b:lens) (c:lens) =\n combine_two_opt_ord a (combine_two_opt b c)\n\n(************************************************************************\n * View: combine_three_opt\n * Combine three lenses optionally\n * (either a, b, c, or any of them, in any order)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n * c:lens - the third lens\n ************************************************************************)\nlet combine_three_opt (a:lens) (b:lens) (c:lens) =\n combine_three_opt_ord a b c\n | combine_three_opt_ord b a c\n | combine_three_opt_ord c b a\n\n","old_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n\n(************************************************************************\n * Group: BLOCK CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: block_generic\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should include <Util.empty>\n * or its equivalent if necessary.\n * entry_noindent:lens - the entry to be stored inside the block,\n * without indentation.\n * This entry should not include <Util.empty>\n * entry_noeol:lens - the entry to be stored inside the block,\n * without eol.\n * This entry should not include <Util.empty>\n * entry_noindent_noeol:lens - the entry to be stored inside the block,\n * without indentation or eol.\n * This entry should not include <Util.empty>\n * comment:lens - the comment lens used in the block\n * comment_noindent:lens - the comment lens used in the block,\n * without indentation.\n * ldelim_re:regexp - regexp for the left delimiter\n * rdelim_re:regexp - regexp for the right delimiter\n * ldelim_default:string - default value for the left delimiter\n * rdelim_default:string - default value for the right delimiter\n ************************************************************************)\nlet block_generic\n (entry:lens) (entry_noindent:lens)\n (entry_noeol:lens) (entry_noindent_noeol:lens)\n (comment:lens) (comment_noindent:lens)\n (ldelim_re:regexp) (rdelim_re:regexp)\n (ldelim_default:string) (rdelim_default:string) =\n let block_single = entry_noindent_noeol | comment_noindent\n in let block_start = entry_noindent | comment_noindent\n in let block_middle = (entry | comment)*\n in let block_end = entry_noeol | comment\n in del ldelim_re ldelim_default\n . ( ( block_start . block_middle . block_end )\n | block_single )\n . del rdelim_re rdelim_default\n\n(************************************************************************\n * View: block_setdefault\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n * ldelim_re:regexp - regexp for the left delimiter\n * rdelim_re:regexp - regexp for the left delimiter\n * ldelim_default:string - default value for the left delimiter\n * rdelim_default:string - default value for the right delimiter\n ************************************************************************)\nlet block_setdelim (entry:lens)\n (ldelim_re:regexp)\n (rdelim_re:regexp)\n (ldelim_default:string)\n (rdelim_default:string) =\n block_generic (Util.empty | Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n ldelim_re rdelim_re\n ldelim_default rdelim_default\n\n(* Variable: block_ldelim_re *)\nlet block_ldelim_re = \/[ \\t\\n]+\\{[ \\t\\n]*\/\n\n(* Variable: block_rdelim_re *)\nlet block_rdelim_re = \/[ \\t\\n]*\\}\/\n\n(* Variable: block_ldelim_default *)\nlet block_ldelim_default = \" {\\n\"\n\n(* Variable: block_rdelim_default *)\nlet block_rdelim_default = \"}\"\n\n(************************************************************************\n * View: block\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block (entry:lens) = block_setdelim entry\n block_ldelim_re block_rdelim_re\n block_ldelim_default block_rdelim_default\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * View: named_block\n * A named <block> enclosed in brackets\n *\n * Parameters:\n * kw:regexp - the regexp for the block name\n * entry:lens - the entry to be stored inside the block\n * this entry should not include <Util.empty>\n ************************************************************************)\nlet named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]\n\n\n(************************************************************************\n * Group: COMBINATORICS\n ************************************************************************)\n\n(************************************************************************\n * View: combine_two_ord\n * Combine two lenses, ensuring first lens is first\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n ************************************************************************)\nlet combine_two_ord (a:lens) (b:lens) = a . b\n\n(************************************************************************\n * View: combine_two\n * Combine two lenses\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n ************************************************************************)\nlet combine_two (a:lens) (b:lens) =\n combine_two_ord a b | combine_two_ord b a\n\n(************************************************************************\n * View: combine_two_opt_ord\n * Combine two lenses optionally, ensuring first lens is first\n * (a, and optionally b)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n ************************************************************************)\nlet combine_two_opt_ord (a:lens) (b:lens) = a . b?\n\n(************************************************************************\n * View: combine_two_opt\n * Combine two lenses optionally\n * (either a, b, or both, in any order)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n ************************************************************************)\nlet combine_two_opt (a:lens) (b:lens) =\n combine_two_opt_ord a b | combine_two_opt_ord b a\n\n(************************************************************************\n * View: combine_three_ord\n * Combine three lenses, ensuring first lens is first\n * (a followed by either b, c, in any order)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n * c:lens - the third lens\n ************************************************************************)\nlet combine_three_ord (a:lens) (b:lens) (c:lens) =\n combine_two_ord a (combine_two b c)\n\n(************************************************************************\n * View: combine_three\n * Combine three lenses\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n * c:lens - the third lens\n ************************************************************************)\nlet combine_three (a:lens) (b:lens) (c:lens) =\n combine_three_ord a b c\n | combine_three_ord b a c\n | combine_three_ord c b a\n\n\n(************************************************************************\n * View: combine_three_opt_ord\n * Combine three lenses optionally, ensuring first lens is first\n * (a followed by either b, c, or any of them, in any order)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n * c:lens - the third lens\n ************************************************************************)\nlet combine_three_opt_ord (a:lens) (b:lens) (c:lens) =\n combine_two_opt_ord a (combine_two_opt b c)\n\n(************************************************************************\n * View: combine_three_opt\n * Combine three lenses optionally\n * (either a, b, c, or any of them, in any order)\n *\n * Parameters:\n * a:lens - the first lens\n * b:lens - the second lens\n * c:lens - the third lens\n ************************************************************************)\nlet combine_three_opt (a:lens) (b:lens) (c:lens) =\n combine_three_opt_ord a b c\n | combine_three_opt_ord b a c\n | combine_three_opt_ord c b a\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f99de5dfe072f20f4c2f7c79083c6ddd04aef26c","subject":"Added support for conf-available apache config file location","message":"Added support for conf-available apache config file location\n","repos":"lutter\/augeas,jjlin\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,jasperla\/augeas,ptoscano\/augeas,kunkku\/augeas,jtopjian\/augeas,pevalme\/augeas,jasperla\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,dafugg\/augeas,MikaelSmith\/augeas,pevalme\/augeas,jjlin\/augeas,mlichvar\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,lutter\/augeas,raphink\/augeas,raphink\/augeas,mlichvar\/augeas,dafugg\/augeas,mlichvar\/augeas,dafugg\/augeas,mchf\/augeas,pevalme\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas,mchf\/augeas,hercules-team\/augeas,manandbytes\/augeas,lutter\/augeas","old_file":"lenses\/httpd.aug","new_file":"lenses\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let eol_comment = Util.comment_generic \/[ \\t\\n]*#[ \\t]*\/ \"# \" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . (eol|eol_comment) . (body . (body|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/conf-available\/*.conf\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet cdot = \/\\\\\\\\.\/\nlet cl = \/\\\\\\\\\\n\/\nlet dquot =\n let no_dquot = \/[^\"\\\\\\r\\n]\/\n in \/\"\/ . (no_dquot|cdot|cl)* . \/\"\/\nlet squot =\n let no_squot = \/[^'\\\\\\r\\n]\/\n in \/'\/ . (no_squot|cdot|cl)* . \/'\/\nlet comp = \/[<>=]?=\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|comp|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let eol_comment = Util.comment_generic \/[ \\t\\n]*#[ \\t]*\/ \"# \" in\n let inner = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . (eol|eol_comment) . (body . (body|comment)*)? .\n indent . dels \"<\/\" in\n let kword = key word in\n let dword = del word \"a\" in\n [ indent . dels \"<\" . square kword inner dword . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b740b0a14d469f57b50a4a258c275a53ddbe3953","subject":"Fix syntax error in test","message":"Fix syntax error in test\n","repos":"jasperla\/augeas,GeoffWilliams\/augeas,kumy\/augeas,MikaelSmith\/augeas,kunkku\/augeas,jjlin\/augeas,mchf\/augeas,MikaelSmith\/augeas,domcleal\/augeas,ptoscano\/augeas,pevalme\/augeas,camptocamp\/augeas,manandbytes\/augeas,camptocamp\/augeas,kumy\/augeas,ptoscano\/augeas,raphink\/augeas,bkearney\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,kunkku\/augeas,ptoscano\/augeas,bkearney\/augeas,jtopjian\/augeas,lutter\/augeas,jasperla\/augeas,camptocamp\/augeas,pevalme\/augeas,jtopjian\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,pevalme\/augeas,domcleal\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,manandbytes\/augeas,bkearney\/augeas,jjlin\/augeas,kumy\/augeas,jjlin\/augeas,hercules-team\/augeas,mlichvar\/augeas,mchf\/augeas,dafugg\/augeas,hercules-team\/augeas,lutter\/augeas,bkearney\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,dafugg\/augeas,kunkku\/augeas","old_file":"tests\/modules\/fail_union_atype.aug","new_file":"tests\/modules\/fail_union_atype.aug","new_contents":"module Fail_union_atype =\n (* This is illegal, otherwise we don't know which alternative *)\n (* to take for a tree { \"a\" = \"?\" } *)\n\n let del_str (s:string) = del s s\n\n let lns = [ key \/a\/ . store \/b\/ . del_str \" (l)\" ]\n | [ key \/a\/ . store \/c\/ . del_str \" (r)\" ]\n\n (* To make this a passing test, make sure that this also works: *)\n (* test lns put \"ac (r)\" after set \"a\" \"b\" = \"ab (l)\" *)\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"module Fail_union_atype =\n (* This is illegal, otherwise we don't know which alternative *)\n (* to take for a tree { \"a\" = \"?\" } *)\n\n let del_str (s:string) = del s s\n\n let lns = [ key \/a\/ . store \/b\/ . del_str \" (l)\" \n | [ key \/a\/ . store \/c\/ . del_str \" (r)\" ]\n\n (* To make this a passing test, make sure that this also works: *)\n (* test lns put \"ac (r)\" after set \"a\" \"b\" = \"ab (l)\" *)\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1473eaa5175f52cd7389b0522d2e68d9f97fa15f","subject":"Add comments for NaturalDocs parsing Reorganize a bit","message":"Add comments for NaturalDocs parsing\nReorganize a bit\n","repos":"dafugg\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,hercules-team\/augeas,ptoscano\/augeas,raphink\/augeas,kunkku\/augeas,camptocamp\/augeas,domcleal\/augeas,manandbytes\/augeas,jjlin\/augeas,camptocamp\/augeas,kumy\/augeas,domcleal\/augeas,pevalme\/augeas,jjlin\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,pevalme\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,mlichvar\/augeas,bkearney\/augeas,jasperla\/augeas,domcleal\/augeas,bkearney\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas,lutter\/augeas,mchf\/augeas,camptocamp\/augeas,jjlin\/augeas,mchf\/augeas,bkearney\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,mlichvar\/augeas,dafugg\/augeas,camptocamp\/augeas,manandbytes\/augeas,lutter\/augeas,kunkku\/augeas,kunkku\/augeas,jasperla\/augeas,kumy\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/inifile.aug","new_file":"lenses\/inifile.aug","new_contents":"(*\nModule: IniFile\n Generic module to create INI files lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com> \n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: TODO\n Things to add in the future\n - Support double quotes in value\n - Support multiline values (is it standard?)\n\nAbout: Lens usage\n This lens is made to provide generic primitives to construct INI File lenses.\n See <Puppet>, <PHP>, <MySQL> or <Dput> for examples of real life lenses using it.\n\n*)\n\nmodule IniFile =\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Internal primitives *)\n\n(*\nVariable: eol\n End of line, inherited from <Util.eol>\n*)\nlet eol = Util.eol\n\n(*\nView: empty\n Empty line, an <eol> subnode\n*)\nlet empty = [ eol ]\n\n\n(* Group: Separators *)\n\n\n\n(*\nVariable: sep\n Generic separator\n\n Parameters: \n pat:regexp - the pattern to delete\n default:string - the default string to use\n*)\nlet sep (pat:regexp) (default:string) \n = Util.del_opt_ws \"\" . del pat default\n\n(*\nVariable: sep_re\n The default regexp for a separator\n*)\n\nlet sep_re = \/[=:]\/\n\n(*\nVariable: sep_default\n The default separator value\n*)\nlet sep_default = \"=\"\n\n\n(* Group: Stores *)\n\n\n(*\nVariable: sto_to_eol\n Store until end of line\n*)\nlet sto_to_eol = Util.del_opt_ws \"\"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n(*\nVariable: sto_to_comment\n Store until comment\n*)\nlet sto_to_comment = Util.del_opt_ws \"\"\n . store \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n\n(* Group: Define comment and defaults *)\n\n(*\nView: comment\n Map comments into \"#comment\" nodes\n\n Parameters:\n pat:regexp - pattern to delete before commented data\n default:string - default pattern before commented data\n\n Sample Usage:\n (start code)\n let comment = IniFile.comment \"#\" \"#\"\n let comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n (end code)\n*)\nlet comment (pat:regexp) (default:string)\n = [ label \"#comment\" . sep pat default\n\t\t . sto_to_eol? . eol ]\n(*\nVariable: comment_re\n Default regexp for <comment> pattern\n*)\n\nlet comment_re = \/[;#]\/\n\n(*\nVariable: comment_default\n Default value for <comment> pattern\n*)\nlet comment_default = \";\"\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Group: entry includes comments *)\n\n(*\nView: entry\n Generic INI File entry\n\n Parameters:\n kw:regexp - keyword regexp for the label\n sep:lens - lens to use as key\/value separator\n comment:lens - lens to use as comment\n\n Sample Usage:\n > let entry = IniFile.entry setting sep comment\n*)\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment\n\n(*\nVariable: entry_re\n Default regexp for <entry> keyword\n*)\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9\\._-]+\/ )\n\n\n(************************************************************************\n * Group: RECORD \n *************************************************************************)\n\n(* Group: Title definition *)\n\n(*\nView: title\n Title for <record>. This maps the title of a record as a node in the abstract tree.\n\n Parameters:\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title IniFile.record_re\n*)\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\n\n(*\nView: title_label\n Title for <record>. This maps the title of a record as a value in the abstract tree.\n\n Parameters:\n name:string - name for the title label\n kw:regexp - keyword regexp for the label\n\n Sample Usage:\n > let title = IniFile.title_label \"target\" IniFile.record_label_re\n*)\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\n\n(*\nVariable: record_re\n Default regexp for <title> keyword pattern\n*)\nlet record_re = ( \/[^]\\n\\\/]+\/ - \/#comment\/ ) \n\n(*\nVariable: record_label_re\n Default regexp for <title_label> keyword pattern\n*)\nlet record_label_re = \/[^]\\n]+\/\n\n\n(* Group: Record definition *)\n\n(*\nView: record_noempty\n INI File Record with no empty lines allowed.\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n*)\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\n\n(*\nView: record\n Generic INI File record\n\n Parameters:\n title:lens - lens to use for title. Use either <title> or <title_label>.\n entry:lens - lens to use for entries in the record. See <entry>.\n\n Sample Usage:\n > let record = IniFile.record title entry\n*)\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n\n(*\n\nGroup: Lens definition\n\nView: lns_noempty\n Generic INI File lens with no empty lines\n\n Parameters:\n record:lens - record lens to use. See <record_noempty>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns_noempty record comment\n*)\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\n\n(*\nView: lns\n Generic INI File lens\n \n Parameters:\n record:lens - record lens to use. See <record>.\n comment:lens - comment lens to use. See <comment>.\n\n Sample Usage:\n > let lns = IniFile.lns record comment\n*)\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n","old_contents":"(* IniFile generic module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* TODO: Support double quotes in value *)\n\nmodule IniFile =\n\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Internal primitives *)\nlet eol = Util.eol\nlet empty = [ eol ]\n\n\n(* Define sep and defaults *)\nlet sep (pat:regexp) (default:string) \n = Util.del_opt_ws \"\" . del pat default\nlet sep_re = \/[=:]\/\nlet sep_default = \"=\"\n\n\n(* Define sto_* *)\nlet sto_to_eol = Util.del_opt_ws \"\"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet sto_to_comment = Util.del_opt_ws \"\"\n . store \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n\n(* Define comment and defaults *)\nlet comment (pat:regexp) (default:string)\n = [ label \"#comment\" . sep pat default\n\t\t . sto_to_eol? . eol ]\nlet comment_re = \/[;#]\/\nlet comment_default = \";\"\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\n(* entry includes comments *)\n\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment\nlet entry_re = ( \/[A-Za-z][A-Za-z0-9\\._-]+\/ - \/#comment\/ )\n\n\n(************************************************************************\n * RECORD \n *************************************************************************)\n\nlet title (kw:regexp)\n = Util.del_str \"[\" . key kw\n . Util.del_str \"]\". eol\nlet title_label (name:string) (kw:regexp)\n = label name\n . Util.del_str \"[\" . store kw\n . Util.del_str \"]\". eol\n\nlet record_noempty (title:lens) (entry:lens)\n = [ title\n\t\t . entry* ]\nlet record (title:lens) (entry:lens)\n = record_noempty title ( entry | empty )\nlet record_re = ( \/[^]\\n\\\/]+\/ - \/#comment\/ ) \nlet record_label_re = \/[^]\\n]+\/\n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns_noempty (record:lens) (comment:lens)\n = comment* . record*\nlet lns (record:lens) (comment:lens)\n = lns_noempty record (comment|empty)\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f4818097bb9ff8c14608dfd60cffacab5d6f2f86","subject":"Sudoers: clean up comment definition","message":"Sudoers: clean up comment definition\n","repos":"pevalme\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,camptocamp\/augeas,hercules-team\/augeas,pevalme\/augeas,MikaelSmith\/augeas,mchf\/augeas,MikaelSmith\/augeas,kunkku\/augeas,lutter\/augeas,bkearney\/augeas,hercules-team\/augeas,jjlin\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,lutter\/augeas,domcleal\/augeas,kunkku\/augeas,bkearney\/augeas,dafugg\/augeas,jjlin\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,domcleal\/augeas,kumy\/augeas,pevalme\/augeas,manandbytes\/augeas,lutter\/augeas,kumy\/augeas,GeoffWilliams\/augeas,raphink\/augeas,kumy\/augeas,camptocamp\/augeas,bkearney\/augeas,jasperla\/augeas,ptoscano\/augeas,ptoscano\/augeas,mlichvar\/augeas,kumy\/augeas,raphink\/augeas,jasperla\/augeas,bkearney\/augeas,mlichvar\/augeas,mlichvar\/augeas,camptocamp\/augeas,domcleal\/augeas,mchf\/augeas,manandbytes\/augeas,camptocamp\/augeas,ptoscano\/augeas,kunkku\/augeas,dafugg\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(* Sudoers module for Augeas \n Author: Raphael Pinson <raphink@gmail.com> \n \n Reference: `man sudoers` \n This lens tries to keep as close as possible to `man sudoers` where possible. \n For example, recursive definitions such as:\n\n Cmnd_Spec_List ::= Cmnd_Spec |\n Cmnd_Spec ',' Cmnd_Spec_List\n\n are replaced by \n\n let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )* \n\n since Augeas cannot deal with recursive definitions.\n The definitions from `man sudoers` are put as commentaries for reference\n throughout the file. More information can be found in the manual.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\nlet indent = del \/[ \\t]+\/ \"\"\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \" \nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\nlet sep_com = sep_cont? . Util.del_str \",\" . sep_cont?\nlet sep_eq = sep_cont? . Util.del_str \"=\" . sep_cont?\nlet sep_col = sep_cont? . Util.del_str \":\" . sep_cont?\n\n(* Define fields *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n\\\\\\\\]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\nlet sto_to_com = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* sto_to_com does not begin or end with a space *)\n(* TODO: there could be a \\ in the middle of a command... *)\nlet sto_to_com_user = store ( \/[^,=:#() \\t\\n]+\/ \n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\nlet sto_to_spc = store \/[^() \\t\\n\\\\\\\\]+\/\n\n\n(* define comments and empty lines *)\nlet comment = \n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n \nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\" ]\n\n(************************************************************************\n * ALIASES\n *************************************************************************)\n\n(************************************************************************\n * User_Alias ::= NAME '=' User_List\n * Runas_Alias ::= NAME '=' Runas_List\n * Host_Alias ::= NAME '=' Host_List\n * Cmnd_Alias ::= NAME '=' Cmnd_List\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\nlet alias_list (kw:string) (sto:lens) = \n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * Alias_Type NAME = item1, item2, ... \n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent? . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n\n\n\n(************************************************************************\n * DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * Default_Type ::= 'Defaults' |\n * 'Defaults' '@' Host_List |\n * 'Defaults' ':' User_List |\n * 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type = \n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * Parameter ::= Parameter '=' Value |\n * Parameter '+=' Value |\n * Parameter '-=' Value |\n * '!'* Parameter\n *************************************************************************)\nlet parameter = \n let value = \/([^,:= \\t\\n\\\\\\\\][^,\\n\\\\\\\\]*[^, \\t\\n\\\\\\\\])|[^,:= \\t\\n\\\\\\\\]\/ in\n [ label \"parameter\" . store value ]\n\n(************************************************************************\n * Parameter_List ::= Parameter |\n * Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n \n(************************************************************************\n * Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent? . key \"Defaults\" . default_type? . sep_cont \n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * USER SPECIFICATION \n *************************************************************************)\n\n(************************************************************************\n * Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com \n . Util.del_str \")\" . sep_cont?\n\n(************************************************************************\n * Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * Cmnd_Spec_List ::= Cmnd_Spec |\n * Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com \n . sep_eq . cmnd_spec_list ]\n\nlet spec = [ label \"spec\" . indent?\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n \t . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = ( empty | comment | alias | defaults | spec )*\n\nlet filter = (incl \"\/etc\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Sudoers module for Augeas \n Author: Raphael Pinson <raphink@gmail.com> \n \n Reference: `man sudoers` \n This lens tries to keep as close as possible to `man sudoers` where possible. \n For example, recursive definitions such as:\n\n Cmnd_Spec_List ::= Cmnd_Spec |\n Cmnd_Spec ',' Cmnd_Spec_List\n\n are replaced by \n\n let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )* \n\n since Augeas cannot deal with recursive definitions.\n The definitions from `man sudoers` are put as commentaries for reference\n throughout the file. More information can be found in the manual.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\nlet indent = del \/[ \\t]+\/ \"\"\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \" \nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\nlet sep_com = sep_cont? . Util.del_str \",\" . sep_cont?\nlet sep_eq = sep_cont? . Util.del_str \"=\" . sep_cont?\nlet sep_col = sep_cont? . Util.del_str \":\" . sep_cont?\n\n(* Define fields *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n\\\\\\\\]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\nlet sto_to_com = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* sto_to_com does not begin or end with a space *)\n(* TODO: there could be a \\ in the middle of a command... *)\nlet sto_to_com_user = store ( \/[^,=:#() \\t\\n]+\/ \n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\nlet sto_to_spc = store \/[^() \\t\\n\\\\\\\\]+\/\n\n\n(* define comments and empty lines *)\nlet comment = \n let value_to_eol = del \/[ \\t]*\/ \" \" . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"comment\" . del \/[ \\t]*#\/ \"# \" . value_to_eol . eol ]\n \nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\" ]\n\n(************************************************************************\n * ALIASES\n *************************************************************************)\n\n(************************************************************************\n * User_Alias ::= NAME '=' User_List\n * Runas_Alias ::= NAME '=' Runas_List\n * Host_Alias ::= NAME '=' Host_List\n * Cmnd_Alias ::= NAME '=' Cmnd_List\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\nlet alias_list (kw:string) (sto:lens) = \n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * Alias_Type NAME = item1, item2, ... \n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent? . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n\n\n\n(************************************************************************\n * DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * Default_Type ::= 'Defaults' |\n * 'Defaults' '@' Host_List |\n * 'Defaults' ':' User_List |\n * 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type = \n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * Parameter ::= Parameter '=' Value |\n * Parameter '+=' Value |\n * Parameter '-=' Value |\n * '!'* Parameter\n *************************************************************************)\nlet parameter = \n let value = \/([^,:= \\t\\n\\\\\\\\][^,\\n\\\\\\\\]*[^, \\t\\n\\\\\\\\])|[^,:= \\t\\n\\\\\\\\]\/ in\n [ label \"parameter\" . store value ]\n\n(************************************************************************\n * Parameter_List ::= Parameter |\n * Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n \n(************************************************************************\n * Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent? . key \"Defaults\" . default_type? . sep_cont \n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * USER SPECIFICATION \n *************************************************************************)\n\n(************************************************************************\n * Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com \n . Util.del_str \")\" . sep_cont?\n\n(************************************************************************\n * Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * Cmnd_Spec_List ::= Cmnd_Spec |\n * Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com \n . sep_eq . cmnd_spec_list ]\n\nlet spec = [ label \"spec\" . indent?\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n \t . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = ( empty | comment | alias | defaults | spec )*\n\nlet filter = (incl \"\/etc\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8b23a3b319ce9d50bb485bc5f47d0276c57960db","subject":"Shellvars: Suse includes","message":"Shellvars: Suse includes\n\n* lenses\/shellvars.aug:\n added include for \/etc\/sysconfig\/network\/ifcfg-\n","repos":"lutter\/augeas,kumy\/augeas,manandbytes\/augeas,kumy\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,jasperla\/augeas,kunkku\/augeas,domcleal\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jtopjian\/augeas,pevalme\/augeas,domcleal\/augeas,lutter\/augeas,dafugg\/augeas,mchf\/augeas,dafugg\/augeas,pevalme\/augeas,ptoscano\/augeas,jasperla\/augeas,manandbytes\/augeas,domcleal\/augeas,lutter\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,hercules-team\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,jjlin\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,pevalme\/augeas,raphink\/augeas,dafugg\/augeas,raphink\/augeas,jjlin\/augeas,mlichvar\/augeas,mchf\/augeas,ptoscano\/augeas,kunkku\/augeas,mlichvar\/augeas,jjlin\/augeas,ptoscano\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let empty = Util.empty\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n let bquot = \/`[^`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . eol ]\n\n let unset = [ key \"unset\" . Util.del_ws_spc . store key_re . eol ]\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let lns = (comment | empty | source | kv | unset) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let empty = Util.empty\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n let bquot = \/`[^`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . eol ]\n\n let unset = [ key \"unset\" . Util.del_ws_spc . store key_re . eol ]\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let lns = (comment | empty | source | kv | unset) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e52822448adce88711ec12a25dc79f291b5f8e46","subject":"Shellvars: use sto_to_semicol in condition lens","message":"Shellvars: use sto_to_semicol in condition lens\n","repos":"mlichvar\/augeas,jjlin\/augeas,pevalme\/augeas,hercules-team\/augeas,dafugg\/augeas,ptoscano\/augeas,dafugg\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,mchf\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas,lutter\/augeas,manandbytes\/augeas,manandbytes\/augeas,dafugg\/augeas,kunkku\/augeas,ptoscano\/augeas,pevalme\/augeas,jjlin\/augeas,mchf\/augeas,ptoscano\/augeas,mlichvar\/augeas,lutter\/augeas,jjlin\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"|\\n\\\\# \\t]#*|\\\\\\\\(.|\\n)\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let condition =\n let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_to_semicol\n . Util.del_ws_spc . Util.del_str end\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let entry_eol =\n let entry_eol_item (item:lens) =\n [ item . comment_or_eol ] in\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol =\n let entry_item (item:lens) = [ item ] in\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n (* Delete a blank line, rather than mapping it *)\n let del_empty = del (Util.empty_generic_re . \"\\n\") \"\\n\"\n\n let empty = Util.empty\n let empty_part_re = Util.empty_generic_re . \/\\n+\/\n let eol = del (\/[ \\t]+|[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n let semicol_eol = del (\/[ \\t]*[;\\n]\/ . empty_part_re*) \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9A-Za-z_,]+\\])?\/ - (\"unset\" | \"export\")\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let eol_for_comment = del \/([ \\t]*\\n)([ \\t]*(#[ \\t]*)?\\n)*\/ \"\\n\"\n let comment = Util.comment_generic_seteol \/[ \\t]*#[ \\t]*\/ \" # \" eol_for_comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic_seteol \/[ \\t]+#[ \\t]*\/ \" # \" eol_for_comment\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;()'\"|\\n\\\\# \\t]#*|\\\\\\\\(.|\\n)\/\n let dquot =\n let char = \/[^\"\\\\]|\\\\\\\\.\/ | Rx.cl\n in \"\\\"\" . char* . \"\\\"\" (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]+`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\(\\)#\\n]*\\)\/\n let dollar_arithm = \/\\$\\(\\([^\\)#\\n]*\\)\\)\/\n\n let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot\n let sto_to_semicol = store (anyquot . (Rx.space . anyquot)*)\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store anyquot in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (anyquot | empty_array)?\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = Util.indent . export? . key key_re\n . eq . (simple_value | array)\n\n let var_action (name:string) =\n Util.indent . del name name . Util.del_ws_spc\n . label (\"@\" . name) . counter \"var_action\"\n . Build.opt_list [ seq \"var_action\" . store (key_re | matching_re) ] Util.del_ws_spc\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/\n\n let shell_builtin_cmds = \"ulimit\" | \"shift\" | \"exit\"\n\n let eval =\n Util.indent . Util.del_str \"eval\" . Util.del_ws_spc\n . label \"@eval\" . store anyquot\n\n let alias =\n Util.indent . Util.del_str \"alias\" . Util.del_ws_spc\n . label \"@alias\" . store key_re . eq\n . [ label \"value\" . store anyquot ]\n\n let builtin =\n Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . (Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ])?\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n\n let condition =\n let sto_cond = store \/[^[#; \\t\\n][^#;\\n]+[^]#; \\t\\n]|[^[]#; \\t\\n]+\/\n in let cond (start:string) (end:string) = [ label \"type\" . store start ]\n . Util.del_ws_spc . sto_cond\n . Util.del_ws_spc . Util.del_str end\n in Util.indent . label \"@condition\" . (cond \"[\" \"]\" | cond \"[[\" \"]]\")\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) (entry_noeol:lens) =\n let pattern = [ label \"@pattern\" . sto_to_semicol . Sep.opt_space ]\n in let case_entry = [ label \"@case_entry\"\n . Util.indent . pattern\n . (Util.del_str \"|\" . Sep.opt_space . pattern)*\n . Util.del_str \")\" . eol\n . entry* . entry_noeol?\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store (char+ | (\"\\\"\" . char+ . \"\\\"\"))\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let entry_eol =\n let entry_eol_item (item:lens) =\n [ item . comment_or_eol ] in\n entry_eol_item source\n | entry_eol_item kv\n | entry_eol_item unset\n | entry_eol_item bare_export\n | entry_eol_item builtin\n | entry_eol_item return\n | entry_eol_item condition\n | entry_eol_item eval\n | entry_eol_item alias\n\n let entry_noeol =\n let entry_item (item:lens) = [ item ] in\n entry_item source\n | entry_item kv\n | entry_item unset\n | entry_item bare_export\n | entry_item builtin\n | entry_item return\n | entry_item condition\n | entry_item eval\n | entry_item alias\n\n let rec rec_entry =\n let entry = comment | entry_eol | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry entry_noeol\n | function entry\n\n let lns_norec = del_empty* . (comment | entry_eol) *\n\n let lns = del_empty* . (comment | entry_eol | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"ip*tables.save\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\" .\n sc_excl \"*.systemd\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/grub_installdevice*\"\n . excl \"\/etc\/default\/rmt\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/firewalld\/firewalld.conf\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/periodic.conf\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/rc.conf.local\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/locale.conf\"\n . incl \"\/etc\/vconsole.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1305b06bd7772cfc1b85174b0eb7f263f4267959","subject":"bugfix\/#14 Parse single and double-quotes in XML prolog","message":"bugfix\/#14 Parse single and double-quotes in XML prolog\n","repos":"coi-gov-pl\/puppet-jboss,coi-gov-pl\/puppet-jboss,coi-gov-pl\/puppet-jboss","old_file":"files\/jbxml.aug","new_file":"files\/jbxml.aug","new_contents":"(* XML lens for Augeas\n Author: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\n Reference: http:\/\/www.w3.org\/TR\/2006\/REC-xml11-20060816\/\n\n This file is based on xml.aug lens from augeas v0.10.0\n*)\n\nmodule JBXml =\n\nautoload xfm\n\n(************************************************************************\n * Utilities lens\n *************************************************************************)\n\nlet dels (s:string) = del s s\nlet spc = \/[ \\t\\n]+\/\nlet osp = \/[ \\t\\n]*\/\nlet sep_spc = del \/[ \\t\\n]+\/ \" \"\nlet sep_osp = del \/[ \\t\\n]*\/ \"\"\nlet sep_eq = del \/[ \\t\\n]*=[ \\t\\n]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\nlet char = \/.|\\n\/\n(* if we hide the quotes, then we can only accept single or double quotes *)\n(* otherwise a put ambiguity is raised *)\nlet sto_dquote = dels \"\\\"\" . store \/[^\"]*\/ . dels \"\\\"\"\nlet sto_squote = dels \"'\" . store \/[^']*\/ . dels \"'\"\n\nlet comment = [ label \"#comment\" .\n dels \"<!--\" .\n store \/([^-]|-[^-])*\/ .\n dels \"-->\" ]\n\nlet pi_target = nmtoken - \/[Xx][Mm][Ll]\/\nlet empty = Util.empty\nlet del_end = del \/>[\\n]?\/ \">\\n\"\nlet del_end_simple = dels \">\"\n\n(* This is siplified version of processing instruction\n * pi has to not start or end with a white space and the string\n * must not contain \"?>\". We restrict too much by not allowing any\n * \"?\" nor \">\" in PI\n *)\nlet pi = \/[^ \\n\\t]|[^ \\n\\t][^?>]*[^ \\n\\t]\/\n\n(************************************************************************\n * Attributes\n *************************************************************************)\n\n\nlet decl = [ label \"#decl\" . sep_spc .\n store \/[^> \\t\\n\\r]|[^> \\t\\n\\r][^>\\t\\n\\r]*[^> \\t\\n\\r]\/ ]\n\nlet decl_def (r:regexp) (b:lens) = [ dels \"<\" . key r .\n sep_spc . store word .\n b . sep_osp . del_end_simple ]\n\nlet elem_def = decl_def \/!ELEMENT\/ decl\n\nlet enum = \"(\" . osp . nmtoken . ( osp . \"|\" . osp . nmtoken )* . osp . \")\"\n\nlet att_type = \/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS\/ |\n enum\n\nlet id_def = [ sep_spc . key \/PUBLIC\/ .\n [ label \"#literal\" . sep_spc . sto_dquote ]* ] |\n [ sep_spc . key \/SYSTEM\/ . sep_spc . sto_dquote ]\n\nlet notation_def = decl_def \/!NOTATION\/ id_def\n\nlet att_def = counter \"att_id\" .\n [ sep_spc . seq \"att_id\" .\n [ label \"#name\" . store word . sep_spc ] .\n [ label \"#type\" . store att_type . sep_spc ] .\n ([ key \/#REQUIRED|#IMPLIED\/ ] |\n [ label \"#FIXED\" . del \/#FIXED[ \\n\\t]*|\/ \"\" . sto_dquote ]) ]*\n\nlet att_list_def = decl_def \/!ATTLIST\/ att_def\n\nlet entity_def = decl_def \/!ENTITY\/ ([sep_spc . label \"#decl\" . sto_dquote ])\n\nlet decl_def_item = elem_def | entity_def | att_list_def | notation_def\n\nlet decl_outer = sep_osp . del \/\\[[ \\n\\t\\r]*\/ \"[\\n\" .\n (decl_def_item . sep_osp )* . dels \"]\"\n\n(* let dtd_def = [ sep_spc . key \"SYSTEM\" . sep_spc . sto_dquote ] *)\n\nlet doctype = decl_def \/!DOCTYPE\/ (decl_outer|id_def)\n\nlet attributes = [ label \"#attribute\" .\n [ sep_spc . key nmtoken . sep_eq . sto_dquote ]+ ]\nlet attributes_sq = [ label \"#attribute\" .\n [ sep_spc . key nmtoken . sep_eq . (sto_dquote|sto_squote) ]+ ]\n\n\nlet prolog = [ label \"#declaration\" .\n dels \"<?xml\" .\n attributes_sq .\n sep_osp .\n dels \"?>\" ]\n\n\n(************************************************************************\n * Tags\n *************************************************************************)\n\n(* we consider entities as simple text *)\nlet text_re = \/[^<]+\/ - \/([^<]*\\]\\]>[^<]*)\/\nlet text = [ label \"#text\" . store text_re ]\nlet cdata = [ label \"#CDATA\" . dels \"<![CDATA[\" .\n store (char* - (char* . \"]]>\" . char*)) . dels \"]]>\" ]\n\nlet element (body:lens) =\n let h = attributes? . sep_osp . dels \">\" . body* . dels \"<\/\" in\n [ dels \"<\" . square nmtoken h . sep_osp . del_end ]\n\nlet empty_element = [ dels \"<\" . key nmtoken . value \"#empty\" .\n attributes? . sep_osp . del \/\\\/>[\\n]?\/ \"\/>\\n\" ]\n\nlet pi_instruction = [ dels \"<?\" . label \"#pi\" .\n [ label \"#target\" . store pi_target ] .\n [ sep_spc . label \"#instruction\" . store pi ]? .\n sep_osp . del \/\\?>\/ \"?>\" ]\n\n(* Typecheck is weaker on rec lens, detected by unfolding *)\n(*\nlet content1 = element text\nlet rec content2 = element (content1|text|comment)\n*)\n\nlet rec content = element (text|comment|content|empty_element|pi_instruction)\n\n(* Constraints are weaker here, but it's better than being too strict *)\nlet doc = (sep_osp . (prolog | comment | doctype | pi_instruction))* .\n ((sep_osp . content) | (sep_osp . empty_element)) .\n (sep_osp . (comment | pi_instruction ))* . sep_osp\n\nlet lns = doc\n\nlet filter = (excl \"*\")\n\nlet xfm = transform lns filter\n","old_contents":"(* XML lens for Augeas\n Author: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\n Reference: http:\/\/www.w3.org\/TR\/2006\/REC-xml11-20060816\/\n*)\n\nmodule JBXml =\n\nautoload xfm\n\n(************************************************************************\n * Utilities lens\n *************************************************************************)\n\nlet dels (s:string) = del s s\nlet spc = \/[ \\t\\n]+\/\nlet osp = \/[ \\t\\n]*\/\nlet sep_spc = del \/[ \\t\\n]+\/ \" \"\nlet sep_osp = del \/[ \\t\\n]*\/ \"\"\nlet sep_eq = del \/[ \\t\\n]*=[ \\t\\n]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\nlet char = \/.|\\n\/\n(* if we hide the quotes, then we can only accept single or double quotes *)\n(* otherwise a put ambiguity is raised *)\nlet sto_dquote = dels \"\\\"\" . store \/[^\"]*\/ . dels \"\\\"\"\nlet sto_squote = dels \"'\" . store \/[^']*\/ . dels \"'\"\n\nlet comment = [ label \"#comment\" .\n dels \"<!--\" .\n store \/([^-]|-[^-])*\/ .\n dels \"-->\" ]\n\nlet pi_target = nmtoken - \/[Xx][Mm][Ll]\/\nlet empty = Util.empty\nlet del_end = del \/>[\\n]?\/ \">\\n\"\nlet del_end_simple = dels \">\"\n\n(* This is siplified version of processing instruction\n * pi has to not start or end with a white space and the string\n * must not contain \"?>\". We restrict too much by not allowing any\n * \"?\" nor \">\" in PI\n *)\nlet pi = \/[^ \\n\\t]|[^ \\n\\t][^?>]*[^ \\n\\t]\/\n\n(************************************************************************\n * Attributes\n *************************************************************************)\n\n\nlet decl = [ label \"#decl\" . sep_spc .\n store \/[^> \\t\\n\\r]|[^> \\t\\n\\r][^>\\t\\n\\r]*[^> \\t\\n\\r]\/ ]\n\nlet decl_def (r:regexp) (b:lens) = [ dels \"<\" . key r .\n sep_spc . store word .\n b . sep_osp . del_end_simple ]\n\nlet elem_def = decl_def \/!ELEMENT\/ decl\n\nlet enum = \"(\" . osp . nmtoken . ( osp . \"|\" . osp . nmtoken )* . osp . \")\"\n\nlet att_type = \/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS\/ |\n enum\n\nlet id_def = [ sep_spc . key \/PUBLIC\/ .\n [ label \"#literal\" . sep_spc . sto_dquote ]* ] |\n [ sep_spc . key \/SYSTEM\/ . sep_spc . sto_dquote ]\n\nlet notation_def = decl_def \/!NOTATION\/ id_def\n\nlet att_def = counter \"att_id\" .\n [ sep_spc . seq \"att_id\" .\n [ label \"#name\" . store word . sep_spc ] .\n [ label \"#type\" . store att_type . sep_spc ] .\n ([ key \/#REQUIRED|#IMPLIED\/ ] |\n [ label \"#FIXED\" . del \/#FIXED[ \\n\\t]*|\/ \"\" . sto_dquote ]) ]*\n\nlet att_list_def = decl_def \/!ATTLIST\/ att_def\n\nlet entity_def = decl_def \/!ENTITY\/ ([sep_spc . label \"#decl\" . sto_dquote ])\n\nlet decl_def_item = elem_def | entity_def | att_list_def | notation_def\n\nlet decl_outer = sep_osp . del \/\\[[ \\n\\t\\r]*\/ \"[\\n\" .\n (decl_def_item . sep_osp )* . dels \"]\"\n\n(* let dtd_def = [ sep_spc . key \"SYSTEM\" . sep_spc . sto_dquote ] *)\n\nlet doctype = decl_def \/!DOCTYPE\/ (decl_outer|id_def)\n\nlet attributes = [ label \"#attribute\" .\n [ sep_spc . key nmtoken . sep_eq . sto_dquote ]+ ]\nlet attributes_sq = [ label \"#attribute\" .\n [ sep_spc . key nmtoken . sep_eq . sto_squote ]+ ]\n\n\nlet prolog = [ label \"#declaration\" .\n dels \"<?xml\" .\n attributes_sq .\n sep_osp .\n dels \"?>\" ]\n\n\n(************************************************************************\n * Tags\n *************************************************************************)\n\n(* we consider entities as simple text *)\nlet text_re = \/[^<]+\/ - \/([^<]*\\]\\]>[^<]*)\/\nlet text = [ label \"#text\" . store text_re ]\nlet cdata = [ label \"#CDATA\" . dels \"<![CDATA[\" .\n store (char* - (char* . \"]]>\" . char*)) . dels \"]]>\" ]\n\nlet element (body:lens) =\n let h = attributes? . sep_osp . dels \">\" . body* . dels \"<\/\" in\n [ dels \"<\" . square nmtoken h . sep_osp . del_end ]\n\nlet empty_element = [ dels \"<\" . key nmtoken . value \"#empty\" .\n attributes? . sep_osp . del \/\\\/>[\\n]?\/ \"\/>\\n\" ]\n\nlet pi_instruction = [ dels \"<?\" . label \"#pi\" .\n [ label \"#target\" . store pi_target ] .\n [ sep_spc . label \"#instruction\" . store pi ]? .\n sep_osp . del \/\\?>\/ \"?>\" ]\n\n(* Typecheck is weaker on rec lens, detected by unfolding *)\n(*\nlet content1 = element text\nlet rec content2 = element (content1|text|comment)\n*)\n\nlet rec content = element (text|comment|content|empty_element|pi_instruction)\n\n(* Constraints are weaker here, but it's better than being too strict *)\nlet doc = (sep_osp . (prolog | comment | doctype | pi_instruction))* .\n ((sep_osp . content) | (sep_osp . empty_element)) .\n (sep_osp . (comment | pi_instruction ))* . sep_osp\n\nlet lns = doc\n\nlet filter = (excl \"*\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"7f59900d0a2b0cd7ef5413c56ff77abafce5bf3f","subject":"Yum: optimize regexp substractions","message":"Yum: optimize regexp substractions\n","repos":"jjlin\/augeas,hercules-team\/augeas,kumy\/augeas,manandbytes\/augeas,dafugg\/augeas,jtopjian\/augeas,kunkku\/augeas,mchf\/augeas,raphink\/augeas,mchf\/augeas,manandbytes\/augeas,hercules-team\/augeas,kunkku\/augeas,MikaelSmith\/augeas,dafugg\/augeas,pevalme\/augeas,mlichvar\/augeas,lutter\/augeas,MikaelSmith\/augeas,jjlin\/augeas,raphink\/augeas,jtopjian\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,pevalme\/augeas,ptoscano\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,kumy\/augeas,mlichvar\/augeas,ptoscano\/augeas,kumy\/augeas,pevalme\/augeas,jasperla\/augeas,lutter\/augeas,kumy\/augeas,ptoscano\/augeas,jjlin\/augeas,lutter\/augeas,kunkku\/augeas","old_file":"lenses\/yum.aug","new_file":"lenses\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries = entry*\n | entry* . list_entry \"baseurl\" . entry*\n | entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"baseurl\" . entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"gpgkey\" . entry* . list_entry \"baseurl\" . entry*\n\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - \"baseurl\" - \"gpgkey\"\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries = entry*\n | entry* . list_entry \"baseurl\" . entry*\n | entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"baseurl\" . entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"gpgkey\" . entry* . list_entry \"baseurl\" . entry*\n\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d2a979965299063a856274825ecdf3cd9fa88729","subject":"Do not allow \\r in comment_or_eol","message":"Do not allow \\r in comment_or_eol\n","repos":"domcleal\/augeas,jasperla\/augeas,jjlin\/augeas,mlichvar\/augeas,kumy\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,lutter\/augeas,manandbytes\/augeas,raphink\/augeas,manandbytes\/augeas,mlichvar\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,hercules-team\/augeas,hercules-team\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jtopjian\/augeas,ptoscano\/augeas,kumy\/augeas,kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,mlichvar\/augeas,kumy\/augeas,kunkku\/augeas,domcleal\/augeas,jjlin\/augeas,pevalme\/augeas,jasperla\/augeas,kumy\/augeas,mchf\/augeas,domcleal\/augeas,jjlin\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,pevalme\/augeas,kunkku\/augeas,raphink\/augeas,lutter\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: doseol\n Delete end of line with optional carriage return,\n including optional trailing whitespace\n*)\n let doseol = del \/[ \\t]*\\r?\\n\/ \"\\n\"\n \n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_noindent\n Map comments into \"#comment\" nodes, without indentation\n*)\n let comment_noindent = comment_generic \/#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol>, with an optional empty comment *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*(#[ \\t]*)?\\r?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\r\\n].*[^ \\t\\r\\n]|[^ \\t\\r\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . del \/[ \\t\\r\\n]*\/ \"\\n\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*\/ \"\/*\"\n . counter \"mline\"\n . mline . (eol . mline)*\n . del \/[ \\t\\r\\n]*\\*\\\/[ \\t]*\\r?\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* View: delim *)\n let delim (op:string) = del (\/[ \\t]*\/ . op . \/[ \\t]*\/)\n (\" \" . op . \" \")\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b7c6216297ded3155eedf040f9ff46096033da8f","subject":"Xinetd: slight formatting improvements","message":"Xinetd: slight formatting improvements\n","repos":"GeoffWilliams\/augeas,dafugg\/augeas,raphink\/augeas,lutter\/augeas,hercules-team\/augeas,kumy\/augeas,jasperla\/augeas,dafugg\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,raphink\/augeas,kunkku\/augeas,pevalme\/augeas,dafugg\/augeas,mchf\/augeas,jjlin\/augeas,ptoscano\/augeas,jtopjian\/augeas,mlichvar\/augeas,lutter\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,kunkku\/augeas,pevalme\/augeas,kumy\/augeas,ptoscano\/augeas,kumy\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jjlin\/augeas,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,jtopjian\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas","old_file":"lenses\/xinetd.aug","new_file":"lenses\/xinetd.aug","new_contents":"(*\n * Module: Xinetd\n * Parses xinetd configuration files\n *\n * The structure of the lens and allowed attributes are ripped directly\n * from xinetd's parser in xinetd\/parse.c in xinetd's source checkout\n * The downside of being so precise here is that if attributes are added\n * they need to be added here, too. Writing a catchall entry, and getting\n * to typecheck correctly would be a huge pain.\n *\n * A really enterprising soul could tighten this down even further by\n * restricting the acceptable values for each attribute.\n *\n * Author: David Lutterkort\n *)\n\nmodule Xinetd =\n autoload xfm\n\n let op = ([ label \"add\" . Util.delim \"+=\" ]\n |[ label \"del\" . Util.delim \"-=\" ]\n | Sep.space_equal)\n\n let value = store Rx.no_spaces\n\n let indent = del Rx.opt_space \"\\t\"\n\n let attr_one (n:regexp) =\n Build.key_value n Sep.space_equal value\n\n let attr_lst (n:regexp) (op_eq: lens) =\n let value_entry = [ label \"value\" . value ] in\n Build.key_value n op_eq (Build.opt_list value_entry Sep.space)\n\n let attr_lst_eq (n:regexp) = attr_lst n Sep.space_equal\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Variable: service_attr\n * Note:\n * It is much faster to combine, for example, all the attr_one\n * attributes into one regexp and pass that to a lens instead of\n * using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter\n * causes the type checker to work _very_ hard.\n *)\n let service_attr =\n attr_one (\/socket_type|protocol|wait|user|group|server|instances\/i\n |\/rpc_version|rpc_number|id|port|nice|banner|bind|interface\/i\n |\/per_source|groups|banner_success|banner_fail|disable|max_load\/i\n |\/rlimit_as|rlimit_cpu|rlimit_data|rlimit_rss|rlimit_stack|v6only\/i\n |\/deny_time|umask|mdns|libwrap\/i)\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\/server_args|log_type|access_times|type|flags|redirect|cps\/i)\n |attr_lst_op (\/log_on_success|log_on_failure|only_from|no_access|env|passenv\/i)\n\n let default_attr =\n attr_one (\/instances|banner|bind|interface|per_source|groups\/i\n |\/banner_success|banner_fail|max_load|v6only|umask|mdns\/i)\n |attr_lst_eq \/cps\/i (* really only two values, not a whole list *)\n |attr_lst_op (\/log_type|log_on_success|log_on_failure|disabled\/i\n |\/no_access|only_from|passenv|enabled\/i)\n\n (* View: body\n * Note:\n * We would really like to say \"the body can contain any of a list\n * of a list of attributes, each of them at most once\"; but that\n * would require that we build a lens that matches the permutation\n * of all attributes; with around 40 individual attributes, that's\n * not computationally feasible, even if we didn't have to worry\n * about how to write that down. The resulting regular expressions\n * would simply be prohibitively large.\n *)\n let body (attr:lens) = Build.block_newlines\n (indent . attr . Util.eol)\n Util.comment\n\n (* View: includes\n * Note:\n * It would be nice if we could use the directories given in include and\n * includedir directives to parse additional files instead of hardcoding\n * all the places where xinetd config files can be found; but that is\n * currently not possible, and implementing that has a good amount of\n * hairy corner cases to consider.\n *)\n let includes =\n Build.key_value_line \/include(dir)?\/ Sep.space (store Rx.no_spaces)\n\n let service =\n let sto_re = \/[^# \\t\\n\\\/]+\/ in\n Build.key_value_line \"service\" Sep.space (store sto_re . body service_attr)\n\n let defaults = [ key \"defaults\" . body default_attr . Util.eol ]\n\n let lns = ( Util.empty | Util.comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\n * Module: Xinetd\n * Parses xinetd configuration files\n *\n * The structure of the lens and allowed attributes are ripped directly\n * from xinetd's parser in xinetd\/parse.c in xinetd's source checkout\n * The downside of being so precise here is that if attributes are added\n * they need to be added here, too. Writing a catchall entry, and getting\n * to typecheck correctly would be a huge pain.\n *\n * A really enterprising soul could tighten this down even further by\n * restricting the acceptable values for each attribute.\n *\n * Author: David Lutterkort\n *)\n\nmodule Xinetd =\n autoload xfm\n\n let op = ([ label \"add\" . Util.delim \"+=\" ]\n |[ label \"del\" . Util.delim \"-=\" ]\n | Sep.space_equal)\n\n let value = store Rx.no_spaces\n\n let indent = del Rx.opt_space \"\\t\"\n\n let attr_one (n:regexp) =\n Build.key_value n Sep.space_equal value\n\n let attr_lst (n:regexp) (op_eq: lens) =\n let value_entry = [ label \"value\" . value ] in\n Build.key_value n op_eq (Build.opt_list value_entry Sep.space)\n\n let attr_lst_eq (n:regexp) = attr_lst n Sep.space_equal\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Variable: service_attr\n * Note:\n * It is much faster to combine, for example, all the attr_one\n * attributes into one regexp and pass that to a lens instead of\n * using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter\n * causes the type checker to work _very_ hard.\n *)\n let service_attr =\n attr_one (\/socket_type|protocol|wait|user|group|server|instances|rpc_version|rpc_number|id|port|nice|banner|bind|interface|per_source|groups|banner_success|banner_fail|disable|max_load|rlimit_as|rlimit_cpu|rlimit_data|rlimit_rss|rlimit_stack|v6only|deny_time|umask|mdns|libwrap\/i)\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\/server_args|log_type|access_times|type|flags|redirect|cps\/i)\n |attr_lst_op (\/log_on_success|log_on_failure|only_from|no_access|env|passenv\/i)\n\n let default_attr =\n attr_one (\/instances|banner|bind|interface|per_source|groups|banner_success|banner_fail|max_load|v6only|umask|mdns\/i)\n |attr_lst_eq \/cps\/i (* really only two values, not a whole list *)\n |attr_lst_op (\/log_type|log_on_success|log_on_failure|disabled|no_access|only_from|passenv|enabled\/i)\n\n (* View: body\n * Note:\n * We would really like to say \"the body can contain any of a list\n * of a list of attributes, each of them at most once\"; but that\n * would require that we build a lens that matches the permutation\n * of all attributes; with around 40 individual attributes, that's\n * not computationally feasible, even if we didn't have to worry\n * about how to write that down. The resulting regular expressions\n * would simply be prohibitively large.\n *)\n let body (attr:lens) = Build.block_newlines\n (indent . attr . Util.eol)\n Util.comment\n\n (* View: includes\n * Note:\n * It would be nice if we could use the directories given in include and\n * includedir directives to parse additional files instead of hardcoding\n * all the places where xinetd config files can be found; but that is\n * currently not possible, and implementing that has a good amount of\n * hairy corner cases to consider.\n *)\n let includes =\n Build.key_value_line \/include(dir)?\/ Sep.space (store Rx.no_spaces)\n\n let service =\n let sto_re = \/[^# \\t\\n\\\/]+\/ in\n Build.key_value_line \"service\" Sep.space (store sto_re . body service_attr)\n\n let defaults = [ key \"defaults\" . body default_attr . Util.eol ]\n\n let lns = ( Util.empty | Util.comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a66b09da3f1b1e2aa382562a5727fc6dfac057be","subject":"Httpd: Add unit test for comment on next line","message":"Httpd: Add unit test for comment on next line\n","repos":"lutter\/augeas,raphink\/augeas,raphink\/augeas,manandbytes\/augeas,mchf\/augeas,jasperla\/augeas,pevalme\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,lutter\/augeas,manandbytes\/augeas,hercules-team\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,jtopjian\/augeas,ptoscano\/augeas,kunkku\/augeas,jjlin\/augeas,jasperla\/augeas,dafugg\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,pevalme\/augeas,mchf\/augeas,dafugg\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,jjlin\/augeas,ptoscano\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,pevalme\/augeas","old_file":"lenses\/tests\/test_httpd.aug","new_file":"lenses\/tests\/test_httpd.aug","new_contents":"module Test_httpd =\n\n(* directives testing *)\nlet d1 = \"ServerRoot \\\"\/etc\/apache2\\\"\\n\"\ntest Httpd.directive get d1 =\n { \"directive\" = \"ServerRoot\"\n { \"arg\" = \"\\\"\/etc\/apache2\\\"\" }\n }\n\n(* simple quotes *)\nlet d1s = \"ServerRoot '\/etc\/apache2'\\n\"\ntest Httpd.directive get d1s =\n { \"directive\" = \"ServerRoot\"\n { \"arg\" = \"'\/etc\/apache2'\" }\n }\n\nlet d2 = \"ScriptAlias \/cgi-bin\/ \/usr\/lib\/cgi-bin\/\\n\"\ntest Httpd.directive get d2 =\n { \"directive\" = \"ScriptAlias\"\n { \"arg\" = \"\/cgi-bin\/\" }\n { \"arg\" = \"\/usr\/lib\/cgi-bin\/\" }\n }\n\nlet d3 = \"LockFile \/var\/lock\/apache2\/accept.lock\\n\"\ntest Httpd.directive get d3 =\n { \"directive\" = \"LockFile\"\n { \"arg\" = \"\/var\/lock\/apache2\/accept.lock\" }\n }\n\nlet c1 = \"\n<IfModule>\n<\/IfModule>\n\"\nlet c1_put =\n\"\n<IfModule foo bar>\n<\/IfModule>\n\"\n\n\ntest Httpd.lns get c1 = { }{ \"IfModule\" }\n\ntest Httpd.lns put c1 after set \"\/IfModule\/arg[1]\" \"foo\";\n set \"\/IfModule\/arg[2]\" \"bar\" = c1_put\n\nlet c2 = \"\n<IfModule !mpm_winnt.c>\n <IfModule !mpm_netware.c>\n LockFile \/var\/lock\/apache2\/accept.lock\n <\/IfModule>\n<\/IfModule>\n\"\n\ntest Httpd.lns get c2 =\n { }\n { \"IfModule\"\n { \"arg\" = \"!mpm_winnt.c\" }\n { \"IfModule\"\n { \"arg\" = \"!mpm_netware.c\" }\n { \"directive\" = \"LockFile\"\n { \"arg\" = \"\/var\/lock\/apache2\/accept.lock\" }\n }\n }\n }\n\n(* arguments must be the first child of the section *)\ntest Httpd.lns put c2 after rm \"\/IfModule\/arg\";\n insb \"arg\" \"\/IfModule\/*[1]\";\n set \"\/IfModule\/arg\" \"foo\" =\n\"\n<IfModule foo>\n <IfModule !mpm_netware.c>\n LockFile \/var\/lock\/apache2\/accept.lock\n <\/IfModule>\n<\/IfModule>\n\"\n\nlet c3 = \"\n<IfModule mpm_event_module>\n StartServers 2\n MaxClients 150\n MinSpareThreads 25\n MaxSpareThreads 75\n ThreadLimit 64\n ThreadsPerChild 25\n MaxRequestsPerChild 0\n<\/IfModule>\n\"\n\ntest Httpd.lns get c3 =\n { }\n { \"IfModule\"\n { \"arg\" = \"mpm_event_module\" }\n { \"directive\" = \"StartServers\"\n { \"arg\" = \"2\" }\n }\n { \"directive\" = \"MaxClients\"\n { \"arg\" = \"150\" }\n }\n { \"directive\" = \"MinSpareThreads\"\n { \"arg\" = \"25\" }\n }\n { \"directive\" = \"MaxSpareThreads\"\n { \"arg\" = \"75\" }\n }\n { \"directive\" = \"ThreadLimit\"\n { \"arg\" = \"64\" }\n }\n { \"directive\" = \"ThreadsPerChild\"\n { \"arg\" = \"25\" }\n }\n { \"directive\" = \"MaxRequestsPerChild\"\n { \"arg\" = \"0\" }\n }\n }\n\n\n\nlet c4 = \"\n<Files ~ \\\"^\\.ht\\\">\n Order allow,deny\n Deny from all\n Satisfy all\n<\/Files>\n\"\n\ntest Httpd.lns get c4 =\n { }\n { \"Files\"\n { \"arg\" = \"~\" }\n { \"arg\" = \"\\\"^\\.ht\\\"\" }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"Deny\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n { \"directive\" = \"Satisfy\"\n { \"arg\" = \"all\" }\n }\n }\n\n\n\nlet c5 = \"LogFormat \\\"%{User-agent}i\\\" agent\\n\"\ntest Httpd.lns get c5 =\n { \"directive\" = \"LogFormat\"\n { \"arg\" = \"\\\"%{User-agent}i\\\"\" }\n { \"arg\" = \"agent\" }\n }\n\nlet c7 = \"LogFormat \\\"%v:%p %h %l %u %t \\\\\"%r\\\\\" %>s %O \\\\\"%{Referer}i\\\\\" \\\\\"%{User-Agent}i\\\\\"\\\" vhost_combined\\n\"\ntest Httpd.lns get c7 =\n { \"directive\" = \"LogFormat\"\n { \"arg\" = \"\\\"%v:%p %h %l %u %t \\\\\"%r\\\\\" %>s %O \\\\\"%{Referer}i\\\\\" \\\\\"%{User-Agent}i\\\\\"\\\"\" }\n { \"arg\" = \"vhost_combined\" }\n }\n\nlet c8 = \"IndexIgnore .??* *~ *# RCS CVS *,v *,t \\n\"\ntest Httpd.directive get c8 =\n { \"directive\" = \"IndexIgnore\"\n { \"arg\" = \".??*\" }\n { \"arg\" = \"*~\" }\n { \"arg\" = \"*#\" }\n { \"arg\" = \"RCS\" }\n { \"arg\" = \"CVS\" }\n { \"arg\" = \"*,v\" }\n { \"arg\" = \"*,t\" }\n }\n\n(* FIXME: not yet supported:\n * The backslash \"\\\" may be used as the last character on a line to indicate\n * that the directive continues onto the next line. There must be no other\n * characters or white space between the backslash and the end of the line.\n *)\nlet multiline = \"Options Indexes \\\nFollowSymLinks MultiViews\n\"\n\ntest Httpd.directive get multiline =\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"FollowSymLinks\" }\n { \"arg\" = \"MultiViews\" }\n }\n\n\nlet conf2 = \"<VirtualHost *:80>\n ServerAdmin webmaster@localhost\n\n DocumentRoot \/var\/www\n <Directory \/>\n Options FollowSymLinks\n AllowOverride None\n <\/Directory>\n <Directory \/var\/www\/>\n Options Indexes FollowSymLinks MultiViews\n AllowOverride None\n Order allow,deny\n allow from all\n <\/Directory>\n\n ScriptAlias \/cgi-bin\/ \/usr\/lib\/cgi-bin\/\n <Directory \\\"\/usr\/lib\/cgi-bin\\\">\n AllowOverride None\n Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch\n Order allow,deny\n Allow from all\n <\/Directory>\n\n ErrorLog \/var\/log\/apache2\/error.log\n\n # Possible values include: debug, info, notice, warn, error, crit,\n # alert, emerg.\n LogLevel warn\n\n CustomLog \/var\/log\/apache2\/access.log combined\n\n SSLRequireSSL\n\n Alias \/doc\/ \\\"\/usr\/share\/doc\/\\\"\n <Directory \\\"\/usr\/share\/doc\/\\\">\n Options Indexes MultiViews FollowSymLinks\n AllowOverride None\n Order deny,allow\n Deny from all\n Allow from 127.0.0.0\/255.0.0.0 ::1\/128\n <\/Directory>\n\n<\/VirtualHost>\n\"\n\ntest Httpd.lns get conf2 =\n { \"VirtualHost\"\n { \"arg\" = \"*:80\" }\n { \"directive\" = \"ServerAdmin\"\n { \"arg\" = \"webmaster@localhost\" }\n }\n { }\n { \"directive\" = \"DocumentRoot\"\n { \"arg\" = \"\/var\/www\" }\n }\n { \"Directory\"\n { \"arg\" = \"\/\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"FollowSymLinks\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n }\n { \"Directory\"\n { \"arg\" = \"\/var\/www\/\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"FollowSymLinks\" }\n { \"arg\" = \"MultiViews\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n }\n { }\n { \"directive\" = \"ScriptAlias\"\n { \"arg\" = \"\/cgi-bin\/\" }\n { \"arg\" = \"\/usr\/lib\/cgi-bin\/\" }\n }\n { \"Directory\"\n { \"arg\" = \"\\\"\/usr\/lib\/cgi-bin\\\"\" }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Options\"\n { \"arg\" = \"+ExecCGI\" }\n { \"arg\" = \"-MultiViews\" }\n { \"arg\" = \"+SymLinksIfOwnerMatch\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"Allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n }\n { }\n { \"directive\" = \"ErrorLog\"\n { \"arg\" = \"\/var\/log\/apache2\/error.log\" }\n }\n { }\n { \"#comment\" = \"Possible values include: debug, info, notice, warn, error, crit,\" }\n { \"#comment\" = \"alert, emerg.\" }\n { \"directive\" = \"LogLevel\"\n { \"arg\" = \"warn\" }\n }\n { }\n { \"directive\" = \"CustomLog\"\n { \"arg\" = \"\/var\/log\/apache2\/access.log\" }\n { \"arg\" = \"combined\" }\n }\n { }\n { \"directive\" = \"SSLRequireSSL\" }\n { }\n { \"directive\" = \"Alias\"\n { \"arg\" = \"\/doc\/\" }\n { \"arg\" = \"\\\"\/usr\/share\/doc\/\\\"\" }\n }\n { \"Directory\"\n { \"arg\" = \"\\\"\/usr\/share\/doc\/\\\"\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"MultiViews\" }\n { \"arg\" = \"FollowSymLinks\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"deny,allow\" }\n }\n { \"directive\" = \"Deny\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n { \"directive\" = \"Allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"127.0.0.0\/255.0.0.0\" }\n { \"arg\" = \"::1\/128\" }\n }\n }\n { }\n }\n\n(* Eol comment *)\ntest Httpd.lns get \"<a> # a comment\nMyDirective Foo\n<\/a>\\n\" =\n { \"a\"\n { \"#comment\" = \"a comment\" }\n { \"directive\" = \"MyDirective\" { \"arg\" = \"Foo\" } } }\n\ntest Httpd.lns get \"<a>\n# a comment\n<\/a>\\n\" =\n { \"a\" { \"#comment\" = \"a comment\" } }\n","old_contents":"module Test_httpd =\n\n(* directives testing *)\nlet d1 = \"ServerRoot \\\"\/etc\/apache2\\\"\\n\"\ntest Httpd.directive get d1 =\n { \"directive\" = \"ServerRoot\"\n { \"arg\" = \"\\\"\/etc\/apache2\\\"\" }\n }\n\n(* simple quotes *)\nlet d1s = \"ServerRoot '\/etc\/apache2'\\n\"\ntest Httpd.directive get d1s =\n { \"directive\" = \"ServerRoot\"\n { \"arg\" = \"'\/etc\/apache2'\" }\n }\n\nlet d2 = \"ScriptAlias \/cgi-bin\/ \/usr\/lib\/cgi-bin\/\\n\"\ntest Httpd.directive get d2 =\n { \"directive\" = \"ScriptAlias\"\n { \"arg\" = \"\/cgi-bin\/\" }\n { \"arg\" = \"\/usr\/lib\/cgi-bin\/\" }\n }\n\nlet d3 = \"LockFile \/var\/lock\/apache2\/accept.lock\\n\"\ntest Httpd.directive get d3 =\n { \"directive\" = \"LockFile\"\n { \"arg\" = \"\/var\/lock\/apache2\/accept.lock\" }\n }\n\nlet c1 = \"\n<IfModule>\n<\/IfModule>\n\"\nlet c1_put =\n\"\n<IfModule foo bar>\n<\/IfModule>\n\"\n\n\ntest Httpd.lns get c1 = { }{ \"IfModule\" }\n\ntest Httpd.lns put c1 after set \"\/IfModule\/arg[1]\" \"foo\";\n set \"\/IfModule\/arg[2]\" \"bar\" = c1_put\n\nlet c2 = \"\n<IfModule !mpm_winnt.c>\n <IfModule !mpm_netware.c>\n LockFile \/var\/lock\/apache2\/accept.lock\n <\/IfModule>\n<\/IfModule>\n\"\n\ntest Httpd.lns get c2 =\n { }\n { \"IfModule\"\n { \"arg\" = \"!mpm_winnt.c\" }\n { \"IfModule\"\n { \"arg\" = \"!mpm_netware.c\" }\n { \"directive\" = \"LockFile\"\n { \"arg\" = \"\/var\/lock\/apache2\/accept.lock\" }\n }\n }\n }\n\n(* arguments must be the first child of the section *)\ntest Httpd.lns put c2 after rm \"\/IfModule\/arg\";\n insb \"arg\" \"\/IfModule\/*[1]\";\n set \"\/IfModule\/arg\" \"foo\" =\n\"\n<IfModule foo>\n <IfModule !mpm_netware.c>\n LockFile \/var\/lock\/apache2\/accept.lock\n <\/IfModule>\n<\/IfModule>\n\"\n\nlet c3 = \"\n<IfModule mpm_event_module>\n StartServers 2\n MaxClients 150\n MinSpareThreads 25\n MaxSpareThreads 75\n ThreadLimit 64\n ThreadsPerChild 25\n MaxRequestsPerChild 0\n<\/IfModule>\n\"\n\ntest Httpd.lns get c3 =\n { }\n { \"IfModule\"\n { \"arg\" = \"mpm_event_module\" }\n { \"directive\" = \"StartServers\"\n { \"arg\" = \"2\" }\n }\n { \"directive\" = \"MaxClients\"\n { \"arg\" = \"150\" }\n }\n { \"directive\" = \"MinSpareThreads\"\n { \"arg\" = \"25\" }\n }\n { \"directive\" = \"MaxSpareThreads\"\n { \"arg\" = \"75\" }\n }\n { \"directive\" = \"ThreadLimit\"\n { \"arg\" = \"64\" }\n }\n { \"directive\" = \"ThreadsPerChild\"\n { \"arg\" = \"25\" }\n }\n { \"directive\" = \"MaxRequestsPerChild\"\n { \"arg\" = \"0\" }\n }\n }\n\n\n\nlet c4 = \"\n<Files ~ \\\"^\\.ht\\\">\n Order allow,deny\n Deny from all\n Satisfy all\n<\/Files>\n\"\n\ntest Httpd.lns get c4 =\n { }\n { \"Files\"\n { \"arg\" = \"~\" }\n { \"arg\" = \"\\\"^\\.ht\\\"\" }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"Deny\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n { \"directive\" = \"Satisfy\"\n { \"arg\" = \"all\" }\n }\n }\n\n\n\nlet c5 = \"LogFormat \\\"%{User-agent}i\\\" agent\\n\"\ntest Httpd.lns get c5 =\n { \"directive\" = \"LogFormat\"\n { \"arg\" = \"\\\"%{User-agent}i\\\"\" }\n { \"arg\" = \"agent\" }\n }\n\nlet c7 = \"LogFormat \\\"%v:%p %h %l %u %t \\\\\"%r\\\\\" %>s %O \\\\\"%{Referer}i\\\\\" \\\\\"%{User-Agent}i\\\\\"\\\" vhost_combined\\n\"\ntest Httpd.lns get c7 =\n { \"directive\" = \"LogFormat\"\n { \"arg\" = \"\\\"%v:%p %h %l %u %t \\\\\"%r\\\\\" %>s %O \\\\\"%{Referer}i\\\\\" \\\\\"%{User-Agent}i\\\\\"\\\"\" }\n { \"arg\" = \"vhost_combined\" }\n }\n\nlet c8 = \"IndexIgnore .??* *~ *# RCS CVS *,v *,t \\n\"\ntest Httpd.directive get c8 =\n { \"directive\" = \"IndexIgnore\"\n { \"arg\" = \".??*\" }\n { \"arg\" = \"*~\" }\n { \"arg\" = \"*#\" }\n { \"arg\" = \"RCS\" }\n { \"arg\" = \"CVS\" }\n { \"arg\" = \"*,v\" }\n { \"arg\" = \"*,t\" }\n }\n\n(* FIXME: not yet supported:\n * The backslash \"\\\" may be used as the last character on a line to indicate\n * that the directive continues onto the next line. There must be no other\n * characters or white space between the backslash and the end of the line.\n *)\nlet multiline = \"Options Indexes \\\nFollowSymLinks MultiViews\n\"\n\ntest Httpd.directive get multiline =\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"FollowSymLinks\" }\n { \"arg\" = \"MultiViews\" }\n }\n\n\nlet conf2 = \"<VirtualHost *:80>\n ServerAdmin webmaster@localhost\n\n DocumentRoot \/var\/www\n <Directory \/>\n Options FollowSymLinks\n AllowOverride None\n <\/Directory>\n <Directory \/var\/www\/>\n Options Indexes FollowSymLinks MultiViews\n AllowOverride None\n Order allow,deny\n allow from all\n <\/Directory>\n\n ScriptAlias \/cgi-bin\/ \/usr\/lib\/cgi-bin\/\n <Directory \\\"\/usr\/lib\/cgi-bin\\\">\n AllowOverride None\n Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch\n Order allow,deny\n Allow from all\n <\/Directory>\n\n ErrorLog \/var\/log\/apache2\/error.log\n\n # Possible values include: debug, info, notice, warn, error, crit,\n # alert, emerg.\n LogLevel warn\n\n CustomLog \/var\/log\/apache2\/access.log combined\n\n SSLRequireSSL\n\n Alias \/doc\/ \\\"\/usr\/share\/doc\/\\\"\n <Directory \\\"\/usr\/share\/doc\/\\\">\n Options Indexes MultiViews FollowSymLinks\n AllowOverride None\n Order deny,allow\n Deny from all\n Allow from 127.0.0.0\/255.0.0.0 ::1\/128\n <\/Directory>\n\n<\/VirtualHost>\n\"\n\ntest Httpd.lns get conf2 =\n { \"VirtualHost\"\n { \"arg\" = \"*:80\" }\n { \"directive\" = \"ServerAdmin\"\n { \"arg\" = \"webmaster@localhost\" }\n }\n { }\n { \"directive\" = \"DocumentRoot\"\n { \"arg\" = \"\/var\/www\" }\n }\n { \"Directory\"\n { \"arg\" = \"\/\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"FollowSymLinks\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n }\n { \"Directory\"\n { \"arg\" = \"\/var\/www\/\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"FollowSymLinks\" }\n { \"arg\" = \"MultiViews\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n }\n { }\n { \"directive\" = \"ScriptAlias\"\n { \"arg\" = \"\/cgi-bin\/\" }\n { \"arg\" = \"\/usr\/lib\/cgi-bin\/\" }\n }\n { \"Directory\"\n { \"arg\" = \"\\\"\/usr\/lib\/cgi-bin\\\"\" }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Options\"\n { \"arg\" = \"+ExecCGI\" }\n { \"arg\" = \"-MultiViews\" }\n { \"arg\" = \"+SymLinksIfOwnerMatch\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"allow,deny\" }\n }\n { \"directive\" = \"Allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n }\n { }\n { \"directive\" = \"ErrorLog\"\n { \"arg\" = \"\/var\/log\/apache2\/error.log\" }\n }\n { }\n { \"#comment\" = \"Possible values include: debug, info, notice, warn, error, crit,\" }\n { \"#comment\" = \"alert, emerg.\" }\n { \"directive\" = \"LogLevel\"\n { \"arg\" = \"warn\" }\n }\n { }\n { \"directive\" = \"CustomLog\"\n { \"arg\" = \"\/var\/log\/apache2\/access.log\" }\n { \"arg\" = \"combined\" }\n }\n { }\n { \"directive\" = \"SSLRequireSSL\" }\n { }\n { \"directive\" = \"Alias\"\n { \"arg\" = \"\/doc\/\" }\n { \"arg\" = \"\\\"\/usr\/share\/doc\/\\\"\" }\n }\n { \"Directory\"\n { \"arg\" = \"\\\"\/usr\/share\/doc\/\\\"\" }\n { \"directive\" = \"Options\"\n { \"arg\" = \"Indexes\" }\n { \"arg\" = \"MultiViews\" }\n { \"arg\" = \"FollowSymLinks\" }\n }\n { \"directive\" = \"AllowOverride\"\n { \"arg\" = \"None\" }\n }\n { \"directive\" = \"Order\"\n { \"arg\" = \"deny,allow\" }\n }\n { \"directive\" = \"Deny\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"all\" }\n }\n { \"directive\" = \"Allow\"\n { \"arg\" = \"from\" }\n { \"arg\" = \"127.0.0.0\/255.0.0.0\" }\n { \"arg\" = \"::1\/128\" }\n }\n }\n { }\n }\n\n(* Eol comment *)\ntest Httpd.lns get \"<a> # a comment\nMyDirective Foo\n<\/a>\\n\" =\n { \"a\"\n { \"#comment\" = \"a comment\" }\n { \"directive\" = \"MyDirective\" { \"arg\" = \"Foo\" } } }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b860f958c9c722df31d4017ff31aae78e5eca037","subject":"Use Sys.getenv(\"HOME\") in dput.aug","message":"Use Sys.getenv(\"HOME\") in dput.aug\n","repos":"lutter\/augeas,mlichvar\/augeas,raphink\/augeas,domcleal\/augeas,MikaelSmith\/augeas,pevalme\/augeas,jasperla\/augeas,jjlin\/augeas,kumy\/augeas,jjlin\/augeas,jjlin\/augeas,mlichvar\/augeas,domcleal\/augeas,mchf\/augeas,manandbytes\/augeas,ptoscano\/augeas,lutter\/augeas,hercules-team\/augeas,pevalme\/augeas,lutter\/augeas,mlichvar\/augeas,domcleal\/augeas,kunkku\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,dafugg\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,kunkku\/augeas,kunkku\/augeas,kumy\/augeas,mchf\/augeas,jtopjian\/augeas,dafugg\/augeas,pevalme\/augeas,dafugg\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas","old_file":"lenses\/dput.aug","new_file":"lenses\/dput.aug","new_contents":"(* Dput module for Augeas\n Author: Raphael Pinson <raphink@gmail.com>\n\n\n Reference: dput uses Python's ConfigParser:\n http:\/\/docs.python.org\/lib\/module-ConfigParser.html\n*)\n\n\nmodule Dput =\n autoload xfm\n\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\n\nlet setting = \"allow_dcut\"\n | \"allow_non-us_software\"\n | \"allow_unsigned_uploads\"\n | \"check_version\"\n | \"default_host_main\"\n | \"default_host_non-us\"\n | \"fqdn\"\n | \"hash\"\n | \"incoming\"\n | \"login\"\n | \"method\"\n | \"passive_ftp\"\n | \"post_upload_command\"\n | \"pre_upload_command\"\n | \"progress_indicator\"\n | \"run_dinstall\"\n | \"run_lintian\"\n | \"scp_compress\"\n | \"ssh_config_options\"\n | \"allowed_distributions\"\n\n(************************************************************************\n * \"name: value\" entries, with continuations in the style of RFC 822;\n * \"name=value\" is also accepted\n * leading whitespace is removed from values\n *************************************************************************)\nlet entry = IniFile.entry setting sep comment\n\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/dput.cf\")\n . (incl (Sys.getenv(\"HOME\") . \"\/.dput.cf\"))\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(* Dput module for Augeas\n Author: Raphael Pinson <raphink@gmail.com>\n\n\n Reference: dput uses Python's ConfigParser:\n http:\/\/docs.python.org\/lib\/module-ConfigParser.html\n*)\n\n\nmodule Dput =\n autoload xfm\n\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\n\nlet setting = \"allow_dcut\"\n | \"allow_non-us_software\"\n | \"allow_unsigned_uploads\"\n | \"check_version\"\n | \"default_host_main\"\n | \"default_host_non-us\"\n | \"fqdn\"\n | \"hash\"\n | \"incoming\"\n | \"login\"\n | \"method\"\n | \"passive_ftp\"\n | \"post_upload_command\"\n | \"pre_upload_command\"\n | \"progress_indicator\"\n | \"run_dinstall\"\n | \"run_lintian\"\n | \"scp_compress\"\n | \"ssh_config_options\"\n | \"allowed_distributions\"\n\n(************************************************************************\n * \"name: value\" entries, with continuations in the style of RFC 822;\n * \"name=value\" is also accepted\n * leading whitespace is removed from values\n *************************************************************************)\nlet entry = IniFile.entry setting sep comment\n\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/dput.cf\")\n . (incl \"~\/.dput.cf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ddfcd5b835870c7200e12f1511f5842acd27525e","subject":"Dhclient: on OpenBSD dhclient.conf lives in \/etc\/dhclient.conf","message":"Dhclient: on OpenBSD dhclient.conf lives in \/etc\/dhclient.conf\n\nFixes ticket #320\n","repos":"ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas,hercules-team\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,kumy\/augeas,raphink\/augeas,pevalme\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,jjlin\/augeas,pevalme\/augeas,lutter\/augeas,MikaelSmith\/augeas,kumy\/augeas,mchf\/augeas,pevalme\/augeas,mlichvar\/augeas,kumy\/augeas,dafugg\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,kunkku\/augeas,kumy\/augeas,mchf\/augeas,jasperla\/augeas,raphink\/augeas,mlichvar\/augeas,jjlin\/augeas,jtopjian\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,lutter\/augeas,jjlin\/augeas,kunkku\/augeas","old_file":"lenses\/dhclient.aug","new_file":"lenses\/dhclient.aug","new_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man dhclient.conf\n The only difference with the reference syntax is that this lens assumes\n that statements end with a new line, while the reference syntax allows\n new statements to be started right after the trailing \";\" of the\n previous statement. This should not be a problem in real-life\n configuration files as statements get usually splitted across several\n lines, rather than merged in a single one.\n\n TODO: support the \"default\", \"supersede\", \"append\" and \"prepend\"\n statements\n*)\n\nmodule Dhclient =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet comment_or_eol = Util.comment_or_eol\nlet empty = Util.empty\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t\\n]+\/ \" \"\nlet sep_scl = del \/[ \\t]*;\/ \";\"\nlet sep_obr = del \/[ \\t\\n]*\\{\\n]*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t\\n]*\\}\/ \" }\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \",\"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\n\n(* Define fields *)\n\n(* TODO: there could be a \" \" in the middle of a value ... *)\nlet sto_to_spc = store \/[^\\\\#,;{}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_to_scl = store \/[^ \\t][^;\\n]+[^ \\t]|[^ \\t;\\n]+\/\nlet rfc_code = [ key \"code\" . sep_spc . store word ]\n . sep_eq\n . [ label \"value\" . sto_to_scl ]\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * SIMPLE STATEMENTS\n *************************************************************************)\n\nlet stmt_simple_re = \"timeout\"\n | \"retry\"\n | \"select-timeout\"\n | \"reboot\"\n | \"backoff-cutoff\"\n | \"initial-interval\"\n | \"do-forward-updates\"\n | \"reject\"\n\nlet stmt_simple = [ key stmt_simple_re\n . sep_spc\n . sto_to_spc\n . sep_scl\n . comment_or_eol ]\n\n\n(************************************************************************\n * ARRAY STATEMENTS\n *************************************************************************)\n\n(* TODO: the array could also be empty, like in the request statement *)\nlet stmt_array_re = \"media\"\n | \"request\"\n | \"require\"\n\nlet stmt_array = [ key stmt_array_re\n . sep_spc\n . counter \"stmt_array\"\n . [ seq \"stmt_array\" . sto_to_spc ]\n . [ sep_com . seq \"stmt_array\" . sto_to_spc ]*\n . sep_scl . comment_or_eol ]\n\n(************************************************************************\n * HASH STATEMENTS\n *************************************************************************)\n\nlet stmt_hash_re = \"send\"\n | \"option\"\n\nlet stmt_hash = [ key stmt_hash_re\n . sep_spc\n . [ key word . sep_spc . (sto_to_spc|rfc_code) ]\n . sep_scl\n . comment_or_eol ]\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n\nlet stmt_block_re = \"interface\"\n | \"lease\"\n | \"alias\"\n\nlet stmt_block_opt_re = \"interface\"\n | \"script\"\n | \"bootp\"\n | \"fixed-address\"\n | \"filename\"\n | \"server-name\"\n | \"medium\"\n | \"vendor option space\"\n\n(* TODO: some options could take no argument like bootp *)\nlet stmt_block_opt = [ key stmt_block_opt_re\n . sep_spc\n . sto_to_spc\n . sep_scl\n . comment_or_eol ]\n\nlet stmt_block_date_re\n = \"renew\"\n | \"rebind\"\n | \"expire\"\n\nlet stmt_block_date = [ key stmt_block_date_re\n . [ sep_spc . label \"weekday\" . sto_number ]\n . [ sep_spc . label \"year\" . sto_number ]\n . [ sep_slh . label \"month\" . sto_number ]\n . [ sep_slh . label \"day\" . sto_number ]\n . [ sep_spc . label \"hour\" . sto_number ]\n . [ sep_col . label \"minute\" . sto_number ]\n . [ sep_col . label \"second\" . sto_number ]\n . sep_scl\n . comment_or_eol ]\n\nlet stmt_block_arg = sep_spc . sto_to_spc\n\nlet stmt_block_entry = sep_spc\n . ( stmt_array\n | stmt_hash\n | stmt_block_opt\n | stmt_block_date )\n\nlet stmt_block = [ key stmt_block_re\n . stmt_block_arg?\n . sep_obr\n . stmt_block_entry+\n . sep_cbr\n . comment_or_eol ]\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet statement = (stmt_simple|stmt_array|stmt_hash|stmt_block)\n\nlet lns = ( empty\n | comment\n | statement )*\n\nlet filter = incl \"\/etc\/dhcp3\/dhclient.conf\"\n . incl \"\/etc\/dhclient.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Intefraces module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man dhclient.conf\n The only difference with the reference syntax is that this lens assumes\n that statements end with a new line, while the reference syntax allows\n new statements to be started right after the trailing \";\" of the\n previous statement. This should not be a problem in real-life\n configuration files as statements get usually splitted across several\n lines, rather than merged in a single one.\n\n TODO: support the \"default\", \"supersede\", \"append\" and \"prepend\"\n statements\n*)\n\nmodule Dhclient =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet comment = Util.comment\nlet comment_or_eol = Util.comment_or_eol\nlet empty = Util.empty\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t\\n]+\/ \" \"\nlet sep_scl = del \/[ \\t]*;\/ \";\"\nlet sep_obr = del \/[ \\t\\n]*\\{\\n]*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t\\n]*\\}\/ \" }\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \",\"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\n\n(* Define fields *)\n\n(* TODO: there could be a \" \" in the middle of a value ... *)\nlet sto_to_spc = store \/[^\\\\#,;{}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_to_scl = store \/[^ \\t][^;\\n]+[^ \\t]|[^ \\t;\\n]+\/\nlet rfc_code = [ key \"code\" . sep_spc . store word ]\n . sep_eq\n . [ label \"value\" . sto_to_scl ]\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * SIMPLE STATEMENTS\n *************************************************************************)\n\nlet stmt_simple_re = \"timeout\"\n | \"retry\"\n | \"select-timeout\"\n | \"reboot\"\n | \"backoff-cutoff\"\n | \"initial-interval\"\n | \"do-forward-updates\"\n | \"reject\"\n\nlet stmt_simple = [ key stmt_simple_re\n . sep_spc\n . sto_to_spc\n . sep_scl\n . comment_or_eol ]\n\n\n(************************************************************************\n * ARRAY STATEMENTS\n *************************************************************************)\n\n(* TODO: the array could also be empty, like in the request statement *)\nlet stmt_array_re = \"media\"\n | \"request\"\n | \"require\"\n\nlet stmt_array = [ key stmt_array_re\n . sep_spc\n . counter \"stmt_array\"\n . [ seq \"stmt_array\" . sto_to_spc ]\n . [ sep_com . seq \"stmt_array\" . sto_to_spc ]*\n . sep_scl . comment_or_eol ]\n\n(************************************************************************\n * HASH STATEMENTS\n *************************************************************************)\n\nlet stmt_hash_re = \"send\"\n | \"option\"\n\nlet stmt_hash = [ key stmt_hash_re\n . sep_spc\n . [ key word . sep_spc . (sto_to_spc|rfc_code) ]\n . sep_scl\n . comment_or_eol ]\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n\nlet stmt_block_re = \"interface\"\n | \"lease\"\n | \"alias\"\n\nlet stmt_block_opt_re = \"interface\"\n | \"script\"\n | \"bootp\"\n | \"fixed-address\"\n | \"filename\"\n | \"server-name\"\n | \"medium\"\n | \"vendor option space\"\n\n(* TODO: some options could take no argument like bootp *)\nlet stmt_block_opt = [ key stmt_block_opt_re\n . sep_spc\n . sto_to_spc\n . sep_scl\n . comment_or_eol ]\n\nlet stmt_block_date_re\n = \"renew\"\n | \"rebind\"\n | \"expire\"\n\nlet stmt_block_date = [ key stmt_block_date_re\n . [ sep_spc . label \"weekday\" . sto_number ]\n . [ sep_spc . label \"year\" . sto_number ]\n . [ sep_slh . label \"month\" . sto_number ]\n . [ sep_slh . label \"day\" . sto_number ]\n . [ sep_spc . label \"hour\" . sto_number ]\n . [ sep_col . label \"minute\" . sto_number ]\n . [ sep_col . label \"second\" . sto_number ]\n . sep_scl\n . comment_or_eol ]\n\nlet stmt_block_arg = sep_spc . sto_to_spc\n\nlet stmt_block_entry = sep_spc\n . ( stmt_array\n | stmt_hash\n | stmt_block_opt\n | stmt_block_date )\n\nlet stmt_block = [ key stmt_block_re\n . stmt_block_arg?\n . sep_obr\n . stmt_block_entry+\n . sep_cbr\n . comment_or_eol ]\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet statement = (stmt_simple|stmt_array|stmt_hash|stmt_block)\n\nlet lns = ( empty\n | comment\n | statement )*\n\nlet filter = incl \"\/etc\/dhcp3\/dhclient.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"cc330e7591281ebcab9b9ba0b5e84a81a75bb026","subject":"Parse nginx sites-enabled","message":"Parse nginx sites-enabled\n\nOn Debian\/Ubuntu the active sites are configured in \/etc\/nginx\/sites-enabled, either as files or as symlinks to files in \/etc\/nginx\/sites-available\/, so parse that path too.\n","repos":"hercules-team\/augeas,mlichvar\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas,ptoscano\/augeas,kunkku\/augeas,mlichvar\/augeas,kunkku\/augeas,kunkku\/augeas,hercules-team\/augeas","old_file":"lenses\/nginx.aug","new_file":"lenses\/nginx.aug","new_contents":"(* Module: Nginx\n Nginx module for Augeas\n\nAuthors: Ian Berry <iberry@barracuda.com>\n Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n\n This module was built to support a limited subset of nginx\n configuration syntax. It works fine with simple blocks and\n field\/value lines.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/nginx\/nginx.conf. See <filter>.\n\nAbout: Examples\n The <Test_Nginx> file contains various examples and tests.\n\nAbout: TODO\n * Convert statement keyworks for a regex\n * Support more advanced block syntax (location)\n*)\n\nmodule Nginx =\n\nautoload xfm\n\n(* Variable: word *)\nlet word = \/[A-Za-z0-9_.:-]+\/\n\n(* Variable: block_re\n The keywords reserved for block entries *)\nlet block_re = \"http\" | \"events\" | \"server\" | \"mail\" | \"stream\"\n\n(* All block keywords, including the ones we treat specially *)\nlet block_re_all = block_re | \"if\" | \"location\" | \"geo\" | \"map\"\n | \"split_clients\" | \"upstream\"\n\n(* View: simple\n A simple entry *)\nlet simple =\n let kw = word - block_re_all\n in let mask = [ label \"mask\" . Util.del_str \"\/\" . store Rx.integer ]\n in let sto = store \/[^ \\t\\n;][^;]*\/ . Sep.semicolon\n in [ Util.indent . key kw . mask? . Sep.space . sto . (Util.eol|Util.comment_eol) ]\n\n(* View: server\n A simple server entry *)\nlet server =\n [ Util.indent . label \"@server\" . Util.del_str \"server\"\n . [ Sep.space . label \"@address\" . store word ]\n . [ Sep.space . key word . (Sep.equal . store word)? ]*\n . Sep.semicolon\n . (Util.eol|Util.comment_eol) ]\n\nlet arg (name:string) (rx:regexp) =\n [ label name . Sep.space . store rx ]\n\n(* Match any argument (as much as possible) *)\nlet any_rx =\n let bare_rx = \/[^\" \\t\\n{][^ \\t\\n{]*\/ in\n let dquote_rx = \/\"([^\\\"]|\\\\.)*\"\/ in\n bare_rx | dquote_rx\n\nlet any_arg (name:string) = arg name any_rx\n\n(* 'if' conditions are enclosed in matching parens which we can't match\n precisely with a regular expression. Instead, we gobble up anything that\n doesn't contain an opening brace. That can of course lead to trouble if\n a condition actually contains an opening brace *)\nlet block_if = key \"if\"\n . arg \"#cond\" \/\\(([^ \\t\\n{]|[ \\t\\n][^{])*\\)\/\n\nlet block_location = key \"location\"\n . (arg \"#comp\" \/=|~|~\\*|\\^~\/)?\n . any_arg \"#uri\"\n\nlet block_geo = key \"geo\"\n . (any_arg \"#address\")?\n . any_arg \"#geo\"\n\nlet block_map = key \"map\"\n . any_arg \"#source\"\n . any_arg \"#variable\"\n\nlet block_split_clients = key \"split_clients\"\n . any_arg \"#string\"\n . any_arg \"#variable\"\n\nlet block_upstream = key \"upstream\"\n . any_arg \"#name\"\n\nlet block_head = key block_re\n | block_if\n | block_location\n | block_geo\n | block_map\n | block_split_clients\n | block_upstream\n\n(* View: block\n A block containing <simple> entries *)\nlet block (entry : lens) =\n [ Util.indent . block_head\n . Build.block_newlines entry Util.comment\n . Util.eol ]\n\nlet rec directive = simple | server | block directive\n\n(* View: lns *)\nlet lns = ( Util.comment | Util.empty | directive )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/nginx\/nginx.conf\"\n . incl \"\/etc\/nginx\/conf.d\/*.conf\"\n . incl \"\/etc\/nginx\/sites-available\/*\"\n . incl \"\/etc\/nginx\/sites-enabled\/*\"\n . incl \"\/usr\/portage\/www-servers\/nginx\/files\/nginx.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/nginx.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/conf.d\/*.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/sites-available\/*\"\n . incl \"\/usr\/local\/etc\/nginx\/sites-enabled\/*\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Module: Nginx\n Nginx module for Augeas\n\nAuthors: Ian Berry <iberry@barracuda.com>\n Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n\n This module was built to support a limited subset of nginx\n configuration syntax. It works fine with simple blocks and\n field\/value lines.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/nginx\/nginx.conf. See <filter>.\n\nAbout: Examples\n The <Test_Nginx> file contains various examples and tests.\n\nAbout: TODO\n * Convert statement keyworks for a regex\n * Support more advanced block syntax (location)\n*)\n\nmodule Nginx =\n\nautoload xfm\n\n(* Variable: word *)\nlet word = \/[A-Za-z0-9_.:-]+\/\n\n(* Variable: block_re\n The keywords reserved for block entries *)\nlet block_re = \"http\" | \"events\" | \"server\" | \"mail\" | \"stream\"\n\n(* All block keywords, including the ones we treat specially *)\nlet block_re_all = block_re | \"if\" | \"location\" | \"geo\" | \"map\"\n | \"split_clients\" | \"upstream\"\n\n(* View: simple\n A simple entry *)\nlet simple =\n let kw = word - block_re_all\n in let mask = [ label \"mask\" . Util.del_str \"\/\" . store Rx.integer ]\n in let sto = store \/[^ \\t\\n;][^;]*\/ . Sep.semicolon\n in [ Util.indent . key kw . mask? . Sep.space . sto . (Util.eol|Util.comment_eol) ]\n\n(* View: server\n A simple server entry *)\nlet server =\n [ Util.indent . label \"@server\" . Util.del_str \"server\"\n . [ Sep.space . label \"@address\" . store word ]\n . [ Sep.space . key word . (Sep.equal . store word)? ]*\n . Sep.semicolon\n . (Util.eol|Util.comment_eol) ]\n\nlet arg (name:string) (rx:regexp) =\n [ label name . Sep.space . store rx ]\n\n(* Match any argument (as much as possible) *)\nlet any_rx =\n let bare_rx = \/[^\" \\t\\n{][^ \\t\\n{]*\/ in\n let dquote_rx = \/\"([^\\\"]|\\\\.)*\"\/ in\n bare_rx | dquote_rx\n\nlet any_arg (name:string) = arg name any_rx\n\n(* 'if' conditions are enclosed in matching parens which we can't match\n precisely with a regular expression. Instead, we gobble up anything that\n doesn't contain an opening brace. That can of course lead to trouble if\n a condition actually contains an opening brace *)\nlet block_if = key \"if\"\n . arg \"#cond\" \/\\(([^ \\t\\n{]|[ \\t\\n][^{])*\\)\/\n\nlet block_location = key \"location\"\n . (arg \"#comp\" \/=|~|~\\*|\\^~\/)?\n . any_arg \"#uri\"\n\nlet block_geo = key \"geo\"\n . (any_arg \"#address\")?\n . any_arg \"#geo\"\n\nlet block_map = key \"map\"\n . any_arg \"#source\"\n . any_arg \"#variable\"\n\nlet block_split_clients = key \"split_clients\"\n . any_arg \"#string\"\n . any_arg \"#variable\"\n\nlet block_upstream = key \"upstream\"\n . any_arg \"#name\"\n\nlet block_head = key block_re\n | block_if\n | block_location\n | block_geo\n | block_map\n | block_split_clients\n | block_upstream\n\n(* View: block\n A block containing <simple> entries *)\nlet block (entry : lens) =\n [ Util.indent . block_head\n . Build.block_newlines entry Util.comment\n . Util.eol ]\n\nlet rec directive = simple | server | block directive\n\n(* View: lns *)\nlet lns = ( Util.comment | Util.empty | directive )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/nginx\/nginx.conf\"\n . incl \"\/etc\/nginx\/conf.d\/*.conf\"\n . incl \"\/etc\/nginx\/sites-available\/*\"\n . incl \"\/usr\/portage\/www-servers\/nginx\/files\/nginx.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/nginx.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/conf.d\/*.conf\"\n . incl \"\/usr\/local\/etc\/nginx\/sites-available\/*\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e73753c3a4f7fbcaf936e714e2d3ff8dab72d39e","subject":"Add default_lbracket and default_rbracket to Build.block_generic","message":"Add default_lbracket and default_rbracket to Build.block_generic\n","repos":"raphink\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,MikaelSmith\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,lutter\/augeas,kumy\/augeas,kumy\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,raphink\/augeas,lutter\/augeas,mlichvar\/augeas,domcleal\/augeas,kumy\/augeas,jasperla\/augeas,dafugg\/augeas,hercules-team\/augeas,mlichvar\/augeas,domcleal\/augeas,kunkku\/augeas,pevalme\/augeas,ptoscano\/augeas,pevalme\/augeas,dafugg\/augeas,manandbytes\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,ptoscano\/augeas,dafugg\/augeas,jtopjian\/augeas,jjlin\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jjlin\/augeas,kunkku\/augeas,mchf\/augeas,mchf\/augeas","old_file":"lenses\/build.aug","new_file":"lenses\/build.aug","new_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n(************************************************************************\n * View: block_generic\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>\n * entry_noindent:lens - the entry to be stored inside the block,\n * without indentation.\n * This entry should not include <Util.empty>\n * entry_noeol:lens - the entry to be stored inside the block,\n * without eol.\n * This entry should not include <Util.empty>\n * entry_noindent_noeol:lens - the entry to be stored inside the block,\n * without indentation or eol.\n * This entry should not include <Util.empty>\n * comment:lens - the comment lens used in the block\n * comment_noindent:lens - the comment lens used in the block,\n * without indentation.\n * default_lbracket:string - default value for the left bracket\n * default_rbracket:string - default value for the right bracket\n ************************************************************************)\nlet block_generic\n (entry:lens) (entry_noindent:lens)\n (entry_noeol:lens) (entry_noindent_noeol:lens)\n (comment:lens) (comment_noindent:lens)\n (default_lbracket:string)\n (default_rbracket:string) =\n let block_single = entry_noindent_noeol | comment_noindent\n in let block_start = entry_noindent | comment_noindent\n in let block_middle = (Util.empty | entry | comment)*\n in let block_end = entry_noeol | comment\n in del \/[ \\t\\n]*\\{[ \\t\\n]*\/ default_lbracket\n . ( ( block_start . block_middle . block_end )\n | block_single )\n . del \/[ \\t\\n]*\\}\/ default_rbracket\n\n(************************************************************************\n * View: block\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block (entry:lens) = block_generic (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n \" {\\n\" \"}\"\n\n(************************************************************************\n * View: named_block\n * A named <block> enclosed in brackets\n *\n * Parameters:\n * kw:regexp - the regexp for the block name\n * entry:lens - the entry to be stored inside the block\n * this entry should not include <Util.empty>\n ************************************************************************)\nlet named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]\n","old_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABEL OPERATIONS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: SUBNODE CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value_line_comment\n * Same as <key_value_line>, but allows to have a comment in the end of a line\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n * comment:lens - the comment lens, which can be taken from <Util>\n ************************************************************************)\nlet key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =\n [ key kw . sep . sto . (eol|comment) ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n(************************************************************************\n * View: key_ws_value\n *\n * Store a key\/value pair where key and value are separated by whitespace\n * and the value goes to the end of the line. Leading and trailing\n * whitespace is stripped from the value. The end of line is consumed by\n * this lens\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet key_ws_value (kw:regexp) =\n key_value_line kw Util.del_ws_spc (store Rx.space_in)\n\n(************************************************************************\n * View: flag\n * A simple flag subnode, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag (kw:regexp) = [ key kw ]\n\n(************************************************************************\n * View: flag_line\n * A simple flag line, consisting of a single key\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n ************************************************************************)\nlet flag_line (kw:regexp) = [ key kw . eol ]\n\n(************************************************************************\n * View: block_generic\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>\n * entry_noindent:lens - the entry to be stored inside the block,\n * without indentation.\n * This entry should not include <Util.empty>\n * entry_noeol:lens - the entry to be stored inside the block,\n * without eol.\n * This entry should not include <Util.empty>\n * entry_noindent_noeol:lens - the entry to be stored inside the block,\n * without indentation or eol.\n * This entry should not include <Util.empty>\n * comment:lens - the comment lens used in the block\n * comment_noindent:lens - the comment lens used in the block,\n * without indentation.\n ************************************************************************)\nlet block_generic (entry:lens) (entry_noindent:lens)\n (entry_noeol:lens) (entry_noindent_noeol:lens)\n (comment:lens) (comment_noindent:lens) =\n let block_single = entry_noindent_noeol | comment_noindent\n in let block_start = entry_noindent | comment_noindent\n in let block_middle = (Util.empty | entry | comment)*\n in let block_end = entry_noeol | comment\n in del \/[ \\t\\n]*\\{[ \\t\\n]*\/ \" {\\n\"\n . ( ( block_start . block_middle . block_end )\n | block_single )\n . del \/[ \\t\\n]*\\}\/ \"}\"\n\n(************************************************************************\n * View: block\n * A block enclosed in brackets\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should not be indented or finish with an eol.\n ************************************************************************)\nlet block (entry:lens) = block_generic (Util.indent . entry . eol)\n (entry . eol) (Util.indent . entry) entry\n Util.comment Util.comment_noindent\n\n(************************************************************************\n * View: named_block\n * A named <block> enclosed in brackets\n *\n * Parameters:\n * kw:regexp - the regexp for the block name\n * entry:lens - the entry to be stored inside the block\n * this entry should not include <Util.empty>\n ************************************************************************)\nlet named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0180fa4abad619f6a2ca6b1b895d26b27737eabe","subject":"Add blkid.conf to shellvars.aug","message":"Add blkid.conf to shellvars.aug\n","repos":"lutter\/augeas,jtopjian\/augeas,manandbytes\/augeas,kunkku\/augeas,raphink\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,domcleal\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,hercules-team\/augeas,pevalme\/augeas,domcleal\/augeas,raphink\/augeas,jjlin\/augeas,jjlin\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,mlichvar\/augeas,mchf\/augeas,domcleal\/augeas,kumy\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,dafugg\/augeas,jasperla\/augeas,jasperla\/augeas,mchf\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,pevalme\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,kumy\/augeas,jjlin\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^;= \\t\\n]+\/ . semicol . eol\n ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . store \/[^; \\t\\n][^;\\n]+[^; \\t\\n]|[^ \\t;\\n]+\/ ]\n . semicol . eol ]\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^;= \\t\\n]+\/ . semicol . eol\n ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . store \/[^; \\t\\n][^;\\n]+[^; \\t\\n]|[^ \\t;\\n]+\/ ]\n . semicol . eol ]\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6ae34cb48118b7fbd1a9bd3bd2dd948ec617479e","subject":"cowpoke.conf","message":"cowpoke.conf\n","repos":"jjlin\/augeas,kumy\/augeas,domcleal\/augeas,manandbytes\/augeas,lutter\/augeas,kumy\/augeas,kunkku\/augeas,mlichvar\/augeas,jjlin\/augeas,pevalme\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,kumy\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,jasperla\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,jjlin\/augeas,mchf\/augeas,hercules-team\/augeas,domcleal\/augeas,pevalme\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,hercules-team\/augeas,mchf\/augeas,ptoscano\/augeas,ptoscano\/augeas,pevalme\/augeas,kunkku\/augeas,kunkku\/augeas,raphink\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,raphink\/augeas,dafugg\/augeas,lutter\/augeas,jasperla\/augeas,manandbytes\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif? . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/updatedb.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif? . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"snmpd\" .\n sc_incl \"snmpd.options\" .\n sc_incl \"snmptrapd\" .\n sc_incl \"snmptrapd.options\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/ucf.conf\"\n . incl \"\/etc\/updatedb.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b474d7b1e8192698e160673c10b6ee2453e81b3f","subject":"Add FreeBSD paths to dovecot","message":"Add FreeBSD paths to dovecot\n","repos":"mlichvar\/augeas,hercules-team\/augeas,kunkku\/augeas,mlichvar\/augeas,kunkku\/augeas,pevalme\/augeas,mlichvar\/augeas,pevalme\/augeas,pevalme\/augeas,hercules-team\/augeas,kunkku\/augeas,ptoscano\/augeas,ptoscano\/augeas,lutter\/augeas,lutter\/augeas,lutter\/augeas,ptoscano\/augeas","old_file":"lenses\/dovecot.aug","new_file":"lenses\/dovecot.aug","new_contents":"(*\nModule: Dovecot\n Parses dovecot configuration files.\n\nAuthor: Serge Smetana <serge.smetana@gmail.com>\n Acunote http:\/\/www.acunote.com\n Pluron, Inc. http:\/\/pluron.com\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Configuration files\n This lens applies to \/etc\/dovecot\/dovecot.conf and files in\n \/etc\/dovecot\/conf.d\/. See <filter>.\n\nAbout: Examples\n The <Test_Dovecot> file contains various examples and tests.\n\nAbout: TODO\n Support for multiline values like queries in dict-sql.conf\n*)\n\nmodule Dovecot =\n\n autoload xfm\n\n(******************************************************************\n * Group: USEFUL PRIMITIVES\n ******************************************************************)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: empty\nMap empty lines. *)\nlet empty = Util.empty\n\n(* View: comment\nMap comments in \"#comment\" nodes. *)\nlet comment = Util.comment\n\n(* View: eq *)\nlet eq = del \/[ \\t]*=\/ \" =\"\n\n(* Variable: any *)\nlet any = Rx.no_spaces\n\n(* Variable: value\nMatch any value after \" =\".\nShould not start and end with spaces. May contain spaces inside *)\nlet value = any . (Rx.space . any)*\n\n(* View: command_start *)\nlet command_start = Util.del_str \"!\"\n\n\n(******************************************************************\n * Group: ENTRIES\n ******************************************************************)\n\n(* Variable: commands *)\nlet commands = \/include|include_try\/\n\n(* Variable: block_names *)\nlet block_names = \/dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener\/\n\n(* Variable: keys\nMatch any possible key except commands and block names. *)\nlet keys = Rx.word - (commands | block_names)\n\n(* View: entry\nMap simple \"key = value\" entries including \"key =\" entries with empty value. *)\nlet entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]\n\n(* View: command\nMap commands started with \"!\". *)\nlet command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nBased off Quote.dquote_spaces\n\nParameters:\n lns1:lens - the lens before\n lns2:lens - the lens after\n*)\nlet dquote_spaces (lns1:lens) (lns2:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\"\\n]*[ \\t]+[^\"\\n]*\/)\n in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ]\n\nlet mailbox = indent\n . dquote_spaces\n (key \/mailbox\/ . Sep.space)\n (Build.block_newlines_spc entry comment . eol)\n\nlet block_ldelim_newlines_re = \/[ \\t]+\\{([ \\t\\n]*\\n)?\/\n\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in del block_ldelim_newlines_re Build.block_ldelim_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default\n\n(* View: block\nMap block enclosed in brackets recursively.\nBlock may be indented and have optional argument.\nBlock body may have entries, comments, empty lines, and nested blocks recursively. *)\nlet rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store \/[\\\/A-Za-z0-9_-]+\/))? . block_newlines (entry|block|mailbox) comment . eol ]\n\n\n(******************************************************************\n * Group: LENS AND FILTER\n ******************************************************************)\n\n(* View: lns\nThe Dovecot lens *)\nlet lns = (comment|empty|entry|command|block)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/etc\/dovecot\/conf.d\/*.conf\")\n . incl \"\/usr\/local\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/usr\/local\/etc\/dovecot\/conf.d\/*.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Dovecot\n Parses dovecot configuration files.\n\nAuthor: Serge Smetana <serge.smetana@gmail.com>\n Acunote http:\/\/www.acunote.com\n Pluron, Inc. http:\/\/pluron.com\n\nAbout: License\n This file is licensed under the LGPL v2+.\n\nAbout: Configuration files\n This lens applies to \/etc\/dovecot\/dovecot.conf and files in\n \/etc\/dovecot\/conf.d\/. See <filter>.\n\nAbout: Examples\n The <Test_Dovecot> file contains various examples and tests.\n\nAbout: TODO\n Support for multiline values like queries in dict-sql.conf\n*)\n\nmodule Dovecot =\n\n autoload xfm\n\n(******************************************************************\n * Group: USEFUL PRIMITIVES\n ******************************************************************)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: empty\nMap empty lines. *)\nlet empty = Util.empty\n\n(* View: comment\nMap comments in \"#comment\" nodes. *)\nlet comment = Util.comment\n\n(* View: eq *)\nlet eq = del \/[ \\t]*=\/ \" =\"\n\n(* Variable: any *)\nlet any = Rx.no_spaces\n\n(* Variable: value\nMatch any value after \" =\".\nShould not start and end with spaces. May contain spaces inside *)\nlet value = any . (Rx.space . any)*\n\n(* View: command_start *)\nlet command_start = Util.del_str \"!\"\n\n\n(******************************************************************\n * Group: ENTRIES\n ******************************************************************)\n\n(* Variable: commands *)\nlet commands = \/include|include_try\/\n\n(* Variable: block_names *)\nlet block_names = \/dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener\/\n\n(* Variable: keys\nMatch any possible key except commands and block names. *)\nlet keys = Rx.word - (commands | block_names)\n\n(* View: entry\nMap simple \"key = value\" entries including \"key =\" entries with empty value. *)\nlet entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]\n\n(* View: command\nMap commands started with \"!\". *)\nlet command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ]\n\n(*\nView: dquote_spaces\n Make double quotes mandatory if value contains spaces,\n and optional if value doesn't contain spaces.\n\nBased off Quote.dquote_spaces\n\nParameters:\n lns1:lens - the lens before\n lns2:lens - the lens after\n*)\nlet dquote_spaces (lns1:lens) (lns2:lens) =\n (* bare has no spaces, and is optionally quoted *)\n let bare = Quote.do_dquote_opt (store \/[^\" \\t\\n]+\/)\n (* quoted has at least one space, and must be quoted *)\n in let quoted = Quote.do_dquote (store \/[^\"\\n]*[ \\t]+[^\"\\n]*\/)\n in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ]\n\nlet mailbox = indent\n . dquote_spaces\n (key \/mailbox\/ . Sep.space)\n (Build.block_newlines_spc entry comment . eol)\n\nlet block_ldelim_newlines_re = \/[ \\t]+\\{([ \\t\\n]*\\n)?\/\n\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del Rx.opt_space \"\\t\"\n in del block_ldelim_newlines_re Build.block_ldelim_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default\n\n(* View: block\nMap block enclosed in brackets recursively.\nBlock may be indented and have optional argument.\nBlock body may have entries, comments, empty lines, and nested blocks recursively. *)\nlet rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store \/[\\\/A-Za-z0-9_-]+\/))? . block_newlines (entry|block|mailbox) comment . eol ]\n\n\n(******************************************************************\n * Group: LENS AND FILTER\n ******************************************************************)\n\n(* View: lns\nThe Dovecot lens *)\nlet lns = (comment|empty|entry|command|block)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/dovecot\/dovecot.conf\"\n . (incl \"\/etc\/dovecot\/conf.d\/*.conf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7086bbc2ac2dd76486cf3f2a68e1b8da2adbbb61","subject":"Sudoers: allow 'visiblepw' parameter flag","message":"Sudoers: allow 'visiblepw' parameter flag\n\nFix provided by christj. Fixes bug #143\n","repos":"jtopjian\/augeas,kunkku\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,hercules-team\/augeas,kunkku\/augeas,jjlin\/augeas,dafugg\/augeas,manandbytes\/augeas,lutter\/augeas,jasperla\/augeas,pevalme\/augeas,kunkku\/augeas,raphink\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,domcleal\/augeas,dafugg\/augeas,raphink\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,pevalme\/augeas,ptoscano\/augeas,jasperla\/augeas,lutter\/augeas,jtopjian\/augeas,mlichvar\/augeas,domcleal\/augeas,kumy\/augeas,domcleal\/augeas,jjlin\/augeas,mlichvar\/augeas,mchf\/augeas,mchf\/augeas,lutter\/augeas,dafugg\/augeas,pevalme\/augeas,mlichvar\/augeas,jjlin\/augeas,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\" | \"visiblepw\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: paramater_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sudoers\n Parses \/etc\/sudoers\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_cont_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\]([^,=:#()\\n\\\\\\\\]|\\\\\\\\[=:,\\\\\\\\])*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com\n\nThere could be a \\ in the middle of a command *)\nlet sto_to_com = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com_host *)\nlet sto_to_com_host = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n\n(* Variable: sto_to_com_user\nEscaped spaces are allowed *)\nlet sto_to_com_user = store ( \/([^,=:#() \\t\\n]([^,=:#() \\t\\n]|(\\\\\\\\[ \\t]))*[^,=:#() \\t\\n])|[^,=:#() \\t\\n]\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_com_col *)\nlet sto_to_com_col = store \/[^\",=#() \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^\", \\t\\n\\\\\\\\]+|\"[^\", \\t\\n\\\\\\\\]+\"\/\n\n(* Variable: sto_to_spc_no_dquote *)\nlet sto_to_spc_no_dquote = store \/[^\", \\t\\n\\\\\\\\]+\/ (* \" relax emacs *)\n\n(* Variable: sto_integer *)\nlet sto_integer = store \/[0-9]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"#comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: del_negate\n * Delete an even number of '!' signs\n *************************************************************************)\nlet del_negate = del \/(!!)*\/ \"\"\n\n(************************************************************************\n * View: negate_node\n * Negation of boolean values for <defaults>. Accept one optional '!'\n * and produce a 'negate' node if there is one.\n *************************************************************************)\nlet negate_node = [ del \"!\" \"!\" . label \"negate\" ]\n\nlet negate_or_value (key:lens) (value:lens) =\n [ del_negate . (negate_node . key | key . value) ]\n\n(************************************************************************\n * View: parameter_flag\n * A flag parameter for <defaults>\n *\n * Flags are implicitly boolean and can be turned off via the '!' operator.\n * Some integer, string and list parameters may also be used in a boolean\n * context to disable them.\n *************************************************************************)\nlet parameter_flag_kw = \"always_set_home\" | \"authenticate\" | \"env_editor\"\n | \"env_reset\" | \"fqdn\" | \"ignore_dot\"\n | \"ignore_local_sudoers\" | \"insults\" | \"log_host\"\n | \"log_year\" | \"long_otp_prompt\" | \"mail_always\"\n | \"mail_badpass\" | \"mail_no_host\" | \"mail_no_perms\"\n | \"mail_no_user\" | \"noexec\" | \"path_info\"\n | \"passprompt_override\" | \"preserve_groups\"\n | \"requiretty\" | \"root_sudo\" | \"rootpw\" | \"runaspw\"\n | \"set_home\" | \"set_logname\" | \"setenv\"\n | \"shell_noargs\" | \"stay_setuid\" | \"targetpw\"\n | \"tty_tickets\"\n\nlet parameter_flag = [ del_negate . negate_node?\n . key parameter_flag_kw ]\n\n(************************************************************************\n * View: parameter_integer\n * An integer parameter for <defaults>\n *************************************************************************)\nlet parameter_integer_nobool_kw = \"passwd_tries\"\n\nlet parameter_integer_nobool = [ key parameter_integer_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_integer\n . del \/\"?\/ \"\" ]\n\n\nlet parameter_integer_bool_kw = \"loglinelen\" | \"passwd_timeout\"\n | \"timestamp_timeout\" | \"umask\"\n\nlet parameter_integer_bool =\n negate_or_value\n (key parameter_integer_bool_kw)\n (sep_eq . del \/\"?\/ \"\" . sto_integer . del \/\"?\/ \"\")\n\nlet parameter_integer = parameter_integer_nobool\n | parameter_integer_bool\n\n(************************************************************************\n * View: parameter_string\n * A string parameter for <defaults>\n *\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_string_nobool_kw = \"badpass_message\" | \"editor\" | \"mailsub\"\n | \"noexec_file\" | \"passprompt\" | \"runas_default\"\n | \"syslog_badpri\" | \"syslog_goodpri\"\n | \"timestampdir\" | \"timestampowner\" | \"secure_path\"\n\nlet parameter_string_nobool = [ key parameter_string_nobool_kw . sep_eq\n . del \/\"?\/ \"\" . sto_to_com_col\n . del \/\"?\/ \"\" ]\n\nlet parameter_string_bool_kw = \"exempt_group\" | \"lecture\" | \"lecture_file\"\n | \"listpw\" | \"logfile\" | \"mailerflags\"\n | \"mailerpath\" | \"mailto\" | \"exempt_group\"\n | \"syslog\" | \"verifypw\" | \"logfile\"\n | \"mailerflags\" | \"mailerpath\" | \"mailto\"\n | \"syslog\" | \"verifypw\"\n\nlet parameter_string_bool =\n negate_or_value\n (key parameter_string_bool_kw)\n (sep_eq . sto_to_com_col)\n\nlet parameter_string = parameter_string_nobool\n | parameter_string_bool\n\n(************************************************************************\n * View: parameter_lists\n * A single list parameter for <defaults>\n *\n * All lists can be used in a boolean context\n * The argument may be a double-quoted, space-separated list or a single\n * value without double-quotes.\n * The list can be replaced, added to, deleted from, or disabled\n * by using the =, +=, -=, and ! operators respectively.\n * An odd number of '!' operators negate the value of the item;\n * an even number just cancel each other out.\n *************************************************************************)\nlet parameter_lists_kw = \"env_check\" | \"env_delete\" | \"env_keep\"\nlet parameter_lists_value = [ label \"var\" . sto_to_spc_no_dquote ]\nlet parameter_lists_value_dquote = [ label \"var\"\n . del \/\"?\/ \"\" . sto_to_spc_no_dquote\n . del \/\"?\/ \"\" ]\n\nlet parameter_lists_values = parameter_lists_value_dquote\n | ( sep_dquote . parameter_lists_value\n . ( sep_cont . parameter_lists_value )+\n . sep_dquote )\n\nlet parameter_lists_sep = sep_cont_opt\n . ( [ del \"+\" \"+\" . label \"append\" ]\n | [ del \"-\" \"-\" . label \"remove\" ] )?\n . del \"=\" \"=\" . sep_cont_opt\n\nlet parameter_lists =\n negate_or_value\n (key parameter_lists_kw)\n (parameter_lists_sep . parameter_lists_values)\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *\n * Parameters may be flags, integer values, strings, or lists.\n *\n *************************************************************************)\nlet parameter = parameter_flag | parameter_integer\n | parameter_string | parameter_lists\n\n(************************************************************************\n * View: paramater_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com_host\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . (incl \"\/etc\/sudoers.d\/*\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c14cb6ca905bcc59149804997d68fcd4e0062ac6","subject":"Improve documentation for sep.aug","message":"Improve documentation for sep.aug\n","repos":"jjlin\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,mlichvar\/augeas,lutter\/augeas,kunkku\/augeas,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,mchf\/augeas,ptoscano\/augeas,manandbytes\/augeas,raphink\/augeas,MikaelSmith\/augeas,kumy\/augeas,mlichvar\/augeas,mchf\/augeas,raphink\/augeas,ptoscano\/augeas,ptoscano\/augeas,jasperla\/augeas,jjlin\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,kumy\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,hercules-team\/augeas,mlichvar\/augeas,lutter\/augeas,jjlin\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,pevalme\/augeas,jtopjian\/augeas,jtopjian\/augeas,dafugg\/augeas,MikaelSmith\/augeas,kumy\/augeas,pevalme\/augeas,jasperla\/augeas","old_file":"lenses\/sep.aug","new_file":"lenses\/sep.aug","new_contents":"(*\nModule: Sep\n Generic separators to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Sep =\n\n(* Variable: colon *)\nlet colon = Util.del_str \":\"\n\n(* Variable: comma *)\nlet comma = Util.del_str \",\"\n\n(* Variable: equal *)\nlet equal = Util.del_str \"=\"\n\n(* Variable: space\n Deletes a <Rx.space> and default to a single space *)\nlet space = del Rx.space \" \"\n\n(* Variable: tab\n Deletes a <Rx.space> and default to a tab *)\nlet tab = del Rx.space \"\\t\"\n\n(* Variable: opt_space\n Deletes a <Rx.opt_space> and default to an empty string *)\nlet opt_space = del Rx.opt_space \"\"\n\n(* Variable: opt_tab\n Deletes a <Rx.opt_space> and default to a tab *)\nlet opt_tab = del Rx.opt_space \"\\t\"\n","old_contents":"(*\nModule: Sep\n Generic separators to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Sep =\n\nlet colon = Util.del_str \":\"\nlet comma = Util.del_str \",\"\nlet equal = Util.del_str \"=\"\nlet space = del Rx.space \" \"\nlet tab = del Rx.space \"\\t\"\nlet opt_space = del Rx.opt_space \"\"\nlet opt_tab = del Rx.opt_space \"\\t\"\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0125329a7c13ecd1ef02d14e042a180fc845cd25","subject":"Resolv: no functional change, whitespace cleanup","message":"Resolv: no functional change, whitespace cleanup\n","repos":"kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,ptoscano\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,kunkku\/augeas","old_file":"lenses\/resolv.aug","new_file":"lenses\/resolv.aug","new_contents":"(*\nModule: Resolv\n Parses \/etc\/resolv.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man resolv.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/resolv.conf. See <filter>.\n*)\n\nmodule Resolv =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \"# \"\n\n(* View: comment_eol *)\nlet comment_eol = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \" # \"\n\n(* View: empty *)\nlet empty = Util.empty\n\n\n(************************************************************************\n * Group: MAIN OPTIONS\n *************************************************************************)\n\n(* View: netmask\nA network mask for IP addresses *)\nlet netmask = [ label \"netmask\" . Util.del_str \"\/\" . store Rx.ip ]\n\n(* View: ipaddr\nAn IP address or range with an optional mask *)\nlet ipaddr = [label \"ipaddr\" . store Rx.ip . netmask?]\n\n\n(* View: nameserver\n A nameserver entry *)\nlet nameserver = Build.key_value_line_comment\n \"nameserver\" Sep.space (store Rx.ip) comment_eol\n\n(* View: domain *)\nlet domain = Build.key_value_line_comment\n \"domain\" Sep.space (store Rx.word) comment_eol\n\n(* View: search *)\nlet search = Build.key_value_line_comment\n \"search\" Sep.space\n (Build.opt_list\n [label \"domain\" . store Rx.word]\n Sep.space)\n comment_eol\n\n(* View: sortlist *)\nlet sortlist = Build.key_value_line_comment\n \"sortlist\" Sep.space\n (Build.opt_list\n ipaddr\n Sep.space)\n comment_eol\n\n(* View: lookup *)\nlet lookup =\n let lookup_entry = Build.flag(\"bind\"|\"file\"|\"yp\")\n in Build.key_value_line_comment\n \"lookup\" Sep.space\n (Build.opt_list\n lookup_entry\n Sep.space)\n comment_eol\n\n(* View: family *)\nlet family =\n let family_entry = Build.flag(\"inet4\"|\"inet6\")\n in Build.key_value_line_comment\n \"family\" Sep.space\n (Build.opt_list\n family_entry\n Sep.space)\n comment_eol\n\n(************************************************************************\n * Group: SPECIAL OPTIONS\n *************************************************************************)\n\n(* View: ip6_dotint\n ip6-dotint option, which supports negation *)\nlet ip6_dotint =\n let negate = [ del \"no-\" \"no-\" . label \"negate\" ]\n in [ negate? . key \"ip6-dotint\" ]\n\n(* View: options\n Options values *)\nlet options =\n let options_entry = Build.key_value (\"ndots\"|\"timeout\"|\"attempts\")\n (Util.del_str \":\") (store Rx.integer)\n | Build.flag (\"debug\"|\"rotate\"|\"no-check-names\"\n |\"inet6\"|\"ip6-bytestring\"|\"edns0\"\n\t\t\t\t |\"single-request-reopen\")\n | ip6_dotint\n\n in Build.key_value_line_comment\n \"options\" Sep.space\n (Build.opt_list\n options_entry\n Sep.space)\n comment_eol\n\n(* View: entry *)\nlet entry = nameserver\n | domain\n | search\n | sortlist\n | options\n | lookup\n | family\n\n(* View: lns *)\nlet lns = ( empty | comment | entry )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/resolv.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Resolv\n Parses \/etc\/resolv.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man resolv.conf` where possible.\n\nAbout: Licence\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/resolv.conf. See <filter>.\n*)\n\nmodule Resolv =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: comment *)\nlet comment = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \"# \"\n\n(* View: comment_eol *)\nlet comment_eol = Util.comment_generic \/[ \\t]*[;#][ \\t]*\/ \" # \"\n\n(* View: empty *)\nlet empty = Util.empty\n\n\n(************************************************************************\n * Group: MAIN OPTIONS\n *************************************************************************)\n\n(* View: netmask\nA network mask for IP addresses *)\nlet netmask = [ label \"netmask\" . Util.del_str \"\/\" . store Rx.ip ]\n\n(* View: ipaddr \nAn IP address or range with an optional mask *) \nlet ipaddr = [label \"ipaddr\" . store Rx.ip . netmask?]\n\n\n(* View: nameserver\n A nameserver entry *)\nlet nameserver = Build.key_value_line_comment\n \"nameserver\" Sep.space (store Rx.ip) comment_eol\n\n(* View: domain *)\nlet domain = Build.key_value_line_comment\n \"domain\" Sep.space (store Rx.word) comment_eol\n\n(* View: search *)\nlet search = Build.key_value_line_comment\n \"search\" Sep.space\n (Build.opt_list \n [label \"domain\" . store Rx.word]\n Sep.space)\n comment_eol\n\n(* View: sortlist *)\nlet sortlist = Build.key_value_line_comment\n \"sortlist\" Sep.space\n (Build.opt_list\n ipaddr\n Sep.space) \n comment_eol\n\n(* View: lookup *)\nlet lookup =\n let lookup_entry = Build.flag(\"bind\"|\"file\"|\"yp\")\n in Build.key_value_line_comment\n \"lookup\" Sep.space\n (Build.opt_list\n lookup_entry\n Sep.space)\n comment_eol\n\n(* View: family *)\nlet family =\n let family_entry = Build.flag(\"inet4\"|\"inet6\")\n in Build.key_value_line_comment\n \"family\" Sep.space\n (Build.opt_list\n family_entry\n Sep.space)\n comment_eol\n\n(************************************************************************\n * Group: SPECIAL OPTIONS\n *************************************************************************)\n\n(* View: ip6_dotint\n ip6-dotint option, which supports negation *)\nlet ip6_dotint = \n let negate = [ del \"no-\" \"no-\" . label \"negate\" ]\n in [ negate? . key \"ip6-dotint\" ]\n\n(* View: options \n Options values *)\nlet options =\n let options_entry = Build.key_value (\"ndots\"|\"timeout\"|\"attempts\") \n (Util.del_str \":\") (store Rx.integer)\n | Build.flag (\"debug\"|\"rotate\"|\"no-check-names\"\n |\"inet6\"|\"ip6-bytestring\"|\"edns0\"\n\t\t\t\t |\"single-request-reopen\")\n | ip6_dotint\n\n in Build.key_value_line_comment\n \"options\" Sep.space\n (Build.opt_list\n options_entry\n Sep.space)\n comment_eol\n\n(* View: entry *)\nlet entry = nameserver\n | domain\n | search\n | sortlist\n | options\n | lookup\n | family\n\n(* View: lns *)\nlet lns = ( empty | comment | entry )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/resolv.conf\")\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c339125c8d0b45cf3f5064b1fe693b74c0b07f22","subject":"feat(lenses): add \/etc\/redis.conf to Redis.lns (#726)","message":"feat(lenses): add \/etc\/redis.conf to Redis.lns (#726)\n\nSigned-off-by: Rapha\u00ebl Pinson <0909132c360f4744d45149034acd6a9d36df8f8f@camptocamp.com>","repos":"hercules-team\/augeas,mlichvar\/augeas,mlichvar\/augeas,hercules-team\/augeas,mlichvar\/augeas","old_file":"lenses\/redis.aug","new_file":"lenses\/redis.aug","new_contents":"(*\nModule: Redis\n Parses Redis's configuration files\n\nAuthor: Marc Fournier <marc.fournier@camptocamp.com>\n\nAbout: Reference\n This lens is based on Redis's default redis.conf\n\nAbout: Usage Example\n(start code)\naugtool> set \/augeas\/load\/Redis\/incl \"\/etc\/redis\/redis.conf\"\naugtool> set \/augeas\/load\/Redis\/lens \"Redis.lns\"\naugtool> load\n\naugtool> get \/files\/etc\/redis\/redis.conf\/vm-enabled\n\/files\/etc\/redis\/redis.conf\/vm-enabled = no\naugtool> print \/files\/etc\/redis\/redis.conf\/rename-command[1]\/\n\/files\/etc\/redis\/redis.conf\/rename-command\n\/files\/etc\/redis\/redis.conf\/rename-command\/from = \"CONFIG\"\n\/files\/etc\/redis\/redis.conf\/rename-command\/to = \"CONFIG2\"\n\naugtool> set \/files\/etc\/redis\/redis.conf\/activerehashing no\naugtool> save\nSaved 1 file(s)\naugtool> set \/files\/etc\/redis\/redis.conf\/save[1]\/seconds 123\naugtool> set \/files\/etc\/redis\/redis.conf\/save[1]\/keys 456\naugtool> save\nSaved 1 file(s)\n(end code)\n The <Test_Redis> file also contains various examples.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n*)\n\nmodule Redis =\nautoload xfm\n\nlet k = Rx.word\nlet v = \/[^ \\t\\n'\"]+\/\nlet comment = Util.comment\nlet empty = Util.empty\nlet indent = Util.indent\nlet eol = Util.eol\nlet del_ws_spc = Util.del_ws_spc\nlet dquote = Util.del_str \"\\\"\"\n\n(* View: standard_entry\nA standard entry is a key-value pair, separated by blank space, with optional\nblank spaces at line beginning & end. The value part can be optionnaly enclosed\nin single or double quotes. Comments at end-of-line ar NOT allowed by\nredis-server.\n*)\nlet standard_entry =\n let reserved_k = \"save\" | \"rename-command\" | \"slaveof\"\n | \"bind\" | \"client-output-buffer-limit\"\n in let entry_noempty = [ indent . key (k - reserved_k) . del_ws_spc\n . Quote.do_quote_opt_nil (store v) . eol ]\n in let entry_empty = [ indent . key (k - reserved_k) . del_ws_spc\n . dquote . store \"\" . dquote . eol ]\n in entry_noempty | entry_empty\n\nlet save = \/save\/\nlet seconds = [ label \"seconds\" . Quote.do_quote_opt_nil (store Rx.integer) ]\nlet keys = [ label \"keys\" . Quote.do_quote_opt_nil (store Rx.integer) ]\n(* View: save_entry\nEntries identified by the \"save\" keyword can be found more than once. They have\n2 mandatory parameters, both integers. The same rules as standard_entry apply\nfor quoting, comments and whitespaces.\n*)\nlet save_entry = [ indent . key save . del_ws_spc . seconds . del_ws_spc . keys . eol ]\n\nlet slaveof = \/slaveof\/\nlet ip = [ label \"ip\" . Quote.do_quote_opt_nil (store Rx.ip) ]\nlet port = [ label \"port\" . Quote.do_quote_opt_nil (store Rx.integer) ]\n(* View: slaveof_entry\nEntries identified by the \"slaveof\" keyword can be found more than once. They\nhave 2 mandatory parameters, the 1st one is an IP address, the 2nd one is a\nport number. The same rules as standard_entry apply for quoting, comments and\nwhitespaces.\n*)\nlet slaveof_entry = [ indent . key slaveof . del_ws_spc . ip . del_ws_spc . port . eol ]\n\n(* View: bind_entry\nThe \"bind\" entry can be passed one or several ip addresses. A bind\nstatement \"bind ip1 ip2 .. ipn\" results in a tree\n{ \"bind\" { \"ip\" = ip1 } { \"ip\" = ip2 } ... { \"ip\" = ipn } }\n*)\nlet bind_entry =\n let ip = del_ws_spc . Quote.do_quote_opt_nil (store Rx.ip) in\n indent . [ key \"bind\" . [ label \"ip\" . ip ]+ ] . eol\n\nlet renamecmd = \/rename-command\/\nlet from = [ label \"from\" . Quote.do_quote_opt_nil (store Rx.word) ]\nlet to = [ label \"to\" . Quote.do_quote_opt_nil (store Rx.word) ]\n(* View: save_entry\nEntries identified by the \"rename-command\" keyword can be found more than once.\nThey have 2 mandatory parameters, both strings. The same rules as\nstandard_entry apply for quoting, comments and whitespaces.\n*)\nlet renamecmd_entry = [ indent . key renamecmd . del_ws_spc . from . del_ws_spc . to . eol ]\n\nlet cobl_cmd = \/client-output-buffer-limit\/\nlet class = [ label \"class\" . Quote.do_quote_opt_nil (store Rx.word) ]\nlet hard_limit = [ label \"hard_limit\" . Quote.do_quote_opt_nil (store Rx.word) ]\nlet soft_limit = [ label \"soft_limit\" . Quote.do_quote_opt_nil (store Rx.word) ]\nlet soft_seconds = [ label \"soft_seconds\" . Quote.do_quote_opt_nil (store Rx.integer) ]\n(* View: client_output_buffer_limit_entry\nEntries identified by the \"client-output-buffer-limit\" keyword can be found\nmore than once. They have four mandatory parameters, of which the first is a\nstring, the last one is an integer and the others are either integers or words,\nalthough redis is very liberal and takes \"4242yadayadabytes\" as a valid limit.\nThe same rules as standard_entry apply for quoting, comments and whitespaces.\n*)\nlet client_output_buffer_limit_entry =\n [ indent . key cobl_cmd . del_ws_spc . class . del_ws_spc . hard_limit .\n del_ws_spc . soft_limit . del_ws_spc . soft_seconds . eol ]\n\nlet entry = standard_entry\n | save_entry\n\t | renamecmd_entry\n\t | slaveof_entry\n\t | bind_entry\n\t | client_output_buffer_limit_entry\n\n(* View: lns\nThe Redis lens\n*)\nlet lns = (comment | empty | entry )*\n\nlet filter =\n incl \"\/etc\/redis.conf\"\n . incl \"\/etc\/redis\/redis.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Redis\n Parses Redis's configuration files\n\nAuthor: Marc Fournier <marc.fournier@camptocamp.com>\n\nAbout: Reference\n This lens is based on Redis's default redis.conf\n\nAbout: Usage Example\n(start code)\naugtool> set \/augeas\/load\/Redis\/incl \"\/etc\/redis\/redis.conf\"\naugtool> set \/augeas\/load\/Redis\/lens \"Redis.lns\"\naugtool> load\n\naugtool> get \/files\/etc\/redis\/redis.conf\/vm-enabled\n\/files\/etc\/redis\/redis.conf\/vm-enabled = no\naugtool> print \/files\/etc\/redis\/redis.conf\/rename-command[1]\/\n\/files\/etc\/redis\/redis.conf\/rename-command\n\/files\/etc\/redis\/redis.conf\/rename-command\/from = \"CONFIG\"\n\/files\/etc\/redis\/redis.conf\/rename-command\/to = \"CONFIG2\"\n\naugtool> set \/files\/etc\/redis\/redis.conf\/activerehashing no\naugtool> save\nSaved 1 file(s)\naugtool> set \/files\/etc\/redis\/redis.conf\/save[1]\/seconds 123\naugtool> set \/files\/etc\/redis\/redis.conf\/save[1]\/keys 456\naugtool> save\nSaved 1 file(s)\n(end code)\n The <Test_Redis> file also contains various examples.\n\nAbout: License\n This file is licensed under the LGPL v2+, like the rest of Augeas.\n*)\n\nmodule Redis =\nautoload xfm\n\nlet k = Rx.word\nlet v = \/[^ \\t\\n'\"]+\/\nlet comment = Util.comment\nlet empty = Util.empty\nlet indent = Util.indent\nlet eol = Util.eol\nlet del_ws_spc = Util.del_ws_spc\nlet dquote = Util.del_str \"\\\"\"\n\n(* View: standard_entry\nA standard entry is a key-value pair, separated by blank space, with optional\nblank spaces at line beginning & end. The value part can be optionnaly enclosed\nin single or double quotes. Comments at end-of-line ar NOT allowed by\nredis-server.\n*)\nlet standard_entry =\n let reserved_k = \"save\" | \"rename-command\" | \"slaveof\"\n | \"bind\" | \"client-output-buffer-limit\"\n in let entry_noempty = [ indent . key (k - reserved_k) . del_ws_spc\n . Quote.do_quote_opt_nil (store v) . eol ]\n in let entry_empty = [ indent . key (k - reserved_k) . del_ws_spc\n . dquote . store \"\" . dquote . eol ]\n in entry_noempty | entry_empty\n\nlet save = \/save\/\nlet seconds = [ label \"seconds\" . Quote.do_quote_opt_nil (store Rx.integer) ]\nlet keys = [ label \"keys\" . Quote.do_quote_opt_nil (store Rx.integer) ]\n(* View: save_entry\nEntries identified by the \"save\" keyword can be found more than once. They have\n2 mandatory parameters, both integers. The same rules as standard_entry apply\nfor quoting, comments and whitespaces.\n*)\nlet save_entry = [ indent . key save . del_ws_spc . seconds . del_ws_spc . keys . eol ]\n\nlet slaveof = \/slaveof\/\nlet ip = [ label \"ip\" . Quote.do_quote_opt_nil (store Rx.ip) ]\nlet port = [ label \"port\" . Quote.do_quote_opt_nil (store Rx.integer) ]\n(* View: slaveof_entry\nEntries identified by the \"slaveof\" keyword can be found more than once. They\nhave 2 mandatory parameters, the 1st one is an IP address, the 2nd one is a\nport number. The same rules as standard_entry apply for quoting, comments and\nwhitespaces.\n*)\nlet slaveof_entry = [ indent . key slaveof . del_ws_spc . ip . del_ws_spc . port . eol ]\n\n(* View: bind_entry\nThe \"bind\" entry can be passed one or several ip addresses. A bind\nstatement \"bind ip1 ip2 .. ipn\" results in a tree\n{ \"bind\" { \"ip\" = ip1 } { \"ip\" = ip2 } ... { \"ip\" = ipn } }\n*)\nlet bind_entry =\n let ip = del_ws_spc . Quote.do_quote_opt_nil (store Rx.ip) in\n indent . [ key \"bind\" . [ label \"ip\" . ip ]+ ] . eol\n\nlet renamecmd = \/rename-command\/\nlet from = [ label \"from\" . Quote.do_quote_opt_nil (store Rx.word) ]\nlet to = [ label \"to\" . Quote.do_quote_opt_nil (store Rx.word) ]\n(* View: save_entry\nEntries identified by the \"rename-command\" keyword can be found more than once.\nThey have 2 mandatory parameters, both strings. The same rules as\nstandard_entry apply for quoting, comments and whitespaces.\n*)\nlet renamecmd_entry = [ indent . key renamecmd . del_ws_spc . from . del_ws_spc . to . eol ]\n\nlet cobl_cmd = \/client-output-buffer-limit\/\nlet class = [ label \"class\" . Quote.do_quote_opt_nil (store Rx.word) ]\nlet hard_limit = [ label \"hard_limit\" . Quote.do_quote_opt_nil (store Rx.word) ]\nlet soft_limit = [ label \"soft_limit\" . Quote.do_quote_opt_nil (store Rx.word) ]\nlet soft_seconds = [ label \"soft_seconds\" . Quote.do_quote_opt_nil (store Rx.integer) ]\n(* View: client_output_buffer_limit_entry\nEntries identified by the \"client-output-buffer-limit\" keyword can be found\nmore than once. They have four mandatory parameters, of which the first is a\nstring, the last one is an integer and the others are either integers or words,\nalthough redis is very liberal and takes \"4242yadayadabytes\" as a valid limit.\nThe same rules as standard_entry apply for quoting, comments and whitespaces.\n*)\nlet client_output_buffer_limit_entry =\n [ indent . key cobl_cmd . del_ws_spc . class . del_ws_spc . hard_limit .\n del_ws_spc . soft_limit . del_ws_spc . soft_seconds . eol ]\n\nlet entry = standard_entry\n | save_entry\n\t | renamecmd_entry\n\t | slaveof_entry\n\t | bind_entry\n\t | client_output_buffer_limit_entry\n\n(* View: lns\nThe Redis lens\n*)\nlet lns = (comment | empty | entry )*\n\nlet filter = incl \"\/etc\/redis\/redis.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0304a2a7efe6a69162500b5f47e04c8d58fbb3b8","subject":"Adapt augeas profile to handle negative int values.","message":"Adapt augeas profile to handle negative int values.\n\nIntroducing keepalive_interval = -1 breaks to augeas lens. Fix the lens\nby allowing signed ints in the regular expression.\n","repos":"eskultety\/libvirt,nertpinx\/libvirt,olafhering\/libvirt,jfehlig\/libvirt,andreabolognani\/libvirt,fabianfreyer\/libvirt,libvirt\/libvirt,fabianfreyer\/libvirt,fabianfreyer\/libvirt,jardasgit\/libvirt,datto\/libvirt,olafhering\/libvirt,eskultety\/libvirt,jardasgit\/libvirt,zippy2\/libvirt,jardasgit\/libvirt,libvirt\/libvirt,taget\/libvirt,nertpinx\/libvirt,jardasgit\/libvirt,datto\/libvirt,libvirt\/libvirt,VenkatDatta\/libvirt,eskultety\/libvirt,fabianfreyer\/libvirt,crobinso\/libvirt,nertpinx\/libvirt,fabianfreyer\/libvirt,jfehlig\/libvirt,taget\/libvirt,crobinso\/libvirt,taget\/libvirt,jfehlig\/libvirt,taget\/libvirt,VenkatDatta\/libvirt,andreabolognani\/libvirt,crobinso\/libvirt,nertpinx\/libvirt,andreabolognani\/libvirt,datto\/libvirt,datto\/libvirt,nertpinx\/libvirt,andreabolognani\/libvirt,jfehlig\/libvirt,VenkatDatta\/libvirt,eskultety\/libvirt,libvirt\/libvirt,zippy2\/libvirt,jardasgit\/libvirt,zippy2\/libvirt,zippy2\/libvirt,olafhering\/libvirt,datto\/libvirt,crobinso\/libvirt,VenkatDatta\/libvirt,taget\/libvirt,olafhering\/libvirt,eskultety\/libvirt,andreabolognani\/libvirt,VenkatDatta\/libvirt","old_file":"daemon\/libvirtd.aug","new_file":"daemon\/libvirtd.aug","new_contents":"(* \/etc\/libvirt\/libvirtd.conf *)\n\nmodule Libvirtd =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/-?[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let network_entry = bool_entry \"listen_tls\"\n | bool_entry \"listen_tcp\"\n | str_entry \"tls_port\"\n | str_entry \"tcp_port\"\n | str_entry \"listen_addr\"\n | bool_entry \"mdns_adv\"\n | str_entry \"mdns_name\"\n\n let sock_acl_entry = str_entry \"unix_sock_group\"\n | str_entry \"unix_sock_ro_perms\"\n | str_entry \"unix_sock_rw_perms\"\n | str_entry \"unix_sock_admin_perms\"\n | str_entry \"unix_sock_dir\"\n\n let authentication_entry = str_entry \"auth_unix_ro\"\n | str_entry \"auth_unix_rw\"\n | str_entry \"auth_tcp\"\n | str_entry \"auth_tls\"\n\n let certificate_entry = str_entry \"key_file\"\n | str_entry \"cert_file\"\n | str_entry \"ca_file\"\n | str_entry \"crl_file\"\n\n let authorization_entry = bool_entry \"tls_no_verify_certificate\"\n | bool_entry \"tls_no_sanity_certificate\"\n | str_array_entry \"tls_allowed_dn_list\"\n | str_array_entry \"sasl_allowed_username_list\"\n | str_array_entry \"access_drivers\"\n\n let processing_entry = int_entry \"min_workers\"\n | int_entry \"max_workers\"\n | int_entry \"max_clients\"\n | int_entry \"max_queued_clients\"\n | int_entry \"max_anonymous_clients\"\n | int_entry \"max_requests\"\n | int_entry \"max_client_requests\"\n | int_entry \"prio_workers\"\n\n let admin_processing_entry = int_entry \"admin_min_workers\"\n | int_entry \"admin_max_workers\"\n | int_entry \"admin_max_clients\"\n | int_entry \"admin_max_queued_clients\"\n | int_entry \"admin_max_client_requests\"\n\n let logging_entry = int_entry \"log_level\"\n | str_entry \"log_filters\"\n | str_entry \"log_outputs\"\n | int_entry \"log_buffer_size\"\n\n let auditing_entry = int_entry \"audit_level\"\n | bool_entry \"audit_logging\"\n\n let keepalive_entry = int_entry \"keepalive_interval\"\n | int_entry \"keepalive_count\"\n | bool_entry \"keepalive_required\"\n\n let admin_keepalive_entry = int_entry \"admin_keepalive_interval\"\n | int_entry \"admin_keepalive_count\"\n | bool_entry \"admin_keepalive_required\"\n\n let misc_entry = str_entry \"host_uuid\"\n\n (* Each enty in the config is one of the following three ... *)\n let entry = network_entry\n | sock_acl_entry\n | authentication_entry\n | certificate_entry\n | authorization_entry\n | processing_entry\n | admin_processing_entry\n | logging_entry\n | auditing_entry\n | keepalive_entry\n | admin_keepalive_entry\n | misc_entry\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/libvirtd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* \/etc\/libvirt\/libvirtd.conf *)\n\nmodule Libvirtd =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let network_entry = bool_entry \"listen_tls\"\n | bool_entry \"listen_tcp\"\n | str_entry \"tls_port\"\n | str_entry \"tcp_port\"\n | str_entry \"listen_addr\"\n | bool_entry \"mdns_adv\"\n | str_entry \"mdns_name\"\n\n let sock_acl_entry = str_entry \"unix_sock_group\"\n | str_entry \"unix_sock_ro_perms\"\n | str_entry \"unix_sock_rw_perms\"\n | str_entry \"unix_sock_admin_perms\"\n | str_entry \"unix_sock_dir\"\n\n let authentication_entry = str_entry \"auth_unix_ro\"\n | str_entry \"auth_unix_rw\"\n | str_entry \"auth_tcp\"\n | str_entry \"auth_tls\"\n\n let certificate_entry = str_entry \"key_file\"\n | str_entry \"cert_file\"\n | str_entry \"ca_file\"\n | str_entry \"crl_file\"\n\n let authorization_entry = bool_entry \"tls_no_verify_certificate\"\n | bool_entry \"tls_no_sanity_certificate\"\n | str_array_entry \"tls_allowed_dn_list\"\n | str_array_entry \"sasl_allowed_username_list\"\n | str_array_entry \"access_drivers\"\n\n let processing_entry = int_entry \"min_workers\"\n | int_entry \"max_workers\"\n | int_entry \"max_clients\"\n | int_entry \"max_queued_clients\"\n | int_entry \"max_anonymous_clients\"\n | int_entry \"max_requests\"\n | int_entry \"max_client_requests\"\n | int_entry \"prio_workers\"\n\n let admin_processing_entry = int_entry \"admin_min_workers\"\n | int_entry \"admin_max_workers\"\n | int_entry \"admin_max_clients\"\n | int_entry \"admin_max_queued_clients\"\n | int_entry \"admin_max_client_requests\"\n\n let logging_entry = int_entry \"log_level\"\n | str_entry \"log_filters\"\n | str_entry \"log_outputs\"\n | int_entry \"log_buffer_size\"\n\n let auditing_entry = int_entry \"audit_level\"\n | bool_entry \"audit_logging\"\n\n let keepalive_entry = int_entry \"keepalive_interval\"\n | int_entry \"keepalive_count\"\n | bool_entry \"keepalive_required\"\n\n let admin_keepalive_entry = int_entry \"admin_keepalive_interval\"\n | int_entry \"admin_keepalive_count\"\n | bool_entry \"admin_keepalive_required\"\n\n let misc_entry = str_entry \"host_uuid\"\n\n (* Each enty in the config is one of the following three ... *)\n let entry = network_entry\n | sock_acl_entry\n | authentication_entry\n | certificate_entry\n | authorization_entry\n | processing_entry\n | admin_processing_entry\n | logging_entry\n | auditing_entry\n | keepalive_entry\n | admin_keepalive_entry\n | misc_entry\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/libvirtd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b43abbb77afd5231ebdb491420fdf50bb204ac08","subject":"group: Testcase for NIS default","message":"group: Testcase for NIS default","repos":"kunkku\/augeas,pevalme\/augeas,pevalme\/augeas,raphink\/augeas,dafugg\/augeas,pevalme\/augeas,lutter\/augeas,jasperla\/augeas,ptoscano\/augeas,raphink\/augeas,ptoscano\/augeas,jjlin\/augeas,manandbytes\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,dafugg\/augeas,mlichvar\/augeas,jasperla\/augeas,kunkku\/augeas,mchf\/augeas,MikaelSmith\/augeas,jjlin\/augeas,jtopjian\/augeas,lutter\/augeas,hercules-team\/augeas,manandbytes\/augeas,dafugg\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,mchf\/augeas,lutter\/augeas,jtopjian\/augeas,jjlin\/augeas","old_file":"lenses\/tests\/test_group.aug","new_file":"lenses\/tests\/test_group.aug","new_contents":"module Test_group =\n\nlet conf = \"bin:x:2:\naudio:x:29:joe\navahi-autoipd:!:113:bill,martha\n\"\n\ntest Group.lns get conf =\n { \"bin\"\n { \"password\" = \"x\" }\n { \"gid\" = \"2\" } }\n { \"audio\"\n { \"password\" = \"x\" }\n { \"gid\" = \"29\" }\n { \"user\" = \"joe\" } }\n { \"avahi-autoipd\"\n { \"password\" = \"!\" }\n { \"gid\" = \"113\" }\n { \"user\" = \"bill\"}\n { \"user\" = \"martha\"} }\n\n(* Password field can be empty *)\ntest Group.lns get \"root::0:root\\n\" =\n { \"root\"\n { \"password\" = \"\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"root\" } }\n\n(* Password field can be disabled by ! or * *)\ntest Group.lns get \"testgrp:!:0:testusr\\n\" =\n { \"testgrp\"\n { \"password\" = \"!\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"testusr\" } }\n\ntest Group.lns get \"testgrp:*:0:testusr\\n\" =\n { \"testgrp\"\n { \"password\" = \"*\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"testusr\" } }\n\n(* NIS defaults *)\ntest Group.lns get \"+\\n\" =\n { \"@nisdefault\" }\n\ntest Group.lns get \"+:::\\n\" =\n { \"@nisdefault\"\n { \"password\" = \"\" }\n { \"gid\" = \"\" } }\n","old_contents":"module Test_group =\n\nlet conf = \"bin:x:2:\naudio:x:29:joe\navahi-autoipd:!:113:bill,martha\n\"\n\ntest Group.lns get conf =\n { \"bin\"\n { \"password\" = \"x\" }\n { \"gid\" = \"2\" } }\n { \"audio\"\n { \"password\" = \"x\" }\n { \"gid\" = \"29\" }\n { \"user\" = \"joe\" } }\n { \"avahi-autoipd\"\n { \"password\" = \"!\" }\n { \"gid\" = \"113\" }\n { \"user\" = \"bill\"}\n { \"user\" = \"martha\"} }\n\n(* Password field can be empty *)\ntest Group.lns get \"root::0:root\\n\" =\n { \"root\"\n { \"password\" = \"\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"root\" } }\n\n(* Password field can be disabled by ! or * *)\ntest Group.lns get \"testgrp:!:0:testusr\\n\" =\n { \"testgrp\"\n { \"password\" = \"!\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"testusr\" } }\n\ntest Group.lns get \"testgrp:*:0:testusr\\n\" =\n { \"testgrp\"\n { \"password\" = \"*\" }\n { \"gid\" = \"0\" }\n { \"user\" = \"testusr\" } }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"30f388992d3d2c6a8e550d3a8dee31ee3ad3a59a","subject":"Rework map lense as slashes are needed for keys","message":"Rework map lense as slashes are needed for keys\n","repos":"smoeding\/puppet-sendmail","old_file":"lib\/augeas\/lenses\/sendmail_map.aug","new_file":"lib\/augeas\/lenses\/sendmail_map.aug","new_contents":"(*\nModule: Sendmail\n Parses map files used by the Sendmail MTA\n\nAuthor: Stefan Moeding <stm@kill-9.net>\n\nAbout: Reference\n\nAbout: License\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/mail\/access, \/etc\/mail\/authinfo,\n \/etc\/mail\/bitdomain, \/etc\/mail\/domaintable, \/etc\/mail\/genericstable,\n \/etc\/mail\/mailertable, \/etc\/mail\/msp-authinfo, \/etc\/mail\/userdb,\n \/etc\/mail\/uudomain and \/etc\/mail\/virtusertable.\n\nAbout: Examples\n The <Test_Sendmail_Map> file contains various examples and tests.\n*)\n\nmodule Sendmail_Map =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n ************************************************************************)\n\nlet eol = Util.eol\nlet empty = Util.empty\nlet comment = Util.comment\nlet del_ws_tab = Util.del_ws_tab\n\n(************************************************************************\n * Group: VIEWS\n ************************************************************************)\n\n(* View: key_re *)\nlet key_re = \/[a-zA-Z0-9@.:_=\\\/+-]+\/\n\n(* View: val_re *)\nlet val_re = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* View: keyval *)\nlet keyval = [ seq \"key\" .\n [ label \"key\" . store key_re ] . del_ws_tab .\n [ label \"value\" . store val_re ] .\n eol ]\n\n(************************************************************************\n * Group: LENS & FILTER\n ************************************************************************)\n\nlet lns = ( comment | empty | keyval )*\n\nlet filter = incl \"\/etc\/mail\/access\"\n . incl \"\/etc\/mail\/authinfo\"\n . incl \"\/etc\/mail\/bitdomain\"\n . incl \"\/etc\/mail\/domaintable\"\n . incl \"\/etc\/mail\/genericstable\"\n . incl \"\/etc\/mail\/mailertable\"\n . incl \"\/etc\/mail\/msp-authinfo\"\n . incl \"\/etc\/mail\/userdb\"\n . incl \"\/etc\/mail\/uudomain\"\n . incl \"\/etc\/mail\/virtusertable\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sendmail\n Parses map files used by the Sendmail MTA\n\nAuthor: Stefan Moeding <stm@kill-9.net>\n\nAbout: Reference\n\nAbout: License\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/mail\/access, \/etc\/mail\/authinfo,\n \/etc\/mail\/bitdomain, \/etc\/mail\/domaintable, \/etc\/mail\/genericstable,\n \/etc\/mail\/mailertable, \/etc\/mail\/msp-authinfo, \/etc\/mail\/userdb,\n \/etc\/mail\/uudomain and \/etc\/mail\/virtusertable.\n\nAbout: Examples\n The <Test_Sendmail_Map> file contains various examples and tests.\n*)\n\nmodule Sendmail_Map =\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n ************************************************************************)\n\nlet eol = Util.eol\nlet empty = Util.empty\nlet comment = Util.comment\nlet del_ws_tab = Util.del_ws_tab\n\n(************************************************************************\n * Group: VIEWS\n ************************************************************************)\n\n(* View: key_re *)\nlet key_re = \/[a-zA-Z0-9.@_:+-]+\/\n\n(* View: val_re *)\nlet val_re = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* View: keyval *)\nlet keyval = [ key key_re . del_ws_tab . store val_re . eol ]\n\n(************************************************************************\n * Group: LENS & FILTER\n ************************************************************************)\n\nlet lns = ( comment | empty | keyval )*\n\nlet filter = incl \"\/etc\/mail\/access\"\n . incl \"\/etc\/mail\/authinfo\"\n . incl \"\/etc\/mail\/bitdomain\"\n . incl \"\/etc\/mail\/domaintable\"\n . incl \"\/etc\/mail\/genericstable\"\n . incl \"\/etc\/mail\/mailertable\"\n . incl \"\/etc\/mail\/msp-authinfo\"\n . incl \"\/etc\/mail\/userdb\"\n . incl \"\/etc\/mail\/uudomain\"\n . incl \"\/etc\/mail\/virtusertable\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Augeas"} {"commit":"1875c81a48b689c120678b1f109488d0aaded92b","subject":"Puppetfile: add support for moduledir (Christoph Maser)","message":"Puppetfile: add support for moduledir (Christoph Maser)\n","repos":"ptoscano\/augeas,hercules-team\/augeas,lutter\/augeas,kunkku\/augeas,mchf\/augeas,pevalme\/augeas,lutter\/augeas,ptoscano\/augeas,lutter\/augeas,hercules-team\/augeas,mlichvar\/augeas,pevalme\/augeas,kunkku\/augeas,manandbytes\/augeas,manandbytes\/augeas,pevalme\/augeas,ptoscano\/augeas,mchf\/augeas,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas","old_file":"lenses\/puppetfile.aug","new_file":"lenses\/puppetfile.aug","new_contents":"(*\nModule: Puppetfile\n Parses libarian-puppet's Puppetfile format\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n See https:\/\/github.com\/rodjek\/librarian-puppet\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Puppetfiles.\n\nAbout: Examples\n The <Test_Puppetfile> file contains various examples and tests.\n*)\n\nmodule Puppetfile =\n\n(* View: comma\n a comma, optionally preceded or followed by spaces or newlines *)\nlet comma = del \/[ \\t\\n]*,[ \\t\\n]*\/ \", \"\n\n(* View: moduledir\n The moduledir setting specifies where modules from the Puppetfile will be installed *)\nlet moduledir = [ Util.indent . key \"moduledir\" . Sep.space . Quote.any . Util.eol ]\n\n(* View: forge\n a forge entry *)\nlet forge = [ Util.indent . key \"forge\" . Sep.space . Quote.any . Util.eol ]\n\n(* View: metadata\n a metadata entry *)\nlet metadata = [ Util.indent . key \"metadata\" . Util.eol ]\n\n(* View: mod\n a module entry, with optional version and options *)\nlet mod =\n let mod_name = Quote.do_quote (store ((Rx.word . \/[\\\/-]\/)? . Rx.word))\n in let version = [ label \"@version\" . Quote.do_quote (store \/[^:\\n]+\/) ]\n in let opt = [ Util.del_str \":\" . key Rx.word . del \/[ \\t]*=>[ \\t]*\/ \" => \"\n . Quote.do_quote (store \/[^,\\n]*\/) ]\n in let opts = Build.opt_list opt comma\n in [ Util.indent . Util.del_str \"mod\" . seq \"mod\" . Sep.space . mod_name\n . (comma . version)?\n . (comma . opts)?\n . Util.eol ] \n\n(* View: lns\n the Puppetfile lens *)\nlet lns = (Util.empty | Util.comment | forge | metadata | mod | moduledir )*\n","old_contents":"(*\nModule: Puppetfile\n Parses libarian-puppet's Puppetfile format\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n See https:\/\/github.com\/rodjek\/librarian-puppet\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Puppetfiles.\n\nAbout: Examples\n The <Test_Puppetfile> file contains various examples and tests.\n*)\n\nmodule Puppetfile =\n\n(* View: comma\n a comma, optionally preceded or followed by spaces or newlines *)\nlet comma = del \/[ \\t\\n]*,[ \\t\\n]*\/ \", \"\n\n(* View: forge\n a forge entry *)\nlet forge = [ Util.indent . key \"forge\" . Sep.space . Quote.any . Util.eol ]\n\n(* View: metadata\n a metadata entry *)\nlet metadata = [ Util.indent . key \"metadata\" . Util.eol ]\n\n(* View: mod\n a module entry, with optional version and options *)\nlet mod =\n let mod_name = Quote.do_quote (store ((Rx.word . \/[\\\/-]\/)? . Rx.word))\n in let version = [ label \"@version\" . Quote.do_quote (store \/[^:\\n]+\/) ]\n in let opt = [ Util.del_str \":\" . key Rx.word . del \/[ \\t]*=>[ \\t]*\/ \" => \"\n . Quote.do_quote (store \/[^,\\n]*\/) ]\n in let opts = Build.opt_list opt comma\n in [ Util.indent . Util.del_str \"mod\" . seq \"mod\" . Sep.space . mod_name\n . (comma . version)?\n . (comma . opts)?\n . Util.eol ] \n\n(* View: lns\n the Puppetfile lens *)\nlet lns = (Util.empty | Util.comment | forge | metadata | mod)*\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0efc183d740421e0811f473666c4f1849e9f0c3f","subject":"Also handle \/etc\/monitrc","message":"Also handle \/etc\/monitrc\n\nFixes ticket #326\n","repos":"jtopjian\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,manandbytes\/augeas,kumy\/augeas,kunkku\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,mchf\/augeas,ptoscano\/augeas,ptoscano\/augeas,raphink\/augeas,raphink\/augeas,dafugg\/augeas,ptoscano\/augeas,jasperla\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas,kumy\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,mlichvar\/augeas,mchf\/augeas,jjlin\/augeas,kunkku\/augeas,pevalme\/augeas,kumy\/augeas,lutter\/augeas,hercules-team\/augeas,jjlin\/augeas,dafugg\/augeas,dafugg\/augeas,manandbytes\/augeas","old_file":"lenses\/monit.aug","new_file":"lenses\/monit.aug","new_contents":"(* Monit module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man monit (1), section \"HOW TO MONITOR\"\n\n \"A monit control file consists of a series of service entries and\n global option statements in a free-format, token-oriented syntax.\n\n Comments begin with a # and extend through the end of the line. There\n are three kinds of tokens in the control file: grammar keywords, numbers\n and strings. On a semantic level, the control file consists of three\n types of statements:\n\n 1. Global set-statements\n A global set-statement starts with the keyword set and the item to\n configure.\n\n 2. Global include-statement\n The include statement consists of the keyword include and a glob\n string.\n\n 3. One or more service entry statements.\n A service entry starts with the keyword check followed by the\n service type\"\n\n*)\n\nmodule Monit =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet spc = Sep.space\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sto_to_spc = store Rx.space_in\nlet sto_no_spc = store Rx.no_spaces\n\nlet word = Rx.word\nlet value = Build.key_value_line word spc sto_to_spc\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\n(* set statement *)\nlet set = Build.key_value \"set\" spc value\n\n(* include statement *)\nlet include = Build.key_value_line \"include\" spc sto_to_spc\n\n(* service statement *)\nlet service = Build.key_value \"check\" spc (Build.list value spc)\n\nlet entry = (set|include|service)\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/monit\/monitrc\"\n . incl \"\/etc\/monitrc\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Monit module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: man monit (1), section \"HOW TO MONITOR\"\n\n \"A monit control file consists of a series of service entries and\n global option statements in a free-format, token-oriented syntax.\n\n Comments begin with a # and extend through the end of the line. There\n are three kinds of tokens in the control file: grammar keywords, numbers\n and strings. On a semantic level, the control file consists of three\n types of statements:\n\n 1. Global set-statements\n A global set-statement starts with the keyword set and the item to\n configure.\n\n 2. Global include-statement\n The include statement consists of the keyword include and a glob\n string.\n\n 3. One or more service entry statements.\n A service entry starts with the keyword check followed by the\n service type\"\n\n*)\n\nmodule Monit =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet spc = Sep.space\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sto_to_spc = store Rx.space_in\nlet sto_no_spc = store Rx.no_spaces\n\nlet word = Rx.word\nlet value = Build.key_value_line word spc sto_to_spc\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\n(* set statement *)\nlet set = Build.key_value \"set\" spc value\n\n(* include statement *)\nlet include = Build.key_value_line \"include\" spc sto_to_spc\n\n(* service statement *)\nlet service = Build.key_value \"check\" spc (Build.list value spc)\n\nlet entry = (set|include|service)\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/monit\/monitrc\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"aa4ab7ff1fca43d0b889fb576752e5bc34e56cc5","subject":"Improve documentation of build.aug","message":"Improve documentation of build.aug\n","repos":"mlichvar\/augeas,lutter\/augeas,pevalme\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,mlichvar\/augeas,hercules-team\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,hercules-team\/augeas,pevalme\/augeas,jjlin\/augeas,manandbytes\/augeas,ptoscano\/augeas,ptoscano\/augeas,ptoscano\/augeas,raphink\/augeas,mchf\/augeas,lutter\/augeas,kunkku\/augeas,jtopjian\/augeas,pevalme\/augeas,dafugg\/augeas,dafugg\/augeas,dafugg\/augeas,lutter\/augeas,domcleal\/augeas,mchf\/augeas,MikaelSmith\/augeas,domcleal\/augeas,MikaelSmith\/augeas,kumy\/augeas,kumy\/augeas,jtopjian\/augeas,kumy\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jasperla\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas","old_file":"lenses\/build.aug","new_file":"lenses\/build.aug","new_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Reference\n This file provides generic functions to build Augeas lenses\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(************************************************************************\n * Group: GENERIC CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: brackets\n * Put a lens inside brackets\n *\n * Parameters:\n * l:lens - the left bracket lens\n * r: lens - the right bracket lens\n * lns:lens - the lens to put inside brackets\n ************************************************************************)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n\n(************************************************************************\n * Group: LIST CONSTRUCTIONS\n ************************************************************************)\n\n(************************************************************************\n * View: list\n * Build a list of identical lenses separated with a given separator\n * (at least 2 elements)\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\n\n\n(************************************************************************\n * View: opt_list\n * Same as <list>, but there might be only one element in the list\n *\n * Parameters:\n * lns:lens - the lens to repeat in the list\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n ************************************************************************)\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n\n(************************************************************************\n * Group: LABELS\n ************************************************************************)\n\n(************************************************************************\n * View: xchg\n * Replace a pattern with a different label in the tree,\n * thus emulating a key but allowing to replace the keyword\n * with a different value than matched\n *\n * Parameters:\n * m:regexp - the pattern to match\n * d:string - the default value when a node in created\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\n(************************************************************************\n * View: xchgs\n * Same as <xchg>, but the pattern is the default string\n *\n * Parameters:\n * m:string - the string to replace, also used as default\n * l:string - the label to apply for such nodes\n ************************************************************************)\nlet xchgs (m:string) (l:string) = xchg m m l\n\n\n(************************************************************************\n * Group: KEYS\n ************************************************************************)\n\n(************************************************************************\n * View: key_value_line\n * A subnode with a keyword, a separator and a storing lens,\n * and an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value_line (kw:regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\n(************************************************************************\n * View: key_value\n * Same as <key_value_line>, but does not end with an end of line\n *\n * Parameters:\n * kw:regexp - the pattern to match as key\n * sep:lens - the separator lens, which can be taken from the <Sep> module\n * sto:lens - the storing lens\n ************************************************************************)\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n\n\n","old_contents":"(*\nModule: Build\n Generic functions to build lenses\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Build =\n\nlet eol = Util.eol\n\n(* Generic constructions *)\nlet brackets (l:lens) (r:lens) (lns:lens) = l . lns . r\n\n(* List constructions *)\nlet list (lns:lens) (sep:lens) = lns . ( sep . lns )+\nlet opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*\n\n(* Labels *)\nlet xchg (m:regexp) (d:string) (l:string) = del m d . label l\n\nlet xchgs (m:string) (l:string) = xchg m m l\n\n(* Keys *)\nlet key_value_line (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto . eol ]\n\nlet key_value (kw: regexp) (sep:lens) (sto:lens) =\n [ key kw . sep . sto ]\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1e80d1f998d712260e910dde2a9083b89a45ecf7","subject":"Mysql: change default comment delimiter from ';' to '#'","message":"Mysql: change default comment delimiter from ';' to '#'\n\nFixes bug #181 reported by devzero\n","repos":"dafugg\/augeas,kumy\/augeas,pevalme\/augeas,manandbytes\/augeas,lutter\/augeas,mlichvar\/augeas,mchf\/augeas,pevalme\/augeas,jjlin\/augeas,domcleal\/augeas,pevalme\/augeas,mlichvar\/augeas,kumy\/augeas,dafugg\/augeas,jtopjian\/augeas,kumy\/augeas,kunkku\/augeas,mlichvar\/augeas,hercules-team\/augeas,domcleal\/augeas,raphink\/augeas,mchf\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas,raphink\/augeas,jtopjian\/augeas,domcleal\/augeas,jasperla\/augeas,jasperla\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,lutter\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,dafugg\/augeas","old_file":"lenses\/mysql.aug","new_file":"lenses\/mysql.aug","new_contents":"(* MySQL module for Augeas *)\n(* Author: Tim Stoop <tim@kumina.nl> *)\n(* Heavily based on php.aug by Raphael Pinson *)\n(* <raphink@gmail.com> *)\n(* *)\n\nmodule MySQL =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re \"#\"\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\nlet entry = [ key IniFile.entry_re . sep . IniFile.sto_to_comment . (comment|IniFile.eol) ] | \n [ key IniFile.entry_re . store \/\/ . (comment|IniFile.eol) ] | \n [ key \/\\![A-Za-z][A-Za-z0-9\\._-]+\/ . del \/ \/ \" \" . store \/\\\/[A-Za-z0-9\\.\\\/_-]+\/ . (comment|IniFile.eol) ] |\n comment\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/mysql\/my.cnf\")\n . (incl \"\/etc\/mysql\/conf.d\/*.cnf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(* MySQL module for Augeas *)\n(* Author: Tim Stoop <tim@kumina.nl> *)\n(* Heavily based on php.aug by Raphael Pinson *)\n(* <raphink@gmail.com> *)\n(* *)\n\nmodule MySQL =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\nlet entry = [ key IniFile.entry_re . sep . IniFile.sto_to_comment . (comment|IniFile.eol) ] | \n [ key IniFile.entry_re . store \/\/ . (comment|IniFile.eol) ] | \n [ key \/\\![A-Za-z][A-Za-z0-9\\._-]+\/ . del \/ \/ \" \" . store \/\\\/[A-Za-z0-9\\.\\\/_-]+\/ . (comment|IniFile.eol) ] |\n comment\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/mysql\/my.cnf\")\n . (incl \"\/etc\/mysql\/conf.d\/*.cnf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e69e82cc91097feb4c99139ec95de3abc36ac3ee","subject":"Added config.d files to the filter","message":"Added config.d files to the filter\n\nUsed by systems running Red Hat or a variant","repos":"lutter\/augeas,jtopjian\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,jasperla\/augeas,jtopjian\/augeas,pevalme\/augeas,manandbytes\/augeas,mlichvar\/augeas,mchf\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,lutter\/augeas,raphink\/augeas,pevalme\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,dafugg\/augeas,kunkku\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,lutter\/augeas,hercules-team\/augeas,jjlin\/augeas,ptoscano\/augeas,mchf\/augeas,ptoscano\/augeas,dafugg\/augeas,ptoscano\/augeas,manandbytes\/augeas,kunkku\/augeas,kunkku\/augeas,raphink\/augeas,jjlin\/augeas,hercules-team\/augeas,pevalme\/augeas","old_file":"lenses\/nginx.aug","new_file":"lenses\/nginx.aug","new_contents":"(* Module: Nginx\n Nginx module for Augeas\n\nAuthors: Ian Berry <iberry@barracuda.com>\n Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n\n This module was built to support a limited subset of nginx\n configuration syntax. It works fine with simple blocks and\n field\/value lines.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/nginx\/nginx.conf. See <filter>.\n\nAbout: Examples\n The <Test_Nginx> file contains various examples and tests.\n\nAbout: TODO\n * Convert statement keyworks for a regex\n * Support more advanced block syntax (location)\n*)\n\nmodule Nginx =\n\nautoload xfm\n\n(* Variable: block_re\n The keywords reserved for block entries *)\nlet block_re = \"http\" | \"events\"\n | \"server\" | \"upstream\"\n | \"location\" | \"if\"\n\n(* View: simple\n A simple entry *)\nlet simple = \n let kw = Rx.word - block_re\n in let sto = store \/[^ \\t\\n;][^;]*\/ . Sep.semicolon\n in Build.key_value_line_comment\n kw Sep.space sto Util.comment_eol\n\n(* View: block\n A block containing <simple> entries *)\nlet block =\n let entry = Util.indent . simple\n in [ key block_re\n . Build.block_newlines entry Util.comment\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( Util.comment | Util.empty | simple | block )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/nginx\/nginx.conf\"\n . incl \"\/etc\/nginx\/conf.d\/*.conf\"\n . incl \"\/usr\/portage\/www-servers\/nginx\/files\/nginx.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Module: Nginx\n Nginx module for Augeas\n\nAuthors: Ian Berry <iberry@barracuda.com>\n Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: Reference\n\n This module was built to support a limited subset of nginx\n configuration syntax. It works fine with simple blocks and\n field\/value lines.\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/nginx\/nginx.conf. See <filter>.\n\nAbout: Examples\n The <Test_Nginx> file contains various examples and tests.\n\nAbout: TODO\n * Convert statement keyworks for a regex\n * Support more advanced block syntax (location)\n*)\n\nmodule Nginx =\n\nautoload xfm\n\n(* Variable: block_re\n The keywords reserved for block entries *)\nlet block_re = \"http\" | \"events\"\n | \"server\" | \"upstream\"\n | \"location\" | \"if\"\n\n(* View: simple\n A simple entry *)\nlet simple = \n let kw = Rx.word - block_re\n in let sto = store \/[^ \\t\\n;][^;]*\/ . Sep.semicolon\n in Build.key_value_line_comment\n kw Sep.space sto Util.comment_eol\n\n(* View: block\n A block containing <simple> entries *)\nlet block =\n let entry = Util.indent . simple\n in [ key block_re\n . Build.block_newlines entry Util.comment\n . Util.eol ]\n\n(* View: lns *)\nlet lns = ( Util.comment | Util.empty | simple | block )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/nginx\/nginx.conf\"\n . incl \"\/usr\/portage\/www-servers\/nginx\/files\/nginx.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ffb03f7f9345496aa425fbb20f41db50618f2c38","subject":"M #-: Fix sinle entry section indent in oned.aug (#3809)","message":"M #-: Fix sinle entry section indent in oned.aug (#3809)\n\n","repos":"OpenNebula\/one,atodorov-storpool\/one,OpenNebula\/one,baby-gnu\/one,baby-gnu\/one,atodorov-storpool\/one,OpenNebula\/one,baby-gnu\/one,baby-gnu\/one,atodorov-storpool\/one,atodorov-storpool\/one,OpenNebula\/one,baby-gnu\/one,OpenNebula\/one,atodorov-storpool\/one,baby-gnu\/one,baby-gnu\/one,OpenNebula\/one,atodorov-storpool\/one,atodorov-storpool\/one,atodorov-storpool\/one,baby-gnu\/one,OpenNebula\/one,atodorov-storpool\/one,OpenNebula\/one,OpenNebula\/one","old_file":"share\/augeas\/oned.aug","new_file":"share\/augeas\/oned.aug","new_contents":"module Oned =\n autoload xfm\n\n(* Version: 1.1 *)\n\n(* primitives *)\nlet sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\nlet eol = del \/\\n\/ \"\\n\"\nlet opt_space = del \/[ \\t]*\/ \"\"\nlet opt_space_nl = del \/[ \\t\\n]*\/ \"\\n\"\nlet opt_nl_indent = del \/[ \\t\\n]*\/ \"\\n \"\nlet comma = del \/,\/ \",\"\nlet left_br = del \/\\[\/ \"[\"\nlet right_br = del \/\\]\/ \"]\"\n\n(* Regexes *)\n(* Match everyhting within quotes *)\nlet re_quoted_str = \/\"[^\\\"]*\"\/\n\n(* Match everything except spaces, quote(\"), l-bracket([) and num-sign(#) *)\nlet re_value_str = \/[^ \\t\\n\"\\[#]+\/\n\n(* Match everything except spaces, quote(\"), num-sign(#) and comma(,) *)\nlet re_section_value_str = \/[^ \\t\\n\"#,]+\/\n\n(* Store either after-value comment or full-line comment *)\nlet comment = [ label \"#comment\" . store \/#[^\\n]*\/ ]\nlet comment_eol = comment . eol\n\n\n(* Simple words *)\nlet name = key \/[A-Za-z_0-9]+\/\nlet re_simple_value = re_quoted_str | re_value_str\n\n\n(* Top level entry like `PORT = 2633` *)\nlet top_level_entry = name . sep . store re_simple_value\nlet top_level_line = opt_space\n . [ top_level_entry . opt_space . (comment)? ]\n . eol\n\n\n(* Section lens for section like `LOG = [ ... ]` *)\nlet section_value = re_quoted_str | re_section_value_str\nlet section_entry = [ name . sep . store section_value ]\nlet section_entry_list =\n ( section_entry . opt_space . comma . opt_nl_indent\n | comment_eol . opt_space )*\n . section_entry . opt_space_nl\n . ( comment_eol )*\n\nlet section = opt_space\n . [ name . sep\n . left_br\n . opt_nl_indent\n . section_entry_list\n . right_br ]\n . eol\n\nlet empty_line = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n(* Main lens *)\nlet lns = ( top_level_line | comment_eol | section | empty_line )*\n\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/one\/oned.conf\"\n . incl \"\/etc\/one\/sched.conf\"\n . incl \"\/etc\/one\/vmm_exec\/vmm_exec_kvm.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"module Oned =\n autoload xfm\n\n(* primitives *)\nlet sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\nlet eol = del \/\\n\/ \"\\n\"\nlet opt_space = del \/[ \\t]*\/ \"\"\nlet opt_space_nl = del \/[ \\t\\n]*\/ \"\\n\"\nlet opt_nl_indent = del \/[ \\t\\n]*\/ \"\\n \"\nlet comma = del \/,\/ \",\"\nlet left_br = del \/\\[\/ \"[\"\nlet right_br = del \/\\]\/ \"]\"\n\n(* Regexes *)\n(* Match everyhting within quotes *)\nlet re_quoted_str = \/\"[^\\\"]*\"\/\n\n(* Match everything except spaces, quote(\"), l-bracket([) and num-sign(#) *)\nlet re_value_str = \/[^ \\t\\n\"\\[#]+\/\n\n(* Match everything except spaces, quote(\"), num-sign(#) and comma(,) *)\nlet re_section_value_str = \/[^ \\t\\n\"#,]+\/\n\n(* Store either after-value comment or full-line comment *)\nlet comment = [ label \"#comment\" . store \/#[^\\n]*\/ ]\nlet comment_eol = comment . eol\n\n\n(* Simple words *)\nlet name = key \/[A-Za-z_0-9]+\/\nlet re_simple_value = re_quoted_str | re_value_str\n\n\n(* Top level entry like `PORT = 2633` *)\nlet top_level_entry = name . sep . store re_simple_value\nlet top_level_line = opt_space\n . [ top_level_entry . opt_space . (comment)? ]\n . eol\n\n\n(* Section lens for section like `LOG = [ ... ]` *)\nlet section_value = re_quoted_str | re_section_value_str\nlet section_entry = [ name . sep . store section_value ]\nlet section_entry_list =\n ( section_entry . opt_space . comma . opt_nl_indent\n | comment_eol . opt_space )*\n . section_entry . opt_space_nl\n . ( comment_eol )*\n\nlet section = opt_space\n . [ name . sep\n . left_br\n . opt_space_nl\n . section_entry_list\n . right_br ]\n . eol\n\nlet empty_line = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n(* Main lens *)\nlet lns = ( top_level_line | comment_eol | section | empty_line )*\n\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/one\/oned.conf\"\n . incl \"\/etc\/one\/sched.conf\"\n . incl \"\/etc\/one\/vmm_exec\/vmm_exec_kvm.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"fd9cf8c09cc40cde471e0e8e77a7dbe376ef22d9","subject":"Nginx: Add non-recursive ambiguities test","message":"Nginx: Add non-recursive ambiguities test\n","repos":"kunkku\/augeas,jjlin\/augeas,mlichvar\/augeas,jjlin\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,pevalme\/augeas,manandbytes\/augeas,jjlin\/augeas,manandbytes\/augeas,kunkku\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,lutter\/augeas,hercules-team\/augeas,mchf\/augeas,pevalme\/augeas,lutter\/augeas,ptoscano\/augeas,mchf\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas,dafugg\/augeas,mlichvar\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,dafugg\/augeas","old_file":"lenses\/tests\/test_nginx.aug","new_file":"lenses\/tests\/test_nginx.aug","new_contents":"(*\nModule: Test_Nginx\n Provides unit tests and examples for the <Nginx> lens.\n*)\nmodule Test_nginx =\n\n(* Check for non-recursive ambiguities *)\nlet directive = Nginx.simple\n | Nginx.block (\n Nginx.simple\n | Nginx.block Nginx.simple\n )\n\n(* Do some limited typechecking on the recursive lens; note that\n unrolling once more leads to a typecheck error that seems to\n be spurious, though it's not clear why\n\n Unrolling once more amounts to adding the clause\n Nginx.block (Nginx.block Nginx.simple)\n to unrolled and results in an error\n overlapping lenses in union.get\n Example matched by both: 'upstream{}\\n'\n*)\nlet unrolled = Nginx.simple | Nginx.block Nginx.simple\n\nlet lns_unrolled = (Util.comment | Util.empty | unrolled)\n\n(* Normal unit tests *)\nlet lns = Nginx.lns\n\nlet conf =\"user nginx nginx;\nworker_processes 1;\nerror_log \/var\/log\/nginx\/error_log info;\n\nevents {\n worker_connections 1024;\n use epoll;\n}\n\n# comment1\n# comment2\n\nhttp {\n\t# comment3\n include \/etc\/nginx\/mime.types;\n default_type application\/octet-stream;\n log_format main\n '$remote_addr - $remote_user [$time_local] '\n '\\\"$request\\\" $status $bytes_sent '\n '\\\"$http_referer\\\" \\\"$http_user_agent\\\" '\n '\\\"$gzip_ratio\\\"';\n client_header_timeout 10m;\n client_body_timeout 10m;\n send_timeout 10m;\n connection_pool_size 256;\n client_header_buffer_size 2k;\n large_client_header_buffers 4 8k;\n request_pool_size 4k;\n gzip on;\n\tgzip_min_length 1000;\n gzip_buffers 4 8k;\n gzip_types text\/plain application\/json;\n output_buffers 1 32k;\n postpone_output 1460;\n sendfile on;\n tcp_nopush on;\n tcp_nodelay on;\n keepalive_timeout 75 20;\n ignore_invalid_headers on;\n index index.html index.php;\n include vhosts\/*.conf;\n}\n\"\n\ntest lns get conf =\n { \"user\" = \"nginx nginx\" }\n { \"worker_processes\" = \"1\" }\n { \"error_log\" = \"\/var\/log\/nginx\/error_log info\" }\n {}\n { \"events\"\n { \"worker_connections\" = \"1024\" }\n { \"use\" = \"epoll\" } }\n {}\n { \"#comment\" = \"comment1\" }\n { \"#comment\" = \"comment2\" }\n {}\n { \"http\"\n \t { \"#comment\" = \"comment3\" }\n { \"include\" = \"\/etc\/nginx\/mime.types\" }\n { \"default_type\" = \"application\/octet-stream\" }\n { \"log_format\" = \"main\n '$remote_addr - $remote_user [$time_local] '\n '\\\"$request\\\" $status $bytes_sent '\n '\\\"$http_referer\\\" \\\"$http_user_agent\\\" '\n '\\\"$gzip_ratio\\\"'\" }\n { \"client_header_timeout\" = \"10m\" }\n { \"client_body_timeout\" = \"10m\" }\n { \"send_timeout\" = \"10m\" }\n { \"connection_pool_size\" = \"256\" }\n { \"client_header_buffer_size\" = \"2k\" }\n { \"large_client_header_buffers\" = \"4 8k\" }\n { \"request_pool_size\" = \"4k\" }\n { \"gzip\" = \"on\" }\n { \"gzip_min_length\" = \"1000\" }\n { \"gzip_buffers\" = \"4 8k\" }\n { \"gzip_types\" = \"text\/plain application\/json\" }\n { \"output_buffers\" = \"1 32k\" }\n { \"postpone_output\" = \"1460\" }\n { \"sendfile\" = \"on\" }\n { \"tcp_nopush\" = \"on\" }\n { \"tcp_nodelay\" = \"on\" }\n { \"keepalive_timeout\" = \"75 20\" }\n { \"ignore_invalid_headers\" = \"on\" }\n { \"index\" = \"index.html index.php\" }\n { \"include\" = \"vhosts\/*.conf\" } }\n\n(* location blocks *)\ntest lns get \"location \/ { }\\n\" =\n { \"location\"\n { \"#uri\" = \"\/\" } }\n\ntest lns get \"location = \/ { }\\n\" =\n { \"location\"\n { \"#comp\" = \"=\" }\n { \"#uri\" = \"\/\" } }\n\ntest lns get \"location \/documents\/ { }\\n\" =\n { \"location\"\n { \"#uri\" = \"\/documents\/\" } }\n\ntest lns get \"location ^~ \/images\/ { }\\n\" =\n { \"location\"\n { \"#comp\" = \"^~\" }\n { \"#uri\" = \"\/images\/\" } }\n\ntest lns get \"location ~* \\.(gif|jpg|jpeg)$ { }\\n\" =\n { \"location\"\n { \"#comp\" = \"~*\" }\n { \"#uri\" = \"\\.(gif|jpg|jpeg)$\" } }\n\ntest lns get \"location @fallback { }\\n\" =\n { \"location\"\n { \"#uri\" = \"@fallback\" } }\n\n(* if blocks *)\ntest lns get \"if ($slow) {\n tcp_nodelay on;\n}\\n\" =\n { \"if\"\n { \"#cond\" = \"($slow)\" }\n { \"tcp_nodelay\" = \"on\" } }\n\ntest lns get \"if ($request_method = POST) { }\\n\" =\n { \"if\"\n { \"#cond\" = \"($request_method = POST)\" } }\n\n\ntest lns get \"if ($http_cookie ~* \\\"id=([^;]+)(?:;|$)\\\") { }\\n\" =\n { \"if\"\n { \"#cond\" = \"($http_cookie ~* \\\"id=([^;]+)(?:;|$)\\\")\" } }\n\n(* geo blocks *)\ntest lns get \"geo $geo { }\\n\" =\n { \"geo\"\n { \"#geo\" = \"$geo\" } }\n\ntest lns get \"geo $address $geo { }\\n\" =\n { \"geo\"\n { \"#address\" = \"$address\" }\n { \"#geo\" = \"$geo\" } }\n\n(* map blocks *)\ntest lns get \"map $http_host $name { }\\n\" =\n { \"map\"\n { \"#source\" = \"$http_host\" }\n { \"#variable\" = \"$name\" } }\n\n(* split_clients block *)\ntest lns get \"split_clients \\\"${remote_addr}AAA\\\" $variable { }\\n\" =\n { \"split_clients\"\n { \"#string\" = \"\\\"${remote_addr}AAA\\\"\" }\n { \"#variable\" = \"$variable\" } }\n\n(* upstream block *)\ntest lns get \"upstream backend { }\\n\" =\n { \"upstream\"\n { \"#name\" = \"backend\" } }\n\n(* GH #179 - recursive blocks *)\nlet http = \"http {\n server {\n listen 80;\n location \/ {\n root\\thtml;\n }\n }\n gzip on;\n}\\n\"\n\ntest lns get http =\n { \"http\"\n { \"server\"\n { \"listen\" = \"80\" }\n { \"location\"\n { \"#uri\" = \"\/\" }\n { \"root\" = \"html\" } } }\n { \"gzip\" = \"on\" } }\n\n(* Make sure we do not screw up the indentation of the file *)\ntest lns put http after set \"\/http\/gzip\" \"off\" =\n\"http {\n server {\n listen 80;\n location \/ {\n root\\thtml;\n }\n }\n gzip off;\n}\\n\"\n","old_contents":"(*\nModule: Test_Nginx\n Provides unit tests and examples for the <Nginx> lens.\n*)\nmodule Test_nginx =\n\n(* Do some limited typechecking on the recursive lens; note that\n unrolling once more leads to a typecheck error that seems to\n be spurious, though it's not clear why\n\n Unrolling once more amounts to adding the clause\n Nginx.block (Nginx.block Nginx.simple)\n to unrolled and results in an error\n overlapping lenses in union.get\n Example matched by both: 'upstream{}\\n'\n*)\nlet unrolled = Nginx.simple | Nginx.block Nginx.simple\n\nlet lns_unrolled = (Util.comment | Util.empty | unrolled)\n\n(* Normal unit tests *)\nlet lns = Nginx.lns\n\nlet conf =\"user nginx nginx;\nworker_processes 1;\nerror_log \/var\/log\/nginx\/error_log info;\n\nevents {\n worker_connections 1024;\n use epoll;\n}\n\n# comment1\n# comment2\n\nhttp {\n\t# comment3\n include \/etc\/nginx\/mime.types;\n default_type application\/octet-stream;\n log_format main\n '$remote_addr - $remote_user [$time_local] '\n '\\\"$request\\\" $status $bytes_sent '\n '\\\"$http_referer\\\" \\\"$http_user_agent\\\" '\n '\\\"$gzip_ratio\\\"';\n client_header_timeout 10m;\n client_body_timeout 10m;\n send_timeout 10m;\n connection_pool_size 256;\n client_header_buffer_size 2k;\n large_client_header_buffers 4 8k;\n request_pool_size 4k;\n gzip on;\n\tgzip_min_length 1000;\n gzip_buffers 4 8k;\n gzip_types text\/plain application\/json;\n output_buffers 1 32k;\n postpone_output 1460;\n sendfile on;\n tcp_nopush on;\n tcp_nodelay on;\n keepalive_timeout 75 20;\n ignore_invalid_headers on;\n index index.html index.php;\n include vhosts\/*.conf;\n}\n\"\n\ntest lns get conf =\n { \"user\" = \"nginx nginx\" }\n { \"worker_processes\" = \"1\" }\n { \"error_log\" = \"\/var\/log\/nginx\/error_log info\" }\n {}\n { \"events\"\n { \"worker_connections\" = \"1024\" }\n { \"use\" = \"epoll\" } }\n {}\n { \"#comment\" = \"comment1\" }\n { \"#comment\" = \"comment2\" }\n {}\n { \"http\"\n \t { \"#comment\" = \"comment3\" }\n { \"include\" = \"\/etc\/nginx\/mime.types\" }\n { \"default_type\" = \"application\/octet-stream\" }\n { \"log_format\" = \"main\n '$remote_addr - $remote_user [$time_local] '\n '\\\"$request\\\" $status $bytes_sent '\n '\\\"$http_referer\\\" \\\"$http_user_agent\\\" '\n '\\\"$gzip_ratio\\\"'\" }\n { \"client_header_timeout\" = \"10m\" }\n { \"client_body_timeout\" = \"10m\" }\n { \"send_timeout\" = \"10m\" }\n { \"connection_pool_size\" = \"256\" }\n { \"client_header_buffer_size\" = \"2k\" }\n { \"large_client_header_buffers\" = \"4 8k\" }\n { \"request_pool_size\" = \"4k\" }\n { \"gzip\" = \"on\" }\n { \"gzip_min_length\" = \"1000\" }\n { \"gzip_buffers\" = \"4 8k\" }\n { \"gzip_types\" = \"text\/plain application\/json\" }\n { \"output_buffers\" = \"1 32k\" }\n { \"postpone_output\" = \"1460\" }\n { \"sendfile\" = \"on\" }\n { \"tcp_nopush\" = \"on\" }\n { \"tcp_nodelay\" = \"on\" }\n { \"keepalive_timeout\" = \"75 20\" }\n { \"ignore_invalid_headers\" = \"on\" }\n { \"index\" = \"index.html index.php\" }\n { \"include\" = \"vhosts\/*.conf\" } }\n\n(* location blocks *)\ntest lns get \"location \/ { }\\n\" =\n { \"location\"\n { \"#uri\" = \"\/\" } }\n\ntest lns get \"location = \/ { }\\n\" =\n { \"location\"\n { \"#comp\" = \"=\" }\n { \"#uri\" = \"\/\" } }\n\ntest lns get \"location \/documents\/ { }\\n\" =\n { \"location\"\n { \"#uri\" = \"\/documents\/\" } }\n\ntest lns get \"location ^~ \/images\/ { }\\n\" =\n { \"location\"\n { \"#comp\" = \"^~\" }\n { \"#uri\" = \"\/images\/\" } }\n\ntest lns get \"location ~* \\.(gif|jpg|jpeg)$ { }\\n\" =\n { \"location\"\n { \"#comp\" = \"~*\" }\n { \"#uri\" = \"\\.(gif|jpg|jpeg)$\" } }\n\ntest lns get \"location @fallback { }\\n\" =\n { \"location\"\n { \"#uri\" = \"@fallback\" } }\n\n(* if blocks *)\ntest lns get \"if ($slow) {\n tcp_nodelay on;\n}\\n\" =\n { \"if\"\n { \"#cond\" = \"($slow)\" }\n { \"tcp_nodelay\" = \"on\" } }\n\ntest lns get \"if ($request_method = POST) { }\\n\" =\n { \"if\"\n { \"#cond\" = \"($request_method = POST)\" } }\n\n\ntest lns get \"if ($http_cookie ~* \\\"id=([^;]+)(?:;|$)\\\") { }\\n\" =\n { \"if\"\n { \"#cond\" = \"($http_cookie ~* \\\"id=([^;]+)(?:;|$)\\\")\" } }\n\n(* geo blocks *)\ntest lns get \"geo $geo { }\\n\" =\n { \"geo\"\n { \"#geo\" = \"$geo\" } }\n\ntest lns get \"geo $address $geo { }\\n\" =\n { \"geo\"\n { \"#address\" = \"$address\" }\n { \"#geo\" = \"$geo\" } }\n\n(* map blocks *)\ntest lns get \"map $http_host $name { }\\n\" =\n { \"map\"\n { \"#source\" = \"$http_host\" }\n { \"#variable\" = \"$name\" } }\n\n(* split_clients block *)\ntest lns get \"split_clients \\\"${remote_addr}AAA\\\" $variable { }\\n\" =\n { \"split_clients\"\n { \"#string\" = \"\\\"${remote_addr}AAA\\\"\" }\n { \"#variable\" = \"$variable\" } }\n\n(* upstream block *)\ntest lns get \"upstream backend { }\\n\" =\n { \"upstream\"\n { \"#name\" = \"backend\" } }\n\n(* GH #179 - recursive blocks *)\nlet http = \"http {\n server {\n listen 80;\n location \/ {\n root\\thtml;\n }\n }\n gzip on;\n}\\n\"\n\ntest lns get http =\n { \"http\"\n { \"server\"\n { \"listen\" = \"80\" }\n { \"location\"\n { \"#uri\" = \"\/\" }\n { \"root\" = \"html\" } } }\n { \"gzip\" = \"on\" } }\n\n(* Make sure we do not screw up the indentation of the file *)\ntest lns put http after set \"\/http\/gzip\" \"off\" =\n\"http {\n server {\n listen 80;\n location \/ {\n root\\thtml;\n }\n }\n gzip off;\n}\\n\"\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d139175ea53f45eded8ac057f42ab04054c04310","subject":"Shellvars.aug: Fix empty lines after comments","message":"Shellvars.aug: Fix empty lines after comments\n","repos":"raphink\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,mchf\/augeas,pevalme\/augeas,lutter\/augeas,lutter\/augeas,lutter\/augeas,dafugg\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,mchf\/augeas,mlichvar\/augeas,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,hercules-team\/augeas,jasperla\/augeas,manandbytes\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,raphink\/augeas,mlichvar\/augeas,hercules-team\/augeas,jjlin\/augeas,kunkku\/augeas,pevalme\/augeas,kumy\/augeas,kumy\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,mlichvar\/augeas,ptoscano\/augeas,dafugg\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*(;|\\n)\\n*\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*(;|\\n)\\n*\/ \"\\n\"\n let empty = Util.empty\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment . empty*\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n let comment_or_eol = comment_eol | semicol_eol\n\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . (empty* . comment* . case_entry)*\n . empty* . comment*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*(;|\\n)\\n*\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*(;|\\n)\\n*\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let matching_re = \"${!\" . key_re . \/[\\*@]\\}\/\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n (* comment_eol in shell MUST begin with a space *)\n let comment_eol = Util.comment_generic \/[ \\t]+#[ \\t]*\/ \" # \"\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^`;() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^']*'\/\n let bquot = \/`[^`\\n]*`\/\n (* dbquot don't take spaces or semi-colons *)\n let dbquot = \/``[^` \\t\\n;]+``\/\n let dollar_assign = \/\\$\\([^\\)#\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | (dquot | squot)+\n | bquot | dbquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store (key_re | matching_re) . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry*\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . ((empty|comment)* . case_entry)*\n . (empty|comment)*\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) *\n\n let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_excl \"network\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_excl \"network-scripts\" .\n sc_incl \"network-scripts\/ifcfg-*\" .\n sc_excl \"rhn\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_excl \"rhn\/allowed-actions\/script\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_excl \"SuSEfirewall2.d\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_default = incl \"\/etc\/default\/*\"\n . excl \"\/etc\/default\/whoopsie\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d73eb0d90f1be40d30f1d7559fdc53029eacd638","subject":"Added \/etc\/sysconfig\/suseconfig to shellvars lens.","message":"Added \/etc\/sysconfig\/suseconfig to shellvars lens.\n","repos":"kunkku\/augeas,mlichvar\/augeas,jjlin\/augeas,kumy\/augeas,jtopjian\/augeas,kunkku\/augeas,jjlin\/augeas,MikaelSmith\/augeas,lutter\/augeas,jasperla\/augeas,jasperla\/augeas,raphink\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,MikaelSmith\/augeas,kumy\/augeas,ptoscano\/augeas,kunkku\/augeas,raphink\/augeas,ptoscano\/augeas,mchf\/augeas,domcleal\/augeas,domcleal\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,dafugg\/augeas,pevalme\/augeas,domcleal\/augeas,kumy\/augeas,hercules-team\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,jtopjian\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,dafugg\/augeas,lutter\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n let bquot = \/`[^`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let lns = (comment | empty | source | kv | unset | bare_export) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"suseconfig\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n let comment = Util.comment\n let empty = Util.empty\n let xchgs = Build.xchgs\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n let bquot = \/`[^`\\n]*`\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ export? . key key_re . eq . (simple_value | array) . eol ]\n\n let var_action (name:string) =\n [ xchgs name (\"@\" . name) . Util.del_ws_spc . store key_re . eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [\n del \/\\.|source\/ \".\" . label \".source\" .\n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol\n ]\n\n let lns = (comment | empty | source | kv | unset | bare_export) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig =\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"puppet\" .\n sc_incl \"puppetmaster\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"88ecc983f7e9eb59b4ea9c0adc05f9e9c625f29f","subject":"Use generic modules Rx, Sep and Build in keepalived.aug","message":"Use generic modules Rx, Sep and Build in keepalived.aug\n","repos":"jtopjian\/augeas,hercules-team\/augeas,raphink\/augeas,ptoscano\/augeas,jasperla\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,lutter\/augeas,kumy\/augeas,dafugg\/augeas,kumy\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,pevalme\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,mchf\/augeas,kunkku\/augeas,domcleal\/augeas,jjlin\/augeas,kunkku\/augeas,kunkku\/augeas,kumy\/augeas,hercules-team\/augeas,dafugg\/augeas,mchf\/augeas,ptoscano\/augeas,raphink\/augeas,jjlin\/augeas,mlichvar\/augeas,domcleal\/augeas,jjlin\/augeas,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,kumy\/augeas,manandbytes\/augeas","old_file":"lenses\/keepalived.aug","new_file":"lenses\/keepalived.aug","new_contents":"(*\nModule: Keepalived\n Parses \/etc\/keepalived\/keepalived.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 keepalived.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/keepalived\/keepalived.conf. See <filter>.\n*)\n\n\nmodule Keepalived =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Comments and empty lines *)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: sep_spc *)\nlet sep_spc = Sep.space\n\n(* View: lbracket *)\nlet lbracket = Util.del_str \"{\"\n\n(* View: rbracket *)\nlet rbracket = Util.del_str \"}\"\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment = \n [ indent . label \"#comment\" . del \/[#!][ \\t]*\/ \"# \"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: eol_comment\nAnd end-of-line comment\nwith a space in front of # by default *)\nlet eol_comment =\n [ label \"#comment\" . del \/[ \\t]*[#!][ \\t]*\/ \" # \"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = Util.empty\n\n(* View: sto_email_addr *)\nlet sto_email_addr = store Rx.email_addr\n\n(* Variable: word *)\nlet word = Rx.word\n\n(* Variable: word_slash *)\nlet word_slash = word | \"\/\"\n\n(* View: sto_word *)\nlet sto_word = store word\n\n(* View: sto_num *)\nlet sto_num = store Rx.integer\n\n(* View: field *)\nlet field (kw:string) (sto:lens) = indent . Build.key_value_line_comment kw sep_spc sto eol_comment\n\n(* View: flag\nA single word *)\nlet flag (kw:regexp) = indent . Build.flag kw\n\n(* View: lens_block \nA generic block with a title lens *)\nlet lens_block (title:lens) (sto:lens) = [ indent . title . sep_spc . lbracket . eol\n . (sto | empty | comment)+\n . indent . rbracket . eol ]\n\n(* View: block\nA simple block with just a block title *)\nlet block (kw:string) (sto:lens) = lens_block (key kw) sto\n\n(* View: named_block \nA block with a block title and name *)\nlet named_block (kw:string) (sto:lens) = lens_block (key kw . sep_spc . sto_word) sto\n\n(* View: named_block_arg_title\nA title lens for named_block_arg *)\nlet named_block_arg_title (kw:string) (name:string) (arg:string) = \n key kw . sep_spc\n . [ label name . sto_word ]\n . sep_spc\n . [ label arg . sto_word ]\n\n(* View: named_block_arg\nA block with a block title, a name and an argument *)\nlet named_block_arg (kw:string) (name:string) (arg:string) (sto:lens) = \n lens_block (named_block_arg_title kw name arg) sto\n\n\n(************************************************************************\n * Group: GLOBAL CONFIGURATION\n *************************************************************************)\n\n(* View: email\nA simple email address entry *)\nlet email = [ indent . label \"email\" . sto_email_addr . (eol_comment|eol) ]\n\n(* View: global_defs_field\nPossible fields in the global_defs block *)\nlet global_defs_field = block \"notification_email\" email\n | field \"notification_email_from\" sto_email_addr\n | field \"smtp_server\" sto_word\n | field \"smtp_connect_timeout\" sto_num\n | field \"lvs_id\" sto_word\n | field \"router_id\" sto_word\n\n(* View: global_defs\nA global_defs block *)\nlet global_defs = block \"global_defs\" global_defs_field\n\n(* View: prefixlen\nA prefix for IP addresses *)\nlet prefixlen = [ label \"prefixlen\" . Util.del_str \"\/\" . sto_num ]\n\n(* View: ipaddr\nAn IP address or range with an optional mask *)\nlet ipaddr = label \"ipaddr\" . store \/[0-9\\.-]+\/ . prefixlen?\n\n(* View: ipdev\nA device for IP addresses *)\nlet ipdev = [ key \"dev\" . sep_spc . sto_word ]\n\n(* View: static_ipaddress_field\nThe whole string is fed to ip addr add.\nYou can truncate the string anywhere you like and let ip addr add use defaults for the rest of the string.\nTo be refined with fields according to `ip addr help`.\n*)\nlet static_ipaddress_field = [ indent . ipaddr\n . (sep_spc . ipdev)?\n . (eol|eol_comment) ]\n\n(* View: static_routes_field\nsrc $SRC_IP to $DST_IP dev $SRC_DEVICE\n*)\nlet static_routes_field = [ indent . label \"route\"\n . [ key \"src\" . sto_word ] . sep_spc\n . [ key \"to\" . sto_word ] . sep_spc\n . [ key \"dev\" . sto_word ] . (eol|eol_comment) ]\n\n(* View: static_routes *)\nlet static_routes = block \"static_ipaddress\" static_ipaddress_field\n | block \"static_routes\" static_routes_field\n\n\n(* View: global_conf \nA global configuration entry *)\nlet global_conf = global_defs | static_routes\n\n\n(************************************************************************\n * Group: VRRP CONFIGURATION\n *************************************************************************)\n\n(*View: vrrp_sync_group_field *)\nlet vrrp_sync_group_field = block \"group\" [ indent . key word . (eol|eol_comment) ]\n\n(* View: vrrp_sync_group *)\nlet vrrp_sync_group = named_block \"vrrp_sync_group\" vrrp_sync_group_field\n\n(* View: vrrp_instance_field *)\nlet vrrp_instance_field = field \"state\" sto_word\n | field \"interface\" sto_word\n | field \"lvs_sync_daemon_interface\" sto_word\n | field \"virtual_router_id\" sto_num\n | field \"priority\" sto_num\n | field \"advert_int\" sto_num\n | flag \"smtp_alert\"\n | flag \"nopreempt\"\n | block \"authentication\" (\n field \"auth_type\" sto_word\n | field \"auth_pass\" sto_word\n )\n | block \"virtual_ipaddress\" static_ipaddress_field\n\n(* View: vrrp_instance *)\nlet vrrp_instance = named_block \"vrrp_instance\" vrrp_instance_field\n\n\n(* View: vrrpd_conf\ncontains subblocks of VRRP synchronization group(s) and VRRP instance(s) *)\nlet vrrpd_conf = vrrp_sync_group | vrrp_instance\n\n\n(************************************************************************\n * Group: LVS CONFIGURATION\n *************************************************************************)\n\n(* View: tcp_check_field *)\nlet tcp_check_field = field \"connect_timeout\" sto_num\n | field \"connect_port\" sto_num\n\n(* View: real_server_field *)\nlet real_server_field = field \"weight\" sto_num\n | block \"TCP_CHECK\" tcp_check_field\n\n(* View: virtual_server_field *)\nlet virtual_server_field = field \"delay_loop\" sto_num\n | field \"lb_algo\" sto_word\n | field \"lb_kind\" sto_word\n | field \"nat_mask\" sto_word\n | field \"protocol\" sto_word\n | named_block_arg \"real_server\" \"ip\" \"port\" real_server_field\n\n(* View: virtual_server *)\nlet virtual_server = named_block_arg \"virtual_server\" \"ip\" \"port\" virtual_server_field\n\n(* View: virtual_server_group_field *)\nlet virtual_server_group_field = [ indent . label \"vip\"\n . [ ipaddr ]\n\t\t\t . sep_spc\n\t\t\t . [ label \"port\" . sto_num ]\n\t\t\t . (eol|eol_comment) ]\n\n(* View: virtual_server_group *)\nlet virtual_server_group = named_block \"virtual_server_group\" virtual_server_group_field\n\n(* View: lvs_conf\ncontains subblocks of Virtual server group(s) and Virtual server(s) *)\nlet lvs_conf = virtual_server | virtual_server_group\n\n\n(* View: lns\n The keepalived lens\n*)\nlet lns = ( empty | comment | global_conf | vrrpd_conf | lvs_conf )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/keepalived\/keepalived.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(*\nModule: Keepalived\n Parses \/etc\/keepalived\/keepalived.conf\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 keepalived.conf` where possible.\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/keepalived\/keepalived.conf. See <filter>.\n*)\n\n\nmodule Keepalived =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Comments and empty lines *)\n\n(* View: indent *)\nlet indent = Util.indent\n\n(* View: eol *)\nlet eol = Util.eol\n\n(* View: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* View: lbracket *)\nlet lbracket = Util.del_str \"{\"\n\n(* View: rbracket *)\nlet rbracket = Util.del_str \"}\"\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment = \n [ indent . label \"#comment\" . del \/[#!][ \\t]*\/ \"# \"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: eol_comment\nAnd end-of-line comment\nwith a space in front of # by default *)\nlet eol_comment =\n [ label \"#comment\" . del \/[ \\t]*[#!][ \\t]*\/ \" # \"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = Util.empty\n\n(* View: sto_email_addr *)\nlet sto_email_addr = store \/[A-Za-z0-9_\\+\\.-]+@[A-Za-z0-9_\\.-]+\/\n\n(* Variable: word *)\nlet word = \/[A-Za-z0-9_\\.-]+\/\n\n(* Variable: word_slash *)\nlet word_slash = \/[A-Za-z0-9_\\.\\\/-]+\/\n\n(* View: sto_word *)\nlet sto_word = store word\n\n(* View: sto_num *)\nlet sto_num = store \/[0-9]+\/\n\n(* View: field *)\nlet field (kw:string) (sto:lens) = [ indent . key kw . sep_spc . sto . (eol_comment|eol) ]\n\n(* View: flag\nA single word *)\nlet flag (kw:regexp) = [ indent . key kw ]\n\n(* View: lens_block \nA generic block with a title lens *)\nlet lens_block (title:lens) (sto:lens) = [ indent . title . sep_spc . lbracket . eol\n . (sto | empty | comment)+\n . indent . rbracket . eol ]\n\n(* View: block\nA simple block with just a block title *)\nlet block (kw:string) (sto:lens) = lens_block (key kw) sto\n\n(* View: named_block \nA block with a block title and name *)\nlet named_block (kw:string) (sto:lens) = lens_block (key kw . sep_spc . sto_word) sto\n\n(* View: named_block_arg_title\nA title lens for named_block_arg *)\nlet named_block_arg_title (kw:string) (name:string) (arg:string) = \n key kw . sep_spc\n . [ label name . sto_word ]\n . sep_spc\n . [ label arg . sto_word ]\n\n(* View: named_block_arg\nA block with a block title, a name and an argument *)\nlet named_block_arg (kw:string) (name:string) (arg:string) (sto:lens) = \n lens_block (named_block_arg_title kw name arg) sto\n\n\n(************************************************************************\n * Group: GLOBAL CONFIGURATION\n *************************************************************************)\n\n(* View: email\nA simple email address entry *)\nlet email = [ indent . label \"email\" . sto_email_addr . (eol_comment|eol) ]\n\n(* View: global_defs_field\nPossible fields in the global_defs block *)\nlet global_defs_field = block \"notification_email\" email\n | field \"notification_email_from\" sto_email_addr\n | field \"smtp_server\" sto_word\n | field \"smtp_connect_timeout\" sto_num\n | field \"lvs_id\" sto_word\n | field \"router_id\" sto_word\n\n(* View: global_defs\nA global_defs block *)\nlet global_defs = block \"global_defs\" global_defs_field\n\n(* View: prefixlen\nA prefix for IP addresses *)\nlet prefixlen = [ label \"prefixlen\" . Util.del_str \"\/\" . sto_num ]\n\n(* View: ipaddr\nAn IP address or range with an optional mask *)\nlet ipaddr = label \"ipaddr\" . store \/[0-9\\.-]+\/ . prefixlen?\n\n(* View: ipdev\nA device for IP addresses *)\nlet ipdev = [ key \"dev\" . sep_spc . sto_word ]\n\n(* View: static_ipaddress_field\nThe whole string is fed to ip addr add.\nYou can truncate the string anywhere you like and let ip addr add use defaults for the rest of the string.\nTo be refined with fields according to `ip addr help`.\n*)\nlet static_ipaddress_field = [ indent . ipaddr\n . (sep_spc . ipdev)?\n . (eol|eol_comment) ]\n\n(* View: static_routes_field\nsrc $SRC_IP to $DST_IP dev $SRC_DEVICE\n*)\nlet static_routes_field = [ indent . label \"route\"\n . [ key \"src\" . sto_word ] . sep_spc\n . [ key \"to\" . sto_word ] . sep_spc\n . [ key \"dev\" . sto_word ] . (eol|eol_comment) ]\n\n(* View: static_routes *)\nlet static_routes = block \"static_ipaddress\" static_ipaddress_field\n | block \"static_routes\" static_routes_field\n\n\n(* View: global_conf \nA global configuration entry *)\nlet global_conf = global_defs | static_routes\n\n\n(************************************************************************\n * Group: VRRP CONFIGURATION\n *************************************************************************)\n\n(*View: vrrp_sync_group_field *)\nlet vrrp_sync_group_field = block \"group\" [ indent . key word . (eol|eol_comment) ]\n\n(* View: vrrp_sync_group *)\nlet vrrp_sync_group = named_block \"vrrp_sync_group\" vrrp_sync_group_field\n\n(* View: vrrp_instance_field *)\nlet vrrp_instance_field = field \"state\" sto_word\n | field \"interface\" sto_word\n | field \"lvs_sync_daemon_interface\" sto_word\n | field \"virtual_router_id\" sto_num\n | field \"priority\" sto_num\n | field \"advert_int\" sto_num\n | flag \"smtp_alert\"\n | flag \"nopreempt\"\n | block \"authentication\" (\n field \"auth_type\" sto_word\n | field \"auth_pass\" sto_word\n )\n | block \"virtual_ipaddress\" static_ipaddress_field\n\n(* View: vrrp_instance *)\nlet vrrp_instance = named_block \"vrrp_instance\" vrrp_instance_field\n\n\n(* View: vrrpd_conf\ncontains subblocks of VRRP synchronization group(s) and VRRP instance(s) *)\nlet vrrpd_conf = vrrp_sync_group | vrrp_instance\n\n\n(************************************************************************\n * Group: LVS CONFIGURATION\n *************************************************************************)\n\n(* View: tcp_check_field *)\nlet tcp_check_field = field \"connect_timeout\" sto_num\n | field \"connect_port\" sto_num\n\n(* View: real_server_field *)\nlet real_server_field = field \"weight\" sto_num\n | block \"TCP_CHECK\" tcp_check_field\n\n(* View: virtual_server_field *)\nlet virtual_server_field = field \"delay_loop\" sto_num\n | field \"lb_algo\" sto_word\n | field \"lb_kind\" sto_word\n | field \"nat_mask\" sto_word\n | field \"protocol\" sto_word\n | named_block_arg \"real_server\" \"ip\" \"port\" real_server_field\n\n(* View: virtual_server *)\nlet virtual_server = named_block_arg \"virtual_server\" \"ip\" \"port\" virtual_server_field\n\n(* View: virtual_server_group_field *)\nlet virtual_server_group_field = [ indent . label \"vip\"\n . [ ipaddr ]\n\t\t\t . sep_spc\n\t\t\t . [ label \"port\" . sto_num ]\n\t\t\t . (eol|eol_comment) ]\n\n(* View: virtual_server_group *)\nlet virtual_server_group = named_block \"virtual_server_group\" virtual_server_group_field\n\n(* View: lvs_conf\ncontains subblocks of Virtual server group(s) and Virtual server(s) *)\nlet lvs_conf = virtual_server | virtual_server_group\n\n\n(* View: lns\n The keepalived lens\n*)\nlet lns = ( empty | comment | global_conf | vrrpd_conf | lvs_conf )*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/keepalived\/keepalived.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3bb58790bb22677f81b4b3e7163c21db016976c3","subject":"Make trapperkeeper lens compatible with 0.10","message":"Make trapperkeeper lens compatible with 0.10\n","repos":"mmckinst\/puppet-puppetserver,tdevelioglu\/puppet-puppetserver,roman-mueller\/puppet-puppetserver,roman-mueller\/puppet-puppetserver,mcanevet\/puppet-puppetserver,olivierHa\/puppet-puppetserver,olivierHa\/puppet-puppetserver,camptocamp\/puppet-puppetserver,camptocamp\/puppet-puppetserver","old_file":"files\/lenses\/trapperkeeper.aug","new_file":"files\/lenses\/trapperkeeper.aug","new_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: BLOCKS (FROM 1.2, FOR 0.10 COMPATIBILITY)\n *************************************************************************)\n\n(* Variable: block_ldelim_newlines_re *)\nlet block_ldelim_newlines_re = \/[ \\t\\n]+\\{([ \\t\\n]*\\n)?\/\n\n(* Variable: block_rdelim_newlines_re *)\nlet block_rdelim_newlines_re = \/[ \\t]*\\}\/\n\n(* Variable: block_ldelim_newlines_default *)\nlet block_ldelim_newlines_default = \"\\n{\\n\"\n\n(* Variable: block_rdelim_newlines_default *)\nlet block_rdelim_newlines_default = \"}\"\n\n(************************************************************************\n * View: block_newline\n * A block enclosed in brackets, with newlines forced\n * and indentation defaulting to a tab.\n *\n * Parameters:\n * entry:lens - the entry to be stored inside the block.\n * This entry should not include <Util.empty>,\n * <Util.comment> or <Util.comment_noindent>,\n * should be indented and finish with an eol.\n ************************************************************************)\nlet block_newlines (entry:lens) (comment:lens) =\n let indent = del \/[ \\t]*\/ \"\\t\"\n in del block_ldelim_newlines_re block_ldelim_newlines_default\n . ((entry | comment) . (Util.empty | entry | comment)*)?\n . del block_rdelim_newlines_re block_rdelim_newlines_default\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n(* View: simple *)\nlet simple = [ Util.indent . key Rx.word\n . sep_with_spc . store \/[^\\[ \\t\\n]+\/ . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let opt_space = del \/[ \\t]*\/ \"\"\n in let comma = opt_space . Util.del_str \",\" . opt_space\n in let elem = [ seq \"elem\" . store Rx.neg1 ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . key Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . key Rx.word . sep\n . block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Trapperkeeper\n Parses Trapperkeeper configuration files\n\nAuthor: Raphael Pinson <raphael.pinson@camptocamp.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to Trapperkeeper webservice configuration files. See <filter>.\n\nAbout: Examples\n The <Test_Trapperkeeper> file contains various examples and tests.\n*)\nmodule Trapperkeeper =\n\nautoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* View: empty *)\nlet empty = Util.empty\n\n(* View: comment *)\nlet comment = Util.comment\n\n(* View: sep *)\nlet sep = del \/[ \\t]*[:=]\/ \":\"\n\n(* View: sep_with_spc *)\nlet sep_with_spc = sep . Sep.opt_space\n\n(************************************************************************\n * Group: ENTRY TYPES\n *************************************************************************)\n\n(* View: simple *)\nlet simple = [ Util.indent . key Rx.word\n . sep_with_spc . store \/[^\\[ \\t\\n]+\/ . Util.eol ]\n\n(* View: array *)\nlet array =\n let lbrack = Util.del_str \"[\"\n in let rbrack = Util.del_str \"]\"\n in let comma = Util.delim \",\"\n in let elem = [ seq \"elem\" . store Rx.neg1 ]\n in let elems = counter \"elem\" . Build.opt_list elem comma\n in [ Util.indent . key Rx.word\n . sep_with_spc . lbrack . Sep.opt_space\n . (elems . Sep.opt_space)?\n . rbrack . Util.eol ]\n\n(* View: hash *)\nlet hash (lns:lens) = [ Util.indent . key Rx.word . sep\n . Build.block_newlines lns Util.comment\n . Util.eol ]\n\n\n(************************************************************************\n * Group: ENTRY\n *************************************************************************)\n\n(* Just for typechecking *)\nlet entry_no_rec = hash (simple|array)\n\n(* View: entry *)\nlet rec entry = hash (entry|simple|array)\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n(* View: lns *)\nlet lns = (empty|comment)* . (entry . (empty|comment)*)*\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/puppetserver\/conf.d\/*\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Augeas"} {"commit":"63b8b879c176c6427b3c01f1f42425441eef3095","subject":"Shellvars: Add test for [[]]","message":"Shellvars: Add test for [[]]\n","repos":"ptoscano\/augeas,kunkku\/augeas,manandbytes\/augeas,jjlin\/augeas,dafugg\/augeas,mchf\/augeas,mlichvar\/augeas,dafugg\/augeas,lutter\/augeas,manandbytes\/augeas,kunkku\/augeas,mchf\/augeas,kunkku\/augeas,jjlin\/augeas,pevalme\/augeas,jjlin\/augeas,hercules-team\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,pevalme\/augeas,lutter\/augeas,dafugg\/augeas,hercules-team\/augeas,mlichvar\/augeas","old_file":"lenses\/tests\/test_shellvars.aug","new_file":"lenses\/tests\/test_shellvars.aug","new_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\"\n { \"1\" = \"ONBOOT\" }\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\"\n { \"1\" = \"FOO\" } }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\"\n { \"1\" = \"f\" } } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\"\n { \"1\" = \"f\" } } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\" = \"*debug*\"\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\"\n { \"1\" = \"${!LC_*}\" } }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n # \n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\ntest \\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\ntest \\\\\\ntest2\\\"\" }\n\n (* Export of multiple variables, RHBZ#1033795 *)\n test lns get \"export TestVar1 TestVar2\\n\" =\n { \"@export\"\n { \"1\" = \"TestVar1\" }\n { \"2\" = \"TestVar2\" } }\n\n (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)\n test lns get \"case $ARG in\n 0) TestVar=\\\"test0\\\" ;;\n 1) TestVar=\\\"test1\\\" ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\" = \"0\"\n { \"TestVar\" = \"\\\"test0\\\"\" } }\n { \"@case_entry\" = \"1\"\n { \"TestVar\" = \"\\\"test1\\\"\" } } }\n\n (* case: support ;; on the same line with multiple commands *)\n test lns get \"case $ARG in\n 0) Foo=0; Bar=1;;\n 1)\n\t Foo=2\n\t Bar=3; Baz=4;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\" = \"0\"\n { \"Foo\" = \"0\" }\n { \"Bar\" = \"1\" }\n }\n { \"@case_entry\" = \"1\"\n { \"Foo\" = \"2\" }\n { \"Bar\" = \"3\" }\n { \"Baz\" = \"4\" }\n }\n }\n\n(* Test: Shellvars.lns\n Support `##` bashism in conditions (GH issue #118) *)\ntest Shellvars.lns get \"if [ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ] ; then\n SUFFIX=\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\nelse\n SUFFIX=\nfi\\n\" =\n { \"@if\" = \"[ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ]\"\n { \"SUFFIX\" = \"\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\" }\n { \"@else\"\n { \"SUFFIX\" = \"\" }\n }\n }\n\n (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)\n test lns get \"export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\\n\" =\n { \"MALLOC_PERTURB_\" = \"$(($RANDOM % 255 + 1))\"\n { \"export\" } }\n\n (*\n * Github issue 202\n *)\n let starts_with_blank = \"\\n \\nVAR=value\\n\"\n\n test lns get starts_with_blank = { \"VAR\" = \"value\" }\n\n (* It is now possible to insert at the beginning of a file\n * that starts with blank lines *)\n test lns put starts_with_blank after\n insb \"#comment\" \"\/*[1]\";\n set \"\/#comment[1]\" \"a comment\" =\n \" # a comment\\nVAR=value\\n\"\n\n (* Modifications of the file lose the blank lines though *)\n test lns put starts_with_blank after\n set \"\/VAR2\" \"abc\" = \"VAR=value\\nVAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\";\n set \"\/VAR2\" \"abc\" = \"VAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\" = \"\"\n\n (* Support associative arrays *)\n test lns get \"var[alpha_beta,gamma]=something\\n\" =\n { \"var[alpha_beta,gamma]\" = \"something\" }\n\n (* GH #188: support more conditions *)\n test Shellvars.lns get \"[ -f $FILENAME ]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" } }\n\n test Shellvars.lns get \"[[ -f $FILENAME ]]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[[\" } }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Test for shell lens *)\nmodule Test_shellvars =\n\n let lns = Shellvars.lns\n\n let eth_static = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=static\nBROADCAST=172.31.0.255\nHWADDR=ab:cd:ef:12:34:56\nexport IPADDR=172.31.0.31 # this is our IP\n#DHCP_HOSTNAME=host.example.com\nNETMASK=255.255.255.0\nNETWORK=172.31.0.0\nunset ONBOOT # We do not want this var\n\"\n let empty_val = \"EMPTY=\\nDEVICE=eth0\\n\"\n\n let key_brack = \"SOME_KEY[1]=\\nDEVICE=eth0\\n\"\n\n test lns get eth_static =\n { \"#comment\" = \"Intel Corporation PRO\/100 VE Network Connection\" }\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n { \"BROADCAST\" = \"172.31.0.255\" }\n { \"HWADDR\" = \"ab:cd:ef:12:34:56\" }\n { \"IPADDR\" = \"172.31.0.31\"\n { \"export\" }\n { \"#comment\" = \"this is our IP\" } }\n { \"#comment\" = \"DHCP_HOSTNAME=host.example.com\" }\n { \"NETMASK\" = \"255.255.255.0\" }\n { \"NETWORK\" = \"172.31.0.0\" }\n { \"@unset\"\n { \"1\" = \"ONBOOT\" }\n { \"#comment\" = \"We do not want this var\" } }\n\n test lns put eth_static after\n set \"BOOTPROTO\" \"dhcp\" ;\n rm \"IPADDR\" ;\n rm \"BROADCAST\" ;\n rm \"NETMASK\" ;\n rm \"NETWORK\"\n = \"# Intel Corporation PRO\/100 VE Network Connection\nDEVICE=eth0\nBOOTPROTO=dhcp\nHWADDR=ab:cd:ef:12:34:56\n#DHCP_HOSTNAME=host.example.com\nunset ONBOOT # We do not want this var\n\"\n test lns get empty_val =\n { \"EMPTY\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get key_brack =\n { \"SOME_KEY[1]\" = \"\" } { \"DEVICE\" = \"eth0\" }\n\n test lns get \"smartd_opts=\\\"-q never\\\"\\n\" =\n { \"smartd_opts\" = \"\\\"-q never\\\"\" }\n\n test lns get \"var=val \\n\" = { \"var\" = \"val\" }\n\n test lns get \". \/etc\/java\/java.conf\\n\" =\n { \".source\" = \"\/etc\/java\/java.conf\" }\n\n (* Quoted strings and other oddities *)\n test lns get \"var=\\\"foo 'bar'\\\"\\n\" =\n { \"var\" = \"\\\"foo 'bar'\\\"\" }\n\n test lns get \"var='Some \\\"funny\\\" value'\\n\" =\n { \"var\" = \"'Some \\\"funny\\\" value'\" }\n\n test lns get \"var=\\\"\\\\\\\"\\\"\\n\" =\n { \"var\" = \"\\\"\\\\\\\"\\\"\" }\n\n test lns get \"var=\\\\\\\"\\n\" =\n { \"var\" = \"\\\\\\\"\" }\n\n test lns get \"var=ab#c\\n\" =\n { \"var\" = \"ab#c\" }\n\n test lns get \"var=ab #c\\n\" =\n { \"var\" = \"ab\"\n { \"#comment\" = \"c\" } }\n\n test lns get \"var=ab; #c\\n\" =\n { \"var\" = \"ab\" }\n { \"#comment\" = \"c\" }\n\n test lns put \"var=ab; #c\\n\" after\n set \"\/#comment\" \"d\" =\n \"var=ab; #d\\n\"\n\n test lns get \"var=ab;\\n\" =\n { \"var\" = \"ab\" }\n\n test lns get \"var='ab#c'\\n\" =\n { \"var\" = \"'ab#c'\" }\n\n test lns get \"var=\\\"ab#c\\\"\\n\" =\n { \"var\" = \"\\\"ab#c\\\"\" }\n\n test lns get \"ESSID='Joe'\\\"'\\\"'s net'\\n\" =\n { \"ESSID\" = \"'Joe'\\\"'\\\"'s net'\" }\n\n test lns get \"var=`ab#c`\\n\" =\n { \"var\" = \"`ab#c`\" }\n\n test lns get \"var=`grep nameserver \/etc\/resolv.conf | head -1`\\n\" =\n { \"var\" = \"`grep nameserver \/etc\/resolv.conf | head -1`\" }\n\n test lns put \"var=ab #c\\n\"\n after rm \"\/var\/#comment\" = \"var=ab\\n\"\n\n test lns put \"var=ab\\n\"\n after set \"\/var\/#comment\" \"this is a var\" =\n \"var=ab # this is a var\\n\"\n\n (* Handling of arrays *)\n test lns get \"var=(val1 \\\"val\\\\\\\"2\\\\\\\"\\\" val3)\\n\" =\n { \"var\"\n { \"1\" = \"val1\" }\n { \"2\" = \"\\\"val\\\\\\\"2\\\\\\\"\\\"\" }\n { \"3\" = \"val3\" } }\n\n test lns get \"var=()\\n\" = { \"var\" = \"()\" }\n\n test lns put \"var=()\\n\" after\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n rm \"var\/*\" ;\n set \"var\" \"value\"\n = \"var=value\\n\"\n\n test lns put \"var=(v1 v2)\\n\" after\n set \"var\/3\" \"v3\"\n = \"var=(v1 v2 v3)\\n\"\n\n test lns get \"var=(v1 v2 \\n \\t v3)\\n\" =\n { \"var\"\n { \"1\" = \"v1\" }\n { \"2\" = \"v2\" }\n { \"3\" = \"v3\" } }\n\n (* Allow spaces after\/before opening\/closing parens for array *)\n test lns get \"config_eth1=( \\\"10.128.0.48\/24\\\" )\\n\" =\n { \"config_eth1\" { \"1\" = \"\\\"10.128.0.48\/24\\\"\" } }\n\n (* Bug 109: allow a bare export *)\n test lns get \"export FOO\\n\" =\n { \"@export\"\n { \"1\" = \"FOO\" } }\n\n (* Bug 73: allow ulimit builtin *)\n test lns get \"ulimit -c unlimited\\n\" =\n { \"@builtin\" = \"ulimit\" { \"args\" = \"-c unlimited\" } }\n\n (* Allow shift builtin *)\n test Shellvars.lns get \"shift\\nshift 2\\n\" =\n { \"@builtin\" = \"shift\" }\n { \"@builtin\" = \"shift\" { \"args\" = \"2\" } }\n\n (* Allow exit builtin *)\n test Shellvars.lns get \"exit\\nexit 2\\n\" =\n { \"@builtin\" = \"exit\" }\n { \"@builtin\" = \"exit\" { \"args\" = \"2\" } }\n\n (* Test semicolons *)\n test lns get \"VAR1=\\\"this;is;a;test\\\"\\nVAR2=this;\\n\" =\n { \"VAR1\" = \"\\\"this;is;a;test\\\"\" }\n { \"VAR2\" = \"this\" }\n\n (* Bug 230: parse conditions *)\n test lns get \"if [ -f \/etc\/default\/keyboard ]; then\\n. \/etc\/default\/keyboard\\nfi\\n\" =\n { \"@if\" = \"[ -f \/etc\/default\/keyboard ]\" { \".source\" = \"\/etc\/default\/keyboard\" } }\n\n (* Recursive condition *)\n test lns get \"if [ -f \/tmp\/file1 ]; then\n if [ -f \/tmp\/file2 ]\n then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3; else; . \/tmp\/file4\n fi\nelse\n . \/tmp\/file3\nfi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \"@if\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" } }\n { \"@else\"\n { \".source\" = \"\/tmp\/file4\" }\n }\n }\n { \"@else\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n (* Multiple elif *)\n test Shellvars.lns get \"if [ -f \/tmp\/file1 ]; then\n . \/tmp\/file1\n elif [ -f \/tmp\/file2 ]; then\n . \/tmp\/file2\n elif [ -f \/tmp\/file3 ]; then\n . \/tmp\/file3\n fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@elif\" = \"[ -f \/tmp\/file2 ]\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n { \"@elif\" = \"[ -f \/tmp\/file3 ]\"\n { \".source\" = \"\/tmp\/file3\" }\n }\n }\n\n\n (* Comment or eol *)\n test lns get \"VAR=value # eol-comment\\n\" =\n { \"VAR\" = \"value\"\n { \"#comment\" = \"eol-comment\" }\n }\n\n (* One-liners *)\n test lns get \"if [ -f \/tmp\/file1 ]; then . \/tmp\/file1; else . \/tmp\/file2; fi\\n\" =\n { \"@if\" = \"[ -f \/tmp\/file1 ]\"\n { \".source\" = \"\/tmp\/file1\" }\n { \"@else\"\n { \".source\" = \"\/tmp\/file2\" }\n }\n }\n\n (* Loops *)\n test lns get \"for f in \/tmp\/file*; do\n while [ 1 ]; do . $f; done\ndone\\n\" =\n { \"@for\" = \"f in \/tmp\/file*\"\n { \"@while\" = \"[ 1 ]\"\n { \".source\" = \"$f\" }\n }\n }\n\n (* Case *)\n test lns get \"case $f in\n \/tmp\/file1)\n . \/tmp\/file1\n ;;\n \/tmp\/file2)\n . \/tmp\/file2\n ;;\n *)\n unset f\n ;;\nesac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"\/tmp\/file1\"\n { \".source\" = \"\/tmp\/file1\" } }\n { \"@case_entry\" = \"\/tmp\/file2\"\n { \".source\" = \"\/tmp\/file2\" } }\n { \"@case_entry\" = \"*\"\n { \"@unset\"\n { \"1\" = \"f\" } } } }\n\n (* Select *)\n test lns get \"select i in a b c; do . \/tmp\/file$i\n done\\n\" =\n { \"@select\" = \"i in a b c\"\n { \".source\" = \"\/tmp\/file$i\" }\n }\n\n (* Return *)\n test lns get \"return\\nreturn 2\\n\" =\n { \"@return\" }\n { \"@return\" = \"2\" }\n\n (* Functions *)\n test Shellvars.lns get \"foo() {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n test Shellvars.lns get \"function foo () {\n . \/tmp\/bar\n }\\n\" =\n { \"@function\" = \"foo\"\n { \".source\" = \"\/tmp\/bar\" }\n }\n\n (* Dollar assignment *)\n test Shellvars.lns get \"FOO=$(bar arg)\\n\" =\n { \"FOO\" = \"$(bar arg)\" }\n\n (* Empty lines before esac *)\n test Shellvars.lns get \"case $f in\n a)\n B=C\n ;;\n\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n }\n\n\n (* Empty lines before a case_entry *)\n test Shellvars.lns get \"case $f in\n\n a)\n B=C\n ;;\n\n b)\n A=D\n ;;\n esac\\n\" =\n { \"@case\" = \"$f\"\n { \"@case_entry\" = \"a\"\n { \"B\" = \"C\" } }\n { \"@case_entry\" = \"b\"\n { \"A\" = \"D\" } } }\n\n\n (* Comments anywhere *)\n test Shellvars.lns get \"case ${INTERFACE} in\n# comment before\neth0)\n# comment in\nOPTIONS=()\n;;\n\n# comment before 2\n*)\n# comment in 2\nunset f\n;;\n# comment after\nesac\\n\" =\n { \"@case\" = \"${INTERFACE}\"\n { \"#comment\" = \"comment before\" }\n { \"@case_entry\" = \"eth0\"\n { \"#comment\" = \"comment in\" }\n { \"OPTIONS\" = \"()\" } }\n { \"#comment\" = \"comment before 2\" }\n { \"@case_entry\" = \"*\"\n { \"#comment\" = \"comment in 2\" }\n { \"@unset\"\n { \"1\" = \"f\" } } }\n { \"#comment\" = \"comment after\" } }\n\n (* Empty case *)\n test Shellvars.lns get \"case $a in\n *)\n ;;\n esac\\n\" =\n { \"@case\" = \"$a\"\n { \"@case_entry\" = \"*\" } }\n\n (* case variables can be surrounded by double quotes *)\n test Shellvars.lns get \"case \\\"${options}\\\" in\n*debug*)\n shift\n ;;\nesac\\n\" =\n { \"@case\" = \"\\\"${options}\\\"\"\n { \"@case_entry\" = \"*debug*\"\n { \"@builtin\" = \"shift\" } } }\n\n (* Double quoted values can have newlines *)\n test Shellvars.lns get \"FOO=\\\"123\\n456\\\"\\n\" =\n { \"FOO\" = \"\\\"123\\n456\\\"\" }\n\n (* Single quoted values can have newlines *)\n test Shellvars.lns get \"FOO='123\\n456'\\n\" =\n { \"FOO\" = \"'123\\n456'\" }\n\n (* bquoted values can have semi-colons *)\n test Shellvars.lns get \"FOO=`bar=date;$bar`\\n\" =\n { \"FOO\" = \"`bar=date;$bar`\" }\n\n (* dollar-assigned values can have semi-colons *)\n test Shellvars.lns get \"FOO=$(bar=date;$bar)\\n\" =\n { \"FOO\" = \"$(bar=date;$bar)\" }\n\n (* dollar-assigned value in bquot *)\n test Shellvars.lns get \"FOO=`echo $(date)`\\n\" =\n { \"FOO\" = \"`echo $(date)`\" }\n\n (* bquot value in dollar-assigned value *)\n test Shellvars.lns get \"FOO=$(echo `date`)\\n\" =\n { \"FOO\" = \"$(echo `date`)\" }\n\n (* dbquot *)\n test Shellvars.lns get \"FOO=``bar``\\n\" =\n { \"FOO\" = \"``bar``\" }\n\n (* unset can be used on wildcard variables *)\n test Shellvars.lns get \"unset ${!LC_*}\\n\" =\n { \"@unset\"\n { \"1\" = \"${!LC_*}\" } }\n\n (* Empty comment before entries *)\n test Shellvars.lns get \"# \\nfoo=bar\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Empty comment after entries *)\n test Shellvars.lns get \"foo=bar\\n# \\n\\n\" =\n { \"foo\" = \"bar\" }\n\n (* Whitespace between lines *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\nBOOTPROTO=static\\n\" =\n { \"DEVICE\" = \"eth0\" }\n { \"BOOTPROTO\" = \"static\" }\n\n (* Whitespace after line *)\n test Shellvars.lns get \"DEVICE=eth0\\n\\n\" =\n { \"DEVICE\" = \"eth0\" }\n\n (* Fails adding variable assignment between comment and blank line *)\n let ins_after_comment = \"# foo\n\n\"\n test lns put ins_after_comment after\n insa \"foo\" \"#comment\" ;\n set \"foo\" \"yes\"\n = \"# foo\\n\\nfoo=yes\\n\"\n\n (* Make sure to support empty comments *)\n test lns get \"# foo\n # \n #\n foo=bar\n #\\n\" =\n { \"#comment\" = \"foo\" }\n { \"foo\" = \"bar\" }\n\n (* Single quotes in arrays, ticket #357 *)\n test lns get \"DLAGENTS=('ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n 'scp::\/usr\/bin\/scp -C %u %o')\\n\" =\n { \"DLAGENTS\"\n { \"1\" = \"'ftp::\/usr\/bin\/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\" }\n { \"2\" = \"'scp::\/usr\/bin\/scp -C %u %o'\" } }\n\n (* Accept continued lines in quoted values *)\n test lns get \"BLAH=\\\" \\\ntest \\\ntest2\\\"\\n\" =\n { \"BLAH\" = \"\\\" \\\\\\ntest \\\\\\ntest2\\\"\" }\n\n (* Export of multiple variables, RHBZ#1033795 *)\n test lns get \"export TestVar1 TestVar2\\n\" =\n { \"@export\"\n { \"1\" = \"TestVar1\" }\n { \"2\" = \"TestVar2\" } }\n\n (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)\n test lns get \"case $ARG in\n 0) TestVar=\\\"test0\\\" ;;\n 1) TestVar=\\\"test1\\\" ;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\" = \"0\"\n { \"TestVar\" = \"\\\"test0\\\"\" } }\n { \"@case_entry\" = \"1\"\n { \"TestVar\" = \"\\\"test1\\\"\" } } }\n\n (* case: support ;; on the same line with multiple commands *)\n test lns get \"case $ARG in\n 0) Foo=0; Bar=1;;\n 1)\n\t Foo=2\n\t Bar=3; Baz=4;;\nesac\\n\" =\n { \"@case\" = \"$ARG\"\n { \"@case_entry\" = \"0\"\n { \"Foo\" = \"0\" }\n { \"Bar\" = \"1\" }\n }\n { \"@case_entry\" = \"1\"\n { \"Foo\" = \"2\" }\n { \"Bar\" = \"3\" }\n { \"Baz\" = \"4\" }\n }\n }\n\n(* Test: Shellvars.lns\n Support `##` bashism in conditions (GH issue #118) *)\ntest Shellvars.lns get \"if [ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ] ; then\n SUFFIX=\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\nelse\n SUFFIX=\nfi\\n\" =\n { \"@if\" = \"[ \\\"${APACHE_CONFDIR##\/etc\/apache2-}\\\" != \\\"${APACHE_CONFDIR}\\\" ]\"\n { \"SUFFIX\" = \"\\\"-${APACHE_CONFDIR##\/etc\/apache2-}\\\"\" }\n { \"@else\"\n { \"SUFFIX\" = \"\" }\n }\n }\n\n (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)\n test lns get \"export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\\n\" =\n { \"MALLOC_PERTURB_\" = \"$(($RANDOM % 255 + 1))\"\n { \"export\" } }\n\n (*\n * Github issue 202\n *)\n let starts_with_blank = \"\\n \\nVAR=value\\n\"\n\n test lns get starts_with_blank = { \"VAR\" = \"value\" }\n\n (* It is now possible to insert at the beginning of a file\n * that starts with blank lines *)\n test lns put starts_with_blank after\n insb \"#comment\" \"\/*[1]\";\n set \"\/#comment[1]\" \"a comment\" =\n \" # a comment\\nVAR=value\\n\"\n\n (* Modifications of the file lose the blank lines though *)\n test lns put starts_with_blank after\n set \"\/VAR2\" \"abc\" = \"VAR=value\\nVAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\";\n set \"\/VAR2\" \"abc\" = \"VAR2=abc\\n\"\n\n test lns put starts_with_blank after\n rm \"\/VAR\" = \"\"\n\n (* Support associative arrays *)\n test lns get \"var[alpha_beta,gamma]=something\\n\" =\n { \"var[alpha_beta,gamma]\" = \"something\" }\n\n (* GH #188: support more conditions *)\n test Shellvars.lns get \"[ -f $FILENAME ]\\n\" =\n { \"@condition\" = \"-f $FILENAME\"\n { \"type\" = \"[\" } }\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"0e897a3e7483517dd6de74e6e7870a278b9e9e6e","subject":"Parse pam.conf in pam.aug","message":"Parse pam.conf in pam.aug\n","repos":"manandbytes\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,dafugg\/augeas,manandbytes\/augeas,kumy\/augeas,jasperla\/augeas,domcleal\/augeas,hercules-team\/augeas,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jjlin\/augeas,dafugg\/augeas,ptoscano\/augeas,lutter\/augeas,raphink\/augeas,ptoscano\/augeas,kunkku\/augeas,jtopjian\/augeas,lutter\/augeas,kumy\/augeas,domcleal\/augeas,mchf\/augeas,MikaelSmith\/augeas,raphink\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,jtopjian\/augeas,jjlin\/augeas,mlichvar\/augeas,mlichvar\/augeas,dafugg\/augeas,pevalme\/augeas,lutter\/augeas,kunkku\/augeas,jjlin\/augeas,mchf\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,hercules-team\/augeas,kumy\/augeas","old_file":"lenses\/pam.aug","new_file":"lenses\/pam.aug","new_contents":"(* Proces \/etc\/pam.d *)\nmodule Pam =\n autoload xfm\n\n let eol = Util.eol\n let indent = Util.indent\n\n (* For the control syntax of [key=value ..] we could split the key value *)\n (* pairs into an array and generate a subtree control\/N\/KEY = VALUE *)\n let control = \/(\\[[^]#\\n]*\\]|[^[ \\t][^ \\t]*)\/\n let word = \/[^# \\t\\n]+\/\n (* Allowed types. FIXME: Should be case insensitive *)\n let types = \/(auth|session|account|password)\/\n\n (* This isn't entirely right: arguments enclosed in [ .. ] are allowed *)\n (* and should be parsed as one *)\n let argument = \/[^#\\n \\t]+\/\n\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n\n\n (* Not mentioned in the man page, but Debian uses the syntax *)\n (* @include module *)\n (* quite a bit *)\n let include = [ indent . Util.del_str \"@\" . key \"include\" .\n Util.del_ws_spc . store word . eol ]\n\n let record = [ seq \"record\" . indent .\n [ label \"optional\" . del \"-\" \"-\" ]? .\n [ label \"type\" . store types ] .\n Util.del_ws_tab .\n [ label \"control\" . store control] .\n Util.del_ws_tab .\n [ label \"module\" . store word ] .\n [ Util.del_ws_tab . label \"argument\" . store argument ]* .\n\t\t comment_or_eol\n ]\n let lns = ( empty | comment | include | record ) *\n\n let filter = incl \"\/etc\/pam.conf\"\n . incl \"\/etc\/pam.d\/*\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Proces \/etc\/pam.d *)\nmodule Pam =\n autoload xfm\n\n let eol = Util.eol\n let indent = Util.indent\n\n (* For the control syntax of [key=value ..] we could split the key value *)\n (* pairs into an array and generate a subtree control\/N\/KEY = VALUE *)\n let control = \/(\\[[^]#\\n]*\\]|[^[ \\t][^ \\t]*)\/\n let word = \/[^# \\t\\n]+\/\n (* Allowed types. FIXME: Should be case insensitive *)\n let types = \/(auth|session|account|password)\/\n\n (* This isn't entirely right: arguments enclosed in [ .. ] are allowed *)\n (* and should be parsed as one *)\n let argument = \/[^#\\n \\t]+\/\n\n let comment = Util.comment\n let comment_or_eol = Util.comment_or_eol\n let empty = Util.empty\n\n\n (* Not mentioned in the man page, but Debian uses the syntax *)\n (* @include module *)\n (* quite a bit *)\n let include = [ indent . Util.del_str \"@\" . key \"include\" .\n Util.del_ws_spc . store word . eol ]\n\n let record = [ seq \"record\" . indent .\n [ label \"optional\" . del \"-\" \"-\" ]? .\n [ label \"type\" . store types ] .\n Util.del_ws_tab .\n [ label \"control\" . store control] .\n Util.del_ws_tab .\n [ label \"module\" . store word ] .\n [ Util.del_ws_tab . label \"argument\" . store argument ]* .\n\t\t comment_or_eol\n ]\n let lns = ( empty | comment | include | record ) *\n\n let xfm = transform lns ((incl \"\/etc\/pam.d\/*\") . Util.stdexcl)\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1b1c3d912544c1db2587b4ba10d44d034cdece4a","subject":"Ssh: allow indented commas_entry","message":"Ssh: allow indented commas_entry\n","repos":"pevalme\/augeas,manandbytes\/augeas,jjlin\/augeas,hercules-team\/augeas,kunkku\/augeas,jtopjian\/augeas,ptoscano\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,mlichvar\/augeas,mchf\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jjlin\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,mchf\/augeas,jasperla\/augeas,lutter\/augeas,raphink\/augeas,MikaelSmith\/augeas,raphink\/augeas,hercules-team\/augeas,jtopjian\/augeas,jasperla\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,dafugg\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,manandbytes\/augeas,kunkku\/augeas,pevalme\/augeas,dafugg\/augeas","old_file":"lenses\/ssh.aug","new_file":"lenses\/ssh.aug","new_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n let eol = Util.doseol\n let spc = Util.del_ws_spc\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store Rx.space_in\n let value_to_spc = store Rx.no_spaces\n let value_to_comma = store \/[^, \\t\\r\\n]+\/\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n let array_entry (k:regexp) =\n [ indent . key k . counter \"array_entry\"\n . [ spc . seq \"array_entry\" . value_to_spc]* . eol ]\n\n let commas_entry (k:regexp) =\n let value = [ seq \"commas_entry\" . value_to_comma]\n in [ indent . key k . counter \"commas_entry\" . spc .\n Build.opt_list value comma . eol ]\n\n let fw_entry (k:regexp) = [ indent . key k . spc .\n\t [ key \/[^ \\t\\r\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let send_env = array_entry \/SendEnv\/i\n\n let proxy_command = [ indent . key \/ProxyCommand\/i . spc . value_to_eol . eol ]\n\n let remote_fw = fw_entry \/RemoteForward\/i\n let local_fw = fw_entry \/LocalForward\/i\n\n let ciphers = commas_entry \/Ciphers\/i\n let macs\t= commas_entry \/MACs\/i\n\n let special_entry = send_env\n\t | proxy_command\n\t | remote_fw\n\t | local_fw\n\t | macs\n\t | ciphers\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/i\n\n\n let other_entry = [ indent . key key_re\n . spc . value_to_spc . eol ]\n\n let entry = comment | empty\n | special_entry\n\t | other_entry\n\n let host = [ key \/Host\/i . spc . value_to_eol . eol . entry* ]\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","old_contents":"(*\nModule: Ssh\n Parses ssh client configuration\n\nAuthor: Jiri Suchomel <jsuchome@suse.cz>\n\nAbout: Reference\n ssh_config man page\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n(start code)\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host example.com\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/RemoteForward\/machine1:1234 machine2:5678\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/1 aes128-ctr\naugtool> set \/files\/etc\/ssh\/ssh_config\/Host[.='example.com']\/Ciphers\/2 aes192-ctr\n(end code)\n\n*)\n\nmodule Ssh =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n let eol = Util.doseol\n let spc = Util.del_ws_spc\n\n let comment = Util.comment\n let empty = Util.empty\n let comma = Util.del_str \",\"\n let indent = Util.indent\n let value_to_eol = store Rx.space_in\n let value_to_spc = store Rx.no_spaces\n let value_to_comma = store \/[^, \\t\\r\\n]+\/\n\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n let array_entry (k:regexp) =\n [ indent . key k . counter \"array_entry\"\n . [ spc . seq \"array_entry\" . value_to_spc]* . eol ]\n\n let commas_entry (k:regexp) =\n let value = [ seq \"commas_entry\" . value_to_comma]\n in [ key k . counter \"commas_entry\" . spc .\n Build.opt_list value comma . eol ]\n\n let fw_entry (k:regexp) = [ indent . key k . spc .\n\t [ key \/[^ \\t\\r\\n\\\/]+\/ . spc . value_to_eol . eol ]]\n\n let send_env = array_entry \/SendEnv\/i\n\n let proxy_command = [ indent . key \/ProxyCommand\/i . spc . value_to_eol . eol ]\n\n let remote_fw = fw_entry \/RemoteForward\/i\n let local_fw = fw_entry \/LocalForward\/i\n\n let ciphers = commas_entry \/Ciphers\/i\n let macs\t= commas_entry \/MACs\/i\n\n let special_entry = send_env\n\t | proxy_command\n\t | remote_fw\n\t | local_fw\n\t | macs\n\t | ciphers\n\n let key_re = \/[A-Za-z0-9]+\/\n - \/SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers\/i\n\n\n let other_entry = [ indent . key key_re\n . spc . value_to_spc . eol ]\n\n let entry = comment | empty\n | special_entry\n\t | other_entry\n\n let host = [ key \/Host\/i . spc . value_to_eol . eol . entry* ]\n\n\n(************************************************************************\n * Group: LENS\n *************************************************************************)\n\n let lns = entry* . host*\n\n let xfm = transform lns (incl \"\/etc\/ssh\/ssh_config\" .\n incl (Sys.getenv(\"HOME\") . \"\/.ssh\/config\"))\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"ffdc146ca462a7f50814745717d514a51383f95f","subject":"Enable parsing of pam","message":"Enable parsing of pam\n","repos":"camptocamp\/augeas,kunkku\/augeas,lutter\/augeas,bkearney\/augeas,bkearney\/augeas,hercules-team\/augeas,mlichvar\/augeas,hercules-team\/augeas,camptocamp\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,domcleal\/augeas,kumy\/augeas,camptocamp\/augeas,jjlin\/augeas,dafugg\/augeas,kumy\/augeas,mchf\/augeas,mlichvar\/augeas,domcleal\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,jasperla\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,jtopjian\/augeas,jjlin\/augeas,kumy\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,manandbytes\/augeas,mlichvar\/augeas,pevalme\/augeas,camptocamp\/augeas,jjlin\/augeas,manandbytes\/augeas,pevalme\/augeas,domcleal\/augeas,raphink\/augeas,mchf\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jasperla\/augeas,lutter\/augeas,jtopjian\/augeas,raphink\/augeas,ptoscano\/augeas","old_file":"spec\/pam.aug","new_file":"spec\/pam.aug","new_contents":"# Parsing \/etc\/inittab\n\nmap\n grammar pam\n # We really need to be able to exclude some files, like\n # backup files and .rpmsave files\n include '\/etc\/pam.d\/*' '\/system\/config\/pam' $basename\nend\n\ngrammar pam\n\n token SEP \/[ \\t]+\/ = '\\t'\n token EOL '\\n'\n token CONTROL \/(\\[[^\\]]*\\]|[^ \\t]+)\/ = 'none'\n token POUND_TO_EOL \/#.*\\n\/ = '# '\n\n file: ( comment | record ) *\n\n comment: ( \/#.*?\\n\/ | \/[ \\t]*\\n\/ )\n\n record: [ seq 'record' .\n [ label 'type' . store ... ] .\n SEP .\n [ label 'control' . store CONTROL] .\n SEP .\n [ label 'module' . store ... ] .\n ( [ SEP . label 'opts' . store ... ] )? .\n EOL\n ]\nend\n","old_contents":"# Parsing \/etc\/inittab\n\n#map\n# grammar pam\n# # We really need to be able to exclude some files, like\n# # backup files and .rpmsave files\n# include '\/etc\/pam.d\/*' '\/system\/config\/pam' $basename\n#end\n\ngrammar pam\n\n token SEP \/[ \\t]+\/ = '\\t'\n token EOL '\\n'\n token CONTROL \/(\\[[^\\]]*\\]|[^ \\t]+)\/ = 'none'\n token POUND_TO_EOL \/#.*\\n\/ = '# '\n\n file: ( comment | record ) *\n\n comment: ( \/#.*?\\n\/ | \/[ \\t]*\\n\/ )\n\n record: [ seq 'record' .\n [ label 'type' . store ... ] .\n SEP .\n [ label 'control' . store CONTROL] .\n SEP .\n [ label 'module' . store ... ] .\n ( [ SEP . label 'opts' . store ... ] )? .\n EOL\n ]\nend\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"148330ac79660e35b8726c7ec6fc8b6916c8a23e","subject":"Yum: add yum-cron*.conf files","message":"Yum: add yum-cron*.conf files\n","repos":"manandbytes\/augeas,lutter\/augeas,ptoscano\/augeas,dafugg\/augeas,jtopjian\/augeas,dafugg\/augeas,raphink\/augeas,ptoscano\/augeas,jjlin\/augeas,lutter\/augeas,mlichvar\/augeas,mlichvar\/augeas,jjlin\/augeas,manandbytes\/augeas,pevalme\/augeas,mchf\/augeas,raphink\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,jjlin\/augeas,kunkku\/augeas,ptoscano\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,lutter\/augeas,pevalme\/augeas,mchf\/augeas,MikaelSmith\/augeas,jasperla\/augeas,jtopjian\/augeas,pevalme\/augeas,kunkku\/augeas","old_file":"lenses\/yum.aug","new_file":"lenses\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries = entry*\n | entry* . list_entry \"baseurl\" . entry*\n | entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"baseurl\" . entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"gpgkey\" . entry* . list_entry \"baseurl\" . entry*\n\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/yum-cron*.conf\") \n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries = entry*\n | entry* . list_entry \"baseurl\" . entry*\n | entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"baseurl\" . entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"gpgkey\" . entry* . list_entry \"baseurl\" . entry*\n\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*\")\n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"dc0a0322c4ff95c491e1bf9b231ae67e738c48c1","subject":"Krb5: fix parse error with IPA generated krb5.conf","message":"Krb5: fix parse error with IPA generated krb5.conf\n","repos":"kumy\/augeas,jasperla\/augeas,dafugg\/augeas,MikaelSmith\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,raphink\/augeas,ptoscano\/augeas,kumy\/augeas,dafugg\/augeas,manandbytes\/augeas,ptoscano\/augeas,jtopjian\/augeas,kumy\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,kumy\/augeas,mchf\/augeas,MikaelSmith\/augeas,pevalme\/augeas,dafugg\/augeas,jjlin\/augeas,mlichvar\/augeas,manandbytes\/augeas,jjlin\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,mchf\/augeas,raphink\/augeas,lutter\/augeas,pevalme\/augeas,kunkku\/augeas,hercules-team\/augeas,jjlin\/augeas,lutter\/augeas,jasperla\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas","old_file":"lenses\/krb5.aug","new_file":"lenses\/krb5.aug","new_contents":"module Krb5 =\n\nautoload xfm\n\nlet comment = Inifile.comment IniFile.comment_re \"#\"\nlet empty = Inifile.empty\nlet eol = Inifile.eol\nlet dels = Util.del_str\n\nlet indent = del \/[ \\t]*\/ \"\"\nlet comma_or_space_sep = del \/[ \\t,]{1,}\/ \" \"\nlet eq = del \/[ \\t]*=[ \\t]*\/ \" = \"\nlet eq_openbr = del \/[ \\t]*=[ \\t\\n]*\\{[ \\t]*\\n\/ \" = {\\n\"\nlet closebr = del \/[ \\t]*\\}\/ \"}\"\n\n(* These two regexps for realms and apps are not entirely true\n - strictly speaking, there's no requirement that a realm is all upper case\n and an application only uses lowercase. But it's what's used in practice.\n\n Without that distinction we couldn't distinguish between applications\n and realms in the [appdefaults] section.\n*)\n\nlet realm_re = \/[A-Z][.a-zA-Z0-9-]*\/\nlet app_re = \/[a-z][a-zA-Z0-9_]*\/\nlet name_re = \/[.a-zA-Z0-9_-]+\/\n\nlet value = store \/[^;# \\t\\n{}]+\/\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ indent . key kw . sep . value . (comment|eol) ] | comment\n\nlet subsec_entry (kw:regexp) (sep:lens) (comment:lens)\n = ( entry kw sep comment ) | empty\n\nlet simple_section (n:string) (k:regexp) =\n let title = Inifile.indented_title n in\n let entry = entry k eq comment in\n Inifile.record title entry\n\nlet record (t:string) (e:lens) =\n let title = Inifile.indented_title t in\n Inifile.record title e\n\nlet v4_name_convert (subsec:lens) = [ indent . key \"v4_name_convert\" .\n eq_openbr . subsec* . closebr . eol ]\n\n(*\n For the enctypes this appears to be a list of the valid entries:\n c4-hmac arcfour-hmac aes128-cts rc4-hmac\n arcfour-hmac-md5 des3-cbc-sha1 des-cbc-md5 des-cbc-crc\n*)\nlet enctype_re = \/[a-zA-Z0-9-]{3,}\/\nlet enctypes = \/permitted_enctypes|default_tgs_enctypes|default_tkt_enctypes\/i\n\n(* An #eol label prevents ambiguity between \"k = v1 v2\" and \"k = v1\\n k = v2\" *)\nlet enctype_list (nr:regexp) (ns:string) =\n indent . del nr ns . eq\n . Build.opt_list [ label ns . store enctype_re ] comma_or_space_sep\n . (comment|eol) . [ label \"#eol\" ]\n\nlet libdefaults =\n let option = entry (name_re - \"v4_name_convert\" - enctypes) eq comment in\n let enctype_lists = enctype_list \/permitted_enctypes\/i \"permitted_enctypes\"\n | enctype_list \/default_tgs_enctypes\/i \"default_tgs_enctypes\"\n | enctype_list \/default_tkt_enctypes\/i \"default_tkt_enctypes\" in\n let subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n record \"libdefaults\" (option|enctype_lists|v4_name_convert subsec)\n\nlet login =\n let keys = \/krb[45]_get_tickets|krb4_convert|krb_run_aklog\/\n |\/aklog_path|accept_passwd\/ in\n simple_section \"login\" keys\n\nlet appdefaults =\n let option = entry (name_re - \"realm\" - \"application\") eq comment in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . (option|empty)* . closebr . eol ] in\n let app = [ indent . label \"application\" . store app_re .\n eq_openbr . (realm|option|empty)* . closebr . eol] in\n record \"appdefaults\" (option|realm|app)\n\nlet realms =\n let simple_option = \/kdc|admin_server|database_module|default_domain\/\n |\/v4_realm|auth_to_local(_names)?|master_kdc|kpasswd_server\/\n |\/admin_server|ticket_lifetime|pkinit_anchors\/ in\n let subsec_option = \/v4_instance_convert\/ in\n let option = subsec_entry simple_option eq comment in\n let subsec = [ indent . key subsec_option . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n let v4subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . (option|subsec|(v4_name_convert v4subsec))* .\n closebr . eol ] in\n record \"realms\" (realm|comment)\n\nlet domain_realm =\n simple_section \"domain_realm\" name_re\n\nlet logging =\n let keys = \/kdc|admin_server|default\/ in\n let xchg (m:regexp) (d:string) (l:string) =\n del m d . label l in\n let xchgs (m:string) (l:string) = xchg m m l in\n let dest =\n [ xchg \/FILE[=:]\/ \"FILE=\" \"file\" . value ]\n |[ xchgs \"STDERR\" \"stderr\" ]\n |[ xchgs \"CONSOLE\" \"console\" ]\n |[ xchgs \"DEVICE=\" \"device\" . value ]\n |[ xchgs \"SYSLOG\" \"syslog\" .\n ([ xchgs \":\" \"severity\" . store \/[A-Za-z0-9]+\/ ].\n [ xchgs \":\" \"facility\" . store \/[A-Za-z0-9]+\/ ]?)? ] in\n let entry = [ indent . key keys . eq . dest . (comment|eol) ] | comment in\n record \"logging\" entry\n\nlet capaths =\n let realm = [ indent . key realm_re .\n eq_openbr .\n (entry realm_re eq comment)* . closebr . eol ] in\n record \"capaths\" (realm|comment)\n\nlet dbdefaults =\n let keys = \/database_module|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbdefaults\" keys\n\nlet dbmodules =\n let keys = \/db_library|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbmodules\" keys\n\n(* This section is not documented in the krb5.conf manpage,\n but the Fermi example uses it. *)\nlet instance_mapping =\n let value = dels \"\\\"\" . store \/[^;# \\t\\n{}]*\/ . dels \"\\\"\" in\n let map_node = label \"mapping\" . store \/[a-zA-Z0-9\\\/*]+\/ in\n let mapping = [ indent . map_node . eq .\n [ label \"value\" . value ] . (comment|eol) ] in\n let instance = [ indent . key name_re .\n eq_openbr . (mapping|comment)* . closebr . eol ] in\n record \"instancemapping\" instance\n\nlet kdc =\n simple_section \"kdc\" \/profile\/\n\nlet pam =\n simple_section \"pam\" name_re\n\nlet lns = (comment|empty)* .\n (libdefaults|login|appdefaults|realms|domain_realm\n |logging|capaths|dbdefaults|dbmodules|instance_mapping|kdc|pam)*\n\nlet xfm = transform lns (incl \"\/etc\/krb5.conf\")\n","old_contents":"module Krb5 =\n\nautoload xfm\n\nlet comment = Inifile.comment IniFile.comment_re \"#\"\nlet empty = Inifile.empty\nlet eol = Inifile.eol\nlet dels = Util.del_str\n\nlet indent = del \/[ \\t]*\/ \"\"\nlet comma_or_space_sep = del \/[ \\t,]{1,}\/ \" \"\nlet eq = del \/[ \\t]*=[ \\t]*\/ \" = \"\nlet eq_openbr = del \/[ \\t]*=[ \\t\\n]*\\{[ \\t]*\\n\/ \" = {\\n\"\nlet closebr = del \/[ \\t]*\\}\/ \"}\"\n\n(* These two regexps for realms and apps are not entirely true\n - strictly speaking, there's no requirement that a realm is all upper case\n and an application only uses lowercase. But it's what's used in practice.\n\n Without that distinction we couldn't distinguish between applications\n and realms in the [appdefaults] section.\n*)\n\nlet realm_re = \/[A-Z][.a-zA-Z0-9-]*\/\nlet app_re = \/[a-z][a-zA-Z0-9_]*\/\nlet name_re = \/[.a-zA-Z0-9_-]+\/\n\nlet value = store \/[^;# \\t\\n{}]+\/\nlet entry (kw:regexp) (sep:lens) (comment:lens)\n = [ indent . key kw . sep . value . (comment|eol) ] | comment\n\nlet subsec_entry (kw:regexp) (sep:lens) (comment:lens)\n = ( entry kw sep comment ) | empty\n\nlet simple_section (n:string) (k:regexp) =\n let title = Inifile.indented_title n in\n let entry = entry k eq comment in\n Inifile.record title entry\n\nlet record (t:string) (e:lens) =\n let title = Inifile.indented_title t in\n Inifile.record title e\n\nlet v4_name_convert (subsec:lens) = [ indent . key \"v4_name_convert\" .\n eq_openbr . subsec* . closebr . eol ]\n\n(*\n For the enctypes this appears to be a list of the valid entries:\n c4-hmac arcfour-hmac aes128-cts rc4-hmac\n arcfour-hmac-md5 des3-cbc-sha1 des-cbc-md5 des-cbc-crc\n*)\nlet enctype_re = \/[a-zA-Z0-9-]{3,}\/\nlet enctypes = \/permitted_enctypes|default_tgs_enctypes|default_tkt_enctypes\/i\n\n(* An #eol label prevents ambiguity between \"k = v1 v2\" and \"k = v1\\n k = v2\" *)\nlet enctype_list (nr:regexp) (ns:string) =\n indent . del nr ns . eq\n . Build.opt_list [ label ns . store enctype_re ] comma_or_space_sep\n . (comment|eol) . [ label \"#eol\" ]\n\nlet libdefaults =\n let option = entry (name_re - \"v4_name_convert\" - enctypes) eq comment in\n let enctype_lists = enctype_list \/permitted_enctypes\/i \"permitted_enctypes\"\n | enctype_list \/default_tgs_enctypes\/i \"default_tgs_enctypes\"\n | enctype_list \/default_tkt_enctypes\/i \"default_tkt_enctypes\" in\n let subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n record \"libdefaults\" (option|enctype_lists|v4_name_convert subsec)\n\nlet login =\n let keys = \/krb[45]_get_tickets|krb4_convert|krb_run_aklog\/\n |\/aklog_path|accept_passwd\/ in\n simple_section \"login\" keys\n\nlet appdefaults =\n let option = entry (name_re - \"realm\" - \"application\") eq comment in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . (option|empty)* . closebr . eol ] in\n let app = [ indent . label \"application\" . store app_re .\n eq_openbr . (realm|option|empty)* . closebr . eol] in\n record \"appdefaults\" (option|realm|app)\n\nlet realms =\n let simple_option = \/kdc|admin_server|database_module|default_domain\/\n |\/v4_realm|auth_to_local(_names)?|master_kdc|kpasswd_server\/\n |\/admin_server|ticket_lifetime\/ in\n let subsec_option = \/v4_instance_convert\/ in\n let option = subsec_entry simple_option eq comment in\n let subsec = [ indent . key subsec_option . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n let v4subsec = [ indent . key \/host|plain\/ . eq_openbr .\n (subsec_entry name_re eq comment)* . closebr . eol ] in\n let realm = [ indent . label \"realm\" . store realm_re .\n eq_openbr . (option|subsec|(v4_name_convert v4subsec))* .\n closebr . eol ] in\n record \"realms\" (realm|comment)\n\nlet domain_realm =\n simple_section \"domain_realm\" name_re\n\nlet logging =\n let keys = \/kdc|admin_server|default\/ in\n let xchg (m:regexp) (d:string) (l:string) =\n del m d . label l in\n let xchgs (m:string) (l:string) = xchg m m l in\n let dest =\n [ xchg \/FILE[=:]\/ \"FILE=\" \"file\" . value ]\n |[ xchgs \"STDERR\" \"stderr\" ]\n |[ xchgs \"CONSOLE\" \"console\" ]\n |[ xchgs \"DEVICE=\" \"device\" . value ]\n |[ xchgs \"SYSLOG\" \"syslog\" .\n ([ xchgs \":\" \"severity\" . store \/[A-Za-z0-9]+\/ ].\n [ xchgs \":\" \"facility\" . store \/[A-Za-z0-9]+\/ ]?)? ] in\n let entry = [ indent . key keys . eq . dest . (comment|eol) ] | comment in\n record \"logging\" entry\n\nlet capaths =\n let realm = [ indent . key realm_re .\n eq_openbr .\n (entry realm_re eq comment)* . closebr . eol ] in\n record \"capaths\" (realm|comment)\n\nlet dbdefaults =\n let keys = \/database_module|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbdefaults\" keys\n\nlet dbmodules =\n let keys = \/db_library|ldap_kerberos_container_dn|ldap_kdc_dn\/\n |\/ldap_kadmind_dn|ldap_service_password_file|ldap_servers\/\n |\/ldap_conns_per_server\/ in\n simple_section \"dbmodules\" keys\n\n(* This section is not documented in the krb5.conf manpage,\n but the Fermi example uses it. *)\nlet instance_mapping =\n let value = dels \"\\\"\" . store \/[^;# \\t\\n{}]*\/ . dels \"\\\"\" in\n let map_node = label \"mapping\" . store \/[a-zA-Z0-9\\\/*]+\/ in\n let mapping = [ indent . map_node . eq .\n [ label \"value\" . value ] . (comment|eol) ] in\n let instance = [ indent . key name_re .\n eq_openbr . (mapping|comment)* . closebr . eol ] in\n record \"instancemapping\" instance\n\nlet kdc =\n simple_section \"kdc\" \/profile\/\n\nlet pam =\n simple_section \"pam\" name_re\n\nlet lns = (comment|empty)* .\n (libdefaults|login|appdefaults|realms|domain_realm\n |logging|capaths|dbdefaults|dbmodules|instance_mapping|kdc|pam)*\n\nlet xfm = transform lns (incl \"\/etc\/krb5.conf\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"5b4d8ca71ba94a14cda1f16f7f3556b6a3671f34","subject":"Xorg: accept InputClass section","message":"Xorg: accept InputClass section\n","repos":"kumy\/augeas,jtopjian\/augeas,kunkku\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,kumy\/augeas,ptoscano\/augeas,dafugg\/augeas,mlichvar\/augeas,kumy\/augeas,kunkku\/augeas,jjlin\/augeas,mlichvar\/augeas,manandbytes\/augeas,jjlin\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,dafugg\/augeas,ptoscano\/augeas,pevalme\/augeas,manandbytes\/augeas,domcleal\/augeas,domcleal\/augeas,raphink\/augeas,kumy\/augeas,kunkku\/augeas,ptoscano\/augeas,jasperla\/augeas,hercules-team\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,mchf\/augeas,lutter\/augeas,jasperla\/augeas,mchf\/augeas,hercules-team\/augeas,mlichvar\/augeas,lutter\/augeas,domcleal\/augeas","old_file":"lenses\/xorg.aug","new_file":"lenses\/xorg.aug","new_contents":"(*\nModule: Xorg\n Parses \/etc\/X11\/xorg.conf\n\nAuthors: Raphael Pinson <raphink@gmail.com>\n Matthew Booth <mbooth@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man xorg.conf` where\n possible.\n\nThe definitions from `man xorg.conf` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Configuration files\n This lens applies to \/etc\/X11\/xorg.conf. See <filter>.\n*)\n\nmodule Xorg =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: to_eol\n * Match everything from here to eol, cropping whitespace at both ends\n *)\nlet to_eol = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Fields and values *)\n\n(* Variable: entries_re\n * This is a list of all patterns which have specific handlers, and should\n * therefore not be matched by the generic handler\n *)\nlet entries_re = \/([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth|[dD]evice)\/\n\n(* Variable: generic_entry_re *)\nlet generic_entry_re = \/[^# \\t\\n\\\/]+\/ - entries_re\n\n(* Variable: quoted_string_val *)\nlet quoted_string_val = del \"\\\"\" \"\\\"\" . store \/[^\"\\n]+\/ . del \"\\\"\" \"\\\"\"\n (* \" relax, emacs *)\n\n(* Variable: int *)\nlet int = \/[0-9]+\/\n\n\n(************************************************************************\n * Group: ENTRIES AND OPTIONS\n *************************************************************************)\n\n\n(* View: entry_int\n * This matches an entry which takes a single integer for an argument\n *)\nlet entry_int (canon:string) (re:regexp) =\n [ indent . del re canon . label canon . sep_spc . store int . eol ]\n\n(* View: entry_rgb\n * This matches an entry which takes 3 integers as arguments representing red,\n * green and blue components\n *)\nlet entry_rgb (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"red\" . sep_spc . store int ]\n . [ label \"green\" . sep_spc . store int ]\n . [ label \"blue\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_xy\n * This matches an entry which takes 2 integers as arguments representing X and\n * Y coordinates\n *)\nlet entry_xy (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"x\" . sep_spc . store int ]\n . [ label \"y\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_str\n * This matches an entry which takes a single quoted string\n *)\nlet entry_str (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . sep_spc . quoted_string_val . eol ]\n\n(* View: entry_generic\n * An entry without a specific handler. Store everything after the keyword,\n * cropping whitespace at both ends.\n *)\nlet entry_generic = [ indent . key generic_entry_re\n . sep_spc . store to_eol . eol ]\n\n(* View: option *)\nlet option = [ indent . del \/[oO]ption\/ \"Option\" . label \"Option\" . sep_spc\n . quoted_string_val\n . [ label \"value\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: screen\n * The Screen entry of ServerLayout\n *)\nlet screen = [ indent . del \/[sS]creen\/ \"Screen\" . label \"Screen\" . sep_spc\n . [ label \"num\" . store int . sep_spc ]?\n . quoted_string_val\n . [ sep_spc . label \"position\" . store to_eol ]?\n . eol ]\n\n(* View: input_device *)\nlet input_device = [ indent . del \/[iI]nput[dD]evice\/ \"InputDevice\"\n . label \"InputDevice\" . sep_spc . quoted_string_val\n . [ label \"option\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: driver *)\nlet driver = entry_str \"Driver\" \/[dD]river\/\n\n(* View: identifier *)\nlet identifier = entry_str \"Identifier\" \/[iI]dentifier\/\n\n(* View: videoram *)\nlet videoram = entry_int \"VideoRam\" \/[vV]ideo[rR]am\/\n\n(* View: default_depth *)\nlet default_depth = entry_int \"DefaultDepth\" \/[dD]efault[dD]epth\/\n\n(* View: device *)\nlet device = entry_str \"Device\" \/[dD]evice\/\n\n(************************************************************************\n * Group: DISPLAY SUBSECTION\n *************************************************************************)\n\n\n(* View: display_modes *)\nlet display_modes = [ indent . del \/[mM]odes\/ \"Modes\" . label \"Modes\"\n . [ label \"mode\" . sep_spc . quoted_string_val ]+\n . eol ]\n\n(*************************************************************************\n * View: display_entry\n * Known values for entries in the Display subsection\n *\n * Definition:\n * > Depth depth\n * > FbBpp bpp\n * > Weight red-weight green-weight blue-weight\n * > Virtual xdim ydim\n * > ViewPort x0 y0\n * > Modes \"mode-name\" ...\n * > Visual \"visual-name\"\n * > Black red green blue\n * > White red green blue\n * > Options\n *)\n\nlet display_entry = entry_int \"Depth\" \/[dD]epth\/ |\n entry_int \"FbBpp\" \/[fF]b[bB]pp\/ |\n entry_rgb \"Weight\" \/[wW]eight\/ |\n entry_xy \"Virtual\" \/[vV]irtual\/ |\n entry_xy \"ViewPort\" \/[vV]iew[pP]ort\/ |\n display_modes |\n entry_str \"Visual\" \/[vV]isual\/ |\n entry_rgb \"Black\" \/[bB]lack\/ |\n entry_rgb \"White\" \/[wW]hite\/ |\n entry_str \"Options\" \/[oO]ptions\/ |\n empty |\n comment\n\n(* View: display *)\nlet display = [ indent . del \"SubSection\" \"SubSection\" . sep_spc\n . sep_dquote . key \"Display\" . sep_dquote\n . eol\n . display_entry*\n . indent . del \"EndSubSection\" \"EndSubSection\" . eol ]\n\n\n(************************************************************************\n * Group: SECTIONS\n *************************************************************************)\n\n\n(************************************************************************\n * Variable: section_re\n * Known values for Section names\n *\n * Definition:\n * > The section names are:\n * >\n * > Files File pathnames\n * > ServerFlags Server flags\n * > Module Dynamic module loading\n * > Extensions Extension Enabling\n * > InputDevice Input device description\n * > InputClass Input Class description\n * > Device Graphics device description\n * > VideoAdaptor Xv video adaptor description\n * > Monitor Monitor description\n * > Modes Video modes descriptions\n * > Screen Screen configuration\n * > ServerLayout Overall layout\n * > DRI DRI-specific configuration\n * > Vendor Vendor-specific configuration\n *************************************************************************)\nlet section_re = \/(Extensions|Files|ServerFlags|Module|InputDevice|InputClass|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor)\/\n\n\n(************************************************************************\n * Variable: secton_re_obsolete\n * The following obsolete section names are still recognised for\n * compatibility purposes. In new config files, the InputDevice\n * section should be used instead.\n *\n * Definition:\n * > Keyboard Keyboard configuration\n * > Pointer Pointer\/mouse configuration\n *************************************************************************)\nlet section_re_obsolete = \/(Keyboard|Pointer)\/\n\n(* View: section_entry *)\nlet section_entry = option |\n screen |\n display |\n input_device |\n driver |\n identifier |\n videoram |\n default_depth |\n device |\n entry_generic |\n empty | comment\n\n(************************************************************************\n * View: section\n * A section in xorg.conf\n *\n * Definition:\n * > Section \"SectionName\"\n * > SectionEntry\n * > ...\n * > EndSection\n *************************************************************************)\nlet section = [ indent . del \"Section\" \"Section\"\n . sep_spc . sep_dquote\n . key (section_re|section_re_obsolete) . sep_dquote\n . eol\n . section_entry*\n . indent . del \"EndSection\" \"EndSection\" . eol ]\n\n(*\n * View: lns\n * The xorg.conf lens\n *)\nlet lns = ( empty | comment | section )*\n\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/X11\/xorg.conf\") .\n (incl \"\/etc\/X11\/xorg.conf.d\/*.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Xorg\n Parses \/etc\/X11\/xorg.conf\n\nAuthors: Raphael Pinson <raphink@gmail.com>\n Matthew Booth <mbooth@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man xorg.conf` where\n possible.\n\nThe definitions from `man xorg.conf` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Configuration files\n This lens applies to \/etc\/X11\/xorg.conf. See <filter>.\n*)\n\nmodule Xorg =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: to_eol\n * Match everything from here to eol, cropping whitespace at both ends\n *)\nlet to_eol = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Fields and values *)\n\n(* Variable: entries_re\n * This is a list of all patterns which have specific handlers, and should\n * therefore not be matched by the generic handler\n *)\nlet entries_re = \/([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth|[dD]evice)\/\n\n(* Variable: generic_entry_re *)\nlet generic_entry_re = \/[^# \\t\\n\\\/]+\/ - entries_re\n\n(* Variable: quoted_string_val *)\nlet quoted_string_val = del \"\\\"\" \"\\\"\" . store \/[^\"\\n]+\/ . del \"\\\"\" \"\\\"\"\n (* \" relax, emacs *)\n\n(* Variable: int *)\nlet int = \/[0-9]+\/\n\n\n(************************************************************************\n * Group: ENTRIES AND OPTIONS\n *************************************************************************)\n\n\n(* View: entry_int\n * This matches an entry which takes a single integer for an argument\n *)\nlet entry_int (canon:string) (re:regexp) =\n [ indent . del re canon . label canon . sep_spc . store int . eol ]\n\n(* View: entry_rgb\n * This matches an entry which takes 3 integers as arguments representing red,\n * green and blue components\n *)\nlet entry_rgb (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"red\" . sep_spc . store int ]\n . [ label \"green\" . sep_spc . store int ]\n . [ label \"blue\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_xy\n * This matches an entry which takes 2 integers as arguments representing X and\n * Y coordinates\n *)\nlet entry_xy (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"x\" . sep_spc . store int ]\n . [ label \"y\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_str\n * This matches an entry which takes a single quoted string\n *)\nlet entry_str (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . sep_spc . quoted_string_val . eol ]\n\n(* View: entry_generic\n * An entry without a specific handler. Store everything after the keyword,\n * cropping whitespace at both ends.\n *)\nlet entry_generic = [ indent . key generic_entry_re\n . sep_spc . store to_eol . eol ]\n\n(* View: option *)\nlet option = [ indent . del \/[oO]ption\/ \"Option\" . label \"Option\" . sep_spc\n . quoted_string_val\n . [ label \"value\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: screen\n * The Screen entry of ServerLayout\n *)\nlet screen = [ indent . del \/[sS]creen\/ \"Screen\" . label \"Screen\" . sep_spc\n . [ label \"num\" . store int . sep_spc ]?\n . quoted_string_val\n . [ sep_spc . label \"position\" . store to_eol ]?\n . eol ]\n\n(* View: input_device *)\nlet input_device = [ indent . del \/[iI]nput[dD]evice\/ \"InputDevice\"\n . label \"InputDevice\" . sep_spc . quoted_string_val\n . [ label \"option\" . sep_spc . quoted_string_val ]*\n . eol ]\n\n(* View: driver *)\nlet driver = entry_str \"Driver\" \/[dD]river\/\n\n(* View: identifier *)\nlet identifier = entry_str \"Identifier\" \/[iI]dentifier\/\n\n(* View: videoram *)\nlet videoram = entry_int \"VideoRam\" \/[vV]ideo[rR]am\/\n\n(* View: default_depth *)\nlet default_depth = entry_int \"DefaultDepth\" \/[dD]efault[dD]epth\/\n\n(* View: device *)\nlet device = entry_str \"Device\" \/[dD]evice\/\n\n(************************************************************************\n * Group: DISPLAY SUBSECTION\n *************************************************************************)\n\n\n(* View: display_modes *)\nlet display_modes = [ indent . del \/[mM]odes\/ \"Modes\" . label \"Modes\"\n . [ label \"mode\" . sep_spc . quoted_string_val ]+\n . eol ]\n\n(*************************************************************************\n * View: display_entry\n * Known values for entries in the Display subsection\n *\n * Definition:\n * > Depth depth\n * > FbBpp bpp\n * > Weight red-weight green-weight blue-weight\n * > Virtual xdim ydim\n * > ViewPort x0 y0\n * > Modes \"mode-name\" ...\n * > Visual \"visual-name\"\n * > Black red green blue\n * > White red green blue\n * > Options\n *)\n\nlet display_entry = entry_int \"Depth\" \/[dD]epth\/ |\n entry_int \"FbBpp\" \/[fF]b[bB]pp\/ |\n entry_rgb \"Weight\" \/[wW]eight\/ |\n entry_xy \"Virtual\" \/[vV]irtual\/ |\n entry_xy \"ViewPort\" \/[vV]iew[pP]ort\/ |\n display_modes |\n entry_str \"Visual\" \/[vV]isual\/ |\n entry_rgb \"Black\" \/[bB]lack\/ |\n entry_rgb \"White\" \/[wW]hite\/ |\n entry_str \"Options\" \/[oO]ptions\/ |\n empty |\n comment\n\n(* View: display *)\nlet display = [ indent . del \"SubSection\" \"SubSection\" . sep_spc\n . sep_dquote . key \"Display\" . sep_dquote\n . eol\n . display_entry*\n . indent . del \"EndSubSection\" \"EndSubSection\" . eol ]\n\n\n(************************************************************************\n * Group: SECTIONS\n *************************************************************************)\n\n\n(************************************************************************\n * Variable: section_re\n * Known values for Section names\n *\n * Definition:\n * > The section names are:\n * >\n * > Files File pathnames\n * > ServerFlags Server flags\n * > Module Dynamic module loading\n * > Extensions Extension Enabling\n * > InputDevice Input device description\n * > InputClass Input Class description\n * > Device Graphics device description\n * > VideoAdaptor Xv video adaptor description\n * > Monitor Monitor description\n * > Modes Video modes descriptions\n * > Screen Screen configuration\n * > ServerLayout Overall layout\n * > DRI DRI-specific configuration\n * > Vendor Vendor-specific configuration\n *************************************************************************)\nlet section_re = \/(Extensions|Files|ServerFlags|Module|InputDevice|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor)\/\n\n\n(************************************************************************\n * Variable: secton_re_obsolete\n * The following obsolete section names are still recognised for\n * compatibility purposes. In new config files, the InputDevice\n * section should be used instead.\n *\n * Definition:\n * > Keyboard Keyboard configuration\n * > Pointer Pointer\/mouse configuration\n *************************************************************************)\nlet section_re_obsolete = \/(Keyboard|Pointer)\/\n\n(* View: section_entry *)\nlet section_entry = option |\n screen |\n display |\n input_device |\n driver |\n identifier |\n videoram |\n default_depth |\n device |\n entry_generic |\n empty | comment\n\n(************************************************************************\n * View: section\n * A section in xorg.conf\n *\n * Definition:\n * > Section \"SectionName\"\n * > SectionEntry\n * > ...\n * > EndSection\n *************************************************************************)\nlet section = [ indent . del \"Section\" \"Section\"\n . sep_spc . sep_dquote\n . key (section_re|section_re_obsolete) . sep_dquote\n . eol\n . section_entry*\n . indent . del \"EndSection\" \"EndSection\" . eol ]\n\n(*\n * View: lns\n * The xorg.conf lens\n *)\nlet lns = ( empty | comment | section )*\n\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/X11\/xorg.conf\") .\n (incl \"\/etc\/X11\/xorg.conf.d\/*.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"33b358454ce24d47b164e4d4f4cc91b5a23b5571","subject":"Various fixes in bbhosts.aug","message":"Various fixes in bbhosts.aug\n","repos":"mchf\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,manandbytes\/augeas,hercules-team\/augeas,pevalme\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,manandbytes\/augeas,kunkku\/augeas,pevalme\/augeas,jjlin\/augeas,mlichvar\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,jasperla\/augeas,hercules-team\/augeas,lutter\/augeas,dafugg\/augeas,kumy\/augeas,jjlin\/augeas,lutter\/augeas,ptoscano\/augeas,jasperla\/augeas,jjlin\/augeas,dafugg\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,pevalme\/augeas,raphink\/augeas,dafugg\/augeas,kumy\/augeas,ptoscano\/augeas,mchf\/augeas,kumy\/augeas,raphink\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,lutter\/augeas,mlichvar\/augeas","old_file":"lenses\/bbhosts.aug","new_file":"lenses\/bbhosts.aug","new_contents":"(* BB-hosts module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* Supported : *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule BBhosts =\n autoload xfm\n\n (* Define useful shortcuts *)\n\n let eol = Util.eol\n let eol_no_spc = Util.del_str \"\\n\"\n let sep_spc = Sep.space\n let word = store \/[^|;# \\n\\t]+\/\n let value_to_eol = store \/[^ \\t][^\\n]+\/\n let ip = store Rx.ipv4\n let url = store \/https?:[^# \\n\\t]+\/\n let word_cont = store \/[^;# \\n\\t]+\/\n\n (* Define comments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Define host *)\n let host_ip = [ label \"ip\" . ip ]\n let host_fqdn = [ label \"fqdn\" . sep_spc . word ]\n\n let host_test_url = [ label \"url\" . url ]\n let host_test_cont (kw:string) = [ store \/!?\/ . key kw .\n (Util.del_str \";\" .\n [ label \"url\" . word_cont ] .\n\t\t\t (Util.del_str \";\" . [ label \"keyword\" . word ])?\n\t\t\t )?\n\t\t\t ]\n\n let host_test_flag_value = [ label \"value\" . Util.del_str \":\"\n . store Rx.word ]\n\n let host_test_flag (kw:string) = [ store \/!?\/ . key kw\n . host_test_flag_value? ]\n\n let host_test = host_test_cont \"cont\"\n | host_test_cont \"contInsecure\"\n | host_test_cont \"dns\"\n | host_test_flag \"CDB\"\n | host_test_flag \"ftp\"\n | host_test_flag \"front\"\n | host_test_flag \"GTM\"\n\t\t | host_test_flag \"noping\"\n\t\t | host_test_flag \"noconn\"\n\t\t | host_test_flag \"ssh\"\n\t\t | host_test_flag \"ssh2\"\n\t\t | host_test_flag \"smtp\"\n\t\t | host_test_flag \"pop3\"\n\t\t | host_test_flag \"imap2\"\n\t\t | host_test_flag \"telnet\"\n\t\t | host_test_flag \"BBDISPLAY\"\n\t\t | host_test_flag \"BBNET\"\n\t\t | host_test_flag \"BBPAGER\"\n\t\t | host_test_flag \"XYMON\"\n | host_test_url\n\n\n let host_test_list = Build.opt_list host_test sep_spc\n\n let host_opts = [ label \"probes\" . sep_spc . Util.del_str \"#\" . (sep_spc . host_test_list)? ]\n\n let host = [ label \"host\" . host_ip . host_fqdn . host_opts . eol ]\n\n (* Define group-compress and group-only *)\n let group_compress = [ key \/group(-compress)?\/ . (sep_spc . value_to_eol)? . eol_no_spc .\n ( comment | empty | host)*\n\t\t ]\n\n let group_only_col = [ label \"col\" . word ]\n let group_only_cols = sep_spc . group_only_col . ( Util.del_str \"|\" . group_only_col )*\n let group_only = [ key \"group-only\" . group_only_cols . sep_spc . value_to_eol . eol_no_spc .\n ( comment | empty | host)*\n\t\t ]\n\n\n (* Define page *)\n let page_title = [ label \"title\" . sep_spc . value_to_eol ]\n let page = [ key \"page\" . sep_spc . word . page_title? . eol_no_spc .\n ( comment | empty | host )* . ( group_compress | group_only )*\n\t\t ]\n\n\n (* Define lens *)\n\n let lns = (comment | empty)* . page*\n\n let filter = incl \"\/etc\/bb\/bb-hosts\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n","old_contents":"(* BB-hosts module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* Supported : *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule BBhosts =\n autoload xfm\n\n (* Define useful shortcuts *)\n\n let eol = Util.eol\n let eol_no_spc = Util.del_str \"\\n\"\n let sep_spc = Sep.space\n let word = store \/[^|;# \\n\\t]+\/\n let value_to_eol = store \/[^ \\t][^\\n]+\/\n let ip = store Rx.ipv4\n let url = store \/https?:[^;,# \\n\\t]+\/\n\n (* Define comments and empty lines *)\n let comment = Util.comment\n let empty = Util.empty\n\n\n (* Define host *)\n let host_ip = [ label \"ip\" . ip ]\n let host_fqdn = [ label \"fqdn\" . sep_spc . word ]\n\n let host_test_url = [ label \"url\" . sep_spc . url ]\n let host_test_cont (kw:string) = [ sep_spc . store \/!?\/ . key kw .\n (Util.del_str \";\" .\n [ label \"url\" . word ] .\n\t\t\t (Util.del_str \";\" . [ label \"keyword\" . word ])?\n\t\t\t )?\n\t\t\t ]\n\n\n let host_test_flag (kw:string) = [ sep_spc . store \/!?\/ . key kw ]\n\n let host_test = host_test_cont \"cont\"\n | host_test_cont \"contInsecure\"\n | host_test_cont \"dns\"\n\t\t | host_test_flag \"noping\"\n\t\t | host_test_flag \"noconn\"\n\t\t | host_test_flag \"ssh\"\n\t\t | host_test_flag \"smtp\"\n\t\t | host_test_flag \"pop3\"\n\t\t | host_test_flag \"imap2\"\n\t\t | host_test_flag \"telnet\"\n\t\t | host_test_flag \"BBDISPLAY\"\n\t\t | host_test_flag \"BBNET\"\n\t\t | host_test_flag \"BBPAGER\"\n | host_test_url\n\n\n let host_opts = [ label \"probes\" . sep_spc . Util.del_str \"#\" . host_test* ]\n\n let host = [ label \"host\" . host_ip . host_fqdn . host_opts . eol ]\n\n (* Define group-compress and group-only *)\n let group_compress = [ key \"group-compress\" . sep_spc . value_to_eol . eol_no_spc .\n ( comment | empty | host)*\n\t\t ]\n\n let group_only_col = [ label \"col\" . word ]\n let group_only_cols = sep_spc . group_only_col . ( Util.del_str \"|\" . group_only_col )*\n let group_only = [ key \"group-only\" . group_only_cols . sep_spc . value_to_eol . eol_no_spc .\n ( comment | empty | host)*\n\t\t ]\n\n\n (* Define page *)\n let page_title = [ label \"title\" . sep_spc . value_to_eol . eol_no_spc ]\n let page = [ key \"page\" . sep_spc . word . page_title .\n ( comment | empty | host )* . ( group_compress | group_only )*\n\t\t ]\n\n\n (* Define lens *)\n\n let lns = (comment | empty)* . page*\n\n let filter = incl \"\/etc\/bb\/bb-hosts\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7ce35fd492282ba75fa144f2759ca28308277e1f","subject":"added copy of yum.aug, rev 142cbf","message":"added copy of yum.aug, rev 142cbf\n","repos":"camptocamp\/puppet-augeas,jordiclariana\/puppet-augeas,SUNET\/puppet-augeas,apa-it\/puppet-augeas,leapcode\/puppet_augeas","old_file":"files\/yum.aug","new_file":"files\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n let key_re = \/[^#;:= \\t\\n[\\\/]+\/ - \"baseurl\"\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/[ \\t]*(,[ \\t]*|\\n[ \\t]+)\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section = [ sechead . (entry* | entry* . (kv_list \"baseurl\") . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\") . (incl \"\/etc\/yum.repos.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/yum.aug' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Augeas"} {"commit":"7d77460ea24c182ce99575a6e09c9c855be278df","subject":"Improve documentation in test_xml.aug","message":"Improve documentation in test_xml.aug\n","repos":"dafugg\/augeas,dafugg\/augeas,lutter\/augeas,dafugg\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,pevalme\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,kumy\/augeas,jasperla\/augeas,mlichvar\/augeas,kumy\/augeas,mchf\/augeas,domcleal\/augeas,jjlin\/augeas,kumy\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,pevalme\/augeas,domcleal\/augeas,lutter\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,jjlin\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,MikaelSmith\/augeas,kunkku\/augeas,jtopjian\/augeas,pevalme\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,jasperla\/augeas,raphink\/augeas,kumy\/augeas,kunkku\/augeas,ptoscano\/augeas,hercules-team\/augeas,jjlin\/augeas,mlichvar\/augeas,mchf\/augeas","old_file":"lenses\/tests\/test_xml.aug","new_file":"lenses\/tests\/test_xml.aug","new_contents":"(*\nModule: Test_Xml\n Provides unit tests and examples for the <Xml> lens.\n*)\n\nmodule Test_Xml =\n\n(* View: knode\n A simple flag function\n\n Parameters:\n r:regexp - the pattern for the flag\n*)\nlet knode (r:regexp) = [ key r ]\n\n(************************************************************************\n * Group: Utilities lens\n *************************************************************************)\n(*\nlet _ = print_regexp(lens_ctype(Xml.text))\nlet _ = print_endline \"\"\n*)\n\n(* Group: Comments *)\n\n(* Test: Xml.comment\n Comments get mapped into \"#comment\" nodes. *)\ntest Xml.comment get\n \"<!-- declarations for <head> & <body> -->\" =\n\n { \"#comment\" = \" declarations for <head> & <body> \" }\n\n(* Test: Xml.comment\n This syntax is not understood. *)\ntest Xml.comment get\n \"<!-- B+, B, or B--->\" = *\n\n(* Group: Prolog and declarations *)\n\n(* Test: Xml.prolog\n The XML prolog tag is mapped in a \"#declaration\" node,\n which contains an \"#attribute\" node with various attributes of the tag. *)\ntest Xml.prolog get\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" =\n\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n { \"encoding\" = \"UTF-8\" }\n }\n }\n\n(* Test: Xml.decl_def_item\n !ELEMENT declaration tags are mapped in \"!ELEMENT\" nodes.\n The associated declaration attribute is mapped in a \"#decl\" subnode. *)\ntest Xml.decl_def_item get\n \"<!ELEMENT greeting (#PCDATA)>\" =\n\n { \"!ELEMENT\" = \"greeting\"\n { \"#decl\" = \"(#PCDATA)\" }\n }\n\n(* Test: Xml.decl_def_item\n !ENTITY declaration tags are mapped in \"!ENTITY\" nodes.\n The associated declaration attribute is mapped in a \"#decl\" subnode. *)\ntest Xml.decl_def_item get\n \"<!ENTITY da \\\" \\\">\" =\n\n { \"!ENTITY\" = \"da\"\n { \"#decl\" = \" \" }\n }\n\n(* Test: Xml.doctype\n !DOCTYPE tags are mapped in \"!DOCTYPE\" nodes.\n The associated system attribute is mapped in a \"SYSTEM\" subnode. *)\ntest Xml.doctype get\n \"<!DOCTYPE greeting SYSTEM \\\"hello.dtd\\\">\" =\n\n { \"!DOCTYPE\" = \"greeting\"\n { \"SYSTEM\" = \"hello.dtd\" }\n }\n\n(* Test: Xml.doctype\n This is an example of a !DOCTYPE tag with !ELEMENT children tags. *)\ntest Xml.doctype get \"<!DOCTYPE foo [\n<!ELEMENT bar (#PCDATA)>\n<!ELEMENT baz (bar)* >\n]>\" =\n\n { \"!DOCTYPE\" = \"foo\"\n { \"!ELEMENT\" = \"bar\"\n { \"#decl\" = \"(#PCDATA)\" }\n }\n { \"!ELEMENT\" = \"baz\"\n { \"#decl\" = \"(bar)*\" }\n }\n }\n\n(* Group: Attributes *)\n\n(* Variable: att_def1 *)\nlet att_def1 = \"<!ATTLIST termdef\nid ID #REQUIRED\nname CDATA #IMPLIED>\"\n(* Variable: att_def2 *)\nlet att_def2 = \"<!ATTLIST list\ntype (bullets|ordered|glossary) \\\"ordered\\\">\"\n(* Variable: att_def3 *)\nlet att_def3 = \"<!ATTLIST form\nmethod CDATA #FIXED \\\"POST\\\">\"\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def1 =\n\n { \"!ATTLIST\" = \"termdef\"\n { \"1\"\n { \"#name\" = \"id\" }\n { \"#type\" = \"ID\" }\n { \"#REQUIRED\" }\n }\n { \"2\"\n { \"#name\" = \"name\" }\n { \"#type\" = \"CDATA\" }\n { \"#IMPLIED\" }\n }\n }\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def2 =\n\n { \"!ATTLIST\" = \"list\"\n { \"1\"\n { \"#name\" = \"type\" }\n { \"#type\" = \"(bullets|ordered|glossary)\" }\n { \"#FIXED\" = \"ordered\" }\n }\n }\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def3 =\n\n { \"!ATTLIST\" = \"form\"\n { \"1\"\n { \"#name\" = \"method\" }\n { \"#type\" = \"CDATA\" }\n { \"#FIXED\" = \"POST\" }\n }\n }\n\n(* Test: Xml.notation_def *)\ntest Xml.notation_def get\n \"<!NOTATION not3 SYSTEM \\\"\\\">\" =\n\n { \"!NOTATION\" = \"not3\"\n { \"SYSTEM\" = \"\" }\n }\n\n(* Variable: cdata1 *)\nlet cdata1 = \"<![CDATA[testing]]>\"\n(* Test: Xml.cdata *)\ntest Xml.cdata get cdata1 = { \"#CDATA\" = \"testing\" }\n\n(* Variable: attr1 *)\nlet attr1 = \" attr1=\\\"value1\\\" attr2=\\\"value2\\\"\"\n(* Variable: attr2 *)\nlet attr2 = \" attr2=\\\"foo\\\"\"\n(* Test: Xml.attributes *)\ntest Xml.attributes get attr1 =\n { \"#attribute\"\n { \"attr1\" = \"value1\" }\n { \"attr2\" = \"value2\" }\n }\n\n(* Test: Xml.attributes *)\ntest Xml.attributes get \" refs=\\\"A1\\nA2 A3\\\"\" =\n { \"#attribute\"\n { \"refs\" = \"A1\\nA2 A3\" }\n }\n\n(* Test: Xml.attributes *)\ntest Xml.attributes put attr1 after rm \"\/#attribute[1]\";\n set \"\/#attribute\/attr2\" \"foo\" = attr2\n\n(* Group: empty *)\n\n(* Variable: empty1 *)\nlet empty1 = \"<a\/>\"\n(* Variable: empty2 *)\nlet empty2 = \"<a foo=\\\"bar\\\"\/>\"\n(* Variable: empty3 *)\nlet empty3 = \"<a foo=\\\"bar\\\"><\/a>\\n\"\n(* Variable: empty4 *)\nlet empty4 = \"<a foo=\\\"bar\\\" far=\\\"baz\\\"\/>\"\n(* Test: Xml.empty_element *)\ntest Xml.empty_element get empty1 = { \"a\" = \"#empty\" }\n(* Test: Xml.empty_element *)\ntest Xml.empty_element get empty2 =\n { \"a\" = \"#empty\" { \"#attribute\" { \"foo\" = \"bar\"} } }\n\n(* Test: Xml.empty_element *)\ntest Xml.empty_element put empty1 after set \"\/a\/#attribute\/foo\" \"bar\" = empty2\n\n(* Test: Xml.empty_element\n The attribute node must be the first child of the element *)\ntest Xml.empty_element put empty1 after set \"\/a\/#attribute\/foo\" \"bar\";\n set \"\/a\/#attribute\/far\" \"baz\" = empty4\n\n(* Test: Xml.content *)\ntest Xml.content put \"<a><b\/><\/a>\" after clear \"\/a\/b\" = \"<a><b><\/b>\\n<\/a>\"\n\n\n(* Group: Full lens *)\n\n(* Test: Xml.lns *)\ntest Xml.lns put \"<a><\/a >\" after set \"\/a\/#text[1]\" \"foo\";\n set \"\/a\/#text[2]\" \"bar\" = \"<a>foobar<\/a >\"\n\n(* Test: Xml.lns *)\ntest Xml.lns get \"<?xml version=\\\"1.0\\\"?>\n<!DOCTYPE catalog PUBLIC \\\"-\/\/OASIS\/\/DTD XML Catalogs V1.0\/\/EN\\\"\n \\\"file:\/\/\/usr\/share\/xml\/schema\/xml-core\/catalog.dtd\\\">\n <doc\/>\" =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"!DOCTYPE\" = \"catalog\"\n { \"PUBLIC\"\n { \"#literal\" = \"-\/\/OASIS\/\/DTD XML Catalogs V1.0\/\/EN\" }\n { \"#literal\" = \"file:\/\/\/usr\/share\/xml\/schema\/xml-core\/catalog.dtd\" }\n }\n }\n { \"doc\" = \"#empty\" }\n\n(* Test: Xml.lns *)\ntest Xml.lns get \"<oor:component-data xmlns:oor=\\\"http:\/\/openoffice.org\/2001\/registry\\\"\/>\n\" =\n { \"oor:component-data\" = \"#empty\"\n { \"#attribute\"\n { \"xmlns:oor\" = \"http:\/\/openoffice.org\/2001\/registry\" }\n }\n }\n\n(* Variable: input1 *)\nlet input1 = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<html>\n <head>\n <title>Wiki<\/title>\n <\/head>\n <body>\n <h1>Augeas<\/h1>\n <p class=\\\"main\\\">Augeas is now able to parse XML files!<\/p>\n <ul>\n <li>Translate from XML to a tree syntax<\/li>\n <li>Translate from the tree back to XML<\/li> <!-- this is some comment -->\n <li>this<\/li>\n <\/ul>\n <\/body>\n<\/html>\n\"\n\n(* Test: Xml.doc\n Test <input1> with <Xml.doc> *)\ntest Xml.doc get input1 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n { \"encoding\" = \"UTF-8\" }\n }\n }\n { \"html\"\n { \"#text\" = \"\\n \" }\n { \"head\"\n { \"#text\" = \"\\n \" }\n { \"title\"\n { \"#text\" = \"Wiki\" }\n }\n { \"#text\" = \" \" }\n }\n { \"#text\" = \" \" }\n { \"body\"\n { \"#text\" = \"\n \" }\n { \"h1\"\n { \"#text\" = \"Augeas\" }\n }\n { \"#text\" = \" \" }\n { \"p\"\n { \"#attribute\"\n { \"class\" = \"main\" }\n }\n { \"#text\" = \"Augeas is now able to parse XML files!\" }\n }\n { \"#text\" = \" \" }\n { \"ul\"\n { \"#text\" = \"\\n \" }\n { \"li\"\n { \"#text\" = \"Translate from XML to a tree syntax\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"Translate from the tree back to XML\" }\n }\n { \"#text\" = \" \" }\n { \"#comment\" = \" this is some comment \" }\n { \"#text\" = \"\n \" }\n { \"li\"\n { \"#text\" = \"this\" }\n }\n { \"#text\" = \" \" }\n }\n { \"#text\" = \" \" }\n }\n }\n\n(* Test: Xml.doc\n Modify <input1> with <Xml.doc> *)\ntest Xml.doc put input1 after rm \"\/html\/body\" =\n\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<html>\n <head>\n <title>Wiki<\/title>\n <\/head>\n <\/html>\n\"\n\n\n(* Variable: ul1 *)\nlet ul1 = \"\n<ul>\n <li>test1<\/li>\n <li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc get ul1 =\n { \"ul\"\n { \"#text\" = \"\n \" }\n { \"li\"\n { \"#text\" = \"test1\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test2\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test3\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test4\" }\n }\n }\n\n\ntest Xml.doc put ul1 after set \"\/ul\/li[3]\/#text\" \"bidon\" = \"\n<ul>\n <li>test1<\/li>\n <li>test2<\/li>\n <li>bidon<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc put ul1 after rm \"\/ul\/li[2]\" = \"\n<ul>\n <li>test1<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n\n(* #text nodes don't move when inserting a node, the result depends on where the node is added *)\ntest Xml.doc put ul1 after insb \"a\" \"\/ul\/li[2]\" = \"\n<ul>\n <li>test1<\/li>\n <a><\/a>\n<li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc put ul1 after insa \"a\" \"\/ul\/li[1]\" = \"\n<ul>\n <li>test1<\/li>\n<a><\/a>\n <li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n(* Attributes must be added before text nodes *)\ntest Xml.doc put ul1 after insb \"#attribute\" \"\/ul\/li[2]\/#text\";\n set \"\/ul\/li[2]\/#attribute\/bidon\" \"gazou\";\n set \"\/ul\/li[2]\/#attribute\/foo\" \"bar\" = \"\n<ul>\n <li>test1<\/li>\n <li bidon=\\\"gazou\\\" foo=\\\"bar\\\">test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n(* if empty element is allowed to be as root, this test triggers error *)\ntest Xml.lns get \"<doc>\n<a><c\/><b><c\/><\/b><c\/><c\/><a><\/a><\/a>\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"a\"\n { \"c\" = \"#empty\" }\n { \"b\"\n { \"c\" = \"#empty\" }\n }\n { \"c\" = \"#empty\" }\n { \"c\" = \"#empty\" }\n { \"a\" }\n }\n }\n\nlet p01pass2 = \"<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!DOCTYPE doc\n[\n<!ELEMENT doc ANY>\n<!ELEMENT a ANY>\n<!ELEMENT b ANY>\n<!ELEMENT c ANY>\n]>\n<doc>\n<a><b><c\/><\/b><\/a>\n<\/doc>\n<!-- comment after document element-->\n<?PI after document element?>\n<!-- comment after document element-->\n<?PI after document element?>\n<!-- comment after document element-->\n<?PI after document element?>\n\"\n\ntest Xml.lns get p01pass2 =\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"a\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"b\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"c\"\n { \"#decl\" = \"ANY\" }\n }\n }\n { \"doc\"\n { \"#text\" = \"\n\" }\n { \"a\"\n { \"b\"\n { \"c\" = \"#empty\" }\n }\n }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n\n\n(* various valid Name constructions *)\ntest Xml.lns get \"<doc>\\n<A:._-0\/>\\n<::._-0\/>\\n<_:._-0\/>\\n<A\/>\\n<_\/>\\n<:\/>\\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"A:._-0\" = \"#empty\" }\n { \"::._-0\" = \"#empty\" }\n { \"_:._-0\" = \"#empty\" }\n { \"A\" = \"#empty\" }\n { \"_\" = \"#empty\" }\n { \":\" = \"#empty\" }\n }\n\ntest Xml.lns get \"<doc>\n<abcdefghijklmnopqrstuvwxyz\/>\n<ABCDEFGHIJKLMNOPQRSTUVWXYZ\/>\n<A01234567890\/>\n<A.-:\/>\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"abcdefghijklmnopqrstuvwxyz\" = \"#empty\" }\n { \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" = \"#empty\" }\n { \"A01234567890\" = \"#empty\" }\n { \"A.-:\" = \"#empty\" }\n }\n\n\nlet p06fail1 = \"<!--non-validating processors may pass this instance because they don't check the IDREFS attribute type-->\n<!DOCTYPE doc\n[\n<!ELEMENT doc (a|refs)*>\n<!ELEMENT a EMPTY>\n<!ELEMENT refs EMPTY>\n<!ATTLIST refs refs IDREFS #REQUIRED>\n<!ATTLIST a id ID #REQUIRED>\n]>\n<doc>\n<a id=\\\"A1\\\"\/><a id=\\\"A2\\\"\/><a id=\\\"A3\\\"\/>\n<refs refs=\\\"\\\"\/>\n<\/doc>\"\n\n(* we accept this test because we do not verify XML references *)\ntest Xml.lns get p06fail1 =\n { \"#comment\" = \"non-validating processors may pass this instance because they don't check the IDREFS attribute type\" }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"(a|refs)*\" }\n }\n { \"!ELEMENT\" = \"a\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!ELEMENT\" = \"refs\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!ATTLIST\" = \"refs\"\n { \"1\"\n { \"#name\" = \"refs\" }\n { \"#type\" = \"IDREFS\" }\n { \"#REQUIRED\" }\n }\n }\n { \"!ATTLIST\" = \"a\"\n { \"1\"\n { \"#name\" = \"id\" }\n { \"#type\" = \"ID\" }\n { \"#REQUIRED\" }\n }\n }\n }\n { \"doc\"\n { \"#text\" = \"\n\" }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A1\" }\n }\n }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A2\" }\n }\n }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A3\" }\n }\n }\n { \"refs\" = \"#empty\"\n { \"#attribute\"\n { \"refs\" = \"\" }\n }\n }\n }\n\n(* we accept dquote, but not single quotes, because of resulting ambiguity *)\nlet p10pass1_1 = \"<doc><A a=\\\"asdf>'">\\nasdf\\n ?>%\\\"\/><\/doc>\"\nlet p10pass1_2 = \"<doc><A a='\\\"\\\">'"'\/><\/doc>\"\n\ntest Xml.lns get p10pass1_1 =\n { \"doc\"\n { \"A\" = \"#empty\"\n { \"#attribute\"\n { \"a\" = \"asdf>'">\\nasdf\\n ?>%\" }\n }\n }\n }\n\ntest Xml.lns get p10pass1_2 = *\n\n(* here again, test exclude single quote *)\nlet p11pass1 = \"<!--Inability to resolve a notation should not be reported as an error-->\n<!DOCTYPE doc\n[\n<!ELEMENT doc EMPTY>\n<!NOTATION not1 SYSTEM \\\"a%a&b�<!ELEMENT<!--<?<\/>?>\/\\''\\\">\n<!NOTATION not3 SYSTEM \\\"\\\">\n]>\n<doc><\/doc>\"\n\ntest Xml.lns get p11pass1 =\n { \"#comment\" = \"Inability to resolve a notation should not be reported as an error\" }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!NOTATION\" = \"not1\"\n { \"SYSTEM\" = \"a%a&b�<!ELEMENT<!--<?<\/>?>\/\\''\" }\n }\n { \"!NOTATION\" = \"not3\"\n { \"SYSTEM\" = \"\" }\n }\n }\n { \"doc\" }\n\ntest Xml.lns get \"<doc>a%b%<\/doc><\/doc>]]<&<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"a%b%<\/doc><\/doc>]]<&\" }\n }\n\nlet p15pass1 = \"<!--a\n<!DOCTYPE\n<?-\n]]>-<[ CDATA [\n\\\"- -'-\n-<doc>-->\n<!---->\n<doc><\/doc>\"\n\ntest Xml.lns get p15pass1 =\n { \"#comment\" = \"a\n<!DOCTYPE\n<?-\n]]>-<[ CDATA [\n\\\"- -'-\n-<doc>\" }\n { \"#comment\" = \"\" }\n { \"doc\" }\n\nlet p22pass3 = \"<?xml version=\\\"1.0\\\"?>\n<!--comment--> <?pi some instruction ?>\n<doc><?pi?><\/doc>\"\n\ntest Xml.lns get p22pass3 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"#comment\" = \"comment\" }\n { \"#pi\"\n { \"#target\" = \"pi\" }\n { \"#instruction\" = \"some instruction\" }\n }\n { \"doc\"\n { \"#pi\"\n { \"#target\" = \"pi\" }\n }\n }\n\nlet p25pass2 = \"<?xml version\n\n \n=\n \n\n\\\"1.0\\\"?>\n<doc><\/doc>\"\n\ntest Xml.lns get p25pass2 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"doc\" }\n\n\ntest Xml.lns get \"<!DOCTYPE \n\ndoc\n\n[\n<!ELEMENT doc EMPTY>\n]>\n<doc><\/doc>\" =\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"EMPTY\" }\n }\n }\n { \"doc\" }\n\ntest Xml.lns get \"<doc><\/doc \\n>\" = { \"doc\" }\n\ntest Xml.lns get \"<a><doc att=\\\"val\\\" \\natt2=\\\"val2\\\" att3=\\\"val3\\\"\/><\/a>\" =\n { \"a\"\n { \"doc\" = \"#empty\"\n { \"#attribute\"\n { \"att\" = \"val\" }\n { \"att2\" = \"val2\" }\n { \"att3\" = \"val3\" }\n }\n }\n }\n\ntest Xml.lns get \"<doc\/>\" = { \"doc\" = \"#empty\" }\n\n(* failure tests *)\n(* only one document element *)\ntest Xml.lns get \"<doc><\/doc><bad\/>\" = *\n\n(* document element must be complete *)\ntest Xml.lns get \"<doc>\" = *\n\n(* emtpy document is rejected *)\ntest Xml.lns get \"\" = *\n\n(* malformed element *)\ntest Xml.lns get \"<a><A@\/><\/a>\" = *\n\n(* a Name cannot start with a digit *)\ntest Xml.lns get \"<a><0A\/><\/a>\" = *\n\n(* no space before \"CDATA\" *)\ntest Xml.lns get \"<doc><![ CDATA[a]]><\/doc>\" = *\n\n(* no space after \"CDATA\" *)\ntest Xml.lns get \"<doc><![CDATA [a]]><\/doc>\" = *\n\n(* CDSect's can't nest *)\ntest Xml.lns get \"<doc>\n<![CDATA[\n<![CDATA[XML doesn't allow CDATA sections to nest]]>\n]]>\n<\/doc>\" = *\n\n(* Comment is illegal in VersionInfo *)\ntest Xml.lns get \"<?xml version <!--bad comment--> =\\\"1.0\\\"?>\n<doc><\/doc>\" = *\n\n(* only declarations in DTD *)\ntest Xml.lns get \"<!DOCTYPE doc [\n<!ELEMENT doc EMPTY>\n<doc><\/doc>\n]>\" = *\n\n(* we do not support external entities *)\ntest Xml.lns get \"<!DOCTYPE doc [\n<!ENTITY % eldecl \\\"<!ELEMENT doc EMPTY>\\\">\n%eldecl;\n]>\n<doc><\/doc>\" = *\n\n","old_contents":"module Test_xml =\n\nlet knode (r:regexp) = [ key r ]\n\n(************************************************************************\n * Utilities lens\n *************************************************************************)\n(*\nlet _ = print_regexp(lens_ctype(Xml.text))\nlet _ = print_endline \"\"\n*)\n\ntest Xml.comment get \"<!-- declarations for <head> & <body> -->\" =\n { \"#comment\" = \" declarations for <head> & <body> \" }\n\ntest Xml.comment get \"<!-- B+, B, or B--->\" = *\n\ntest Xml.prolog get \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n { \"encoding\" = \"UTF-8\" }\n }\n }\n\ntest Xml.decl_def_item get \"<!ELEMENT greeting (#PCDATA)>\" =\n { \"!ELEMENT\" = \"greeting\"\n { \"#decl\" = \"(#PCDATA)\" }\n }\n\ntest Xml.decl_def_item get \"<!ENTITY da \\\" \\\">\" =\n { \"!ENTITY\" = \"da\"\n { \"#decl\" = \" \" }\n }\n\ntest Xml.doctype get \"<!DOCTYPE greeting SYSTEM \\\"hello.dtd\\\">\" =\n { \"!DOCTYPE\" = \"greeting\"\n { \"SYSTEM\" = \"hello.dtd\" }\n }\n\ntest Xml.doctype get \"<!DOCTYPE foo [\n<!ELEMENT bar (#PCDATA)>\n<!ELEMENT baz (bar)* >\n]>\" =\n { \"!DOCTYPE\" = \"foo\"\n { \"!ELEMENT\" = \"bar\"\n { \"#decl\" = \"(#PCDATA)\" }\n }\n { \"!ELEMENT\" = \"baz\"\n { \"#decl\" = \"(bar)*\" }\n }\n }\n\nlet att_def1 = \"<!ATTLIST termdef\nid ID #REQUIRED\nname CDATA #IMPLIED>\"\nlet att_def2 = \"<!ATTLIST list\ntype (bullets|ordered|glossary) \\\"ordered\\\">\"\nlet att_def3 = \"<!ATTLIST form\nmethod CDATA #FIXED \\\"POST\\\">\"\n\ntest Xml.att_list_def get att_def1 =\n { \"!ATTLIST\" = \"termdef\"\n { \"1\"\n { \"#name\" = \"id\" }\n { \"#type\" = \"ID\" }\n { \"#REQUIRED\" }\n }\n { \"2\"\n { \"#name\" = \"name\" }\n { \"#type\" = \"CDATA\" }\n { \"#IMPLIED\" }\n }\n }\n\ntest Xml.att_list_def get att_def2 =\n { \"!ATTLIST\" = \"list\"\n { \"1\"\n { \"#name\" = \"type\" }\n { \"#type\" = \"(bullets|ordered|glossary)\" }\n { \"#FIXED\" = \"ordered\" }\n }\n }\n\ntest Xml.att_list_def get att_def3 =\n { \"!ATTLIST\" = \"form\"\n { \"1\"\n { \"#name\" = \"method\" }\n { \"#type\" = \"CDATA\" }\n { \"#FIXED\" = \"POST\" }\n }\n }\n\ntest Xml.notation_def get \"<!NOTATION not3 SYSTEM \\\"\\\">\" =\n { \"!NOTATION\" = \"not3\"\n { \"SYSTEM\" = \"\" }\n }\n\nlet cdata1 = \"<![CDATA[testing]]>\"\ntest Xml.cdata get cdata1 = { \"#CDATA\" = \"testing\" }\n\nlet attr1 = \" attr1=\\\"value1\\\" attr2=\\\"value2\\\"\"\nlet attr2 = \" attr2=\\\"foo\\\"\"\ntest Xml.attributes get attr1 =\n { \"#attribute\"\n { \"attr1\" = \"value1\" }\n { \"attr2\" = \"value2\" }\n }\n\ntest Xml.attributes get \" refs=\\\"A1\\nA2 A3\\\"\" =\n { \"#attribute\"\n { \"refs\" = \"A1\\nA2 A3\" }\n }\n\ntest Xml.attributes put attr1 after rm \"\/#attribute[1]\";\n set \"\/#attribute\/attr2\" \"foo\" = attr2\n\nlet empty1 = \"<a\/>\"\nlet empty2 = \"<a foo=\\\"bar\\\"\/>\"\nlet empty3 = \"<a foo=\\\"bar\\\"><\/a>\\n\"\nlet empty4 = \"<a foo=\\\"bar\\\" far=\\\"baz\\\"\/>\"\ntest Xml.empty_element get empty1 = { \"a\" = \"#empty\" }\ntest Xml.empty_element get empty2 =\n { \"a\" = \"#empty\" { \"#attribute\" { \"foo\" = \"bar\"} } }\n\ntest Xml.empty_element put empty1 after set \"\/a\/#attribute\/foo\" \"bar\" = empty2\n\n(* the attribute node must be the first child of the element *)\ntest Xml.empty_element put empty1 after set \"\/a\/#attribute\/foo\" \"bar\";\n set \"\/a\/#attribute\/far\" \"baz\" = empty4\n\ntest Xml.content put \"<a><b\/><\/a>\" after clear \"\/a\/b\" = \"<a><b><\/b>\\n<\/a>\"\n\ntest Xml.lns put \"<a><\/a >\" after set \"\/a\/#text[1]\" \"foo\";\n set \"\/a\/#text[2]\" \"bar\" = \"<a>foobar<\/a >\"\n\ntest Xml.lns get \"<?xml version=\\\"1.0\\\"?>\n<!DOCTYPE catalog PUBLIC \\\"-\/\/OASIS\/\/DTD XML Catalogs V1.0\/\/EN\\\"\n \\\"file:\/\/\/usr\/share\/xml\/schema\/xml-core\/catalog.dtd\\\">\n <doc\/>\" =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"!DOCTYPE\" = \"catalog\"\n { \"PUBLIC\"\n { \"#literal\" = \"-\/\/OASIS\/\/DTD XML Catalogs V1.0\/\/EN\" }\n { \"#literal\" = \"file:\/\/\/usr\/share\/xml\/schema\/xml-core\/catalog.dtd\" }\n }\n }\n { \"doc\" = \"#empty\" }\n\ntest Xml.lns get \"<oor:component-data xmlns:oor=\\\"http:\/\/openoffice.org\/2001\/registry\\\"\/>\n\" =\n { \"oor:component-data\" = \"#empty\"\n { \"#attribute\"\n { \"xmlns:oor\" = \"http:\/\/openoffice.org\/2001\/registry\" }\n }\n }\n\nlet input1 = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<html>\n <head>\n <title>Wiki<\/title>\n <\/head>\n <body>\n <h1>Augeas<\/h1>\n <p class=\\\"main\\\">Augeas is now able to parse XML files!<\/p>\n <ul>\n <li>Translate from XML to a tree syntax<\/li>\n <li>Translate from the tree back to XML<\/li> <!-- this is some comment -->\n <li>this<\/li>\n <\/ul>\n <\/body>\n<\/html>\n\"\n\ntest Xml.doc get input1 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n { \"encoding\" = \"UTF-8\" }\n }\n }\n { \"html\"\n { \"#text\" = \"\\n \" }\n { \"head\"\n { \"#text\" = \"\\n \" }\n { \"title\"\n { \"#text\" = \"Wiki\" }\n }\n { \"#text\" = \" \" }\n }\n { \"#text\" = \" \" }\n { \"body\"\n { \"#text\" = \"\n \" }\n { \"h1\"\n { \"#text\" = \"Augeas\" }\n }\n { \"#text\" = \" \" }\n { \"p\"\n { \"#attribute\"\n { \"class\" = \"main\" }\n }\n { \"#text\" = \"Augeas is now able to parse XML files!\" }\n }\n { \"#text\" = \" \" }\n { \"ul\"\n { \"#text\" = \"\\n \" }\n { \"li\"\n { \"#text\" = \"Translate from XML to a tree syntax\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"Translate from the tree back to XML\" }\n }\n { \"#text\" = \" \" }\n { \"#comment\" = \" this is some comment \" }\n { \"#text\" = \"\n \" }\n { \"li\"\n { \"#text\" = \"this\" }\n }\n { \"#text\" = \" \" }\n }\n { \"#text\" = \" \" }\n }\n }\n\ntest Xml.doc put input1 after rm \"\/html\/body\" =\n\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<html>\n <head>\n <title>Wiki<\/title>\n <\/head>\n <\/html>\n\"\n\n\nlet ul1 = \"\n<ul>\n <li>test1<\/li>\n <li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc get ul1 =\n { \"ul\"\n { \"#text\" = \"\n \" }\n { \"li\"\n { \"#text\" = \"test1\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test2\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test3\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test4\" }\n }\n }\n\n\ntest Xml.doc put ul1 after set \"\/ul\/li[3]\/#text\" \"bidon\" = \"\n<ul>\n <li>test1<\/li>\n <li>test2<\/li>\n <li>bidon<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc put ul1 after rm \"\/ul\/li[2]\" = \"\n<ul>\n <li>test1<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n\n(* #text nodes don't move when inserting a node, the result depends on where the node is added *)\ntest Xml.doc put ul1 after insb \"a\" \"\/ul\/li[2]\" = \"\n<ul>\n <li>test1<\/li>\n <a><\/a>\n<li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc put ul1 after insa \"a\" \"\/ul\/li[1]\" = \"\n<ul>\n <li>test1<\/li>\n<a><\/a>\n <li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n(* Attributes must be added before text nodes *)\ntest Xml.doc put ul1 after insb \"#attribute\" \"\/ul\/li[2]\/#text\";\n set \"\/ul\/li[2]\/#attribute\/bidon\" \"gazou\";\n set \"\/ul\/li[2]\/#attribute\/foo\" \"bar\" = \"\n<ul>\n <li>test1<\/li>\n <li bidon=\\\"gazou\\\" foo=\\\"bar\\\">test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n(* if empty element is allowed to be as root, this test triggers error *)\ntest Xml.lns get \"<doc>\n<a><c\/><b><c\/><\/b><c\/><c\/><a><\/a><\/a>\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"a\"\n { \"c\" = \"#empty\" }\n { \"b\"\n { \"c\" = \"#empty\" }\n }\n { \"c\" = \"#empty\" }\n { \"c\" = \"#empty\" }\n { \"a\" }\n }\n }\n\nlet p01pass2 = \"<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!DOCTYPE doc\n[\n<!ELEMENT doc ANY>\n<!ELEMENT a ANY>\n<!ELEMENT b ANY>\n<!ELEMENT c ANY>\n]>\n<doc>\n<a><b><c\/><\/b><\/a>\n<\/doc>\n<!-- comment after document element-->\n<?PI after document element?>\n<!-- comment after document element-->\n<?PI after document element?>\n<!-- comment after document element-->\n<?PI after document element?>\n\"\n\ntest Xml.lns get p01pass2 =\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"a\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"b\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"c\"\n { \"#decl\" = \"ANY\" }\n }\n }\n { \"doc\"\n { \"#text\" = \"\n\" }\n { \"a\"\n { \"b\"\n { \"c\" = \"#empty\" }\n }\n }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n\n\n(* various valid Name constructions *)\ntest Xml.lns get \"<doc>\\n<A:._-0\/>\\n<::._-0\/>\\n<_:._-0\/>\\n<A\/>\\n<_\/>\\n<:\/>\\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"A:._-0\" = \"#empty\" }\n { \"::._-0\" = \"#empty\" }\n { \"_:._-0\" = \"#empty\" }\n { \"A\" = \"#empty\" }\n { \"_\" = \"#empty\" }\n { \":\" = \"#empty\" }\n }\n\ntest Xml.lns get \"<doc>\n<abcdefghijklmnopqrstuvwxyz\/>\n<ABCDEFGHIJKLMNOPQRSTUVWXYZ\/>\n<A01234567890\/>\n<A.-:\/>\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"abcdefghijklmnopqrstuvwxyz\" = \"#empty\" }\n { \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" = \"#empty\" }\n { \"A01234567890\" = \"#empty\" }\n { \"A.-:\" = \"#empty\" }\n }\n\n\nlet p06fail1 = \"<!--non-validating processors may pass this instance because they don't check the IDREFS attribute type-->\n<!DOCTYPE doc\n[\n<!ELEMENT doc (a|refs)*>\n<!ELEMENT a EMPTY>\n<!ELEMENT refs EMPTY>\n<!ATTLIST refs refs IDREFS #REQUIRED>\n<!ATTLIST a id ID #REQUIRED>\n]>\n<doc>\n<a id=\\\"A1\\\"\/><a id=\\\"A2\\\"\/><a id=\\\"A3\\\"\/>\n<refs refs=\\\"\\\"\/>\n<\/doc>\"\n\n(* we accept this test because we do not verify XML references *)\ntest Xml.lns get p06fail1 =\n { \"#comment\" = \"non-validating processors may pass this instance because they don't check the IDREFS attribute type\" }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"(a|refs)*\" }\n }\n { \"!ELEMENT\" = \"a\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!ELEMENT\" = \"refs\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!ATTLIST\" = \"refs\"\n { \"1\"\n { \"#name\" = \"refs\" }\n { \"#type\" = \"IDREFS\" }\n { \"#REQUIRED\" }\n }\n }\n { \"!ATTLIST\" = \"a\"\n { \"1\"\n { \"#name\" = \"id\" }\n { \"#type\" = \"ID\" }\n { \"#REQUIRED\" }\n }\n }\n }\n { \"doc\"\n { \"#text\" = \"\n\" }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A1\" }\n }\n }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A2\" }\n }\n }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A3\" }\n }\n }\n { \"refs\" = \"#empty\"\n { \"#attribute\"\n { \"refs\" = \"\" }\n }\n }\n }\n\n(* we accept dquote, but not single quotes, because of resulting ambiguity *)\nlet p10pass1_1 = \"<doc><A a=\\\"asdf>'">\\nasdf\\n ?>%\\\"\/><\/doc>\"\nlet p10pass1_2 = \"<doc><A a='\\\"\\\">'"'\/><\/doc>\"\n\ntest Xml.lns get p10pass1_1 =\n { \"doc\"\n { \"A\" = \"#empty\"\n { \"#attribute\"\n { \"a\" = \"asdf>'">\\nasdf\\n ?>%\" }\n }\n }\n }\n\ntest Xml.lns get p10pass1_2 = *\n\n(* here again, test exclude single quote *)\nlet p11pass1 = \"<!--Inability to resolve a notation should not be reported as an error-->\n<!DOCTYPE doc\n[\n<!ELEMENT doc EMPTY>\n<!NOTATION not1 SYSTEM \\\"a%a&b�<!ELEMENT<!--<?<\/>?>\/\\''\\\">\n<!NOTATION not3 SYSTEM \\\"\\\">\n]>\n<doc><\/doc>\"\n\ntest Xml.lns get p11pass1 =\n { \"#comment\" = \"Inability to resolve a notation should not be reported as an error\" }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!NOTATION\" = \"not1\"\n { \"SYSTEM\" = \"a%a&b�<!ELEMENT<!--<?<\/>?>\/\\''\" }\n }\n { \"!NOTATION\" = \"not3\"\n { \"SYSTEM\" = \"\" }\n }\n }\n { \"doc\" }\n\ntest Xml.lns get \"<doc>a%b%<\/doc><\/doc>]]<&<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"a%b%<\/doc><\/doc>]]<&\" }\n }\n\nlet p15pass1 = \"<!--a\n<!DOCTYPE\n<?-\n]]>-<[ CDATA [\n\\\"- -'-\n-<doc>-->\n<!---->\n<doc><\/doc>\"\n\ntest Xml.lns get p15pass1 =\n { \"#comment\" = \"a\n<!DOCTYPE\n<?-\n]]>-<[ CDATA [\n\\\"- -'-\n-<doc>\" }\n { \"#comment\" = \"\" }\n { \"doc\" }\n\nlet p22pass3 = \"<?xml version=\\\"1.0\\\"?>\n<!--comment--> <?pi some instruction ?>\n<doc><?pi?><\/doc>\"\n\ntest Xml.lns get p22pass3 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"#comment\" = \"comment\" }\n { \"#pi\"\n { \"#target\" = \"pi\" }\n { \"#instruction\" = \"some instruction\" }\n }\n { \"doc\"\n { \"#pi\"\n { \"#target\" = \"pi\" }\n }\n }\n\nlet p25pass2 = \"<?xml version\n\n \n=\n \n\n\\\"1.0\\\"?>\n<doc><\/doc>\"\n\ntest Xml.lns get p25pass2 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"doc\" }\n\n\ntest Xml.lns get \"<!DOCTYPE \n\ndoc\n\n[\n<!ELEMENT doc EMPTY>\n]>\n<doc><\/doc>\" =\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"EMPTY\" }\n }\n }\n { \"doc\" }\n\ntest Xml.lns get \"<doc><\/doc \\n>\" = { \"doc\" }\n\ntest Xml.lns get \"<a><doc att=\\\"val\\\" \\natt2=\\\"val2\\\" att3=\\\"val3\\\"\/><\/a>\" =\n { \"a\"\n { \"doc\" = \"#empty\"\n { \"#attribute\"\n { \"att\" = \"val\" }\n { \"att2\" = \"val2\" }\n { \"att3\" = \"val3\" }\n }\n }\n }\n\ntest Xml.lns get \"<doc\/>\" = { \"doc\" = \"#empty\" }\n\n(* failure tests *)\n(* only one document element *)\ntest Xml.lns get \"<doc><\/doc><bad\/>\" = *\n\n(* document element must be complete *)\ntest Xml.lns get \"<doc>\" = *\n\n(* emtpy document is rejected *)\ntest Xml.lns get \"\" = *\n\n(* malformed element *)\ntest Xml.lns get \"<a><A@\/><\/a>\" = *\n\n(* a Name cannot start with a digit *)\ntest Xml.lns get \"<a><0A\/><\/a>\" = *\n\n(* no space before \"CDATA\" *)\ntest Xml.lns get \"<doc><![ CDATA[a]]><\/doc>\" = *\n\n(* no space after \"CDATA\" *)\ntest Xml.lns get \"<doc><![CDATA [a]]><\/doc>\" = *\n\n(* CDSect's can't nest *)\ntest Xml.lns get \"<doc>\n<![CDATA[\n<![CDATA[XML doesn't allow CDATA sections to nest]]>\n]]>\n<\/doc>\" = *\n\n(* Comment is illegal in VersionInfo *)\ntest Xml.lns get \"<?xml version <!--bad comment--> =\\\"1.0\\\"?>\n<doc><\/doc>\" = *\n\n(* only declarations in DTD *)\ntest Xml.lns get \"<!DOCTYPE doc [\n<!ELEMENT doc EMPTY>\n<doc><\/doc>\n]>\" = *\n\n(* we do not support external entities *)\ntest Xml.lns get \"<!DOCTYPE doc [\n<!ENTITY % eldecl \\\"<!ELEMENT doc EMPTY>\\\">\n%eldecl;\n]>\n<doc><\/doc>\" = *\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b6943ab317767f21f820459d75bbb0ebc7c20ebd","subject":"Fix put test - it was checking for hte wrong result","message":"Fix put test - it was checking for hte wrong result\n","repos":"pevalme\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,mchf\/augeas,jtopjian\/augeas,dafugg\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,camptocamp\/augeas,jasperla\/augeas,MikaelSmith\/augeas,lutter\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,camptocamp\/augeas,ptoscano\/augeas,mlichvar\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,manandbytes\/augeas,jasperla\/augeas,mchf\/augeas,ptoscano\/augeas,bkearney\/augeas,kumy\/augeas,kumy\/augeas,lutter\/augeas,bkearney\/augeas,manandbytes\/augeas,pevalme\/augeas,hercules-team\/augeas,bkearney\/augeas,jjlin\/augeas,raphink\/augeas,kunkku\/augeas,domcleal\/augeas,domcleal\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,pevalme\/augeas,kumy\/augeas,jtopjian\/augeas,jjlin\/augeas,raphink\/augeas,GeoffWilliams\/augeas,lutter\/augeas,camptocamp\/augeas,hercules-team\/augeas","old_file":"tests\/modules\/pass_subtree_growth.aug","new_file":"tests\/modules\/pass_subtree_growth.aug","new_contents":"module Pass_subtree_growth =\n\n (* Make sure that a subtree that is not the lowest one does indeed *)\n (* grow the tree, instead of just setting the label of an enclosed *)\n (* subtree. This is only a problem if the enclosed subtree does *)\n (* not have a label *)\n\n let lns = [ label \"outer\" . [ store \/a\/ ] ]\n\n (* The improper result is { \"outer\" = \"a\" } *)\n test lns get \"a\" = { \"outer\" { = \"a\" } }\n\n (* This produces a tree { \"outer\" = \"b\" { = \"a\" } } *)\n (* but the value for \"outer\" is never used in put *)\n (* (That should probably be flagged as an error separately) *)\n test lns put \"a\" after set \"outer\" \"b\" = \"a\"\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"module Pass_subtree_growth =\n\n (* Make sure that a subtree that is not the lowest one does indeed *)\n (* grow the tree, instead of just setting the label of an enclosed *)\n (* subtree. This is only a problem if the enclosed subtree does *)\n (* not have a label *)\n\n let lns = [ label \"outer\" . [ store \/a\/ ] ]\n\n (* The improper result is { \"outer\" = \"a\" } *)\n test lns get \"a\" = { \"outer\" { = \"a\" } }\n\n test lns put \"a\" after set \"outer\" \"b\" = \"b\"\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7e5905455be25dc9fe59f18bca843fc2e3dee324","subject":"Add more recent nagios lens","message":"Add more recent nagios lens\n","repos":"ScottWales\/base-vm,ScottWales\/dataportal","old_file":"modules\/nagios\/lib\/augeas\/lenses\/nagioscfg.aug","new_file":"modules\/nagios\/lib\/augeas\/lenses\/nagioscfg.aug","new_contents":"(*\nModule: NagiosConfig\n Parses \/etc\/{nagios{3,},icinga\/*.cfg\n\nAuthors: Sebastien Aperghis-Tramoni <sebastien@aperghis.net>\n Rapha\u00ebl Pinson <raphink@gmail.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/{nagios{3,},icinga\/*.cfg. See <filter>.\n*)\n\nmodule NagiosCfg =\nautoload xfm\n\n(************************************************************************\n * Group: Utility variables\/functions\n ************************************************************************)\n(* View: param_def\n define a field *)\nlet param_def =\n let space_in = \/[^ \\t\\n][^\\n=]*[^ \\t\\n]|[^ \\t\\n]\/\n in key \/[A-Za-z0-9_]+\/\n . Sep.space_equal\n . store space_in\n\n(* View: macro_def\n Macro line, as used in resource.cfg *)\nlet macro_def =\n let macro = \/\\$[A-Za-z0-9]+\\$\/\n in let macro_decl = Rx.word | Rx.fspath\n in key macro . Sep.space_equal . store macro_decl\n\n(************************************************************************\n * Group: Entries\n ************************************************************************)\n(* View: param\n Params can have sub params *)\nlet param =\n [ Util.indent . param_def\n . [ Sep.space . param_def ]*\n . Util.eol ]\n\n(* View: macro *)\nlet macro = [ Util.indent . macro_def . Util.eol ]\n\n(************************************************************************\n * Group: Lens\n ************************************************************************)\n(* View: entry\n Define the accepted entries, such as param for regular configuration\n files, and macro for resources.cfg .*)\nlet entry = param\n\t | macro\n\n(* View: lns\n main structure *)\nlet lns = ( Util.empty | Util.comment | entry )*\n\n(* View: filter *)\nlet filter = incl \"\/etc\/nagios3\/*.cfg\"\n . incl \"\/etc\/nagios\/*.cfg\"\n\t . incl \"\/etc\/icinga\/*.cfg\"\n\t . excl \"\/etc\/nagios3\/commands.cfg\"\n\t . excl \"\/etc\/nagios\/commands.cfg\"\n\t . excl \"\/etc\/nagios\/nrpe.cfg\"\n\t . incl \"\/etc\/icinga\/commands.cfg\"\n\nlet xfm = transform lns filter\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'modules\/nagios\/lib\/augeas\/lenses\/nagioscfg.aug' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Augeas"} {"commit":"10a67b1ed80f33f8e31aee6838301273c10e85cb","subject":"Php: expand filter slightly","message":"Php: expand filter slightly\n\nSuggested by Robin Lee Powell <rlpowell@digitalkingdom.org>\n","repos":"kunkku\/augeas,camptocamp\/augeas,jjlin\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,dafugg\/augeas,kunkku\/augeas,ptoscano\/augeas,mlichvar\/augeas,jtopjian\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,dafugg\/augeas,ptoscano\/augeas,mchf\/augeas,camptocamp\/augeas,manandbytes\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,jtopjian\/augeas,mlichvar\/augeas,camptocamp\/augeas,raphink\/augeas,jasperla\/augeas,bkearney\/augeas,jasperla\/augeas,bkearney\/augeas,kunkku\/augeas,MikaelSmith\/augeas,bkearney\/augeas,domcleal\/augeas,lutter\/augeas,camptocamp\/augeas,lutter\/augeas,jjlin\/augeas,kumy\/augeas,mchf\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,raphink\/augeas,kumy\/augeas,pevalme\/augeas,hercules-team\/augeas,kumy\/augeas,ptoscano\/augeas,kumy\/augeas,manandbytes\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/php.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2e8ee81e5546fa2b7d8c76e2e3acea0cb86ae80a","subject":"Xml test (input1): modify to mildly check handling DOS line endings","message":"Xml test (input1): modify to mildly check handling DOS line endings\n","repos":"kunkku\/augeas,jtopjian\/augeas,kumy\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,kumy\/augeas,kumy\/augeas,mlichvar\/augeas,jjlin\/augeas,mchf\/augeas,jjlin\/augeas,manandbytes\/augeas,kumy\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,jasperla\/augeas,hercules-team\/augeas,dafugg\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,mchf\/augeas,raphink\/augeas,mlichvar\/augeas,jtopjian\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas,jasperla\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas","old_file":"lenses\/tests\/test_xml.aug","new_file":"lenses\/tests\/test_xml.aug","new_contents":"(*\nModule: Test_Xml\n Provides unit tests and examples for the <Xml> lens.\n*)\n\nmodule Test_Xml =\n\n(* View: knode\n A simple flag function\n\n Parameters:\n r:regexp - the pattern for the flag\n*)\nlet knode (r:regexp) = [ key r ]\n\n(************************************************************************\n * Group: Utilities lens\n *************************************************************************)\n(*\nlet _ = print_regexp(lens_ctype(Xml.text))\nlet _ = print_endline \"\"\n*)\n\n(* Group: Comments *)\n\n(* Test: Xml.comment\n Comments get mapped into \"#comment\" nodes. *)\ntest Xml.comment get\n \"<!-- declarations for <head> & <body> -->\" =\n\n { \"#comment\" = \" declarations for <head> & <body> \" }\n\n(* Test: Xml.comment\n This syntax is not understood. *)\ntest Xml.comment get\n \"<!-- B+, B, or B--->\" = *\n\n(* Group: Prolog and declarations *)\n\n(* Test: Xml.prolog\n The XML prolog tag is mapped in a \"#declaration\" node,\n which contains an \"#attribute\" node with various attributes of the tag. *)\ntest Xml.prolog get\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" =\n\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n { \"encoding\" = \"UTF-8\" }\n }\n }\n\n(* Test: Xml.decl_def_item\n !ELEMENT declaration tags are mapped in \"!ELEMENT\" nodes.\n The associated declaration attribute is mapped in a \"#decl\" subnode. *)\ntest Xml.decl_def_item get\n \"<!ELEMENT greeting (#PCDATA)>\" =\n\n { \"!ELEMENT\" = \"greeting\"\n { \"#decl\" = \"(#PCDATA)\" }\n }\n\n(* Test: Xml.decl_def_item\n !ENTITY declaration tags are mapped in \"!ENTITY\" nodes.\n The associated declaration attribute is mapped in a \"#decl\" subnode. *)\ntest Xml.decl_def_item get\n \"<!ENTITY da \\\" \\\">\" =\n\n { \"!ENTITY\" = \"da\"\n { \"#decl\" = \" \" }\n }\n\n(* Test: Xml.doctype\n !DOCTYPE tags are mapped in \"!DOCTYPE\" nodes.\n The associated system attribute is mapped in a \"SYSTEM\" subnode. *)\ntest Xml.doctype get\n \"<!DOCTYPE greeting SYSTEM \\\"hello.dtd\\\">\" =\n\n { \"!DOCTYPE\" = \"greeting\"\n { \"SYSTEM\" = \"hello.dtd\" }\n }\n\n(* Test: Xml.doctype\n This is an example of a !DOCTYPE tag with !ELEMENT children tags. *)\ntest Xml.doctype get \"<!DOCTYPE foo [\n<!ELEMENT bar (#PCDATA)>\n<!ELEMENT baz (bar)* >\n]>\" =\n\n { \"!DOCTYPE\" = \"foo\"\n { \"!ELEMENT\" = \"bar\"\n { \"#decl\" = \"(#PCDATA)\" }\n }\n { \"!ELEMENT\" = \"baz\"\n { \"#decl\" = \"(bar)*\" }\n }\n }\n\n(* Group: Attributes *)\n\n(* Variable: att_def1 *)\nlet att_def1 = \"<!ATTLIST termdef\nid ID #REQUIRED\nname CDATA #IMPLIED>\"\n(* Variable: att_def2 *)\nlet att_def2 = \"<!ATTLIST list\ntype (bullets|ordered|glossary) \\\"ordered\\\">\"\n(* Variable: att_def3 *)\nlet att_def3 = \"<!ATTLIST form\nmethod CDATA #FIXED \\\"POST\\\">\"\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def1 =\n\n { \"!ATTLIST\" = \"termdef\"\n { \"1\"\n { \"#name\" = \"id\" }\n { \"#type\" = \"ID\" }\n { \"#REQUIRED\" }\n }\n { \"2\"\n { \"#name\" = \"name\" }\n { \"#type\" = \"CDATA\" }\n { \"#IMPLIED\" }\n }\n }\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def2 =\n\n { \"!ATTLIST\" = \"list\"\n { \"1\"\n { \"#name\" = \"type\" }\n { \"#type\" = \"(bullets|ordered|glossary)\" }\n { \"#FIXED\" = \"ordered\" }\n }\n }\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def3 =\n\n { \"!ATTLIST\" = \"form\"\n { \"1\"\n { \"#name\" = \"method\" }\n { \"#type\" = \"CDATA\" }\n { \"#FIXED\" = \"POST\" }\n }\n }\n\n(* Test: Xml.notation_def *)\ntest Xml.notation_def get\n \"<!NOTATION not3 SYSTEM \\\"\\\">\" =\n\n { \"!NOTATION\" = \"not3\"\n { \"SYSTEM\" = \"\" }\n }\n\n(* Variable: cdata1 *)\nlet cdata1 = \"<![CDATA[testing]]>\"\n(* Test: Xml.cdata *)\ntest Xml.cdata get cdata1 = { \"#CDATA\" = \"testing\" }\n\n(* Variable: attr1 *)\nlet attr1 = \" attr1=\\\"value1\\\" attr2=\\\"value2\\\"\"\n(* Variable: attr2 *)\nlet attr2 = \" attr2=\\\"foo\\\"\"\n(* Test: Xml.attributes *)\ntest Xml.attributes get attr1 =\n { \"#attribute\"\n { \"attr1\" = \"value1\" }\n { \"attr2\" = \"value2\" }\n }\n\n(* Test: Xml.attributes *)\ntest Xml.attributes get \" refs=\\\"A1\\nA2 A3\\\"\" =\n { \"#attribute\"\n { \"refs\" = \"A1\\nA2 A3\" }\n }\n\n(* Test: Xml.attributes *)\ntest Xml.attributes put attr1 after rm \"\/#attribute[1]\";\n set \"\/#attribute\/attr2\" \"foo\" = attr2\n\n(* test quoting *)\n(* well formed values *)\ntest Xml.attributes get \" attr1=\\\"value1\\\"\" = { \"#attribute\" { \"attr1\" = \"value1\" } }\ntest Xml.attributes get \" attr1='value1'\" = { \"#attribute\" { \"attr1\" = \"value1\" } }\ntest Xml.attributes get \" attr1='va\\\"lue1'\" = { \"#attribute\" { \"attr1\" = \"va\\\"lue1\" } }\ntest Xml.attributes get \" attr1=\\\"va'lue1\\\"\" = { \"#attribute\" { \"attr1\" = \"va'lue1\" } }\n\n(* illegal as per the XML standard *)\ntest Xml.attributes get \" attr1=\\\"va\\\"lue1\\\"\" = *\ntest Xml.attributes get \" attr1='va'lue1'\" = *\n\n(* malformed values *)\ntest Xml.attributes get \" attr1=\\\"value1'\" = *\ntest Xml.attributes get \" attr1='value1\\\"\" = *\n\n(* Group: empty *)\n\n(* Variable: empty1 *)\nlet empty1 = \"<a\/>\"\n(* Variable: empty2 *)\nlet empty2 = \"<a foo=\\\"bar\\\"\/>\"\n(* Variable: empty3 *)\nlet empty3 = \"<a foo=\\\"bar\\\"><\/a>\\n\"\n(* Variable: empty4 *)\nlet empty4 = \"<a foo=\\\"bar\\\" far=\\\"baz\\\"\/>\"\n(* Test: Xml.empty_element *)\ntest Xml.empty_element get empty1 = { \"a\" = \"#empty\" }\n(* Test: Xml.empty_element *)\ntest Xml.empty_element get empty2 =\n { \"a\" = \"#empty\" { \"#attribute\" { \"foo\" = \"bar\"} } }\n\n(* Test: Xml.empty_element *)\ntest Xml.empty_element put empty1 after set \"\/a\/#attribute\/foo\" \"bar\" = empty2\n\n(* Test: Xml.empty_element\n The attribute node must be the first child of the element *)\ntest Xml.empty_element put empty1 after set \"\/a\/#attribute\/foo\" \"bar\";\n set \"\/a\/#attribute\/far\" \"baz\" = empty4\n\n(* Test: Xml.content *)\ntest Xml.content put \"<a><b\/><\/a>\" after clear \"\/a\/b\" = \"<a><b><\/b>\\n<\/a>\"\n\n\n(* Group: Full lens *)\n\n(* Test: Xml.lns *)\ntest Xml.lns put \"<a><\/a >\" after set \"\/a\/#text[1]\" \"foo\";\n set \"\/a\/#text[2]\" \"bar\" = \"<a>foobar<\/a >\"\n\n(* Test: Xml.lns *)\ntest Xml.lns get \"<?xml version=\\\"1.0\\\"?>\n<!DOCTYPE catalog PUBLIC \\\"-\/\/OASIS\/\/DTD XML Catalogs V1.0\/\/EN\\\"\n \\\"file:\/\/\/usr\/share\/xml\/schema\/xml-core\/catalog.dtd\\\">\n <doc\/>\" =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"!DOCTYPE\" = \"catalog\"\n { \"PUBLIC\"\n { \"#literal\" = \"-\/\/OASIS\/\/DTD XML Catalogs V1.0\/\/EN\" }\n { \"#literal\" = \"file:\/\/\/usr\/share\/xml\/schema\/xml-core\/catalog.dtd\" }\n }\n }\n { \"doc\" = \"#empty\" }\n\n(* Test: Xml.lns *)\ntest Xml.lns get \"<oor:component-data xmlns:oor=\\\"http:\/\/openoffice.org\/2001\/registry\\\"\/>\n\" =\n { \"oor:component-data\" = \"#empty\"\n { \"#attribute\"\n { \"xmlns:oor\" = \"http:\/\/openoffice.org\/2001\/registry\" }\n }\n }\n\n(* Variable: input1 *)\nlet input1 = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<html>\\r\n <head>\n <title>Wiki<\/title>\n <\/head>\n <body>\n <h1>Augeas<\/h1>\n <p class=\\\"main\\\">Augeas is now able to parse XML files!<\/p>\n <ul>\n <li>Translate from XML to a tree syntax<\/li>\n <li>Translate from the tree back to XML<\/li> <!-- this is some comment -->\n <li>this<\/li>\n <\/ul>\n <\/body>\n<\/html>\n\"\n\n(* Test: Xml.doc\n Test <input1> with <Xml.doc> *)\ntest Xml.doc get input1 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n { \"encoding\" = \"UTF-8\" }\n }\n }\n { \"html\"\n { \"#text\" = \"\\r\\n \" }\n { \"head\"\n { \"#text\" = \"\\n \" }\n { \"title\"\n { \"#text\" = \"Wiki\" }\n }\n { \"#text\" = \" \" }\n }\n { \"#text\" = \" \" }\n { \"body\"\n { \"#text\" = \"\n \" }\n { \"h1\"\n { \"#text\" = \"Augeas\" }\n }\n { \"#text\" = \" \" }\n { \"p\"\n { \"#attribute\"\n { \"class\" = \"main\" }\n }\n { \"#text\" = \"Augeas is now able to parse XML files!\" }\n }\n { \"#text\" = \" \" }\n { \"ul\"\n { \"#text\" = \"\\n \" }\n { \"li\"\n { \"#text\" = \"Translate from XML to a tree syntax\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"Translate from the tree back to XML\" }\n }\n { \"#text\" = \" \" }\n { \"#comment\" = \" this is some comment \" }\n { \"#text\" = \"\n \" }\n { \"li\"\n { \"#text\" = \"this\" }\n }\n { \"#text\" = \" \" }\n }\n { \"#text\" = \" \" }\n }\n }\n\n(* Test: Xml.doc\n Modify <input1> with <Xml.doc> *)\ntest Xml.doc put input1 after rm \"\/html\/body\" =\n\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<html>\\r\n <head>\n <title>Wiki<\/title>\n <\/head>\n <\/html>\n\"\n\n\n(* Variable: ul1 *)\nlet ul1 = \"\n<ul>\n <li>test1<\/li>\n <li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc get ul1 =\n { \"ul\"\n { \"#text\" = \"\n \" }\n { \"li\"\n { \"#text\" = \"test1\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test2\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test3\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test4\" }\n }\n }\n\n\ntest Xml.doc put ul1 after set \"\/ul\/li[3]\/#text\" \"bidon\" = \"\n<ul>\n <li>test1<\/li>\n <li>test2<\/li>\n <li>bidon<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc put ul1 after rm \"\/ul\/li[2]\" = \"\n<ul>\n <li>test1<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n\n(* #text nodes don't move when inserting a node, the result depends on where the node is added *)\ntest Xml.doc put ul1 after insb \"a\" \"\/ul\/li[2]\" = \"\n<ul>\n <li>test1<\/li>\n <a><\/a>\n<li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc put ul1 after insa \"a\" \"\/ul\/li[1]\" = \"\n<ul>\n <li>test1<\/li>\n<a><\/a>\n <li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n(* Attributes must be added before text nodes *)\ntest Xml.doc put ul1 after insb \"#attribute\" \"\/ul\/li[2]\/#text\";\n set \"\/ul\/li[2]\/#attribute\/bidon\" \"gazou\";\n set \"\/ul\/li[2]\/#attribute\/foo\" \"bar\" = \"\n<ul>\n <li>test1<\/li>\n <li bidon=\\\"gazou\\\" foo=\\\"bar\\\">test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n(* if empty element is allowed to be as root, this test triggers error *)\ntest Xml.lns get \"<doc>\n<a><c\/><b><c\/><\/b><c\/><c\/><a><\/a><\/a>\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"a\"\n { \"c\" = \"#empty\" }\n { \"b\"\n { \"c\" = \"#empty\" }\n }\n { \"c\" = \"#empty\" }\n { \"c\" = \"#empty\" }\n { \"a\" }\n }\n }\n\nlet p01pass2 = \"<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!DOCTYPE doc\n[\n<!ELEMENT doc ANY>\n<!ELEMENT a ANY>\n<!ELEMENT b ANY>\n<!ELEMENT c ANY>\n]>\n<doc>\n<a><b><c\/><\/b><\/a>\n<\/doc>\n<!-- comment after document element-->\n<?PI after document element?>\n<!-- comment after document element-->\n<?PI after document element?>\n<!-- comment after document element-->\n<?PI after document element?>\n\"\n\ntest Xml.lns get p01pass2 =\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"a\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"b\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"c\"\n { \"#decl\" = \"ANY\" }\n }\n }\n { \"doc\"\n { \"#text\" = \"\n\" }\n { \"a\"\n { \"b\"\n { \"c\" = \"#empty\" }\n }\n }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n\n\n(* various valid Name constructions *)\ntest Xml.lns get \"<doc>\\n<A:._-0\/>\\n<::._-0\/>\\n<_:._-0\/>\\n<A\/>\\n<_\/>\\n<:\/>\\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"A:._-0\" = \"#empty\" }\n { \"::._-0\" = \"#empty\" }\n { \"_:._-0\" = \"#empty\" }\n { \"A\" = \"#empty\" }\n { \"_\" = \"#empty\" }\n { \":\" = \"#empty\" }\n }\n\ntest Xml.lns get \"<doc>\n<abcdefghijklmnopqrstuvwxyz\/>\n<ABCDEFGHIJKLMNOPQRSTUVWXYZ\/>\n<A01234567890\/>\n<A.-:\/>\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"abcdefghijklmnopqrstuvwxyz\" = \"#empty\" }\n { \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" = \"#empty\" }\n { \"A01234567890\" = \"#empty\" }\n { \"A.-:\" = \"#empty\" }\n }\n\n\nlet p06fail1 = \"<!--non-validating processors may pass this instance because they don't check the IDREFS attribute type-->\n<!DOCTYPE doc\n[\n<!ELEMENT doc (a|refs)*>\n<!ELEMENT a EMPTY>\n<!ELEMENT refs EMPTY>\n<!ATTLIST refs refs IDREFS #REQUIRED>\n<!ATTLIST a id ID #REQUIRED>\n]>\n<doc>\n<a id=\\\"A1\\\"\/><a id=\\\"A2\\\"\/><a id=\\\"A3\\\"\/>\n<refs refs=\\\"\\\"\/>\n<\/doc>\"\n\n(* we accept this test because we do not verify XML references *)\ntest Xml.lns get p06fail1 =\n { \"#comment\" = \"non-validating processors may pass this instance because they don't check the IDREFS attribute type\" }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"(a|refs)*\" }\n }\n { \"!ELEMENT\" = \"a\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!ELEMENT\" = \"refs\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!ATTLIST\" = \"refs\"\n { \"1\"\n { \"#name\" = \"refs\" }\n { \"#type\" = \"IDREFS\" }\n { \"#REQUIRED\" }\n }\n }\n { \"!ATTLIST\" = \"a\"\n { \"1\"\n { \"#name\" = \"id\" }\n { \"#type\" = \"ID\" }\n { \"#REQUIRED\" }\n }\n }\n }\n { \"doc\"\n { \"#text\" = \"\n\" }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A1\" }\n }\n }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A2\" }\n }\n }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A3\" }\n }\n }\n { \"refs\" = \"#empty\"\n { \"#attribute\"\n { \"refs\" = \"\" }\n }\n }\n }\n\n(* we accept dquote, but not single quotes, because of resulting ambiguity *)\nlet p10pass1_1 = \"<doc><A a=\\\"asdf>'">\\nasdf\\n ?>%\\\"\/><\/doc>\"\nlet p10pass1_2 = \"<doc><A a='\\\"\\\">'"'\/><\/doc>\"\n\ntest Xml.lns get p10pass1_1 =\n { \"doc\"\n { \"A\" = \"#empty\"\n { \"#attribute\"\n { \"a\" = \"asdf>'">\\nasdf\\n ?>%\" }\n }\n }\n }\n\ntest Xml.lns get p10pass1_2 =\n { \"doc\"\n { \"A\" = \"#empty\"\n { \"#attribute\"\n { \"a\" = \"\\\"\\\">'"\" }\n }\n }\n }\n\n(* here again, test exclude single quote *)\nlet p11pass1 = \"<!--Inability to resolve a notation should not be reported as an error-->\n<!DOCTYPE doc\n[\n<!ELEMENT doc EMPTY>\n<!NOTATION not1 SYSTEM \\\"a%a&b�<!ELEMENT<!--<?<\/>?>\/\\''\\\">\n<!NOTATION not3 SYSTEM \\\"\\\">\n]>\n<doc><\/doc>\"\n\ntest Xml.lns get p11pass1 =\n { \"#comment\" = \"Inability to resolve a notation should not be reported as an error\" }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!NOTATION\" = \"not1\"\n { \"SYSTEM\" = \"a%a&b�<!ELEMENT<!--<?<\/>?>\/\\''\" }\n }\n { \"!NOTATION\" = \"not3\"\n { \"SYSTEM\" = \"\" }\n }\n }\n { \"doc\" }\n\ntest Xml.lns get \"<doc>a%b%<\/doc><\/doc>]]<&<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"a%b%<\/doc><\/doc>]]<&\" }\n }\n\nlet p15pass1 = \"<!--a\n<!DOCTYPE\n<?-\n]]>-<[ CDATA [\n\\\"- -'-\n-<doc>-->\n<!---->\n<doc><\/doc>\"\n\ntest Xml.lns get p15pass1 =\n { \"#comment\" = \"a\n<!DOCTYPE\n<?-\n]]>-<[ CDATA [\n\\\"- -'-\n-<doc>\" }\n { \"#comment\" = \"\" }\n { \"doc\" }\n\nlet p22pass3 = \"<?xml version=\\\"1.0\\\"?>\n<!--comment--> <?pi some instruction ?>\n<doc><?pi?><\/doc>\"\n\ntest Xml.lns get p22pass3 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"#comment\" = \"comment\" }\n { \"#pi\"\n { \"#target\" = \"pi\" }\n { \"#instruction\" = \"some instruction\" }\n }\n { \"doc\"\n { \"#pi\"\n { \"#target\" = \"pi\" }\n }\n }\n\nlet p25pass2 = \"<?xml version\n\n\n=\n\n\n\\\"1.0\\\"?>\n<doc><\/doc>\"\n\ntest Xml.lns get p25pass2 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"doc\" }\n\n\ntest Xml.lns get \"<!DOCTYPE\n\ndoc\n\n[\n<!ELEMENT doc EMPTY>\n]>\n<doc><\/doc>\" =\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"EMPTY\" }\n }\n }\n { \"doc\" }\n\ntest Xml.lns get \"<doc><\/doc \\n>\" = { \"doc\" }\n\ntest Xml.lns get \"<a><doc att=\\\"val\\\" \\natt2=\\\"val2\\\" att3=\\\"val3\\\"\/><\/a>\" =\n { \"a\"\n { \"doc\" = \"#empty\"\n { \"#attribute\"\n { \"att\" = \"val\" }\n { \"att2\" = \"val2\" }\n { \"att3\" = \"val3\" }\n }\n }\n }\n\ntest Xml.lns get \"<doc\/>\" = { \"doc\" = \"#empty\" }\n\n(* failure tests *)\n(* only one document element *)\ntest Xml.lns get \"<doc><\/doc><bad\/>\" = *\n\n(* document element must be complete *)\ntest Xml.lns get \"<doc>\" = *\n\n(* emtpy document is rejected *)\ntest Xml.lns get \"\" = *\n\n(* malformed element *)\ntest Xml.lns get \"<a><A@\/><\/a>\" = *\n\n(* a Name cannot start with a digit *)\ntest Xml.lns get \"<a><0A\/><\/a>\" = *\n\n(* no space before \"CDATA\" *)\ntest Xml.lns get \"<doc><![ CDATA[a]]><\/doc>\" = *\n\n(* no space after \"CDATA\" *)\ntest Xml.lns get \"<doc><![CDATA [a]]><\/doc>\" = *\n\n(* CDSect's can't nest *)\ntest Xml.lns get \"<doc>\n<![CDATA[\n<![CDATA[XML doesn't allow CDATA sections to nest]]>\n]]>\n<\/doc>\" = *\n\n(* Comment is illegal in VersionInfo *)\ntest Xml.lns get \"<?xml version <!--bad comment--> =\\\"1.0\\\"?>\n<doc><\/doc>\" = *\n\n(* only declarations in DTD *)\ntest Xml.lns get \"<!DOCTYPE doc [\n<!ELEMENT doc EMPTY>\n<doc><\/doc>\n]>\" = *\n\n(* we do not support external entities *)\ntest Xml.lns get \"<!DOCTYPE doc [\n<!ENTITY % eldecl \\\"<!ELEMENT doc EMPTY>\\\">\n%eldecl;\n]>\n<doc><\/doc>\" = *\n","old_contents":"(*\nModule: Test_Xml\n Provides unit tests and examples for the <Xml> lens.\n*)\n\nmodule Test_Xml =\n\n(* View: knode\n A simple flag function\n\n Parameters:\n r:regexp - the pattern for the flag\n*)\nlet knode (r:regexp) = [ key r ]\n\n(************************************************************************\n * Group: Utilities lens\n *************************************************************************)\n(*\nlet _ = print_regexp(lens_ctype(Xml.text))\nlet _ = print_endline \"\"\n*)\n\n(* Group: Comments *)\n\n(* Test: Xml.comment\n Comments get mapped into \"#comment\" nodes. *)\ntest Xml.comment get\n \"<!-- declarations for <head> & <body> -->\" =\n\n { \"#comment\" = \" declarations for <head> & <body> \" }\n\n(* Test: Xml.comment\n This syntax is not understood. *)\ntest Xml.comment get\n \"<!-- B+, B, or B--->\" = *\n\n(* Group: Prolog and declarations *)\n\n(* Test: Xml.prolog\n The XML prolog tag is mapped in a \"#declaration\" node,\n which contains an \"#attribute\" node with various attributes of the tag. *)\ntest Xml.prolog get\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" =\n\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n { \"encoding\" = \"UTF-8\" }\n }\n }\n\n(* Test: Xml.decl_def_item\n !ELEMENT declaration tags are mapped in \"!ELEMENT\" nodes.\n The associated declaration attribute is mapped in a \"#decl\" subnode. *)\ntest Xml.decl_def_item get\n \"<!ELEMENT greeting (#PCDATA)>\" =\n\n { \"!ELEMENT\" = \"greeting\"\n { \"#decl\" = \"(#PCDATA)\" }\n }\n\n(* Test: Xml.decl_def_item\n !ENTITY declaration tags are mapped in \"!ENTITY\" nodes.\n The associated declaration attribute is mapped in a \"#decl\" subnode. *)\ntest Xml.decl_def_item get\n \"<!ENTITY da \\\" \\\">\" =\n\n { \"!ENTITY\" = \"da\"\n { \"#decl\" = \" \" }\n }\n\n(* Test: Xml.doctype\n !DOCTYPE tags are mapped in \"!DOCTYPE\" nodes.\n The associated system attribute is mapped in a \"SYSTEM\" subnode. *)\ntest Xml.doctype get\n \"<!DOCTYPE greeting SYSTEM \\\"hello.dtd\\\">\" =\n\n { \"!DOCTYPE\" = \"greeting\"\n { \"SYSTEM\" = \"hello.dtd\" }\n }\n\n(* Test: Xml.doctype\n This is an example of a !DOCTYPE tag with !ELEMENT children tags. *)\ntest Xml.doctype get \"<!DOCTYPE foo [\n<!ELEMENT bar (#PCDATA)>\n<!ELEMENT baz (bar)* >\n]>\" =\n\n { \"!DOCTYPE\" = \"foo\"\n { \"!ELEMENT\" = \"bar\"\n { \"#decl\" = \"(#PCDATA)\" }\n }\n { \"!ELEMENT\" = \"baz\"\n { \"#decl\" = \"(bar)*\" }\n }\n }\n\n(* Group: Attributes *)\n\n(* Variable: att_def1 *)\nlet att_def1 = \"<!ATTLIST termdef\nid ID #REQUIRED\nname CDATA #IMPLIED>\"\n(* Variable: att_def2 *)\nlet att_def2 = \"<!ATTLIST list\ntype (bullets|ordered|glossary) \\\"ordered\\\">\"\n(* Variable: att_def3 *)\nlet att_def3 = \"<!ATTLIST form\nmethod CDATA #FIXED \\\"POST\\\">\"\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def1 =\n\n { \"!ATTLIST\" = \"termdef\"\n { \"1\"\n { \"#name\" = \"id\" }\n { \"#type\" = \"ID\" }\n { \"#REQUIRED\" }\n }\n { \"2\"\n { \"#name\" = \"name\" }\n { \"#type\" = \"CDATA\" }\n { \"#IMPLIED\" }\n }\n }\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def2 =\n\n { \"!ATTLIST\" = \"list\"\n { \"1\"\n { \"#name\" = \"type\" }\n { \"#type\" = \"(bullets|ordered|glossary)\" }\n { \"#FIXED\" = \"ordered\" }\n }\n }\n\n(* Test: Xml.att_list_def *)\ntest Xml.att_list_def get\n att_def3 =\n\n { \"!ATTLIST\" = \"form\"\n { \"1\"\n { \"#name\" = \"method\" }\n { \"#type\" = \"CDATA\" }\n { \"#FIXED\" = \"POST\" }\n }\n }\n\n(* Test: Xml.notation_def *)\ntest Xml.notation_def get\n \"<!NOTATION not3 SYSTEM \\\"\\\">\" =\n\n { \"!NOTATION\" = \"not3\"\n { \"SYSTEM\" = \"\" }\n }\n\n(* Variable: cdata1 *)\nlet cdata1 = \"<![CDATA[testing]]>\"\n(* Test: Xml.cdata *)\ntest Xml.cdata get cdata1 = { \"#CDATA\" = \"testing\" }\n\n(* Variable: attr1 *)\nlet attr1 = \" attr1=\\\"value1\\\" attr2=\\\"value2\\\"\"\n(* Variable: attr2 *)\nlet attr2 = \" attr2=\\\"foo\\\"\"\n(* Test: Xml.attributes *)\ntest Xml.attributes get attr1 =\n { \"#attribute\"\n { \"attr1\" = \"value1\" }\n { \"attr2\" = \"value2\" }\n }\n\n(* Test: Xml.attributes *)\ntest Xml.attributes get \" refs=\\\"A1\\nA2 A3\\\"\" =\n { \"#attribute\"\n { \"refs\" = \"A1\\nA2 A3\" }\n }\n\n(* Test: Xml.attributes *)\ntest Xml.attributes put attr1 after rm \"\/#attribute[1]\";\n set \"\/#attribute\/attr2\" \"foo\" = attr2\n\n(* test quoting *)\n(* well formed values *)\ntest Xml.attributes get \" attr1=\\\"value1\\\"\" = { \"#attribute\" { \"attr1\" = \"value1\" } }\ntest Xml.attributes get \" attr1='value1'\" = { \"#attribute\" { \"attr1\" = \"value1\" } }\ntest Xml.attributes get \" attr1='va\\\"lue1'\" = { \"#attribute\" { \"attr1\" = \"va\\\"lue1\" } }\ntest Xml.attributes get \" attr1=\\\"va'lue1\\\"\" = { \"#attribute\" { \"attr1\" = \"va'lue1\" } }\n\n(* illegal as per the XML standard *)\ntest Xml.attributes get \" attr1=\\\"va\\\"lue1\\\"\" = *\ntest Xml.attributes get \" attr1='va'lue1'\" = *\n\n(* malformed values *)\ntest Xml.attributes get \" attr1=\\\"value1'\" = *\ntest Xml.attributes get \" attr1='value1\\\"\" = *\n\n(* Group: empty *)\n\n(* Variable: empty1 *)\nlet empty1 = \"<a\/>\"\n(* Variable: empty2 *)\nlet empty2 = \"<a foo=\\\"bar\\\"\/>\"\n(* Variable: empty3 *)\nlet empty3 = \"<a foo=\\\"bar\\\"><\/a>\\n\"\n(* Variable: empty4 *)\nlet empty4 = \"<a foo=\\\"bar\\\" far=\\\"baz\\\"\/>\"\n(* Test: Xml.empty_element *)\ntest Xml.empty_element get empty1 = { \"a\" = \"#empty\" }\n(* Test: Xml.empty_element *)\ntest Xml.empty_element get empty2 =\n { \"a\" = \"#empty\" { \"#attribute\" { \"foo\" = \"bar\"} } }\n\n(* Test: Xml.empty_element *)\ntest Xml.empty_element put empty1 after set \"\/a\/#attribute\/foo\" \"bar\" = empty2\n\n(* Test: Xml.empty_element\n The attribute node must be the first child of the element *)\ntest Xml.empty_element put empty1 after set \"\/a\/#attribute\/foo\" \"bar\";\n set \"\/a\/#attribute\/far\" \"baz\" = empty4\n\n(* Test: Xml.content *)\ntest Xml.content put \"<a><b\/><\/a>\" after clear \"\/a\/b\" = \"<a><b><\/b>\\n<\/a>\"\n\n\n(* Group: Full lens *)\n\n(* Test: Xml.lns *)\ntest Xml.lns put \"<a><\/a >\" after set \"\/a\/#text[1]\" \"foo\";\n set \"\/a\/#text[2]\" \"bar\" = \"<a>foobar<\/a >\"\n\n(* Test: Xml.lns *)\ntest Xml.lns get \"<?xml version=\\\"1.0\\\"?>\n<!DOCTYPE catalog PUBLIC \\\"-\/\/OASIS\/\/DTD XML Catalogs V1.0\/\/EN\\\"\n \\\"file:\/\/\/usr\/share\/xml\/schema\/xml-core\/catalog.dtd\\\">\n <doc\/>\" =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"!DOCTYPE\" = \"catalog\"\n { \"PUBLIC\"\n { \"#literal\" = \"-\/\/OASIS\/\/DTD XML Catalogs V1.0\/\/EN\" }\n { \"#literal\" = \"file:\/\/\/usr\/share\/xml\/schema\/xml-core\/catalog.dtd\" }\n }\n }\n { \"doc\" = \"#empty\" }\n\n(* Test: Xml.lns *)\ntest Xml.lns get \"<oor:component-data xmlns:oor=\\\"http:\/\/openoffice.org\/2001\/registry\\\"\/>\n\" =\n { \"oor:component-data\" = \"#empty\"\n { \"#attribute\"\n { \"xmlns:oor\" = \"http:\/\/openoffice.org\/2001\/registry\" }\n }\n }\n\n(* Variable: input1 *)\nlet input1 = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<html>\n <head>\n <title>Wiki<\/title>\n <\/head>\n <body>\n <h1>Augeas<\/h1>\n <p class=\\\"main\\\">Augeas is now able to parse XML files!<\/p>\n <ul>\n <li>Translate from XML to a tree syntax<\/li>\n <li>Translate from the tree back to XML<\/li> <!-- this is some comment -->\n <li>this<\/li>\n <\/ul>\n <\/body>\n<\/html>\n\"\n\n(* Test: Xml.doc\n Test <input1> with <Xml.doc> *)\ntest Xml.doc get input1 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n { \"encoding\" = \"UTF-8\" }\n }\n }\n { \"html\"\n { \"#text\" = \"\\n \" }\n { \"head\"\n { \"#text\" = \"\\n \" }\n { \"title\"\n { \"#text\" = \"Wiki\" }\n }\n { \"#text\" = \" \" }\n }\n { \"#text\" = \" \" }\n { \"body\"\n { \"#text\" = \"\n \" }\n { \"h1\"\n { \"#text\" = \"Augeas\" }\n }\n { \"#text\" = \" \" }\n { \"p\"\n { \"#attribute\"\n { \"class\" = \"main\" }\n }\n { \"#text\" = \"Augeas is now able to parse XML files!\" }\n }\n { \"#text\" = \" \" }\n { \"ul\"\n { \"#text\" = \"\\n \" }\n { \"li\"\n { \"#text\" = \"Translate from XML to a tree syntax\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"Translate from the tree back to XML\" }\n }\n { \"#text\" = \" \" }\n { \"#comment\" = \" this is some comment \" }\n { \"#text\" = \"\n \" }\n { \"li\"\n { \"#text\" = \"this\" }\n }\n { \"#text\" = \" \" }\n }\n { \"#text\" = \" \" }\n }\n }\n\n(* Test: Xml.doc\n Modify <input1> with <Xml.doc> *)\ntest Xml.doc put input1 after rm \"\/html\/body\" =\n\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<html>\n <head>\n <title>Wiki<\/title>\n <\/head>\n <\/html>\n\"\n\n\n(* Variable: ul1 *)\nlet ul1 = \"\n<ul>\n <li>test1<\/li>\n <li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc get ul1 =\n { \"ul\"\n { \"#text\" = \"\n \" }\n { \"li\"\n { \"#text\" = \"test1\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test2\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test3\" }\n }\n { \"#text\" = \" \" }\n { \"li\"\n { \"#text\" = \"test4\" }\n }\n }\n\n\ntest Xml.doc put ul1 after set \"\/ul\/li[3]\/#text\" \"bidon\" = \"\n<ul>\n <li>test1<\/li>\n <li>test2<\/li>\n <li>bidon<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc put ul1 after rm \"\/ul\/li[2]\" = \"\n<ul>\n <li>test1<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n\n(* #text nodes don't move when inserting a node, the result depends on where the node is added *)\ntest Xml.doc put ul1 after insb \"a\" \"\/ul\/li[2]\" = \"\n<ul>\n <li>test1<\/li>\n <a><\/a>\n<li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\ntest Xml.doc put ul1 after insa \"a\" \"\/ul\/li[1]\" = \"\n<ul>\n <li>test1<\/li>\n<a><\/a>\n <li>test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n(* Attributes must be added before text nodes *)\ntest Xml.doc put ul1 after insb \"#attribute\" \"\/ul\/li[2]\/#text\";\n set \"\/ul\/li[2]\/#attribute\/bidon\" \"gazou\";\n set \"\/ul\/li[2]\/#attribute\/foo\" \"bar\" = \"\n<ul>\n <li>test1<\/li>\n <li bidon=\\\"gazou\\\" foo=\\\"bar\\\">test2<\/li>\n <li>test3<\/li>\n <li>test4<\/li>\n<\/ul>\n\"\n\n(* if empty element is allowed to be as root, this test triggers error *)\ntest Xml.lns get \"<doc>\n<a><c\/><b><c\/><\/b><c\/><c\/><a><\/a><\/a>\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"a\"\n { \"c\" = \"#empty\" }\n { \"b\"\n { \"c\" = \"#empty\" }\n }\n { \"c\" = \"#empty\" }\n { \"c\" = \"#empty\" }\n { \"a\" }\n }\n }\n\nlet p01pass2 = \"<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!-- comment after document element-->\n<?PI before document element?>\n<!DOCTYPE doc\n[\n<!ELEMENT doc ANY>\n<!ELEMENT a ANY>\n<!ELEMENT b ANY>\n<!ELEMENT c ANY>\n]>\n<doc>\n<a><b><c\/><\/b><\/a>\n<\/doc>\n<!-- comment after document element-->\n<?PI after document element?>\n<!-- comment after document element-->\n<?PI after document element?>\n<!-- comment after document element-->\n<?PI after document element?>\n\"\n\ntest Xml.lns get p01pass2 =\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"before document element\" }\n }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"a\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"b\"\n { \"#decl\" = \"ANY\" }\n }\n { \"!ELEMENT\" = \"c\"\n { \"#decl\" = \"ANY\" }\n }\n }\n { \"doc\"\n { \"#text\" = \"\n\" }\n { \"a\"\n { \"b\"\n { \"c\" = \"#empty\" }\n }\n }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n { \"#comment\" = \" comment after document element\" }\n { \"#pi\"\n { \"#target\" = \"PI\" }\n { \"#instruction\" = \"after document element\" }\n }\n\n\n(* various valid Name constructions *)\ntest Xml.lns get \"<doc>\\n<A:._-0\/>\\n<::._-0\/>\\n<_:._-0\/>\\n<A\/>\\n<_\/>\\n<:\/>\\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"A:._-0\" = \"#empty\" }\n { \"::._-0\" = \"#empty\" }\n { \"_:._-0\" = \"#empty\" }\n { \"A\" = \"#empty\" }\n { \"_\" = \"#empty\" }\n { \":\" = \"#empty\" }\n }\n\ntest Xml.lns get \"<doc>\n<abcdefghijklmnopqrstuvwxyz\/>\n<ABCDEFGHIJKLMNOPQRSTUVWXYZ\/>\n<A01234567890\/>\n<A.-:\/>\n<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"\\n\" }\n { \"abcdefghijklmnopqrstuvwxyz\" = \"#empty\" }\n { \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" = \"#empty\" }\n { \"A01234567890\" = \"#empty\" }\n { \"A.-:\" = \"#empty\" }\n }\n\n\nlet p06fail1 = \"<!--non-validating processors may pass this instance because they don't check the IDREFS attribute type-->\n<!DOCTYPE doc\n[\n<!ELEMENT doc (a|refs)*>\n<!ELEMENT a EMPTY>\n<!ELEMENT refs EMPTY>\n<!ATTLIST refs refs IDREFS #REQUIRED>\n<!ATTLIST a id ID #REQUIRED>\n]>\n<doc>\n<a id=\\\"A1\\\"\/><a id=\\\"A2\\\"\/><a id=\\\"A3\\\"\/>\n<refs refs=\\\"\\\"\/>\n<\/doc>\"\n\n(* we accept this test because we do not verify XML references *)\ntest Xml.lns get p06fail1 =\n { \"#comment\" = \"non-validating processors may pass this instance because they don't check the IDREFS attribute type\" }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"(a|refs)*\" }\n }\n { \"!ELEMENT\" = \"a\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!ELEMENT\" = \"refs\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!ATTLIST\" = \"refs\"\n { \"1\"\n { \"#name\" = \"refs\" }\n { \"#type\" = \"IDREFS\" }\n { \"#REQUIRED\" }\n }\n }\n { \"!ATTLIST\" = \"a\"\n { \"1\"\n { \"#name\" = \"id\" }\n { \"#type\" = \"ID\" }\n { \"#REQUIRED\" }\n }\n }\n }\n { \"doc\"\n { \"#text\" = \"\n\" }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A1\" }\n }\n }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A2\" }\n }\n }\n { \"a\" = \"#empty\"\n { \"#attribute\"\n { \"id\" = \"A3\" }\n }\n }\n { \"refs\" = \"#empty\"\n { \"#attribute\"\n { \"refs\" = \"\" }\n }\n }\n }\n\n(* we accept dquote, but not single quotes, because of resulting ambiguity *)\nlet p10pass1_1 = \"<doc><A a=\\\"asdf>'">\\nasdf\\n ?>%\\\"\/><\/doc>\"\nlet p10pass1_2 = \"<doc><A a='\\\"\\\">'"'\/><\/doc>\"\n\ntest Xml.lns get p10pass1_1 =\n { \"doc\"\n { \"A\" = \"#empty\"\n { \"#attribute\"\n { \"a\" = \"asdf>'">\\nasdf\\n ?>%\" }\n }\n }\n }\n\ntest Xml.lns get p10pass1_2 =\n { \"doc\"\n { \"A\" = \"#empty\"\n { \"#attribute\"\n { \"a\" = \"\\\"\\\">'"\" }\n }\n }\n }\n\n(* here again, test exclude single quote *)\nlet p11pass1 = \"<!--Inability to resolve a notation should not be reported as an error-->\n<!DOCTYPE doc\n[\n<!ELEMENT doc EMPTY>\n<!NOTATION not1 SYSTEM \\\"a%a&b�<!ELEMENT<!--<?<\/>?>\/\\''\\\">\n<!NOTATION not3 SYSTEM \\\"\\\">\n]>\n<doc><\/doc>\"\n\ntest Xml.lns get p11pass1 =\n { \"#comment\" = \"Inability to resolve a notation should not be reported as an error\" }\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"EMPTY\" }\n }\n { \"!NOTATION\" = \"not1\"\n { \"SYSTEM\" = \"a%a&b�<!ELEMENT<!--<?<\/>?>\/\\''\" }\n }\n { \"!NOTATION\" = \"not3\"\n { \"SYSTEM\" = \"\" }\n }\n }\n { \"doc\" }\n\ntest Xml.lns get \"<doc>a%b%<\/doc><\/doc>]]<&<\/doc>\" =\n { \"doc\"\n { \"#text\" = \"a%b%<\/doc><\/doc>]]<&\" }\n }\n\nlet p15pass1 = \"<!--a\n<!DOCTYPE\n<?-\n]]>-<[ CDATA [\n\\\"- -'-\n-<doc>-->\n<!---->\n<doc><\/doc>\"\n\ntest Xml.lns get p15pass1 =\n { \"#comment\" = \"a\n<!DOCTYPE\n<?-\n]]>-<[ CDATA [\n\\\"- -'-\n-<doc>\" }\n { \"#comment\" = \"\" }\n { \"doc\" }\n\nlet p22pass3 = \"<?xml version=\\\"1.0\\\"?>\n<!--comment--> <?pi some instruction ?>\n<doc><?pi?><\/doc>\"\n\ntest Xml.lns get p22pass3 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"#comment\" = \"comment\" }\n { \"#pi\"\n { \"#target\" = \"pi\" }\n { \"#instruction\" = \"some instruction\" }\n }\n { \"doc\"\n { \"#pi\"\n { \"#target\" = \"pi\" }\n }\n }\n\nlet p25pass2 = \"<?xml version\n\n\n=\n\n\n\\\"1.0\\\"?>\n<doc><\/doc>\"\n\ntest Xml.lns get p25pass2 =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"doc\" }\n\n\ntest Xml.lns get \"<!DOCTYPE\n\ndoc\n\n[\n<!ELEMENT doc EMPTY>\n]>\n<doc><\/doc>\" =\n { \"!DOCTYPE\" = \"doc\"\n { \"!ELEMENT\" = \"doc\"\n { \"#decl\" = \"EMPTY\" }\n }\n }\n { \"doc\" }\n\ntest Xml.lns get \"<doc><\/doc \\n>\" = { \"doc\" }\n\ntest Xml.lns get \"<a><doc att=\\\"val\\\" \\natt2=\\\"val2\\\" att3=\\\"val3\\\"\/><\/a>\" =\n { \"a\"\n { \"doc\" = \"#empty\"\n { \"#attribute\"\n { \"att\" = \"val\" }\n { \"att2\" = \"val2\" }\n { \"att3\" = \"val3\" }\n }\n }\n }\n\ntest Xml.lns get \"<doc\/>\" = { \"doc\" = \"#empty\" }\n\n(* failure tests *)\n(* only one document element *)\ntest Xml.lns get \"<doc><\/doc><bad\/>\" = *\n\n(* document element must be complete *)\ntest Xml.lns get \"<doc>\" = *\n\n(* emtpy document is rejected *)\ntest Xml.lns get \"\" = *\n\n(* malformed element *)\ntest Xml.lns get \"<a><A@\/><\/a>\" = *\n\n(* a Name cannot start with a digit *)\ntest Xml.lns get \"<a><0A\/><\/a>\" = *\n\n(* no space before \"CDATA\" *)\ntest Xml.lns get \"<doc><![ CDATA[a]]><\/doc>\" = *\n\n(* no space after \"CDATA\" *)\ntest Xml.lns get \"<doc><![CDATA [a]]><\/doc>\" = *\n\n(* CDSect's can't nest *)\ntest Xml.lns get \"<doc>\n<![CDATA[\n<![CDATA[XML doesn't allow CDATA sections to nest]]>\n]]>\n<\/doc>\" = *\n\n(* Comment is illegal in VersionInfo *)\ntest Xml.lns get \"<?xml version <!--bad comment--> =\\\"1.0\\\"?>\n<doc><\/doc>\" = *\n\n(* only declarations in DTD *)\ntest Xml.lns get \"<!DOCTYPE doc [\n<!ELEMENT doc EMPTY>\n<doc><\/doc>\n]>\" = *\n\n(* we do not support external entities *)\ntest Xml.lns get \"<!DOCTYPE doc [\n<!ENTITY % eldecl \\\"<!ELEMENT doc EMPTY>\\\">\n%eldecl;\n]>\n<doc><\/doc>\" = *\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"142cbf0f43e60733a41aaef9d0791dc568f75727","subject":"Use the new '-' operator for key_re","message":"Use the new '-' operator for key_re\n","repos":"mchf\/augeas,kumy\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,camptocamp\/augeas,bkearney\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jasperla\/augeas,bkearney\/augeas,pevalme\/augeas,manandbytes\/augeas,jtopjian\/augeas,kumy\/augeas,raphink\/augeas,mchf\/augeas,lutter\/augeas,lutter\/augeas,mlichvar\/augeas,lutter\/augeas,domcleal\/augeas,jjlin\/augeas,ptoscano\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,kunkku\/augeas,camptocamp\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,dafugg\/augeas,jtopjian\/augeas,jasperla\/augeas,ptoscano\/augeas,domcleal\/augeas,camptocamp\/augeas,kumy\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,raphink\/augeas,dafugg\/augeas,jjlin\/augeas,domcleal\/augeas,bkearney\/augeas,pevalme\/augeas,camptocamp\/augeas,kumy\/augeas,manandbytes\/augeas,bkearney\/augeas,kunkku\/augeas,mlichvar\/augeas,pevalme\/augeas","old_file":"lenses\/yum.aug","new_file":"lenses\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n let key_re = \/[^#;:= \\t\\n[\\\/]+\/ - \"baseurl\"\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/[ \\t]*(,[ \\t]*|\\n[ \\t]+)\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section = [ sechead . (entry* | entry* . (kv_list \"baseurl\") . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\") . (incl \"\/etc\/yum.repos.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n let eol = Util.del_str \"\\n\"\n\n (* Very painful: the regular expression is \/[^#;:= \\t\\n[\\\/]\/ - \"baseurl\" *)\n (* Clearly, we need support for forming the setminus of regular *)\n (* languages. *)\n let key_re = \/([^b#;:= \\t\\n[\\\/]|b[^a#;:= \\t\\n[\\\/]|ba[^s#;:= \\t\\n[\\\/]|bas[^e#;:= \\t\\n[\\\/]|base[^u#;:= \\t\\n[\\\/]|baseu[^r#;:= \\t\\n[\\\/]|baseur[^l#;:= \\t\\n[\\\/]|baseurl[^#;:= \\t\\n[\\\/])[^#;:= \\t\\n[\\\/]*\/\n\n let eq = del \/[ \\t]*[:=][ \\t]*\/ \"=\"\n let secname = \/[^]\\\/]+\/\n\n let value = \/[^ \\t\\n][^\\n]*\/\n\n (* We really need to allow comments starting with REM and rem but that *)\n (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)\n (* to do that cleanly is somewhat annoying to craft by hand; we'd need to *)\n (* define KEY_RE as \/[A-Za-z0-9]+\/ - \"REM\" - \"rem\" *)\n let comment = [ del \/([;#].*)?[ \\t]*\\n\/ \"\\n\" ]\n\n let list_sep = del \/[ \\t]*(,[ \\t]*|\\n[ \\t]+)\/ \"\\n\\t\"\n let list_value = store \/[^ \\t\\n,]+\/\n\n let kv_list(s:string) =\n [ key s . eq . list_value ] .\n [ list_sep . label s . list_value ]* . eol\n\n let kv = [ key key_re . eq . store value . eol ]\n\n let sechead = Util.del_str \"[\" . key secname . Util.del_str \"]\"\n . del \/[ \\t]*[;#]?.*\/ \"\"\n . eol\n\n let entry = comment | kv\n\n (* A section is a section head, followed by any number of key value *)\n (* entries, with comments and blank lines freely interspersed. The *)\n (* continuation lines allowed for baseurl entries make this a little *)\n (* more interesting: there can be at most one baseurl entry in each *)\n (* section (more precisely, yum will only obey one of them, but we act *)\n (* as if yum would actually barf) *)\n let section = [ sechead . (entry* | entry* . (kv_list \"baseurl\") . entry*)]\n\n let lns = (comment) * . (section) *\n\n let filter = (incl \"\/etc\/yum.conf\") . (incl \"\/etc\/yum.repos.d\/*\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1007363f2a93e7232d665d7667f1b7738bafda29","subject":"add shorewall aug tests","message":"add shorewall aug tests\n","repos":"Contegix\/omnibus-puppet,Contegix\/omnibus-puppet","old_file":"files\/embedded\/share\/augeas\/lenses\/tests\/test_shorewall_rules.aug","new_file":"files\/embedded\/share\/augeas\/lenses\/tests\/test_shorewall_rules.aug","new_contents":"module Test_shorewall_rules =\n let basic = \"Foo\/ACCEPT fw bloc\nBar\/DENY bloc fw\\n\"\n\n let tabs = \"Foo\/ACCEPT fw bloc\nBar\/DENY bloc fw\\n\"\n\n let three_fields_plus_comment = \"ACCEPT fw:127.0.0.1 bloc\n# This should be a comment.\nFoo\/ACCEPT bloc fw\n\"\n\n let rules_and_comments = \"ACCEPT fw:127.0.0.1 bloc tcp - 22 127.0.0.1 22\/s root\/user\n# This should be a comment.\n\nFoo\/ACCEPT bloc fw\n\"\n\n let rules_comment_section = \"# This is a comment.\nSECTION NEW\nACCEPT fw:127.0.0.1 bloc tcp - 22 127.0.0.1 22\/s root\/user # This should also be a comment.\n# This should be a comment.\n\nFoo\/ACCEPT bloc fw\n\"\n\n let hq_server01_test = \"SMTP\/ACCEPT:info fw net:63.246.22.101,63.246.22.114,63.246.22.117 tcp smtp - - 25\/min\\n\"\n\n let put_test_basic = \"ACCEPT net fw tcp\n\"\n\n let put_test_basic_result = \"ACCEPT net fw tcp\nDENY fw bloc tcp\n\"\n\n let put_test_comment = \"# This is a comment.\nACCEPT net fw tcp\n\"\n\n let put_test_comment_result = \"# This is a comment.\nACCEPT net fw tcp\nDENY fw bloc tcp\n\"\n\n\n test Shorewall_rules.lns get hq_server01_test =\n { \"rule\"\n { \"action\" = \"SMTP\/ACCEPT:info\" }\n { \"source\" = \"fw\" }\n { \"dest\" = \"net:63.246.22.101,63.246.22.114,63.246.22.117\" }\n { \"proto\" = \"tcp\" }\n { \"dest_port\" = \"smtp\" }\n { \"source_port\" = \"-\" }\n { \"dest_original\" = \"-\" }\n { \"rate_limit\" = \"25\/min\" } }\n\n test Shorewall_rules.lns get basic =\n { \"rule\"\n { \"action\" = \"Foo\/ACCEPT\" }\n { \"source\" = \"fw\" }\n { \"dest\" = \"bloc\" } }\n { \"rule\"\n { \"action\" = \"Bar\/DENY\" }\n { \"source\" = \"bloc\" }\n { \"dest\" = \"fw\" } }\n\n test Shorewall_rules.lns get tabs =\n { \"rule\"\n { \"action\" = \"Foo\/ACCEPT\" }\n { \"source\" = \"fw\" }\n { \"dest\" = \"bloc\" } }\n { \"rule\"\n { \"action\" = \"Bar\/DENY\" }\n { \"source\" = \"bloc\" }\n { \"dest\" = \"fw\" } }\n\n test Shorewall_rules.lns get three_fields_plus_comment =\n { \"rule\"\n { \"action\" = \"ACCEPT\" }\n { \"source\" = \"fw:127.0.0.1\" }\n { \"dest\" = \"bloc\" } }\n { \"#comment\" = \"This should be a comment.\" }\n { \"rule\"\n { \"action\" = \"Foo\/ACCEPT\" }\n { \"source\" = \"bloc\" }\n { \"dest\" = \"fw\" } }\n\n test Shorewall_rules.lns get rules_and_comments =\n { \"rule\"\n { \"action\" = \"ACCEPT\" }\n { \"source\" = \"fw:127.0.0.1\" }\n { \"dest\" = \"bloc\" }\n { \"proto\" = \"tcp\" }\n { \"dest_port\" = \"-\" }\n { \"source_port\" = \"22\" }\n { \"dest_original\" = \"127.0.0.1\" }\n { \"rate_limit\" = \"22\/s\" }\n { \"user_group\" = \"root\/user\" } }\n { \"#comment\" = \"This should be a comment.\" }\n {}\n { \"rule\"\n { \"action\" = \"Foo\/ACCEPT\" }\n { \"source\" = \"bloc\" }\n { \"dest\" = \"fw\" } }\n\n(* test Shorewall_rules.lns get rules_comment_section =\n { \"#comment\" = \"This is a comment.\" }\n { \"SECTION\" = \"NEW\" }\n { \"rule\"\n { \"action\" = \"ACCEPT\" }\n { \"source\" = \"fw:127.0.0.1\" }\n { \"dest\" = \"bloc\" }\n { \"proto\" = \"tcp\" }\n { \"dest_port\" = \"-\" }\n { \"source_port\" = \"22\" }\n { \"dest_original\" = \"127.0.0.1\" }\n { \"rate_limit\" = \"22\/s\" }\n { \"user_group\" = \"root\/user\" }\n { \"#comment\" = \"This should also be a comment.\" } }\n { \"#comment\" = \"This should be a comment.\" }\n {}\n { \"rule\"\n { \"action\" = \"Foo\/ACCEPT\" }\n { \"source\" = \"bloc\" }\n { \"dest\" = \"fw\" } }\n*)\n\n test Shorewall_rules.lns put put_test_basic after\n set \"\/rule[last() + 1]\/action\" \"DENY\";\n set \"\/rule[last()]\/source\" \"fw\";\n set \"\/rule[last()]\/dest\" \"bloc\";\n set \"\/rule[last()]\/proto\" \"tcp\"\n = put_test_basic_result\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/embedded\/share\/augeas\/lenses\/tests\/test_shorewall_rules.aug' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Augeas"} {"commit":"75da3040d13143016713ec9b3c8a2c08fb8a2a50","subject":"Shellvars: load \/etc\/sysconfig\/sendmail","message":"Shellvars: load \/etc\/sysconfig\/sendmail\n","repos":"manandbytes\/augeas,dafugg\/augeas,kunkku\/augeas,kunkku\/augeas,hercules-team\/augeas,mchf\/augeas,raphink\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,kumy\/augeas,domcleal\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,kunkku\/augeas,kumy\/augeas,kumy\/augeas,camptocamp\/augeas,jjlin\/augeas,domcleal\/augeas,mchf\/augeas,lutter\/augeas,MikaelSmith\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,ptoscano\/augeas,camptocamp\/augeas,camptocamp\/augeas,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,jasperla\/augeas,pevalme\/augeas,lutter\/augeas,bkearney\/augeas,raphink\/augeas,jasperla\/augeas,manandbytes\/augeas,domcleal\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,dafugg\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,kumy\/augeas,MikaelSmith\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n let eq = Util.del_str \"=\"\n let comment = [ del \/(#.*)?[ \\t]*\\n\/ \"# \\n\" ]\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/ \n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \"(\" \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t]+\/ \" \" . seq \"values\" . array_value ] *\n . del \")\" \")\"\n \n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value = \n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | empty_array)\n\n let kv = [ key key_re . eq . (simple_value | array) . eol ]\n\n let source = \n [ \n del \/\\.|source\/ \".\" . label \".source\" . \n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol \n ]\n\n let lns = (comment | source | kv) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig = \n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"sendmail\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Generic lens for shell-script config files like the ones found *)\n(* in \/etc\/sysconfig *)\nmodule Shellvars =\n autoload xfm\n\n let eol = Util.eol\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/\n let eq = Util.del_str \"=\"\n let comment = [ del \/(#.*)?[ \\t]*\\n\/ \"# \\n\" ]\n\n let char = \/[^() '\"\\t\\n]|\\\\\\\\\"\/ \n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \"(\" \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t]+\/ \" \" . seq \"values\" . array_value ] *\n . del \")\" \")\"\n \n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value = \n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | empty_array)\n\n let kv = [ key key_re . eq . (simple_value | array) . eol ]\n\n let source = \n [ \n del \/\\.|source\/ \".\" . label \".source\" . \n Util.del_ws_spc . store \/[^= \\t\\n]+\/ . eol \n ]\n\n let lns = (comment | source | kv) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let filter_sysconfig = \n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"selinux\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9170b191b7cf0ae0f9faddb4bb8cc844334ea6ab","subject":"bootloader is also present in shellvars_list, exclude from shellvars.","message":"bootloader is also present in shellvars_list, exclude from shellvars.\n","repos":"hercules-team\/augeas-do-not-use,jasperla\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,dafugg\/augeas,domcleal\/augeas,mchf\/augeas,hercules-team\/augeas,raphink\/augeas,kumy\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,lutter\/augeas,kunkku\/augeas,kumy\/augeas,ptoscano\/augeas,jjlin\/augeas,mchf\/augeas,raphink\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,lutter\/augeas,mlichvar\/augeas,jjlin\/augeas,lutter\/augeas,dafugg\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,pevalme\/augeas,MikaelSmith\/augeas,domcleal\/augeas,manandbytes\/augeas,mlichvar\/augeas,mlichvar\/augeas,hercules-team\/augeas,pevalme\/augeas,kumy\/augeas,kumy\/augeas,pevalme\/augeas,ptoscano\/augeas,jjlin\/augeas,domcleal\/augeas,jtopjian\/augeas,jasperla\/augeas,jtopjian\/augeas","old_file":"lenses\/shellvars.aug","new_file":"lenses\/shellvars.aug","new_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"bootloader\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Shellvars\n Generic lens for shell-script config files like the ones found\n in \/etc\/sysconfig\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Shellvars =\n autoload xfm\n\n let eol = del \/[ \\t]+|[ \\t]*[;\\n]\/ \"\\n\"\n let semicol_eol = del \/[ \\t]*[;\\n]\/ \"\\n\"\n\n let key_re = \/[A-Za-z0-9_]+(\\[[0-9]+\\])?\/ - \"unset\" - \"export\"\n let eq = Util.del_str \"=\"\n\n let comment = Util.comment\n let comment_eol = Util.comment_eol\n let comment_or_eol = comment_eol | semicol_eol\n\n let empty = Util.empty\n let xchgs = Build.xchgs\n let semicol = del \/;?\/ \"\"\n\n let char = \/[^;#() '\"\\t\\n]|\\\\\\\\\"\/\n let dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/ (* \" Emacs, relax *)\n let squot = \/'[^'\\n]*'\/\n (* For some reason, `` conflicts with comment_or_eol *)\n let bquot = \/`[^#`\\n]*`\/\n let dollar_assign = \/\\$\\([^#`\\n]*\\)\/\n\n let sto_to_semicol = store \/[^#; \\t\\n][^#;\\n]+[^#; \\t\\n]|[^#; \\t\\n]+\/\n\n (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)\n (* arrays here because of typechecking headaches. Instead, they are *)\n (* treated as a simple value *)\n let array =\n let array_value = store (char+ | dquot) in\n del \/\\([ \\t]*\/ \"(\" . counter \"values\" .\n [ seq \"values\" . array_value ] .\n [ del \/[ \\t\\n]+\/ \" \" . seq \"values\" . array_value ] *\n . del \/[ \\t]*\\)\/ \")\"\n\n (* Treat an empty list () as a value '()'; that's not quite correct *)\n (* but fairly close. *)\n let simple_value =\n let empty_array = \/\\([ \\t]*\\)\/ in\n store (char* | dquot | squot | bquot | dollar_assign | empty_array)\n\n let export = [ key \"export\" . Util.del_ws_spc ]\n let kv = [ Util.indent . export? . key key_re\n . eq . (simple_value | array) . semicol . comment_or_eol ]\n\n let var_action (name:string) =\n [ Util.indent . xchgs name (\"@\" . name) . Util.del_ws_spc\n . store key_re . semicol . comment_or_eol ]\n\n let unset = var_action \"unset\"\n let bare_export = var_action \"export\"\n\n let source =\n [ Util.indent\n . del \/\\.|source\/ \".\" . label \".source\"\n . Util.del_ws_spc . store \/[^;=# \\t\\n]+\/ . comment_or_eol ]\n\n let shell_builtin_cmds = \"ulimit\"\n\n let builtin =\n [ Util.indent . label \"@builtin\"\n . store shell_builtin_cmds\n . Util.del_ws_spc\n . [ label \"args\" . sto_to_semicol ]\n . comment_or_eol ]\n\n let keyword (kw:string) = Util.indent . Util.del_str kw\n let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl\n\n let return =\n [ Util.indent . label \"@return\"\n . Util.del_str \"return\"\n . ( Util.del_ws_spc . store Rx.integer )?\n . comment_or_eol ]\n\n\n(************************************************************************\n * Group: CONDITIONALS AND LOOPS\n *************************************************************************)\n\n let generic_cond_start (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) =\n keyword_label start_kw lbl . Sep.space\n . sto_to_semicol . semicol_eol\n . keyword then_kw . eol\n . contents\n\n let generic_cond (start_kw:string) (lbl:string)\n (then_kw:string) (contents:lens) (end_kw:string) =\n [ generic_cond_start start_kw lbl then_kw contents\n . keyword end_kw . comment_or_eol ]\n\n let cond_if (entry:lens) =\n let elif = [ generic_cond_start \"elif\" \"@elif\" \"then\" entry+ ] in\n let else = [ keyword_label \"else\" \"@else\" . eol . entry+ ] in\n generic_cond \"if\" \"@if\" \"then\" (entry+ . elif* . else?) \"fi\"\n\n let loop_for (entry:lens) =\n generic_cond \"for\" \"@for\" \"do\" entry+ \"done\"\n\n let loop_while (entry:lens) =\n generic_cond \"while\" \"@while\" \"do\" entry+ \"done\"\n\n let loop_until (entry:lens) =\n generic_cond \"until\" \"@until\" \"do\" entry+ \"done\"\n\n let loop_select (entry:lens) =\n generic_cond \"select\" \"@select\" \"do\" entry+ \"done\"\n\n let case (entry:lens) =\n let case_entry = [ label \"@case_entry\"\n . Util.indent . store \/[^ \\t\\n\\)]+\/\n . Util.del_str \")\" . eol\n . entry+\n . Util.indent . Util.del_str \";;\" . eol ] in\n [ keyword_label \"case\" \"@case\" . Sep.space\n . store char+\n . del \/[ \\t\\n]+\/ \" \" . Util.del_str \"in\" . eol\n . case_entry+\n . keyword \"esac\" . comment_or_eol ]\n\n let function (entry:lens) =\n [ Util.indent . label \"@function\"\n . del \/(function[ \\t]+)?\/ \"\"\n . store Rx.word . del \/[ \\t]*\\(\\)\/ \"()\"\n . eol . Util.del_str \"{\" . eol\n . entry+\n . Util.indent . Util.del_str \"}\" . eol ]\n\n let rec rec_entry =\n let entry = comment | empty | source | kv\n | unset | bare_export | builtin | return | rec_entry in\n cond_if entry\n | loop_for entry\n | loop_select entry\n | loop_while entry\n | loop_until entry\n | case entry\n | function entry\n\n let lns = (comment | empty | source | kv | unset | bare_export | builtin | return | rec_entry) *\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n let sc_excl (n:string) = (excl (\"\/etc\/sysconfig\/\" . n))\n\n let filter_sysconfig =\n sc_incl \"*\" .\n sc_excl \"hw-uuid\" .\n sc_excl \"hwconf\" .\n sc_excl \"ip*tables\" .\n sc_excl \"kernel\" .\n sc_excl \"*.pub\" .\n sc_excl \"sysstat.ioconf\" .\n sc_excl \"system-config-firewall\" .\n sc_excl \"system-config-securitylevel\" .\n sc_incl \"network\/config\" .\n sc_incl \"network\/dhcp\" .\n sc_incl \"network\/dhcp6r\" .\n sc_incl \"network\/dhcp6s\" .\n sc_incl \"network\/ifcfg-*\" .\n sc_incl \"network\/if-down.d\/*\" .\n sc_incl \"network\/ifroute-*\" .\n sc_incl \"network\/if-up.d\/*\" .\n sc_incl \"network\/providers\/*\" .\n sc_incl \"rhn\/allowed-actions\/*\" .\n sc_incl \"rhn\/allowed-actions\/script\/*\" .\n sc_incl \"rhn\/rhnsd\" .\n sc_incl \"SuSEfirewall2.d\/cobbler\" .\n sc_incl \"SuSEfirewall2.d\/services\/*\" .\n sc_excl \"SuSEfirewall2.d\/services\/TEMPLATE\"\n\n let filter_ifcfg = incl \"\/etc\/sysconfig\/network-scripts\/ifcfg-*\"\n . incl \"\/etc\/sysconfig\/network\/ifcfg-*\"\n let filter_default = incl \"\/etc\/default\/*\"\n let filter_misc = incl \"\/etc\/arno-iptables-firewall\/debconf.cfg\"\n . incl \"\/etc\/cron-apt\/config\"\n . incl \"\/etc\/environment\"\n . incl \"\/etc\/blkid.conf\"\n . incl \"\/etc\/adduser.conf\"\n . incl \"\/etc\/cowpoke.conf\"\n . incl \"\/etc\/cvs-cron.conf\"\n . incl \"\/etc\/cvs-pserver.conf\"\n . incl \"\/etc\/devscripts.conf\"\n . incl \"\/etc\/lintianrc\"\n . incl \"\/etc\/lsb-release\"\n . incl \"\/etc\/os-release\"\n . incl \"\/etc\/popularity-contest.conf\"\n . incl \"\/etc\/rc.conf\"\n . incl \"\/etc\/selinux\/config\"\n . incl \"\/etc\/ucf.conf\"\n\n let filter = filter_sysconfig\n . filter_ifcfg\n . filter_default\n . filter_misc\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d1f464f81fcd490d002b69f2bf65e834136ba708","subject":"Test that an invalid regexp makes module loading fail","message":"Test that an invalid regexp makes module loading fail\n","repos":"mlichvar\/augeas,manandbytes\/augeas,domcleal\/augeas,kunkku\/augeas,camptocamp\/augeas,mchf\/augeas,lutter\/augeas,jjlin\/augeas,kumy\/augeas,jjlin\/augeas,kumy\/augeas,domcleal\/augeas,hercules-team\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jasperla\/augeas,bkearney\/augeas,mlichvar\/augeas,hercules-team\/augeas,bkearney\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,raphink\/augeas,bkearney\/augeas,jasperla\/augeas,ptoscano\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,lutter\/augeas,raphink\/augeas,pevalme\/augeas,kunkku\/augeas,pevalme\/augeas,dafugg\/augeas,kunkku\/augeas,mchf\/augeas,bkearney\/augeas,ptoscano\/augeas,pevalme\/augeas,kumy\/augeas,jtopjian\/augeas,lutter\/augeas,camptocamp\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,mlichvar\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,kumy\/augeas,camptocamp\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas","old_file":"tests\/modules\/fail_regexp_range_end.aug","new_file":"tests\/modules\/fail_regexp_range_end.aug","new_contents":"module Fail_regexp_range_end =\n\n let lns = [ key \/[1-0]\/ ]\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/modules\/fail_regexp_range_end.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"e458a7688b8bd87fba39311b897c32bb1b04bf23","subject":"added augeas lenses for cgroups","message":"added augeas lenses for cgroups\n","repos":"ppp0\/puppet-packages,feedlabs\/puppet-packages,ppp0\/puppet-packages,zazabe\/puppet-packages,tomaszdurka\/puppet-packages,feedlabs\/puppet-packages,vrenetic\/puppet-packages,tomaszdurka\/puppet-packages,njam\/puppet-packages,zazabe\/puppet-packages,zazabe\/puppet-packages,feedlabs\/puppet-packages,vrenetic\/puppet-packages,njam\/puppet-packages,feedlabs\/puppet-packages,feedlabs\/puppet-packages,zazabe\/puppet-packages,cargomedia\/puppet-packages,vrenetic\/puppet-packages,zazabe\/puppet-packages,ppp0\/puppet-packages,njam\/puppet-packages,tomaszdurka\/puppet-packages,cargomedia\/puppet-packages,cargomedia\/puppet-packages,tomaszdurka\/puppet-packages,cargomedia\/puppet-packages,njam\/puppet-packages,tomaszdurka\/puppet-packages,tomaszdurka\/puppet-packages,vrenetic\/puppet-packages,njam\/puppet-packages,cargomedia\/puppet-packages,ppp0\/puppet-packages,vrenetic\/puppet-packages,ppp0\/puppet-packages,vrenetic\/puppet-packages","old_file":"modules\/cgroups\/files\/cgconfig.aug","new_file":"modules\/cgroups\/files\/cgconfig.aug","new_contents":"(*\nModule: cgconfig\n Parses \/etc\/cgconfig.conf\n\nAuthor:\n Ivana Hutarova Varekova <varekova@redhat.com>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Licence\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n * print all mounted cgroups\n print \/files\/etc\/cgconfig.conf\/mount\n\nAbout: Configuration files\n This lens applies to \/etc\/cgconfig.conf. See <filter>.\n *)\n\nmodule Cgconfig =\n autoload xfm\n\n let indent = Util.indent\n let eol = Util.eol\n let comment = Util.comment\n let empty = Util.empty\n let space = Sep.space\n\n let id = \/[a-zA-Z0-9_\\\/.-]+\/\n let name = \/[^#= \\n\\t{}\\\/]+\/\n let cont_name = \/(cpuacct|cpu|devices|ns|cpuset|memory|freezer|net_cls)\/\n let role_name = \/(admin|task)\/\n let id_name = \/(uid|gid)\/\n let address = \/[^#; \\n\\t{}]+\/\n\n let lbracket = del \/[ \\t\\n]*\\{\/ \" {\"\n let rbracket = del \/[ \\t]*\\}\/ \"}\"\n let eq = indent . Util.del_str \"=\" . indent\n\n(******************************************\n * Function to deal with abc=def; entries\n ******************************************)\n\n let key_value (key_rx:regexp) (val_rx:regexp) =\n [ indent . key key_rx . eq . store val_rx\n . indent . Util.del_str \";\" ]\n\n (* Function to deal with bracketted entries *)\n let brack_entry_base (lnsa:lens) (lnsb:lens) =\n [ indent . lnsa . lbracket . lnsb . rbracket ]\n\n let brack_entry_key (kw:regexp) (lns:lens) =\n let lnsa = key kw in\n brack_entry_base lnsa lns\n\n let brack_entry (kw:regexp) (lns:lens) =\n let full_lns = (lns | comment | empty)* in\n brack_entry_key kw full_lns\n\n(******************************************\n * control groups\n ******************************************)\n\n let permission_setting = key_value id_name address\n\n(* task setting *)\n let t_info = brack_entry \"task\" permission_setting\n\n(* admin setting *)\n let a_info = brack_entry \"admin\" permission_setting\n\n(* permissions setting *)\n let perm_info =\n let ce = (comment|empty)* in\n let perm_info_lns = ce .\n ((t_info . ce . (a_info . ce)?)\n |(a_info . ce . (t_info . ce)?))? in\n brack_entry_key \"perm\" perm_info_lns\n\n let variable_setting = key_value name address\n\n(* controllers setting *)\n let controller_info =\n let lnsa = label \"controller\" . store cont_name in\n let lnsb = ( variable_setting | comment | empty ) * in\n brack_entry_base lnsa lnsb\n\n(* group { ... } *)\n let group_data =\n let lnsa = key \"group\" . space . indent . store id in\n let lnsb = ( perm_info | controller_info | comment | empty )* in\n brack_entry_base lnsa lnsb\n\n\n(*************************************************\n * mount point\n *************************************************)\n\n(* controller = mount_point; *)\n let mount_point = key_value name address\n\n(* mount { .... } *)\n let mount_data = brack_entry \"mount\" mount_point\n\n\n(****************************************************\n * namespace\n ****************************************************)\n\n(* controller = cgroup; *)\n let namespace_instance = key_value name address\n\n\n(* namespace { .... } *)\n let namespace = brack_entry \"namespace\" namespace_instance\n\n let lns = ( comment | empty | mount_data | group_data | namespace )*\n\n let xfm = transform lns (incl \"\/etc\/cgconfig.conf\")\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'modules\/cgroups\/files\/cgconfig.aug' did not match any file(s) known to git\n","license":"mit","lang":"Augeas"} {"commit":"cb03702686f5e670f094de80141cad91d1b12317","subject":"A test for the del typecheck","message":"A test for the del typecheck\n","repos":"jasperla\/augeas,dafugg\/augeas,kumy\/augeas,camptocamp\/augeas,kumy\/augeas,camptocamp\/augeas,mlichvar\/augeas,pevalme\/augeas,lutter\/augeas,kumy\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,kumy\/augeas,bkearney\/augeas,bkearney\/augeas,hercules-team\/augeas,domcleal\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,jjlin\/augeas,manandbytes\/augeas,kunkku\/augeas,bkearney\/augeas,camptocamp\/augeas,dafugg\/augeas,mchf\/augeas,raphink\/augeas,raphink\/augeas,bkearney\/augeas,lutter\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,jtopjian\/augeas,ptoscano\/augeas,jjlin\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,pevalme\/augeas,kunkku\/augeas,camptocamp\/augeas,jtopjian\/augeas,jjlin\/augeas,dafugg\/augeas,domcleal\/augeas,kunkku\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,mchf\/augeas","old_file":"tests\/modules\/fail_del_default_check.aug","new_file":"tests\/modules\/fail_del_default_check.aug","new_contents":"module Fail_del_default_check =\n\n (* Not valid since the default value \"NO\" does not match \/[a-z]+\/ *)\n let lns = del \/[a-z]+\/ \"NO\"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/modules\/fail_del_default_check.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a0512d64cdf4fd4a920d4ad54674ce1da89b0503","subject":"Process lots of files in \/etc\/sysconfig","message":"Process lots of files in \/etc\/sysconfig\n\nLoad all those shell-script style config files from \/etc\/sysconfig using\nthe generic Shellvars lens.\n\nUltimately, it would be better if we definedfor each of them which\nvariables are actually going to be looked at (together with some\nrestrictions on possible values)\n","repos":"raphink\/augeas,bkearney\/augeas,jjlin\/augeas,domcleal\/augeas,jasperla\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,mchf\/augeas,camptocamp\/augeas,pevalme\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,manandbytes\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,camptocamp\/augeas,ptoscano\/augeas,jasperla\/augeas,domcleal\/augeas,camptocamp\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,kunkku\/augeas,jjlin\/augeas,kunkku\/augeas,jtopjian\/augeas,dafugg\/augeas,mchf\/augeas,bkearney\/augeas,bkearney\/augeas,lutter\/augeas,kumy\/augeas,mlichvar\/augeas,raphink\/augeas,pevalme\/augeas,hercules-team\/augeas,dafugg\/augeas,mlichvar\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,dafugg\/augeas,manandbytes\/augeas,kumy\/augeas,ptoscano\/augeas,hercules-team\/augeas,lutter\/augeas,mlichvar\/augeas,ptoscano\/augeas,jjlin\/augeas,kumy\/augeas,pevalme\/augeas","old_file":"lenses\/sysconfig.aug","new_file":"lenses\/sysconfig.aug","new_contents":"module Sysconfig =\n autoload xfm\n\n let sc_incl (n:string) = (incl (\"\/etc\/sysconfig\/\" . n))\n\n let filter = Util.stdexcl .\n sc_incl \"atd\" .\n sc_incl \"authconfig\" .\n sc_incl \"autofs\" .\n sc_incl \"clock\" .\n sc_incl \"cpuspeed\" .\n sc_incl \"crond\" .\n sc_incl \"crontab\" .\n sc_incl \"desktop\" .\n sc_incl \"firstboot\" .\n sc_incl \"grub\" .\n sc_incl \"hsqldb\" .\n sc_incl \"httpd\" .\n sc_incl \"i18n\" .\n sc_incl \"init\" .\n sc_incl \"iptables-config\" .\n sc_incl \"irda\" .\n sc_incl \"irqbalance\" .\n sc_incl \"kdump\" .\n sc_incl \"kernel\" .\n sc_incl \"keyboard\" .\n sc_incl \"kudzu\" .\n sc_incl \"libvirtd\" .\n sc_incl \"lircd\" .\n sc_incl \"nasd\" .\n sc_incl \"netconsole\" .\n sc_incl \"network\" .\n sc_incl \"nfs\" .\n sc_incl \"ntpd\" .\n sc_incl \"prelink\" .\n sc_incl \"readonly-root\" .\n sc_incl \"rsyslog\" .\n sc_incl \"samba\" .\n sc_incl \"saslauthd\" .\n sc_incl \"smartmontools\" .\n sc_incl \"spamassassin\" .\n sc_incl \"sysstat\" .\n sc_incl \"system-config-users\" .\n sc_incl \"vncservers\" .\n sc_incl \"wpa_supplicant\" .\n sc_incl \"xend\" .\n sc_incl \"xendomains\"\n\n let xfm = transform Shellvars.lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lenses\/sysconfig.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"3e32544854d6dcbea19ee4aff46b48f7201099d3","subject":"Process virtlockd.conf instead of libvirtd.conf","message":"Process virtlockd.conf instead of libvirtd.conf\n","repos":"nertpinx\/libvirt,fabianfreyer\/libvirt,crobinso\/libvirt,fabianfreyer\/libvirt,jfehlig\/libvirt,andreabolognani\/libvirt,zippy2\/libvirt,VenkatDatta\/libvirt,fabianfreyer\/libvirt,rlaager\/libvirt,libvirt\/libvirt,jardasgit\/libvirt,rlaager\/libvirt,VenkatDatta\/libvirt,zippy2\/libvirt,taget\/libvirt,eskultety\/libvirt,elmarco\/libvirt,rlaager\/libvirt,zhlcindy\/libvirt-1.1.4-maintain,jardasgit\/libvirt,shugaoye\/libvirt,crobinso\/libvirt,jfehlig\/libvirt,VenkatDatta\/libvirt,taget\/libvirt,elmarco\/libvirt,zhlcindy\/libvirt-1.1.4-maintain,taget\/libvirt,elmarco\/libvirt,cbosdo\/libvirt,jardasgit\/libvirt,nertpinx\/libvirt,jardasgit\/libvirt,nertpinx\/libvirt,zippy2\/libvirt,zhlcindy\/libvirt-1.1.4-maintain,fabianfreyer\/libvirt,eskultety\/libvirt,VenkatDatta\/libvirt,cbosdo\/libvirt,olafhering\/libvirt,eskultety\/libvirt,crobinso\/libvirt,libvirt\/libvirt,agx\/libvirt,agx\/libvirt,datto\/libvirt,zhlcindy\/libvirt-1.1.4-maintain,eskultety\/libvirt,jardasgit\/libvirt,libvirt\/libvirt,zippy2\/libvirt,olafhering\/libvirt,andreabolognani\/libvirt,rlaager\/libvirt,zhlcindy\/libvirt-1.1.4-maintain,andreabolognani\/libvirt,rlaager\/libvirt,fabianfreyer\/libvirt,cbosdo\/libvirt,datto\/libvirt,datto\/libvirt,agx\/libvirt,jfehlig\/libvirt,shugaoye\/libvirt,cbosdo\/libvirt,VenkatDatta\/libvirt,shugaoye\/libvirt,shugaoye\/libvirt,nertpinx\/libvirt,olafhering\/libvirt,shugaoye\/libvirt,datto\/libvirt,agx\/libvirt,elmarco\/libvirt,cbosdo\/libvirt,datto\/libvirt,taget\/libvirt,elmarco\/libvirt,jfehlig\/libvirt,libvirt\/libvirt,andreabolognani\/libvirt,agx\/libvirt,taget\/libvirt,nertpinx\/libvirt,crobinso\/libvirt,eskultety\/libvirt,andreabolognani\/libvirt,olafhering\/libvirt","old_file":"src\/locking\/virtlockd.aug","new_file":"src\/locking\/virtlockd.aug","new_contents":"(* \/etc\/libvirt\/virtlockd.conf *)\n\nmodule Virtlockd =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let logging_entry = int_entry \"log_level\"\n | str_entry \"log_filters\"\n | str_entry \"log_outputs\"\n | int_entry \"log_buffer_size\"\n | int_entry \"max_clients\"\n\n (* Each enty in the config is one of the following three ... *)\n let entry = logging_entry\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/virtlockd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* \/etc\/libvirt\/libvirtd.conf *)\n\nmodule Libvirtd =\n autoload xfm\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let value_sep = del \/[ \\t]*=[ \\t]*\/ \" = \"\n let indent = del \/[ \\t]*\/ \"\"\n\n let array_sep = del \/,[ \\t\\n]*\/ \", \"\n let array_start = del \/\\[[ \\t\\n]*\/ \"[ \"\n let array_end = del \/\\]\/ \"]\"\n\n let str_val = del \/\\\"\/ \"\\\"\" . store \/[^\\\"]*\/ . del \/\\\"\/ \"\\\"\"\n let bool_val = store \/0|1\/\n let int_val = store \/[0-9]+\/\n let str_array_element = [ seq \"el\" . str_val ] . del \/[ \\t\\n]*\/ \"\"\n let str_array_val = counter \"el\" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end\n\n let str_entry (kw:string) = [ key kw . value_sep . str_val ]\n let bool_entry (kw:string) = [ key kw . value_sep . bool_val ]\n let int_entry (kw:string) = [ key kw . value_sep . int_val ]\n let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]\n\n\n (* Config entry grouped by function - same order as example config *)\n let logging_entry = int_entry \"log_level\"\n | str_entry \"log_filters\"\n | str_entry \"log_outputs\"\n | int_entry \"log_buffer_size\"\n | int_entry \"max_clients\"\n\n (* Each enty in the config is one of the following three ... *)\n let entry = logging_entry\n let comment = [ label \"#comment\" . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . del \/\\n\/ \"\\n\" ]\n let empty = [ label \"#empty\" . eol ]\n\n let record = indent . entry . eol\n\n let lns = ( record | comment | empty ) *\n\n let filter = incl \"\/etc\/libvirt\/virtlockd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6a9469cd43c7d9c34c1c090ff63b0b80614fe954","subject":"Correctly set the module name, and let it actually test the Lightdm lens.","message":"Correctly set the module name, and let it actually test the Lightdm lens.\n","repos":"jtopjian\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,pevalme\/augeas,dafugg\/augeas,kumy\/augeas,lutter\/augeas,kunkku\/augeas,dafugg\/augeas,raphink\/augeas,ptoscano\/augeas,jasperla\/augeas,mlichvar\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,kunkku\/augeas,jjlin\/augeas,jjlin\/augeas,mchf\/augeas,mchf\/augeas,jasperla\/augeas,jtopjian\/augeas,raphink\/augeas,manandbytes\/augeas,kumy\/augeas,kunkku\/augeas,kumy\/augeas,lutter\/augeas,dafugg\/augeas,kumy\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,ptoscano\/augeas,hercules-team\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,lutter\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas","old_file":"lenses\/tests\/test_lightdm.aug","new_file":"lenses\/tests\/test_lightdm.aug","new_contents":"(* \nModule: Test_Lightdm\n Module to test Lightdm module for Augeas\n\nAuthor: David Salmen <dsalmen@dsalmen.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n*)\n\nmodule Test_lightdm =\n\n let conf_lightdm = \"\n[SeatDefaults]\ngreeter-session=unity-greeter\nuser-session=ubuntu\n\"\n\n test Lightdm.lns get conf_lightdm =\n {}\n { \"SeatDefaults\"\n { \"greeter-session\" = \"unity-greeter\" }\n { \"user-session\" = \"ubuntu\" }\n }\n\n test Lightdm.lns put conf_lightdm after\n set \"SeatDefaults\/allow-guest\" \"false\"\n = \"\n[SeatDefaults]\ngreeter-session=unity-greeter\nuser-session=ubuntu\nallow-guest=false\n\"\n\n test Lightdm.lns put conf_lightdm after\n set \"SeatDefaults\/allow-guest\" \"true\"\n = \"\n[SeatDefaults]\ngreeter-session=unity-greeter\nuser-session=ubuntu\nallow-guest=true\n\"\n\n let conf_unity_greeter = \"\n#\n# background = Background file to use, either an image path or a color (e.g. #772953)\n# logo = Logo file to use\n# theme-name = GTK+ theme to use\n# font-name = Font to use\n# xft-antialias = Whether to antialias Xft fonts (true or false)\n# xft-dpi = Resolution for Xft in dots per inch (e.g. 96)\n# xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)\n# xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)\n#\n[greeter]\nbackground=\/usr\/share\/backgrounds\/warty-final-ubuntu.png\nlogo=\/usr\/share\/unity-greeter\/logo.png\ntheme-name=Ambiance\nicon-theme-name=ubuntu-mono-dark\nfont-name=Ubuntu 11\nxft-antialias=true\nxft-dpi=96\nxft-hintstyle=hintslight\nxft-rgba=rgb\n\" \n\n test Lightdm.lns get conf_unity_greeter =\n {}\n { \"#comment\" }\n { \"#comment\" = \"background = Background file to use, either an image path or a color (e.g. #772953)\" }\n { \"#comment\" = \"logo = Logo file to use\" }\n { \"#comment\" = \"theme-name = GTK+ theme to use\" }\n { \"#comment\" = \"font-name = Font to use\" }\n { \"#comment\" = \"xft-antialias = Whether to antialias Xft fonts (true or false)\" }\n { \"#comment\" = \"xft-dpi = Resolution for Xft in dots per inch (e.g. 96)\" }\n { \"#comment\" = \"xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)\" }\n { \"#comment\" = \"xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)\" }\n { \"#comment\" }\n { \"greeter\"\n { \"background\" = \"\/usr\/share\/backgrounds\/warty-final-ubuntu.png\" }\n { \"logo\" = \"\/usr\/share\/unity-greeter\/logo.png\" }\n { \"theme-name\" = \"Ambiance\" }\n { \"icon-theme-name\" = \"ubuntu-mono-dark\" }\n { \"font-name\" = \"Ubuntu 11\" }\n { \"xft-antialias\" = \"true\" }\n { \"xft-dpi\" = \"96\" }\n { \"xft-hintstyle\" = \"hintslight\" }\n { \"xft-rgba\" = \"rgb\" }\n }\n\n let conf_users = \"\n#\n# User accounts configuration\n#\n# NOTE: If you have AccountsService installed on your system, then LightDM will\n# use this instead and these settings will be ignored\n#\n# minimum-uid = Minimum UID required to be shown in greeter\n# hidden-users = Users that are not shown to the user\n# hidden-shells = Shells that indicate a user cannot login\n#\n[UserAccounts]\nminimum-uid=500\nhidden-users=nobody nobody4 noaccess\nhidden-shells=\/bin\/false \/usr\/sbin\/nologin\n\"\n\n test Lightdm.lns get conf_users =\n {}\n { \"#comment\" }\n { \"#comment\" = \"User accounts configuration\" }\n { \"#comment\" }\n { \"#comment\" = \"NOTE: If you have AccountsService installed on your system, then LightDM will\" }\n { \"#comment\" = \"use this instead and these settings will be ignored\" }\n { \"#comment\" }\n { \"#comment\" = \"minimum-uid = Minimum UID required to be shown in greeter\" }\n { \"#comment\" = \"hidden-users = Users that are not shown to the user\" }\n { \"#comment\" = \"hidden-shells = Shells that indicate a user cannot login\" }\n { \"#comment\" }\n { \"UserAccounts\"\n { \"minimum-uid\" = \"500\" }\n { \"hidden-users\" = \"nobody nobody4 noaccess\" }\n { \"hidden-shells\" = \"\/bin\/false \/usr\/sbin\/nologin\" }\n }\n\n","old_contents":"(* \nModule: Test_Lightdm module to test Lightdm module for Augeas\n\nAuthor: David Salmen <dsalmen@dsalmen.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n*)\n\nmodule Test_lightdm =\n\n let conf_lightdm = \"\n[SeatDefaults]\ngreeter-session=unity-greeter\nuser-session=ubuntu\n\"\n\n test Puppet.lns get conf_lightdm =\n {}\n { \"SeatDefaults\"\n { \"greeter-session\" = \"unity-greeter\" }\n { \"user-session\" = \"ubuntu\" }\n }\n\n test Puppet.lns put conf_lightdm after\n set \"SeatDefaults\/allow-guest\" \"false\"\n = \"\n[SeatDefaults]\ngreeter-session=unity-greeter\nuser-session=ubuntu\nallow-guest=false\n\"\n\n test Puppet.lns put conf_lightdm after\n set \"SeatDefaults\/allow-guest\" \"true\"\n = \"\n[SeatDefaults]\ngreeter-session=unity-greeter\nuser-session=ubuntu\nallow-guest=true\n\"\n\n let conf_unity_greeter = \"\n#\n# background = Background file to use, either an image path or a color (e.g. #772953)\n# logo = Logo file to use\n# theme-name = GTK+ theme to use\n# font-name = Font to use\n# xft-antialias = Whether to antialias Xft fonts (true or false)\n# xft-dpi = Resolution for Xft in dots per inch (e.g. 96)\n# xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)\n# xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)\n#\n[greeter]\nbackground=\/usr\/share\/backgrounds\/warty-final-ubuntu.png\nlogo=\/usr\/share\/unity-greeter\/logo.png\ntheme-name=Ambiance\nicon-theme-name=ubuntu-mono-dark\nfont-name=Ubuntu 11\nxft-antialias=true\nxft-dpi=96\nxft-hintstyle=hintslight\nxft-rgba=rgb\n\" \n\n test Puppet.lns get conf_unity_greeter =\n {}\n { \"#comment\" }\n { \"#comment\" = \"background = Background file to use, either an image path or a color (e.g. #772953)\" }\n { \"#comment\" = \"logo = Logo file to use\" }\n { \"#comment\" = \"theme-name = GTK+ theme to use\" }\n { \"#comment\" = \"font-name = Font to use\" }\n { \"#comment\" = \"xft-antialias = Whether to antialias Xft fonts (true or false)\" }\n { \"#comment\" = \"xft-dpi = Resolution for Xft in dots per inch (e.g. 96)\" }\n { \"#comment\" = \"xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)\" }\n { \"#comment\" = \"xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)\" }\n { \"#comment\" }\n { \"greeter\"\n { \"background\" = \"\/usr\/share\/backgrounds\/warty-final-ubuntu.png\" }\n { \"logo\" = \"\/usr\/share\/unity-greeter\/logo.png\" }\n { \"theme-name\" = \"Ambiance\" }\n { \"icon-theme-name\" = \"ubuntu-mono-dark\" }\n { \"font-name\" = \"Ubuntu 11\" }\n { \"xft-antialias\" = \"true\" }\n { \"xft-dpi\" = \"96\" }\n { \"xft-hintstyle\" = \"hintslight\" }\n { \"xft-rgba\" = \"rgb\" }\n }\n\n let conf_users = \"\n#\n# User accounts configuration\n#\n# NOTE: If you have AccountsService installed on your system, then LightDM will\n# use this instead and these settings will be ignored\n#\n# minimum-uid = Minimum UID required to be shown in greeter\n# hidden-users = Users that are not shown to the user\n# hidden-shells = Shells that indicate a user cannot login\n#\n[UserAccounts]\nminimum-uid=500\nhidden-users=nobody nobody4 noaccess\nhidden-shells=\/bin\/false \/usr\/sbin\/nologin\n\"\n\n test Puppet.lns get conf_users =\n {}\n { \"#comment\" }\n { \"#comment\" = \"User accounts configuration\" }\n { \"#comment\" }\n { \"#comment\" = \"NOTE: If you have AccountsService installed on your system, then LightDM will\" }\n { \"#comment\" = \"use this instead and these settings will be ignored\" }\n { \"#comment\" }\n { \"#comment\" = \"minimum-uid = Minimum UID required to be shown in greeter\" }\n { \"#comment\" = \"hidden-users = Users that are not shown to the user\" }\n { \"#comment\" = \"hidden-shells = Shells that indicate a user cannot login\" }\n { \"#comment\" }\n { \"UserAccounts\"\n { \"minimum-uid\" = \"500\" }\n { \"hidden-users\" = \"nobody nobody4 noaccess\" }\n { \"hidden-shells\" = \"\/bin\/false \/usr\/sbin\/nologin\" }\n }\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"429dea7af9cda4d6f86c67c215bb01baccb62d98","subject":"* lenses\/tests\/test_iptables.aug: test that we accept blank lines","message":"* lenses\/tests\/test_iptables.aug: test that we accept blank lines\n","repos":"mlichvar\/augeas,pevalme\/augeas,jtopjian\/augeas,domcleal\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kumy\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,kumy\/augeas,raphink\/augeas,lutter\/augeas,domcleal\/augeas,dafugg\/augeas,mlichvar\/augeas,domcleal\/augeas,MikaelSmith\/augeas,mchf\/augeas,kumy\/augeas,hercules-team\/augeas,raphink\/augeas,ptoscano\/augeas,jasperla\/augeas,mchf\/augeas,kunkku\/augeas,manandbytes\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,jjlin\/augeas,mlichvar\/augeas,pevalme\/augeas,kunkku\/augeas,dafugg\/augeas,hercules-team\/augeas,jjlin\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,pevalme\/augeas,jjlin\/augeas,jasperla\/augeas,lutter\/augeas,kunkku\/augeas,ptoscano\/augeas","old_file":"lenses\/tests\/test_iptables.aug","new_file":"lenses\/tests\/test_iptables.aug","new_contents":"module Test_iptables =\n\nlet add_rule = Iptables.table_rule\nlet ipt_match = Iptables.ipt_match\n\ntest add_rule get\n\"-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT\\n\" =\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"ESTABLISHED,RELATED\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n\"-A INPUT -p icmp -j \\tACCEPT \\n\" =\n { \"append\" = \"INPUT\"\n { \"protocol\" = \"icmp\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n\"-A INPUT -i lo -j ACCEPT\\n\" =\n { \"append\" = \"INPUT\"\n { \"in-interface\" = \"lo\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest ipt_match get \" -m tcp -p tcp --dport 53\" =\n { \"match\" = \"tcp\" } { \"protocol\" = \"tcp\" } { \"dport\" = \"53\" }\n\nlet arule = \" -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT\"\n\ntest add_rule get (\"--append INPUT\" . arule . \"\\n\") =\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"NEW\" }\n { \"match\" = \"tcp\" }\n { \"protocol\" = \"tcp\" }\n { \"dport\" = \"53\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest ipt_match get arule =\n { \"match\" = \"state\" } { \"state\" = \"NEW\" } { \"match\" = \"tcp\" }\n { \"protocol\" = \"tcp\" } { \"dport\" = \"53\" } { \"jump\" = \"ACCEPT\" }\n\ntest ipt_match get (\"-A INPUT\" . arule) = *\n\ntest ipt_match get \" -p esp -j ACCEPT\" =\n { \"protocol\" = \"esp\" } { \"jump\" = \"ACCEPT\" }\n\ntest ipt_match get\n \" -m state --state NEW -m udp -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT\"\n =\n { \"match\" = \"state\" } { \"state\" = \"NEW\" } { \"match\" = \"udp\" }\n { \"protocol\" = \"udp\" } { \"dport\" = \"5353\" }\n { \"destination\" = \"224.0.0.251\" } { \"jump\" = \"ACCEPT\" }\n\ntest add_rule get\n \"-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT\\n\" =\n { \"insert\" = \"FORWARD\"\n { \"match\" = \"physdev\" } { \"physdev-is-bridged\" } { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n \"-A INPUT -j REJECT --reject-with icmp-host-prohibited\\n\" =\n { \"append\" = \"INPUT\"\n { \"jump\" = \"REJECT\" } { \"reject-with\" = \"icmp-host-prohibited\" } }\n\ntest add_rule get\n \"-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT\\n\" =\n { \"append\" = \"RH-Firewall-1-INPUT\"\n { \"protocol\" = \"icmp\" }\n { \"icmp-type\" = \"any\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest Iptables.table get \"*filter\n:RH-Firewall-1-INPUT - [0:0]\n-A FORWARD -j RH-Firewall-1-INPUT\n-A RH-Firewall-1-INPUT -i lo -j ACCEPT\nCOMMIT\\n\" =\n { \"table\" = \"filter\"\n { \"chain\" = \"RH-Firewall-1-INPUT\"\n { \"policy\" = \"-\" } }\n { \"append\" = \"FORWARD\"\n { \"jump\" = \"RH-Firewall-1-INPUT\" } }\n { \"append\" = \"RH-Firewall-1-INPUT\"\n { \"in-interface\" = \"lo\" }\n { \"jump\" = \"ACCEPT\" } } }\n\ntest Iptables.table get \"*filter\n\n:RH-Firewall-1-INPUT - [0:0]\n\n-A FORWARD -j RH-Firewall-1-INPUT\n\nCOMMIT\\n\" =\n { \"table\" = \"filter\"\n { }\n { \"chain\" = \"RH-Firewall-1-INPUT\"\n { \"policy\" = \"-\" } }\n { }\n { \"append\" = \"FORWARD\"\n { \"jump\" = \"RH-Firewall-1-INPUT\" } }\n { } }\n\nlet conf = \"# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*filter\n:INPUT DROP [1:229]\n:FORWARD DROP [0:0]\n:OUTPUT DROP [0:0]\n-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n-I FORWARD -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n# comments and blank lines are allow between rules\n\n-A FORWARD -i eth1 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT\n--append OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\n# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*mangle\n:PREROUTING ACCEPT [658:32445]\n\n:INPUT ACCEPT [658:32445]\n:FORWARD ACCEPT [0:0]\n:OUTPUT ACCEPT [891:68234]\n:POSTROUTING ACCEPT [891:68234]\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\n# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*nat\n:PREROUTING ACCEPT [1:229]\n:POSTROUTING ACCEPT [3:450]\n# The output chain\n:OUTPUT ACCEPT [3:450]\n# insert something\n--insert POSTROUTING -o eth0 -j SNAT --to-source 195.233.192.1 \\t\n# and now commit\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\\n\"\n\ntest Iptables.lns get conf =\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"filter\"\n { \"chain\" = \"INPUT\" { \"policy\" = \"DROP\" } }\n { \"chain\" = \"FORWARD\" { \"policy\" = \"DROP\" } }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"DROP\" } }\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n {}\n { \"insert\" = \"FORWARD\"\n { \"in-interface\" = \"eth0\" }\n { \"match\" = \"state\" }\n { \"state\" = \"RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n {}\n { \"#comment\" = \"comments and blank lines are allow between rules\" }\n {}\n { \"append\" = \"FORWARD\"\n { \"in-interface\" = \"eth1\" }\n { \"match\" = \"state\" }\n { \"state\" = \"NEW,RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n { \"append\" = \"OUTPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"NEW,RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"mangle\"\n { \"chain\" = \"PREROUTING\" { \"policy\" = \"ACCEPT\" } }\n {}\n { \"chain\" = \"INPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"FORWARD\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"POSTROUTING\" { \"policy\" = \"ACCEPT\" } } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"nat\"\n { \"chain\" = \"PREROUTING\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"POSTROUTING\" { \"policy\" = \"ACCEPT\" } }\n { \"#comment\" = \"The output chain\" }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"#comment\" = \"insert something\" }\n { \"insert\" = \"POSTROUTING\"\n { \"out-interface\" = \"eth0\" }\n { \"jump\" = \"SNAT\" }\n { \"to-source\" = \"195.233.192.1\" } }\n { \"#comment\" = \"and now commit\" } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n\ntest ipt_match get \" -m comment --comment \\\"A comment\\\"\" =\n { \"match\" = \"comment\" }\n { \"comment\" = \"\\\"A comment\\\"\" }\n\n(*\n * Test the various schemes for negation that iptables supports\n *\n * Note that the two ways in which a parameter can be negated lead to\n * two different trees that mean the same.\n *)\ntest add_rule get \"-I POSTROUTING ! -d 192.168.122.0\/24 -j MASQUERADE\\n\" =\n { \"insert\" = \"POSTROUTING\"\n { \"destination\" = \"192.168.122.0\/24\"\n { \"not\" } }\n { \"jump\" = \"MASQUERADE\" } }\n\ntest add_rule get \"-I POSTROUTING -d ! 192.168.122.0\/24 -j MASQUERADE\\n\" =\n { \"insert\" = \"POSTROUTING\"\n { \"destination\" = \"! 192.168.122.0\/24\" }\n { \"jump\" = \"MASQUERADE\" } }\n\ntest add_rule put \"-I POSTROUTING ! -d 192.168.122.0\/24 -j MASQUERADE\\n\"\n after rm \"\/insert\/destination\/not\" =\n \"-I POSTROUTING -d 192.168.122.0\/24 -j MASQUERADE\\n\"\n\n(* I have no idea if iptables will accept double negations, but we\n * allow it syntactically *)\ntest add_rule put \"-I POSTROUTING -d ! 192.168.122.0\/24 -j MASQUERADE\\n\"\n after clear \"\/insert\/destination\/not\" =\n \"-I POSTROUTING ! -d ! 192.168.122.0\/24 -j MASQUERADE\\n\"\n\ntest Iptables.chain get \":tcp_packets - [0:0]\n\" =\n { \"chain\" = \"tcp_packets\" { \"policy\" = \"-\" } }\n\n(* Bug #157 *)\ntest ipt_match get \" --tcp-flags SYN,RST,ACK,FIN SYN\" =\n { \"tcp-flags\"\n { \"mask\" = \"SYN\" }\n { \"mask\" = \"RST\" }\n { \"mask\" = \"ACK\" }\n { \"mask\" = \"FIN\" }\n { \"set\" = \"SYN\" } }\n\n(* Bug #224 *)\ntest ipt_match get \" --icmpv6-type neighbor-solicitation\" =\n { \"icmpv6-type\" = \"neighbor-solicitation\" }\n","old_contents":"module Test_iptables =\n\nlet add_rule = Iptables.table_rule\nlet ipt_match = Iptables.ipt_match\n\ntest add_rule get\n\"-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT\\n\" =\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"ESTABLISHED,RELATED\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n\"-A INPUT -p icmp -j \\tACCEPT \\n\" =\n { \"append\" = \"INPUT\"\n { \"protocol\" = \"icmp\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n\"-A INPUT -i lo -j ACCEPT\\n\" =\n { \"append\" = \"INPUT\"\n { \"in-interface\" = \"lo\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest ipt_match get \" -m tcp -p tcp --dport 53\" =\n { \"match\" = \"tcp\" } { \"protocol\" = \"tcp\" } { \"dport\" = \"53\" }\n\nlet arule = \" -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT\"\n\ntest add_rule get (\"--append INPUT\" . arule . \"\\n\") =\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"NEW\" }\n { \"match\" = \"tcp\" }\n { \"protocol\" = \"tcp\" }\n { \"dport\" = \"53\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest ipt_match get arule =\n { \"match\" = \"state\" } { \"state\" = \"NEW\" } { \"match\" = \"tcp\" }\n { \"protocol\" = \"tcp\" } { \"dport\" = \"53\" } { \"jump\" = \"ACCEPT\" }\n\ntest ipt_match get (\"-A INPUT\" . arule) = *\n\ntest ipt_match get \" -p esp -j ACCEPT\" =\n { \"protocol\" = \"esp\" } { \"jump\" = \"ACCEPT\" }\n\ntest ipt_match get\n \" -m state --state NEW -m udp -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT\"\n =\n { \"match\" = \"state\" } { \"state\" = \"NEW\" } { \"match\" = \"udp\" }\n { \"protocol\" = \"udp\" } { \"dport\" = \"5353\" }\n { \"destination\" = \"224.0.0.251\" } { \"jump\" = \"ACCEPT\" }\n\ntest add_rule get\n \"-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT\\n\" =\n { \"insert\" = \"FORWARD\"\n { \"match\" = \"physdev\" } { \"physdev-is-bridged\" } { \"jump\" = \"ACCEPT\" } }\n\ntest add_rule get\n \"-A INPUT -j REJECT --reject-with icmp-host-prohibited\\n\" =\n { \"append\" = \"INPUT\"\n { \"jump\" = \"REJECT\" } { \"reject-with\" = \"icmp-host-prohibited\" } }\n\ntest add_rule get\n \"-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT\\n\" =\n { \"append\" = \"RH-Firewall-1-INPUT\"\n { \"protocol\" = \"icmp\" }\n { \"icmp-type\" = \"any\" }\n { \"jump\" = \"ACCEPT\" } }\n\ntest Iptables.table get \"*filter\n:RH-Firewall-1-INPUT - [0:0]\n-A FORWARD -j RH-Firewall-1-INPUT\n-A RH-Firewall-1-INPUT -i lo -j ACCEPT\nCOMMIT\\n\" =\n { \"table\" = \"filter\"\n { \"chain\" = \"RH-Firewall-1-INPUT\"\n { \"policy\" = \"-\" } }\n { \"append\" = \"FORWARD\"\n { \"jump\" = \"RH-Firewall-1-INPUT\" } }\n { \"append\" = \"RH-Firewall-1-INPUT\"\n { \"in-interface\" = \"lo\" }\n { \"jump\" = \"ACCEPT\" } } }\n\nlet conf = \"# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*filter\n:INPUT DROP [1:229]\n:FORWARD DROP [0:0]\n:OUTPUT DROP [0:0]\n-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n-I FORWARD -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n# comments and blank lines are allow between rules\n\n-A FORWARD -i eth1 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT\n--append OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\n# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*mangle\n:PREROUTING ACCEPT [658:32445]\n\n:INPUT ACCEPT [658:32445]\n:FORWARD ACCEPT [0:0]\n:OUTPUT ACCEPT [891:68234]\n:POSTROUTING ACCEPT [891:68234]\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\n# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\n*nat\n:PREROUTING ACCEPT [1:229]\n:POSTROUTING ACCEPT [3:450]\n# The output chain\n:OUTPUT ACCEPT [3:450]\n# insert something\n--insert POSTROUTING -o eth0 -j SNAT --to-source 195.233.192.1 \\t\n# and now commit\nCOMMIT\n# Completed on Wed Apr 24 10:19:55 2002\\n\"\n\ntest Iptables.lns get conf =\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"filter\"\n { \"chain\" = \"INPUT\" { \"policy\" = \"DROP\" } }\n { \"chain\" = \"FORWARD\" { \"policy\" = \"DROP\" } }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"DROP\" } }\n { \"append\" = \"INPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n {}\n { \"insert\" = \"FORWARD\"\n { \"in-interface\" = \"eth0\" }\n { \"match\" = \"state\" }\n { \"state\" = \"RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n {}\n { \"#comment\" = \"comments and blank lines are allow between rules\" }\n {}\n { \"append\" = \"FORWARD\"\n { \"in-interface\" = \"eth1\" }\n { \"match\" = \"state\" }\n { \"state\" = \"NEW,RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } }\n { \"append\" = \"OUTPUT\"\n { \"match\" = \"state\" }\n { \"state\" = \"NEW,RELATED,ESTABLISHED\" }\n { \"jump\" = \"ACCEPT\" } } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"mangle\"\n { \"chain\" = \"PREROUTING\" { \"policy\" = \"ACCEPT\" } }\n {}\n { \"chain\" = \"INPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"FORWARD\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"POSTROUTING\" { \"policy\" = \"ACCEPT\" } } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n { \"#comment\" =\n \"Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002\" }\n { \"table\" = \"nat\"\n { \"chain\" = \"PREROUTING\" { \"policy\" = \"ACCEPT\" } }\n { \"chain\" = \"POSTROUTING\" { \"policy\" = \"ACCEPT\" } }\n { \"#comment\" = \"The output chain\" }\n { \"chain\" = \"OUTPUT\" { \"policy\" = \"ACCEPT\" } }\n { \"#comment\" = \"insert something\" }\n { \"insert\" = \"POSTROUTING\"\n { \"out-interface\" = \"eth0\" }\n { \"jump\" = \"SNAT\" }\n { \"to-source\" = \"195.233.192.1\" } }\n { \"#comment\" = \"and now commit\" } }\n { \"#comment\" = \"Completed on Wed Apr 24 10:19:55 2002\" }\n\ntest ipt_match get \" -m comment --comment \\\"A comment\\\"\" =\n { \"match\" = \"comment\" }\n { \"comment\" = \"\\\"A comment\\\"\" }\n\n(*\n * Test the various schemes for negation that iptables supports\n *\n * Note that the two ways in which a parameter can be negated lead to\n * two different trees that mean the same.\n *)\ntest add_rule get \"-I POSTROUTING ! -d 192.168.122.0\/24 -j MASQUERADE\\n\" =\n { \"insert\" = \"POSTROUTING\"\n { \"destination\" = \"192.168.122.0\/24\"\n { \"not\" } }\n { \"jump\" = \"MASQUERADE\" } }\n\ntest add_rule get \"-I POSTROUTING -d ! 192.168.122.0\/24 -j MASQUERADE\\n\" =\n { \"insert\" = \"POSTROUTING\"\n { \"destination\" = \"! 192.168.122.0\/24\" }\n { \"jump\" = \"MASQUERADE\" } }\n\ntest add_rule put \"-I POSTROUTING ! -d 192.168.122.0\/24 -j MASQUERADE\\n\"\n after rm \"\/insert\/destination\/not\" =\n \"-I POSTROUTING -d 192.168.122.0\/24 -j MASQUERADE\\n\"\n\n(* I have no idea if iptables will accept double negations, but we\n * allow it syntactically *)\ntest add_rule put \"-I POSTROUTING -d ! 192.168.122.0\/24 -j MASQUERADE\\n\"\n after clear \"\/insert\/destination\/not\" =\n \"-I POSTROUTING ! -d ! 192.168.122.0\/24 -j MASQUERADE\\n\"\n\ntest Iptables.chain get \":tcp_packets - [0:0]\n\" =\n { \"chain\" = \"tcp_packets\" { \"policy\" = \"-\" } }\n\n(* Bug #157 *)\ntest ipt_match get \" --tcp-flags SYN,RST,ACK,FIN SYN\" =\n { \"tcp-flags\"\n { \"mask\" = \"SYN\" }\n { \"mask\" = \"RST\" }\n { \"mask\" = \"ACK\" }\n { \"mask\" = \"FIN\" }\n { \"set\" = \"SYN\" } }\n\n(* Bug #224 *)\ntest ipt_match get \" --icmpv6-type neighbor-solicitation\" =\n { \"icmpv6-type\" = \"neighbor-solicitation\" }\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"36790ba70becfa55f5bec1e203b865358ac94dc0","subject":"Limits (filter): no need to exclude anything","message":"Limits (filter): no need to exclude anything\n","repos":"bkearney\/augeas,camptocamp\/augeas,jasperla\/augeas,manandbytes\/augeas,dafugg\/augeas,kunkku\/augeas,MikaelSmith\/augeas,kumy\/augeas,lutter\/augeas,pevalme\/augeas,jtopjian\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas,domcleal\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,kumy\/augeas,jasperla\/augeas,bkearney\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,manandbytes\/augeas,domcleal\/augeas,bkearney\/augeas,lutter\/augeas,bkearney\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kunkku\/augeas,mchf\/augeas,pevalme\/augeas,raphink\/augeas,jjlin\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,ptoscano\/augeas,mlichvar\/augeas,dafugg\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,camptocamp\/augeas,raphink\/augeas,mchf\/augeas,jjlin\/augeas,camptocamp\/augeas","old_file":"lenses\/limits.aug","new_file":"lenses\/limits.aug","new_contents":"(* Limits module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: \/etc\/security\/limits.conf\n\n*)\n\nmodule Limits =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet domain = label \"domain\" . store \/[%@]?[A-Za-z0-9_.-]+|\\*\/\n\nlet type_re = \"soft\"\n | \"hard\"\n | \"-\"\nlet type = [ label \"type\" . store type_re ]\n\nlet item_re = \"core\"\n | \"data\"\n | \"fsize\"\n | \"memlock\"\n | \"nofile\"\n | \"rss\"\n | \"stack\"\n | \"cpu\"\n | \"nproc\"\n | \"as\"\n | \"maxlogins\"\n | \"maxsyslogins\"\n | \"priority\"\n | \"locks\"\n | \"sigpending\"\n | \"msgqueue\"\n | \"nice\"\n | \"rtprio\"\n | \"chroot\"\nlet item = [ label \"item\" . store item_re ]\n\nlet value = [ label \"value\" . store \/[A-Za-z0-9_.\\\/-]+\/ ]\nlet entry = [ domain . spc\n . type . spc\n . item . spc\n . value . eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter = incl \"\/etc\/security\/limits.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Limits module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: \/etc\/security\/limits.conf\n\n*)\n\nmodule Limits =\n\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\nlet comment = Util.comment\nlet empty = Util.empty\n\nlet sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n\n(************************************************************************\n * ENTRIES\n *************************************************************************)\n\nlet domain = label \"domain\" . store \/[%@]?[A-Za-z0-9_.-]+|\\*\/\n\nlet type_re = \"soft\"\n | \"hard\"\n | \"-\"\nlet type = [ label \"type\" . store type_re ]\n\nlet item_re = \"core\"\n | \"data\"\n | \"fsize\"\n | \"memlock\"\n | \"nofile\"\n | \"rss\"\n | \"stack\"\n | \"cpu\"\n | \"nproc\"\n | \"as\"\n | \"maxlogins\"\n | \"maxsyslogins\"\n | \"priority\"\n | \"locks\"\n | \"sigpending\"\n | \"msgqueue\"\n | \"nice\"\n | \"rtprio\"\n | \"chroot\"\nlet item = [ label \"item\" . store item_re ]\n\nlet value = [ label \"value\" . store \/[A-Za-z0-9_.\\\/-]+\/ ]\nlet entry = [ domain . spc\n . type . spc\n . item . spc\n . value . eol ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = (comment|empty|entry) *\n\nlet filter\n = incl \"\/etc\/security\/limits.conf\"\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"7443fdca495981873fc8b083c92ff47648adb00a","subject":"Exports: Do not use Hosts lenses","message":"Exports: Do not use Hosts lenses\n","repos":"GeoffWilliams\/augeas,jtopjian\/augeas,dafugg\/augeas,jjlin\/augeas,lutter\/augeas,mlichvar\/augeas,kunkku\/augeas,raphink\/augeas,pevalme\/augeas,pevalme\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,hercules-team\/augeas,ptoscano\/augeas,kunkku\/augeas,lutter\/augeas,dafugg\/augeas,hercules-team\/augeas,manandbytes\/augeas,jasperla\/augeas,dafugg\/augeas,MikaelSmith\/augeas,manandbytes\/augeas,raphink\/augeas,lutter\/augeas,jtopjian\/augeas,pevalme\/augeas,mchf\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,jjlin\/augeas,mlichvar\/augeas,ptoscano\/augeas,jasperla\/augeas,mchf\/augeas,kunkku\/augeas","old_file":"lenses\/exports.aug","new_file":"lenses\/exports.aug","new_contents":"(* Lens for Linux syntax of NFS exports(5) *)\n\n(*\nModule: Exports\n Parses \/etc\/exports\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: Description\n \/etc\/exports contains lines associating a directory with one or\n more hosts, and NFS options for each host.\n\nAbout: Usage Example\n\n(start code)\n\n $ augtool\n augtool> ls \/files\/etc\/exports\/\n comment[1] = \/etc\/exports: the access control list for filesystems which may be exported\n comment[2] = to NFS clients. See exports(5).\n comment[3] = sample \/etc\/exports file\n dir[1]\/ = \/\n dir[2]\/ = \/projects\n dir[3]\/ = \/usr\n dir[4]\/ = \/home\/joe\n\n\n augtool> ls \/files\/etc\/exports\/dir[1]\n client[1]\/ = master\n client[2]\/ = trusty\n(end code)\n\nThe corresponding line in the file is:\n\n(start code)\n\t\/ master(rw) trusty(rw,no_root_squash)\n(end code)\n\n Digging further:\n\n(start code)\n augtool> ls \/files\/etc\/exports\/dir[1]\/client[1]\n option = rw\n\n To add a new entry, you'd do something like this:\n(end code)\n\n(start code)\n augtool> set \/files\/etc\/exports\/dir[10000] \/foo\n augtool> set \/files\/etc\/exports\/dir[last()]\/client[1] weeble\n augtool> set \/files\/etc\/exports\/dir[last()]\/client[1]\/option[1] ro\n augtool> set \/files\/etc\/exports\/dir[last()]\/client[1]\/option[2] all_squash\n augtool> save\n Saved 1 file(s)\n(end code)\n\n Which creates the line:\n\n(start code)\n \/foo weeble(ro,all_squash)\n(end code)\n\nAbout: Limitations\n This lens cannot handle options without a host, as with the last\n example line in \"man 5 exports\":\n\n\t\/pub (ro,insecure,all_squash)\n\n In this case, though, you can just do:\n\n\t\/pub *(ro,insecure,all_squash)\n\n It also can't handle whitespace before the directory name.\n*)\n\nmodule Exports =\n autoload xfm\n\n let client_re = \/[a-zA-Z0-9.@*?\\\/:-]+\/\n\n let eol = Util.eol\n let lbracket = Util.del_str \"(\"\n let rbracket = Util.del_str \")\"\n let sep_com = Sep.comma\n let sep_spc = Sep.space\n\n let option = [ label \"option\" . store \/[^,)]*\/ ]\n\n let client = [ label \"client\" . store client_re .\n ( Build.brackets lbracket rbracket\n ( Build.opt_list option sep_com ) )? ]\n\n let entry = [ label \"dir\" . store \/\\\/[^ \\t]*\/\n . sep_spc . Build.opt_list client sep_spc . eol ]\n\n let lns = (Util.empty | Util.comment | entry)*\n\n let xfm = transform lns (incl \"\/etc\/exports\")\n","old_contents":"(* Lens for Linux syntax of NFS exports(5) *)\n\n(*\nModule: Exports\n Parses \/etc\/exports\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: Description\n \/etc\/exports contains lines associating a directory with one or\n more hosts, and NFS options for each host.\n\nAbout: Usage Example\n\n(start code)\n\n $ augtool\n augtool> ls \/files\/etc\/exports\/\n comment[1] = \/etc\/exports: the access control list for filesystems which may be exported\n comment[2] = to NFS clients. See exports(5).\n comment[3] = sample \/etc\/exports file\n dir[1]\/ = \/\n dir[2]\/ = \/projects\n dir[3]\/ = \/usr\n dir[4]\/ = \/home\/joe\n\n\n augtool> ls \/files\/etc\/exports\/dir[1]\n client[1]\/ = master\n client[2]\/ = trusty\n(end code)\n\nThe corresponding line in the file is:\n\n(start code)\n\t\/ master(rw) trusty(rw,no_root_squash)\n(end code)\n\n Digging further:\n\n(start code)\n augtool> ls \/files\/etc\/exports\/dir[1]\/client[1]\n option = rw\n\n To add a new entry, you'd do something like this:\n(end code)\n\n(start code)\n augtool> set \/files\/etc\/exports\/dir[10000] \/foo\n augtool> set \/files\/etc\/exports\/dir[last()]\/client[1] weeble\n augtool> set \/files\/etc\/exports\/dir[last()]\/client[1]\/option[1] ro\n augtool> set \/files\/etc\/exports\/dir[last()]\/client[1]\/option[2] all_squash\n augtool> save\n Saved 1 file(s)\n(end code)\n\n Which creates the line:\n\n(start code)\n \/foo weeble(ro,all_squash)\n(end code)\n\nAbout: Limitations\n This lens cannot handle options without a host, as with the last\n example line in \"man 5 exports\":\n\n\t\/pub (ro,insecure,all_squash)\n\n In this case, though, you can just do:\n\n\t\/pub *(ro,insecure,all_squash)\n\n It also can't handle whitespace before the directory name.\n*)\n\nmodule Exports =\n autoload xfm\n\n let client_re = \/[a-zA-Z0-9.@*?\\\/:-]+\/\n\n let eol = Util.eol\n let lbracket = Util.del_str \"(\"\n let rbracket = Util.del_str \")\"\n let sep_com = Sep.comma\n let sep_spc = Sep.space\n\n let option = [ label \"option\" . store \/[^,)]*\/ ]\n\n let client = [ label \"client\" . store client_re .\n ( Build.brackets lbracket rbracket\n ( Build.opt_list option sep_com ) )? ]\n\n let entry = [ label \"dir\" . store \/\\\/[^ \\t]*\/\n . sep_spc . Build.opt_list client sep_spc . eol ]\n\n let lns = (Hosts.empty | Hosts.comment | entry)*\n\n let xfm = transform lns (incl \"\/etc\/exports\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"796521dc75004f0f3fbeb552f3b3f23db0dc8a2f","subject":"backport fix ae9dd6, remove after 0.5.1 release","message":"backport fix ae9dd6, remove after 0.5.1 release\n","repos":"leapcode\/puppet_augeas,apa-it\/puppet-augeas,jordiclariana\/puppet-augeas,SUNET\/puppet-augeas,camptocamp\/puppet-augeas","old_file":"files\/vsftpd.aug","new_file":"files\/vsftpd.aug","new_contents":"(* Parse vsftpd.conf *)\nmodule Vsftpd =\n autoload xfm\n\n(* The code in parseconf.c does not seem to allow for trailing whitespace *)\n(* in the config file *)\nlet eol = Util.del_str \"\\n\"\nlet empty = Util.empty\nlet comment = Util.comment\n\nlet bool_option_re = \/anonymous_enable|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert\/\n\nlet uint_option_re = \/accept_timeout|connect_timeout|local_umask|anon_umask|ftp_data_port|idle_session_timeout|data_connection_timeout|pasv_min_port|pasv_max_port|anon_max_rate|local_max_rate|listen_port|max_clients|file_open_mode|max_per_ip|trans_chunk_size|delay_failed_login|delay_successful_login|max_login_fails|chown_upload_mode\/\n\nlet str_option_re = \/secure_chroot_dir|ftp_username|chown_username|xferlog_file|vsftpd_log_file|message_file|nopriv_user|ftpd_banner|banned_email_file|chroot_list_file|pam_service_name|guest_username|userlist_file|anon_root|local_root|banner_file|pasv_address|listen_address|user_config_dir|listen_address6|cmds_allowed|hide_file|deny_file|user_sub_token|email_password_file|rsa_cert_file|dsa_cert_file|ssl_ciphers|rsa_private_key_file|dsa_private_key_file|ca_certs_file\/\n\nlet bool_value_re = \/[yY][eE][sS]|[tT][rR][uU][eE]|1|[nN][oO]|[fF][aA][lL][sS][eE]|0\/\n\nlet option (k:regexp) (v:regexp) = [ key k . Util.del_str \"=\" . store v . eol ]\n\nlet bool_option = option bool_option_re bool_value_re\n\nlet str_option = option str_option_re \/[^\\n]+\/\n\nlet uint_option = option uint_option_re \/[0-9]+\/\n\nlet lns = (bool_option|str_option|uint_option|comment|empty)*\n\nlet filter = (incl \"\/etc\/vsftpd.conf\") . (incl \"\/etc\/vsftpd\/vsftpd.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/vsftpd.aug' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Augeas"} {"commit":"7f5e97ccd6f4b526d215fc7169098f70c15317f6","subject":"Inittab: clean up formatting some","message":"Inittab: clean up formatting some\n","repos":"domcleal\/augeas,kumy\/augeas,bkearney\/augeas,domcleal\/augeas,kumy\/augeas,pevalme\/augeas,MikaelSmith\/augeas,lutter\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,lutter\/augeas,raphink\/augeas,jjlin\/augeas,mchf\/augeas,hercules-team\/augeas,kunkku\/augeas,kunkku\/augeas,jtopjian\/augeas,ptoscano\/augeas,dafugg\/augeas,bkearney\/augeas,jasperla\/augeas,jjlin\/augeas,dafugg\/augeas,mlichvar\/augeas,jjlin\/augeas,manandbytes\/augeas,bkearney\/augeas,hercules-team\/augeas,kumy\/augeas,mlichvar\/augeas,ptoscano\/augeas,domcleal\/augeas,pevalme\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,pevalme\/augeas,kunkku\/augeas,jasperla\/augeas,kumy\/augeas,mlichvar\/augeas,lutter\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,bkearney\/augeas","old_file":"lenses\/inittab.aug","new_file":"lenses\/inittab.aug","new_contents":"(* Parsing \/etc\/inittab *)\nmodule Inittab =\n autoload xfm\n\n let sep = Util.del_str \":\"\n let eol = Util.del_str \"\\n\"\n\n let id = \/[^\\\/#:\\n]{1,4}\/\n let value = \/[^#:\\n]*\/\n\n let comment = Util.comment|Util.empty\n\n let record =\n let field (name:string) = [ label name . store value ] in\n [ key id . sep .\n field \"runlevels\" . sep .\n field \"action\" . sep .\n field \"process\" . eol ]\n\n let lns = ( comment | record ) *\n\n let xfm = transform lns (incl \"\/etc\/inittab\")\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing \/etc\/inittab *)\nmodule Inittab =\n autoload xfm\n\n let sep = Util.del_str \":\"\n let eol = Util.del_str \"\\n\"\n\n let id = \/[^\\\/#:\\n]{1,4}\/\n let value = \/[^#:\\n]*\/\n\n let comment = Util.comment|Util.empty\n\n let field (name:string) = [ label name . store value ]\n let record = [ key id . sep .\n field(\"runlevels\") . sep .\n field(\"action\") . sep .\n field(\"process\") .\n eol\n ]\n\n let lns = ( comment | record ) *\n\n let xfm = transform lns (incl \"\/etc\/inittab\")\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b014b72940a6b071d51fe9a080fbd7079d1d688e","subject":"Use regexp union instead of lens union in dput.aug","message":"Use regexp union instead of lens union in dput.aug\n\nUsing a union of regexps is much faster than a union of lenses, since the\nregular expressions that are constructed internally are much simpler.\n","repos":"raphink\/augeas,jtopjian\/augeas,jasperla\/augeas,camptocamp\/augeas,bkearney\/augeas,ptoscano\/augeas,pevalme\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,camptocamp\/augeas,lutter\/augeas,pevalme\/augeas,kunkku\/augeas,camptocamp\/augeas,raphink\/augeas,dafugg\/augeas,kumy\/augeas,kumy\/augeas,mchf\/augeas,jjlin\/augeas,camptocamp\/augeas,lutter\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,jasperla\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,bkearney\/augeas,dafugg\/augeas,mlichvar\/augeas,ptoscano\/augeas,kumy\/augeas,kunkku\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,kunkku\/augeas,domcleal\/augeas,bkearney\/augeas,lutter\/augeas,jjlin\/augeas,dafugg\/augeas,manandbytes\/augeas,manandbytes\/augeas,mchf\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,GeoffWilliams\/augeas,domcleal\/augeas,ptoscano\/augeas,jtopjian\/augeas,bkearney\/augeas,pevalme\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/dput.aug","new_file":"lenses\/dput.aug","new_contents":"(* Dput module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\n\nmodule Dput =\n autoload xfm\n\n let setting = \"allow_non-us_software\"\n | \"allow_unsigned_uploads\"\n | \"check_version\"\n | \"default_host_main\"\n | \"default_host_non-us\"\n | \"fqdn\"\n | \"hash\"\n | \"incoming\"\n | \"login\"\n | \"method\"\n | \"passive_ftp\"\n | \"post_upload_command\"\n | \"pre_upload_command\"\n | \"progress_indicator\"\n | \"run_dinstall\"\n | \"run_lintian\"\n | \"scp_compress\"\n\t\t| \"ssh_config_options\"\n\t\n let entry = IniFile.entry setting\n\n let record = IniFile.record \"target\" entry\n\n let lns = IniFile.lns record\n\n let filter = (incl \"\/etc\/dput.cf\")\n . (incl \"~\/.dput.cf\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n","old_contents":"(* Dput module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\n\nmodule Dput =\n autoload xfm\n\n let setting = IniFile.entry \"allow_non-us_software\"\n | IniFile.entry \"allow_unsigned_uploads\"\n | IniFile.entry \"check_version\"\n | IniFile.entry \"default_host_main\"\n | IniFile.entry \"default_host_non-us\"\n | IniFile.entry \"fqdn\"\n | IniFile.entry \"hash\"\n | IniFile.entry \"incoming\"\n | IniFile.entry \"login\"\n | IniFile.entry \"method\"\n | IniFile.entry \"passive_ftp\"\n | IniFile.entry \"post_upload_command\"\n | IniFile.entry \"pre_upload_command\"\n | IniFile.entry \"progress_indicator\"\n | IniFile.entry \"run_dinstall\"\n | IniFile.entry \"run_lintian\"\n | IniFile.entry \"scp_compress\"\n\t\t| IniFile.entry \"ssh_config_options\"\n\n let record = IniFile.record \"target\" setting\n\n let lns = IniFile.lns record\n\n let filter = (incl \"\/etc\/dput.cf\")\n . (incl \"~\/.dput.cf\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6f6d2687d400662f2c8fd67fa0439d2c2fd99f3d","subject":"Remove trailing whitespaces in util.aug","message":"Remove trailing whitespaces in util.aug\n","repos":"kumy\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jjlin\/augeas,lutter\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,mlichvar\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,dafugg\/augeas,kumy\/augeas,mlichvar\/augeas,kunkku\/augeas,kumy\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,manandbytes\/augeas,hercules-team\/augeas,pevalme\/augeas,jjlin\/augeas,mchf\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,raphink\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,dafugg\/augeas,lutter\/augeas,jasperla\/augeas,mchf\/augeas,domcleal\/augeas,jtopjian\/augeas,domcleal\/augeas,jasperla\/augeas,domcleal\/augeas,MikaelSmith\/augeas,jjlin\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,kumy\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol> *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*#?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline =\n let mline_re = (\/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\"\n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*[ \\t\\n]*\/ \"\/*\\n\"\n . counter \"mline\"\n . (mline . (eol . mline)*)\n . del \/[ \\t\\n]*\\*\\\/[ \\t]*\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style =\n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) =\n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style =\n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(*\nModule: Util\n Generic module providing useful primitives\n\nAuthor: David Lutterkort\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n*)\n\n\nmodule Util =\n\n\n(*\nVariable: del_str\n Delete a string and default to it\n\n Parameters:\n s:string - the string to delete and default to\n*)\n let del_str (s:string) = del s s\n\n(*\nVariable: del_ws\n Delete mandatory whitespace\n*)\n let del_ws = del \/[ \\t]+\/\n\n(*\nVariable: del_ws_spc\n Delete mandatory whitespace, default to single space\n*)\n let del_ws_spc = del_ws \" \"\n\n(*\nVariable: del_ws_tab\n Delete mandatory whitespace, default to single tab\n*)\n let del_ws_tab = del_ws \"\\t\"\n\n\n(*\nVariable: del_opt_ws\n Delete optional whitespace\n*)\n let del_opt_ws = del \/[ \\t]*\/\n\n\n(*\nVariable: eol\n Delete end of line, including optional trailing whitespace\n*)\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(*\nVariable: indent\n Delete indentation, including leading whitespace\n*)\n let indent = del \/[ \\t]*\/ \"\"\n\n(* Group: Comment\n This is a general definition of comment\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are\n ignored together with empty lines\n\nView: comment_generic\n Map comments and set default comment sign\n*)\n\n let comment_generic (r:regexp) (d:string) =\n [ label \"#comment\" . del r d\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n(* View: comment\n Map comments into \"#comment\" nodes\n*)\n let comment = comment_generic \/[ \\t]*#[ \\t]*\/ \"# \"\n\n(* View: comment_eol\n Map eol comments into \"#comment\" nodes\n Add a space before # for end of line comments\n*)\n let comment_eol = comment_generic \/[ \\t]*#[ \\t]*\/ \" # \"\n\n(* View: comment_or_eol\n A <comment_eol> or <eol> *)\n let comment_or_eol = comment_eol | (del \/[ \\t]*#?\\n\/ \"\\n\")\n\n(* View: comment_multiline\n A C-style multiline comment *)\n let comment_multiline = \n let mline_re = (\/[^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n]\/ - \/.*\\*\\\/.*\/) in\n let mline = [ seq \"mline\" \n . store mline_re ] in\n [ label \"#mcomment\" . del \/[ \\t]*\\\/\\*[ \\t\\n]*\/ \"\/*\\n\"\n . counter \"mline\"\n . (mline . (eol . mline)*)\n . del \/[ \\t\\n]*\\*\\\/[ \\t]*\\n\/ \"\\n*\/\\n\" ]\n\n(* View: comment_c_style\n A comment line, C-style *)\n let comment_c_style = \n comment_generic \/[ \\t]*\\\/\\\/[ \\t]*\/ \"\/\/ \"\n\n(* View: empty_generic\n A generic definition of <empty>\n Map empty lines, including empty comments *)\n let empty_generic (r:regexp) = \n [ del r \"\" . del_str \"\\n\" ]\n\n(* View: empty\n Map empty lines, including empty comments *)\n let empty = empty_generic \/[ \\t]*#?[ \\t]*\/\n\n(* View: empty_c_style\n Map empty lines, including C-style empty comment *)\n let empty_c_style = \n empty_generic \/[ \\t]*((\\\/\\\/)|(\\\/\\*[ \\t]*\\*\\\/))?[ \\t]*\/\n\n\n(* View: Split *)\n(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n(* appears in a separate subtree. The labels for the subtrees are *)\n(* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n(* Group: Exclusions\n\nVariable: stdexcl\n Exclusion for files that are commonly not wanted\/needed\n*)\n let stdexcl = (excl \"*~\") .\n (excl \"*.rpmnew\") .\n (excl \"*.rpmsave\") .\n (excl \"*.dpkg-old\") .\n (excl \"*.dpkg-new\") .\n (excl \"*.dpkg-bak\") .\n (excl \"*.dpkg-dist\") .\n (excl \"*.augsave\") .\n (excl \"*.augnew\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"4a144018fd2ec1fd9bef670e1081a4deb88bb90f","subject":"Add test for radicale lens","message":"Add test for radicale lens\n","repos":"kunkku\/augeas,ptoscano\/augeas,lutter\/augeas,kunkku\/augeas,hercules-team\/augeas,pevalme\/augeas,hercules-team\/augeas,mlichvar\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,manandbytes\/augeas,mlichvar\/augeas,lutter\/augeas,mchf\/augeas,manandbytes\/augeas,lutter\/augeas,pevalme\/augeas,mchf\/augeas","old_file":"lenses\/tests\/test_radicale.aug","new_file":"lenses\/tests\/test_radicale.aug","new_contents":"module Test_radicale =\n\n let conf = \"\n[server]\n\n[encoding]\n\n[well-known]\n\n[auth]\n\n[git]\n\n[rights]\n\n[storage]\n\n[logging]\n\n[headers]\n\n\"\n\n test Radicale.lns get conf =\n {}\n { \"server\"\n {} }\n { \"encoding\"\n {} }\n { \"well-known\"\n {} }\n { \"auth\"\n {} }\n { \"git\"\n {} }\n { \"rights\"\n {} }\n { \"storage\"\n {} }\n { \"logging\"\n {} }\n { \"headers\"\n {} }\n\n test Radicale.lns put conf after\n set \"server\/hosts\" \"127.0.0.1:5232, [::1]:5232\";\n set \"server\/base_prefix\" \"\/radicale\/\";\n set \"well-known\/caldav\" \"\/radicale\/%(user)s\/caldav\/\";\n set \"well-known\/cardav\" \"\/radicale\/%(user)s\/carddav\/\";\n set \"auth\/type\" \"remote_user\";\n set \"rights\/type\" \"owner_only\"\n = \"\n[server]\n\nhosts=127.0.0.1:5232, [::1]:5232\nbase_prefix=\/radicale\/\n[encoding]\n\n[well-known]\n\ncaldav=\/radicale\/%(user)s\/caldav\/\ncardav=\/radicale\/%(user)s\/carddav\/\n[auth]\n\ntype=remote_user\n[git]\n\n[rights]\n\ntype=owner_only\n[storage]\n\n[logging]\n\n[headers]\n\n\"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lenses\/tests\/test_radicale.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"920c32139ae5e8523542ae145e0a06b3990fd8e8","subject":"Use Cron.shellvar in anacron.aug","message":"Use Cron.shellvar in anacron.aug\n","repos":"pevalme\/augeas,domcleal\/augeas,raphink\/augeas,kunkku\/augeas,dafugg\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,pevalme\/augeas,jjlin\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,kumy\/augeas,dafugg\/augeas,mchf\/augeas,dafugg\/augeas,jjlin\/augeas,manandbytes\/augeas,lutter\/augeas,jasperla\/augeas,mlichvar\/augeas,domcleal\/augeas,mlichvar\/augeas,kumy\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kunkku\/augeas,kumy\/augeas,ptoscano\/augeas,jtopjian\/augeas,kumy\/augeas,raphink\/augeas,jjlin\/augeas,mchf\/augeas,hercules-team\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,manandbytes\/augeas,MikaelSmith\/augeas","old_file":"lenses\/anacron.aug","new_file":"lenses\/anacron.aug","new_contents":"(*\nModule: Anacron\n Parses \/etc\/anacrontab\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 anacrontab` where\n possible.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/anacrontab. See <filter>.\n\nAbout: Examples\n The <Test_Anacron> file contains various examples and tests.\n*)\n\nmodule Anacron =\n autoload xfm\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar = Cron.shellvar\n\n\n(* View: period *)\nlet period = [ label \"period\" . store Rx.integer ]\n\n(* Variable: period_name_re\n The valid values for <period_name>. Currently only \"monthly\" *)\nlet period_name_re = \"monthly\"\n\n(************************************************************************\n * View: period_name\n * In the format \"@keyword\"\n *************************************************************************)\nlet period_name = [ label \"period_name\" . Util.del_str \"@\"\n . store period_name_re ]\n\n(************************************************************************\n * View: delay\n * The delay for an <entry>\n *************************************************************************)\nlet delay = [ label \"delay\" . store Rx.integer ]\n\n(************************************************************************\n * View: job_identifier\n * The job_identifier for an <entry>\n *************************************************************************)\nlet job_identifier = [ label \"job-identifier\" . store Rx.word ]\n\n(************************************************************************\n * View: entry\n * An anacrontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . Util.indent\n . ( period | period_name )\n . Sep.space . delay\n . Sep.space . job_identifier\n . Sep.space . store Rx.space_in . Util.eol ]\n\n\n(*\n * View: lns\n * The anacron lens\n *)\nlet lns = ( Util.empty | Util.comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/anacrontab\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Anacron\n Parses \/etc\/anacrontab\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man 5 anacrontab` where\n possible.\n\nAbout: License\n This file is licensed under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n\nAbout: Configuration files\n This lens applies to \/etc\/anacrontab. See <filter>.\n\nAbout: Examples\n The <Test_Anacron> file contains various examples and tests.\n*)\n\nmodule Anacron =\n autoload xfm\n\n(************************************************************************\n * Group: ENTRIES\n *************************************************************************)\n\n\n(************************************************************************\n * View: shellvar\n * A shell variable in crontab\n *************************************************************************)\n\nlet shellvar =\n let key_re = Shellvars.key_re - \"entry\" in\n let sto_to_eol = store \/[^\\n]*[^ \\t\\n]\/ in\n [ key key_re . Sep.equal . sto_to_eol . Util.eol ]\n\n\n(* View: period *)\nlet period = [ label \"period\" . store Rx.integer ]\n\n(* Variable: period_name_re\n The valid values for <period_name>. Currently only \"monthly\" *)\nlet period_name_re = \"monthly\"\n\n(************************************************************************\n * View: period_name\n * In the format \"@keyword\"\n *************************************************************************)\nlet period_name = [ label \"period_name\" . Util.del_str \"@\"\n . store period_name_re ]\n\n(************************************************************************\n * View: delay\n * The delay for an <entry>\n *************************************************************************)\nlet delay = [ label \"delay\" . store Rx.integer ]\n\n(************************************************************************\n * View: job_identifier\n * The job_identifier for an <entry>\n *************************************************************************)\nlet job_identifier = [ label \"job-identifier\" . store Rx.word ]\n\n(************************************************************************\n * View: entry\n * An anacrontab entry\n *************************************************************************)\n\nlet entry = [ label \"entry\" . Util.indent\n . ( period | period_name )\n . Sep.space . delay\n . Sep.space . job_identifier\n . Sep.space . store Rx.space_in . Util.eol ]\n\n\n(*\n * View: lns\n * The anacron lens\n *)\nlet lns = ( Util.empty | Util.comment | shellvar | entry )*\n\n\n(* Variable: filter *)\nlet filter =\n incl \"\/etc\/anacrontab\" .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a3d1c48dbf1cd07181cf064e6866fa86d6ef3592","subject":"Xinetd: better handling of whitespace","message":"Xinetd: better handling of whitespace\n\n- allow indented comments\n- allow spaces around \"}\" to close a service\n","repos":"mlichvar\/augeas,jjlin\/augeas,manandbytes\/augeas,mchf\/augeas,jjlin\/augeas,camptocamp\/augeas,kunkku\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,domcleal\/augeas,kumy\/augeas,pevalme\/augeas,jtopjian\/augeas,hercules-team\/augeas,dafugg\/augeas,bkearney\/augeas,ptoscano\/augeas,jjlin\/augeas,kumy\/augeas,raphink\/augeas,kunkku\/augeas,MikaelSmith\/augeas,mlichvar\/augeas,manandbytes\/augeas,dafugg\/augeas,camptocamp\/augeas,bkearney\/augeas,camptocamp\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,pevalme\/augeas,pevalme\/augeas,raphink\/augeas,kumy\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,mchf\/augeas,bkearney\/augeas,jasperla\/augeas,ptoscano\/augeas,kunkku\/augeas,jtopjian\/augeas,domcleal\/augeas,lutter\/augeas,jasperla\/augeas,dafugg\/augeas,domcleal\/augeas,ptoscano\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,hercules-team\/augeas-do-not-use","old_file":"lenses\/xinetd.aug","new_file":"lenses\/xinetd.aug","new_contents":"(* Process xinetd config files *)\n(* The structure of the lens and allowed attributes are ripped directly *)\n(* from xinetd's parser in xinetd\/parse.c in xinetd's source checkout *)\n(* The downside of being so precise here is that if attributes are added *)\n(* they need to be added here, too. Writing a catchall entry, and getting *)\n(* to typecheck correctly would be a huge pain. *)\n(* A really enterprising soul could tighten this down even further by *)\n(* restricting the acceptable values for each attribute. *)\nmodule Xinetd =\n autoload xfm\n\n let comment = [ del \/[ \\t]*(#.*|[ \\t]*)\\n\/ \"#\\n\" ]\n\n let name = key \/[^ \\t\\n\\\/+-=]+\/\n let opt_spc = del \/[ \\t]*\/ \"\"\n let spc = del \/[ \\t]+\/ \" \"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let eq = opt_spc . Util.del_str \"=\"\n\n let op = opt_spc . ([ label \"add\" . Util.del_str \"+=\" ]\n |[ label \"del\" . Util.del_str \"-=\" ]\n |Util.del_str \"=\")\n\n let value = store \/[^ \\t\\n]+\/\n\n let attr_one (n:regexp) =\n [ opt_spc . key n . eq . spc . value . eol ]\n\n let attr_lst (n:regexp) (op_eq: lens) =\n [ opt_spc . key n . op_eq . [label \"value\" . spc . value]* . eol ]\n\n let attr_lst_eq (n:regexp) = attr_lst n eq\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Note: it is much faster to combine, for example, all the attr_one *)\n (* attributes into one regexp and pass that to a lens instead of *)\n (* using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter *)\n (* causes the type checker to work _very_ hard. *)\n\n let service_attr =\n attr_one (\"socket_type\" | \"protocol\" | \"wait\" | \"user\" | \"group\"\n |\"server\" | \"instances\" | \"rpc_version\" | \"rpc_number\"\n | \"id\" | \"port\" | \"nice\" | \"banner\" | \"bind\" | \"interface\"\n | \"per_source\" | \"groups\" | \"banner_success\" | \"banner_fail\"\n | \"disable\" | \"max_load\" | \"rlimit_as\" | \"rlimit_cpu\"\n | \"rlimit_data\" | \"rlimit_rss\" | \"rlimit_stack\" | \"v6only\"\n | \"deny_time\" | \"umask\" | \"mdns\" | \"libwrap\")\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\"server_args\" | \"log_type\" | \"access_times\" | \"type\"\n | \"flags\" | \"redirect\" | \"cps\")\n |attr_lst_op ( \"log_on_success\" | \"log_on_failure\"| \"only_from\"\n | \"no_access\" | \"env\" | \"passenv\")\n\n let default_attr =\n attr_one ( \"instances\" | \"banner\" | \"bind\" | \"interface\" | \"per_source\"\n | \"groups\" | \"banner_success\" | \"banner_fail\" | \"max_load\"\n | \"v6only\" | \"umask\" | \"mdns\")\n |attr_lst_eq \"cps\" (* really only two values, not a whole list *)\n |attr_lst_op ( \"log_type\" | \"log_on_success\" | \"log_on_failure\" | \"disabled\"\n | \"no_access\" | \"only_from\" | \"passenv\" | \"enabled\" )\n\n (* Note: we would really like to say \"the body can contain any of a list *)\n (* of a list of attributes, each of them at most once\"; but that *)\n (* would require that we build a lens that matches the permutation *)\n (* of all attributes; with around 40 individual attributes, that's *)\n (* not computationally feasible, even if we didn't have to worry *)\n (* about how to write that down. The resulting regular expressions *)\n (* would simply be prohibitively large. *)\n let body (attr:lens) = Util.del_str \"\\n{\\n\"\n . (comment|attr)*\n . del \/[ \\t]*}[ \\t]*\\n\/ \"}\\n\"\n\n (* It would be nice if we could use the directories given in include and *)\n (* includedir directives to parse additional files instead of hardcoding *)\n (* all the places where xinetd config files can be found; but that is *)\n (* currently not possible, and implementing that has a good amount of *)\n (* hairy corner cases to consider. *)\n let includes = [ key \/include|includedir\/\n . Util.del_ws_spc . store \/[^ \\t\\n]+\/ . eol ]\n\n let service = \n let key_re = \/[^ \\t\\n\\\/]+\/ - \/include|includedir|defaults\/ in\n [ del \/service[ \\t]+\/ \"service \" . key key_re . body service_attr ]\n\n let defaults = [ key \"defaults\" . del \/[ \\t]*\/ \"\" . body default_attr ]\n\n let lns = ( comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Process xinetd config files *)\n(* The structure of the lens and allowed attributes are ripped directly *)\n(* from xinetd's parser in xinetd\/parse.c in xinetd's source checkout *)\n(* The downside of being so precise here is that if attributes are added *)\n(* they need to be added here, too. Writing a catchall entry, and getting *)\n(* to typecheck correctly would be a huge pain. *)\n(* A really enterprising soul could tighten this down even further by *)\n(* restricting the acceptable values for each attribute. *)\nmodule Xinetd =\n autoload xfm\n\n let comment = [ del \/(#.*|[ \\t]*)\\n\/ \"#\\n\" ]\n\n let name = key \/[^ \\t\\n\\\/+-=]+\/\n let opt_spc = del \/[ \\t]*\/ \"\"\n let spc = del \/[ \\t]+\/ \" \"\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n let eq = opt_spc . Util.del_str \"=\"\n\n let op = opt_spc . ([ label \"add\" . Util.del_str \"+=\" ]\n |[ label \"del\" . Util.del_str \"-=\" ]\n |Util.del_str \"=\")\n\n let value = store \/[^ \\t\\n]+\/\n\n let attr_one (n:regexp) =\n [ opt_spc . key n . eq . spc . value . eol ]\n\n let attr_lst (n:regexp) (op_eq: lens) =\n [ opt_spc . key n . op_eq . [label \"value\" . spc . value]* . eol ]\n\n let attr_lst_eq (n:regexp) = attr_lst n eq\n\n let attr_lst_op (n:regexp) = attr_lst n op\n\n (* Note: it is much faster to combine, for example, all the attr_one *)\n (* attributes into one regexp and pass that to a lens instead of *)\n (* using lens union (attr_one \"a\" | attr_one \"b\"|..) because the latter *)\n (* causes the type checker to work _very_ hard. *)\n\n let service_attr =\n attr_one (\"socket_type\" | \"protocol\" | \"wait\" | \"user\" | \"group\"\n |\"server\" | \"instances\" | \"rpc_version\" | \"rpc_number\"\n | \"id\" | \"port\" | \"nice\" | \"banner\" | \"bind\" | \"interface\"\n | \"per_source\" | \"groups\" | \"banner_success\" | \"banner_fail\"\n | \"disable\" | \"max_load\" | \"rlimit_as\" | \"rlimit_cpu\"\n | \"rlimit_data\" | \"rlimit_rss\" | \"rlimit_stack\" | \"v6only\"\n | \"deny_time\" | \"umask\" | \"mdns\" | \"libwrap\")\n (* redirect and cps aren't really lists, they take exactly two values *)\n |attr_lst_eq (\"server_args\" | \"log_type\" | \"access_times\" | \"type\"\n | \"flags\" | \"redirect\" | \"cps\")\n |attr_lst_op ( \"log_on_success\" | \"log_on_failure\"| \"only_from\"\n | \"no_access\" | \"env\" | \"passenv\")\n\n let default_attr =\n attr_one ( \"instances\" | \"banner\" | \"bind\" | \"interface\" | \"per_source\"\n | \"groups\" | \"banner_success\" | \"banner_fail\" | \"max_load\"\n | \"v6only\" | \"umask\" | \"mdns\")\n |attr_lst_eq \"cps\" (* really only two values, not a whole list *)\n |attr_lst_op ( \"log_type\" | \"log_on_success\" | \"log_on_failure\" | \"disabled\"\n | \"no_access\" | \"only_from\" | \"passenv\" | \"enabled\" )\n\n (* Note: we would really like to say \"the body can contain any of a list *)\n (* of a list of attributes, each of them at most once\"; but that *)\n (* would require that we build a lens that matches the permutation *)\n (* of all attributes; with around 40 individual attributes, that's *)\n (* not computationally feasible, even if we didn't have to worry *)\n (* about how to write that down. The resulting regular expressions *)\n (* would simply be prohibitively large. *)\n let body (attr:lens) = Util.del_str \"\\n{\\n\"\n . (comment|attr)*\n . Util.del_str \"}\\n\"\n\n (* It would be nice if we could use the directories given in include and *)\n (* includedir directives to parse additional files instead of hardcoding *)\n (* all the places where xinetd config files can be found; but that is *)\n (* currently not possible, and implementing that has a good amount of *)\n (* hairy corner cases to consider. *)\n let includes = [ key \/include|includedir\/\n . Util.del_ws_spc . store \/[^ \\t\\n]+\/ . eol ]\n\n let service = \n let key_re = \/[^ \\t\\n\\\/]+\/ - \/include|includedir|defaults\/ in\n [ del \/service[ \\t]+\/ \"service \" . key key_re . body service_attr ]\n\n let defaults = [ key \"defaults\" . del \/[ \\t]*\/ \"\" . body default_attr ]\n\n let lns = ( comment | includes | defaults | service )*\n\n let filter = incl \"\/etc\/xinetd.d\/*\"\n . incl \"\/etc\/xinetd.conf\"\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a85e225a7d5a84d2c3173129454b66271a01ed1f","subject":"Test for continuation lines","message":"Test for continuation lines\n","repos":"kumy\/augeas,MikaelSmith\/augeas,jjlin\/augeas,lutter\/augeas,jjlin\/augeas,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,dafugg\/augeas,kumy\/augeas,bkearney\/augeas,hercules-team\/augeas,mlichvar\/augeas,domcleal\/augeas,ptoscano\/augeas,jtopjian\/augeas,pevalme\/augeas,manandbytes\/augeas,camptocamp\/augeas,ptoscano\/augeas,raphink\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,ptoscano\/augeas,pevalme\/augeas,jtopjian\/augeas,pevalme\/augeas,kunkku\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,camptocamp\/augeas,domcleal\/augeas,manandbytes\/augeas,camptocamp\/augeas,jasperla\/augeas,kumy\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,bkearney\/augeas,bkearney\/augeas,lutter\/augeas,mchf\/augeas,MikaelSmith\/augeas,jasperla\/augeas,mchf\/augeas,dafugg\/augeas,hercules-team\/augeas,camptocamp\/augeas,jjlin\/augeas,mlichvar\/augeas,raphink\/augeas","old_file":"tests\/modules\/pass_cont_line.aug","new_file":"tests\/modules\/pass_cont_line.aug","new_contents":"module Pass_cont_line =\n\n(* Parse a list of words where the list can stretch over multiple lines.\n Mostly there to demonstrate how to deal with continuation lines. *)\n\nlet list_elt = [ label \"element\" . store \/[a-z]+\/ ]\n\nlet ws_cont = \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \n\nlet sep = del ws_cont \" \"\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\nlet list = list_elt . ( sep . list_elt )* . eol\n\nlet exp_tree = { \"element\" = \"a\" } { \"element\" = \"b\" }\n\ntest list get \"a b\\n\" = exp_tree\ntest list get \"a \\\\\\n b\\n\" = exp_tree\ntest list get \"a\\\\\\nb\\n\" = exp_tree\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/modules\/pass_cont_line.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"dfd3a012c9279e27b0ea347a6e9c36e18df69cd2","subject":"Upgrade subversion lens to official","message":"Upgrade subversion lens to official\n\n","repos":"raphink\/puppet-subversion","old_file":"files\/subversion.aug","new_file":"files\/subversion.aug","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/raphink\/puppet-subversion.git\/'\n","license":"bsd-3-clause","lang":"Augeas"} {"commit":"aa2763a1772cd30a9651812fcce8030e187e208c","subject":"Logrotate (hooks): simplify to speed up typechecker","message":"Logrotate (hooks): simplify to speed up typechecker\n","repos":"ptoscano\/augeas,jjlin\/augeas,jjlin\/augeas,mchf\/augeas,dafugg\/augeas,ptoscano\/augeas,bkearney\/augeas,kumy\/augeas,domcleal\/augeas,raphink\/augeas,kunkku\/augeas,pevalme\/augeas,domcleal\/augeas,kunkku\/augeas,hercules-team\/augeas,bkearney\/augeas,lutter\/augeas,hercules-team\/augeas,GeoffWilliams\/augeas,manandbytes\/augeas,mlichvar\/augeas,pevalme\/augeas,lutter\/augeas,jjlin\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,kunkku\/augeas,jtopjian\/augeas,domcleal\/augeas,manandbytes\/augeas,kumy\/augeas,kumy\/augeas,mchf\/augeas,dafugg\/augeas,bkearney\/augeas,ptoscano\/augeas,raphink\/augeas,dafugg\/augeas,jasperla\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,jasperla\/augeas,lutter\/augeas,MikaelSmith\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas","old_file":"lenses\/logrotate.aug","new_file":"lenses\/logrotate.aug","new_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.del_str \"\\n\"\n let num = \/[0-9]+\/\n let word = \/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n (* define comments and empty lines *)\n let comment (indent:string) = [ label \"#comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . eol ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_val . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) = [ del \/[ \\t]*\/ indent . key \"create\" .\n ( sep_spc . [ label \"mode\" . store num ] . sep_spc .\n\t\t [ label \"owner\" . store word ] . sep_spc .\n\t\t [ label \"group\" . store word ])?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" size indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" size indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . del \"\\n\" \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ del \/[ \\t]*\/ \"\\t\" . key hook_names . eol .\n hook_lines .\n del \/[ \\t]*endscript\\n\/ \"\\tendscript\\n\" ]\n\n (* Define rule *)\n\n let body = del \/\\{[ \\t]*\\n\/ \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n let rule =\n [ label \"rule\" .\n [ label \"file\" . store word ] .\n\t [ del \/[ \\t]+\/ \" \" . label \"file\" . store word ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n\n","old_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.del_str \"\\n\"\n let num = \/[0-9]+\/\n let word = \/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n (* define comments and empty lines *)\n let comment (indent:string) = [ label \"#comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . eol ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_val . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) = [ del \/[ \\t]*\/ indent . key \"create\" .\n ( sep_spc . [ label \"mode\" . store num ] . sep_spc .\n\t\t [ label \"owner\" . store word ] . sep_spc .\n\t\t [ label \"group\" . store word ])?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" size indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" size indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . del \"\\n\" \"\\n\"\n\n let hook_func (func_type:string) = [\n del \/[ \\t]*\/ \"\\t\" . key func_type . eol .\n hook_lines .\n del \/[ \\t]*endscript\\n\/ \"\\tendscript\\n\" ]\n\n let hooks = hook_func \"postrotate\"\n | hook_func \"prerotate\"\n | hook_func \"firstaction\"\n | hook_func \"lastaction\"\n\n (* Define rule *)\n\n let body = del \/\\{[ \\t]*\\n\/ \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n let rule =\n [ label \"rule\" .\n [ label \"file\" . store word ] .\n\t [ del \/[ \\t]+\/ \" \" . label \"file\" . store word ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"97820b6b0085d6450b1a72966280c6598e28d54d","subject":"Remove trailing spaces in lenses\/tests\/test_nagiosobjects.aug","message":"Remove trailing spaces in lenses\/tests\/test_nagiosobjects.aug\n","repos":"domcleal\/augeas,ptoscano\/augeas,jjlin\/augeas,jjlin\/augeas,kumy\/augeas,lutter\/augeas,mlichvar\/augeas,mchf\/augeas,manandbytes\/augeas,dafugg\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas,dafugg\/augeas,kunkku\/augeas,kunkku\/augeas,jtopjian\/augeas,manandbytes\/augeas,dafugg\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,raphink\/augeas,mchf\/augeas,lutter\/augeas,jasperla\/augeas,kumy\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,pevalme\/augeas,pevalme\/augeas,mlichvar\/augeas,ptoscano\/augeas,kunkku\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,pevalme\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,kumy\/augeas,jjlin\/augeas,lutter\/augeas","old_file":"lenses\/tests\/test_nagiosobjects.aug","new_file":"lenses\/tests\/test_nagiosobjects.aug","new_contents":"module Test_NagiosObjects =\n let conf=\"\n#\n# Nagios Objects definitions file\n#\n\ndefine host {\n host_name plonk\n alias plonk\n address plonk\n use generic_template\n contact_groups Monitoring-Team,admins\n}\n\ndefine service {\n service_description gen\n use generic_template_passive\n host_name plonk\n check_command nopassivecheckreceived\n contact_groups admins\n}\n\"\n\n test NagiosObjects.lns get conf =\n {}\n {}\n { \"#comment\" = \"Nagios Objects definitions file\" }\n {}\n {}\n { \"host\"\n { \"host_name\" = \"plonk\" }\n { \"alias\" = \"plonk\" }\n { \"address\" = \"plonk\" }\n { \"use\" = \"generic_template\" }\n { \"contact_groups\" = \"Monitoring-Team,admins\" }\n }\n {}\n { \"service\"\n { \"service_description\" = \"gen\" }\n { \"use\" = \"generic_template_passive\" }\n { \"host_name\" = \"plonk\" }\n { \"check_command\" = \"nopassivecheckreceived\" }\n { \"contact_groups\" = \"admins\" }\n }\n\n","old_contents":"module Test_NagiosObjects =\n let conf=\"\n#\n# Nagios Objects definitions file\n#\n\ndefine host {\n host_name plonk\n alias plonk\n address plonk\n use generic_template\n contact_groups Monitoring-Team,admins\n}\n\ndefine service {\n service_description gen\n use generic_template_passive\n host_name plonk\n check_command nopassivecheckreceived\n contact_groups admins\n}\n\"\n\n test NagiosObjects.lns get conf =\n {}\n {}\n { \"#comment\" = \"Nagios Objects definitions file\" }\n {}\n {}\n { \"host\" \n { \"host_name\" = \"plonk\" }\n { \"alias\" = \"plonk\" }\n { \"address\" = \"plonk\" }\n { \"use\" = \"generic_template\" }\n { \"contact_groups\" = \"Monitoring-Team,admins\" }\n }\n {}\n { \"service\" \n { \"service_description\" = \"gen\" }\n { \"use\" = \"generic_template_passive\" }\n { \"host_name\" = \"plonk\" }\n { \"check_command\" = \"nopassivecheckreceived\" }\n { \"contact_groups\" = \"admins\" }\n }\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f6dd0560d9169402030a1cdb4746b6a24aabe10e","subject":"Grub: simplify comment_re to speed up typecheck","message":"Grub: simplify comment_re to speed up typecheck\n","repos":"jjlin\/augeas,MikaelSmith\/augeas,lutter\/augeas,bkearney\/augeas,pevalme\/augeas,ptoscano\/augeas,raphink\/augeas,hercules-team\/augeas,dafugg\/augeas,jasperla\/augeas,jasperla\/augeas,pevalme\/augeas,kunkku\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,mlichvar\/augeas,mlichvar\/augeas,hercules-team\/augeas,kumy\/augeas,camptocamp\/augeas,manandbytes\/augeas,dafugg\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,domcleal\/augeas,camptocamp\/augeas,domcleal\/augeas,kumy\/augeas,mchf\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,kumy\/augeas,kunkku\/augeas,jtopjian\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,camptocamp\/augeas,pevalme\/augeas,jjlin\/augeas,bkearney\/augeas,ptoscano\/augeas,raphink\/augeas,mchf\/augeas,manandbytes\/augeas,bkearney\/augeas,mlichvar\/augeas,camptocamp\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jjlin\/augeas,jtopjian\/augeas","old_file":"lenses\/grub.aug","new_file":"lenses\/grub.aug","new_contents":"module Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n let eol = Util.eol\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n let opt_ws = Util.del_opt_ws \"\"\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n let kw_arg (kw:string) (indent:string) (dflt_sep:string) =\n [ Util.del_opt_ws indent . key kw . value_sep dflt_sep\n . value_to_eol . eol ]\n\n let kw_boot_arg (kw:string) = kw_arg kw \"\\t\" \" \"\n let kw_menu_arg (kw:string) = kw_arg kw \"\" \"=\"\n let password_arg = [ key \"password\" .\n (Util.del_ws_spc . [ Util.del_str \"--md5\" . label \"md5\" ])? .\n Util.del_ws_spc . store (\/[^ \\t\\n]+\/ - \"--md5\") .\n (Util.del_ws_spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n Util.del_str \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n Util.del_ws_spc . [ label \"normal\" . color_spec ] .\n (Util.del_ws_spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"serial\"\n | kw_menu_arg \"terminal\"\n | password_arg\n | color\n\n let title = del \/title[ \\t]+\/ \"title \" . value_to_eol . eol\n\n let module_lines = [ label \"modules\" .\n Util.del_ws \"\\t\" .\n Util.del_str \"module\" . Util.del_ws_spc\n . value_to_eol . eol ]\n\n let boot_setting = kw_boot_arg \"root\"\n | kw_boot_arg \"kernel\"\n | kw_boot_arg \"initrd\"\n | kw_boot_arg \"rootnoverify\"\n | kw_boot_arg \"chainloader\"\n | kw_boot_arg \"uuid\"\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | kw_pres \"savedefault\"\n | module_lines\n\n let boot = [ label \"title\" . title . boot_setting* ]\n\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n let empty = Util.empty\n\n\n let debian_header = \"## ## Start Default Options ##\\n\"\n let debian_footer = \"## ## End Default Options ##\\n\"\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n let debian_value_sep = del \/[ \\t]*=\/ \"=\"\n let debian_kw_arg (kw:regexp) =\n [ Util.del_opt_ws \"\" . key kw . debian_value_sep\n . value_to_eol? . eol ]\n\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n\n let debian_setting = debian_kw_arg debian_setting_re\n\n let debian_entry = del \"#\" \"#\" . debian_setting\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n let lns = (comment | empty | menu_setting | boot | debian)*\n let xfm = transform lns (incl \"\/etc\/grub.conf\")\n","old_contents":"module Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n let eol = Util.eol\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n let opt_ws = Util.del_opt_ws \"\"\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n let kw_arg (kw:string) (indent:string) (dflt_sep:string) =\n [ Util.del_opt_ws indent . key kw . value_sep dflt_sep\n . value_to_eol . eol ]\n\n let kw_boot_arg (kw:string) = kw_arg kw \"\\t\" \" \"\n let kw_menu_arg (kw:string) = kw_arg kw \"\" \"=\"\n let password_arg = [ key \"password\" .\n (Util.del_ws_spc . [ Util.del_str \"--md5\" . label \"md5\" ])? .\n Util.del_ws_spc . store (\/[^ \\t\\n]+\/ - \"--md5\") .\n (Util.del_ws_spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n Util.del_str \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n Util.del_ws_spc . [ label \"normal\" . color_spec ] .\n (Util.del_ws_spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"serial\"\n | kw_menu_arg \"terminal\"\n | password_arg\n | color\n\n let title = del \/title[ \\t]+\/ \"title \" . value_to_eol . eol\n\n let module_lines = [ label \"modules\" .\n Util.del_ws \"\\t\" .\n Util.del_str \"module\" . Util.del_ws_spc\n . value_to_eol . eol ]\n\n let boot_setting = kw_boot_arg \"root\"\n | kw_boot_arg \"kernel\"\n | kw_boot_arg \"initrd\"\n | kw_boot_arg \"rootnoverify\"\n | kw_boot_arg \"chainloader\"\n | kw_boot_arg \"uuid\"\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | kw_pres \"savedefault\"\n | module_lines\n\n let boot = [ label \"title\" . title . boot_setting* ]\n\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"# ## Start Default Options ##\"\n - \"# ## End Default Options ##\"\n\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n let empty = Util.empty\n\n\n let debian_header = \"## ## Start Default Options ##\\n\"\n let debian_footer = \"## ## End Default Options ##\\n\"\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n let debian_value_sep = del \/[ \\t]*=\/ \"=\"\n let debian_kw_arg (kw:regexp) =\n [ Util.del_opt_ws \"\" . key kw . debian_value_sep\n . value_to_eol? . eol ]\n\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n\n let debian_setting = debian_kw_arg debian_setting_re\n\n let debian_entry = del \"#\" \"#\" . debian_setting\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n let lns = (comment | empty | menu_setting | boot | debian)*\n let xfm = transform lns (incl \"\/etc\/grub.conf\")\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b34a2222054761e2dbd66e2da3da5a9e5d2d0ad8","subject":"Add a bunch of keywords available on squid-2.7-STABLE6 or squid-3.HEAD-20090308.","message":"Add a bunch of keywords available on squid-2.7-STABLE6 or squid-3.HEAD-20090308.\n\nThe keywords list was generated by the following command:\n\nfgrep TAG squid-2.7.STABLE6\/src\/squid.conf.default | awk '{ print \" | \\\"\"$3\"\\\"\" }' | sort > \/tmp\/squid2.7\n\nfgrep TAG squid-3.HEAD-20090308\/src\/squid.conf.documented | awk '{ print \" | \\\"\"$3\"\\\"\" }' | sort > \/tmp\/squid3-HEAD\n\ncat \/tmp\/squid2.7 \/tmp\/squid3-HEAD | sort | uniq\n","repos":"pevalme\/augeas,raphink\/augeas,kunkku\/augeas,bkearney\/augeas,mlichvar\/augeas,lutter\/augeas,jjlin\/augeas,bkearney\/augeas,GeoffWilliams\/augeas,kumy\/augeas,domcleal\/augeas,ptoscano\/augeas,mlichvar\/augeas,kumy\/augeas,hercules-team\/augeas,jasperla\/augeas,mlichvar\/augeas,hercules-team\/augeas,kumy\/augeas,raphink\/augeas,dafugg\/augeas,domcleal\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,jasperla\/augeas,bkearney\/augeas,dafugg\/augeas,mchf\/augeas,camptocamp\/augeas,jjlin\/augeas,camptocamp\/augeas,pevalme\/augeas,lutter\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,mchf\/augeas,lutter\/augeas,ptoscano\/augeas,camptocamp\/augeas,ptoscano\/augeas,jtopjian\/augeas,camptocamp\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,manandbytes\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kunkku\/augeas,jjlin\/augeas,kunkku\/augeas,manandbytes\/augeas,bkearney\/augeas","old_file":"lenses\/squid.aug","new_file":"lenses\/squid.aug","new_contents":"(* Squid module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: the self-documented default squid.conf file\n\n*)\n\nmodule Squid =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\n\nlet word = \/[A-Za-z0-9!_.-]+(\\[[0-9]+\\])?\/\nlet sto_to_spc = store \/[^# \\t\\n]+\/\n\nlet comment = Spacevars.comment\nlet value (kw:string)\n = [ spc . label kw . sto_to_spc ]\nlet parameters = [ label \"parameters\"\n . counter \"parameters\"\n . [ spc . seq \"parameters\" . sto_to_spc ]+ ]\n\n(************************************************************************\n * SPACEVARS SETTINGS\n *************************************************************************)\n\nlet entry_re = \"accept_filter\"\n | \"access_log\"\n | \"acl_uses_indirect_client\"\n | \"adaptation_access\"\n | \"adaptation_service_set\"\n | \"allow_underscore\"\n | \"always_direct\"\n | \"announce_file\"\n | \"announce_host\"\n | \"announce_period\"\n | \"announce_port\"\n | \"append_domain\"\n | \"as_whois_server\"\n | \"authenticate_cache_garbage_interval\"\n | \"authenticate_ip_shortcircuit_access\"\n | \"authenticate_ip_shortcircuit_ttl\"\n | \"authenticate_ip_ttl\"\n | \"authenticate_ttl\"\n | \"background_ping_rate\"\n | \"balance_on_multiple_ip\"\n | \"broken_posts\"\n | \"broken_vary_encoding\"\n | \"buffered_logs\"\n | \"cache\"\n | \"cache_dir\"\n | \"cache_dns_program\"\n | \"cache_effective_group\"\n | \"cache_effective_user\"\n | \"cache_log\"\n | \"cache_mem\"\n | \"cache_mgr\"\n | \"cachemgr_passwd\"\n | \"cache_peer\"\n | \"cache_peer_access\"\n | \"cache_peer_domain\"\n | \"cache_replacement_policy\"\n | \"cache_store_log\"\n | \"cache_swap_high\"\n | \"cache_swap_low\"\n | \"cache_swap_state\"\n | \"cache_vary\"\n | \"check_hostnames\"\n | \"chroot\"\n | \"client_db\"\n | \"client_lifetime\"\n | \"client_netmask\"\n | \"client_persistent_connections\"\n | \"clientside_tos\"\n | \"collapsed_forwarding\"\n | \"connect_timeout\"\n | \"coredump_dir\"\n | \"dead_peer_timeout\"\n | \"debug_options\"\n | \"delay_access\"\n | \"delay_class\"\n | \"delay_initial_bucket_level\"\n | \"delay_parameters\"\n | \"delay_pools\"\n | \"delay_pool_uses_indirect_client\"\n | \"deny_info\"\n | \"detect_broken_pconn\"\n | \"digest_bits_per_entry\"\n | \"digest_generation\"\n | \"digest_rebuild_chunk_percentage\"\n | \"digest_rebuild_period\"\n | \"digest_rewrite_period\"\n | \"digest_swapout_chunk_size\"\n | \"diskd_program\"\n | \"dns_children\"\n | \"dns_defnames\"\n | \"dns_nameservers\"\n | \"dns_retransmit_interval\"\n | \"dns_testnames\"\n | \"dns_timeout\"\n | \"dns_v4_fallback\"\n | \"ecap_enable\"\n | \"ecap_service\"\n | \"email_err_data\"\n | \"emulate_httpd_log\"\n | \"err_html_text\"\n | \"error_default_language\"\n | \"error_directory\"\n | \"error_log_languages\"\n | \"error_map\"\n | \"err_page_stylesheet\"\n | \"esi_parser\"\n | \"extension_methods\"\n | \"external_acl_type\"\n | \"external_refresh_check\"\n | \"follow_x_forwarded_for\"\n | \"forwarded_for\"\n | \"forward_log\"\n | \"forward_timeout\"\n | \"fqdncache_size\"\n | \"ftp_epsv_all\"\n | \"ftp_list_width\"\n | \"ftp_passive\"\n | \"ftp_sanitycheck\"\n | \"ftp_telnet_protocol\"\n | \"ftp_user\"\n | \"global_internal_static\"\n | \"half_closed_clients\"\n | \"header_access\"\n | \"header_replace\"\n | \"hierarchy_stoplist\"\n | \"high_memory_warning\"\n | \"high_page_fault_warning\"\n | \"high_response_time_warning\"\n | \"hostname_aliases\"\n | \"hosts_file\"\n | \"htcp_access\"\n | \"htcp_clr_access\"\n | \"htcp_port\"\n | \"http_accel_surrogate_remote\"\n | \"http_access2\"\n | \"httpd_accel_no_pmtu_disc\"\n | \"httpd_accel_surrogate_id\"\n | \"httpd_suppress_version_string\"\n | \"http_port\"\n | \"http_reply_access\"\n | \"https_port\"\n | \"icap_access\"\n | \"icap_class\"\n | \"icap_client_username_encode\"\n | \"icap_client_username_header\"\n | \"icap_connect_timeout\"\n | \"icap_default_options_ttl\"\n | \"icap_enable\"\n | \"icap_io_timeout\"\n | \"icap_persistent_connections\"\n | \"icap_preview_enable\"\n | \"icap_preview_size\"\n | \"icap_send_client_ip\"\n | \"icap_send_client_username\"\n | \"icap_service\"\n | \"icap_service_failure_limit\"\n | \"icap_service_revival_delay\"\n | \"icon_directory\"\n | \"icp_access\"\n | \"icp_hit_stale\"\n | \"icp_port\"\n | \"icp_query_timeout\"\n | \"ident_lookup_access\"\n | \"ident_timeout\"\n | \"ie_refresh\"\n | \"ignore_expect_100\"\n | \"ignore_ims_on_miss\"\n | \"ignore_unknown_nameservers\"\n | \"incoming_dns_average\"\n | \"incoming_http_average\"\n | \"incoming_icp_average\"\n | \"incoming_rate\"\n | \"ipcache_high\"\n | \"ipcache_low\"\n | \"ipcache_size\"\n | \"loadable_modules\"\n | \"location_rewrite_access\"\n | \"location_rewrite_children\"\n | \"location_rewrite_concurrency\"\n | \"location_rewrite_program\"\n | \"log_access\"\n | \"logfile_daemon\"\n | \"logfile_rotate\"\n | \"logformat\"\n | \"log_fqdn\"\n | \"log_icp_queries\"\n | \"log_ip_on_direct\"\n | \"log_mime_hdrs\"\n | \"log_uses_indirect_client\"\n | \"mail_from\"\n | \"mail_program\"\n | \"max_filedescriptors\"\n | \"maximum_icp_query_timeout\"\n | \"maximum_object_size\"\n | \"maximum_object_size_in_memory\"\n | \"maximum_single_addr_tries\"\n | \"max_open_disk_fds\"\n | \"max_stale\"\n | \"mcast_groups\"\n | \"mcast_icp_query_timeout\"\n | \"mcast_miss_addr\"\n | \"mcast_miss_encode_key\"\n | \"mcast_miss_port\"\n | \"mcast_miss_ttl\"\n | \"memory_pools\"\n | \"memory_pools_limit\"\n | \"memory_replacement_policy\"\n | \"mime_table\"\n | \"min_dns_poll_cnt\"\n | \"min_http_poll_cnt\"\n | \"min_icp_poll_cnt\"\n | \"minimum_direct_hops\"\n | \"minimum_direct_rtt\"\n | \"minimum_expiry_time\"\n | \"minimum_icp_query_timeout\"\n | \"minimum_object_size\"\n | \"miss_access\"\n | \"negative_dns_ttl\"\n | \"negative_ttl\"\n | \"neighbor_type_domain\"\n | \"netdb_filename\"\n | \"netdb_high\"\n | \"netdb_low\"\n | \"netdb_ping_period\"\n | \"never_direct\"\n | \"nonhierarchical_direct\"\n | \"offline_mode\"\n | \"pconn_timeout\"\n | \"peer_connect_timeout\"\n | \"persistent_connection_after_error\"\n | \"persistent_request_timeout\"\n | \"pid_filename\"\n | \"pinger_enable\"\n | \"pinger_program\"\n | \"pipeline_prefetch\"\n | \"positive_dns_ttl\"\n | \"prefer_direct\"\n | \"qos_flows\"\n | \"query_icmp\"\n | \"quick_abort_max\"\n | \"quick_abort_min\"\n | \"quick_abort_pct\"\n | \"range_offset_limit\"\n | \"read_ahead_gap\"\n | \"read_timeout\"\n | \"redirector_bypass\"\n | \"referer_log\"\n | \"refresh_all_ims\"\n | \"refresh_pattern\"\n | \"refresh_stale_hit\"\n | \"relaxed_header_parser\"\n | \"reload_into_ims\"\n | \"reply_body_max_size\"\n | \"reply_header_access\"\n | \"reply_header_max_size\"\n | \"request_body_max_size\"\n | \"request_entities\"\n | \"request_header_access\"\n | \"request_header_max_size\"\n | \"request_timeout\"\n | \"retry_on_error\"\n | \"server_http11\"\n | \"server_persistent_connections\"\n | \"short_icon_urls\"\n | \"shutdown_lifetime\"\n | \"sleep_after_fork\"\n | \"snmp_access\"\n | \"snmp_incoming_address\"\n | \"snmp_outgoing_address\"\n | \"snmp_port\"\n | \"ssl_bump\"\n | \"ssl_engine\"\n | \"sslpassword_program\"\n | \"sslproxy_cafile\"\n | \"sslproxy_capath\"\n | \"sslproxy_cert_error\"\n | \"sslproxy_cipher\"\n | \"sslproxy_client_certificate\"\n | \"sslproxy_client_key\"\n | \"sslproxy_flags\"\n | \"sslproxy_options\"\n | \"sslproxy_version\"\n | \"ssl_unclean_shutdown\"\n | \"store_avg_object_size\"\n | \"store_dir_select_algorithm\"\n | \"store_objects_per_bucket\"\n | \"storeurl_access\"\n | \"storeurl_rewrite_children\"\n | \"storeurl_rewrite_concurrency\"\n | \"storeurl_rewrite_program\"\n | \"strip_query_terms\"\n | \"tcp_outgoing_address\"\n | \"tcp_outgoing_tos\"\n | \"tcp_recv_bufsize\"\n | \"test_reachability\"\n | \"udp_incoming_address\"\n | \"udp_outgoing_address\"\n | \"umask\"\n | \"unique_hostname\"\n | \"unlinkd_program\"\n | \"update_headers\"\n | \"upgrade_http0.9\"\n | \"uri_whitespace\"\n | \"url_rewrite_access\"\n | \"url_rewrite_bypass\"\n | \"url_rewrite_children\"\n | \"url_rewrite_concurrency\"\n | \"url_rewrite_host_header\"\n | \"url_rewrite_program\"\n | \"useragent_log\"\n | \"vary_ignore_expire\"\n | \"via\"\n | \"visible_hostname\"\n | \"wccp2_address\"\n | \"wccp2_assignment_method\"\n | \"wccp2_forwarding_method\"\n | \"wccp2_rebuild_wait\"\n | \"wccp2_return_method\"\n | \"wccp2_router\"\n | \"wccp2_service\"\n | \"wccp2_service_info\"\n | \"wccp2_weight\"\n | \"wccp_address\"\n | \"wccp_router\"\n | \"wccp_version\"\n | \"windows_ipaddrchangemonitor\"\n | \"zero_buffers\"\n | \"zph_local\"\n | \"zph_mode\"\n | \"zph_option\"\n | \"zph_parent\"\n | \"zph_sibling\"\nlet entry = Spacevars.entry entry_re\n\n(************************************************************************\n * AUTH\n *************************************************************************)\n\nlet auth_re = \"auth_param\"\nlet auth = [ key \"auth_param\"\n . value \"scheme\"\n . value \"parameter\"\n . (value \"setting\") ?\n . (eol|comment) ]\n\n(************************************************************************\n * ACL\n *************************************************************************)\n\nlet acl_re = \"acl\"\nlet acl = [ key acl_re . spc\n . [ key word\n . value \"type\"\n . value \"setting\"\n . parameters?\n . (eol|comment) ] ]\n\n(************************************************************************\n * HTTP ACCESS\n *************************************************************************)\n\nlet http_access_re\n = \"http_access\"\nlet http_access\n = [ key http_access_re\n . spc\n . [ key \/allow|deny\/\n . spc\n . sto_to_spc\n . parameters? ]\n . (eol|comment) ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = Spacevars.lns (entry|auth|acl|http_access)\n\nlet filter = Util.stdexcl\n . incl \"\/etc\/squid\/squid.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(* Squid module for Augeas\n Author: Free Ekanayaka <free@64studio.com>\n\n Reference: the self-documented default squid.conf file\n\n*)\n\nmodule Squid =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\nlet spc = Util.del_ws_spc\n\nlet word = \/[A-Za-z0-9!_.-]+(\\[[0-9]+\\])?\/\nlet sto_to_spc = store \/[^# \\t\\n]+\/\n\nlet comment = Spacevars.comment\nlet value (kw:string)\n = [ spc . label kw . sto_to_spc ]\nlet parameters = [ label \"parameters\"\n . counter \"parameters\"\n . [ spc . seq \"parameters\" . sto_to_spc ]+ ]\n\n(************************************************************************\n * SPACEVARS SETTINGS\n *************************************************************************)\n\nlet entry_re = \"authenticate_cache_garbage_interval\"\n | \"access_log\"\n | \"acl_uses_indirect_client\"\n | \"allow_underscore\"\n | \"always_direct\"\n | \"announce_file\"\n | \"announce_host\"\n | \"announce_period\"\n | \"announce_port\"\n | \"append_domain\"\n | \"as_whois_server\"\n | \"authenticate_ip_ttl\"\n | \"authenticate_ttl\"\n | \"balance_on_multiple_ip\"\n | \"broken_posts\"\n | \"broken_vary_encoding\"\n | \"buffered_logs\"\n | \"cache\"\n | \"cache_dir\"\n | \"cache_dns_program\"\n | \"cache_effective_group\"\n | \"cache_effective_user\"\n | \"cache_log\"\n | \"cache_mem\"\n | \"cache_mgr\"\n | \"cache_peer\"\n | \"cache_peer_access\"\n | \"cache_peer_domain\"\n | \"cache_replacement_policy\"\n | \"cache_store_log\"\n | \"cache_swap_high\"\n | \"cache_swap_low\"\n | \"cache_swap_state\"\n | \"cache_vary\"\n | \"cachemgr_passwd\"\n | \"check_hostnames\"\n | \"chroot\"\n | \"client_db\"\n | \"client_lifetime\"\n | \"client_netmask\"\n | \"client_persistent_connections\"\n | \"collapsed_forwarding\"\n | \"connect_timeout\"\n | \"coredump_dir\"\n | \"dead_peer_timeout\"\n | \"debug_options\"\n | \"delay_access\"\n | \"delay_class\"\n | \"delay_initial_bucket_level\"\n | \"delay_parameters\"\n | \"delay_pool_uses_indirect_client\"\n | \"delay_pools\"\n | \"deny_info\"\n | \"detect_broken_pconn\"\n | \"digest_bits_per_entry\"\n | \"digest_generation\"\n | \"digest_rebuild_chunk_percentage\"\n | \"digest_rebuild_period\"\n | \"digest_rewrite_period\"\n | \"digest_swapout_chunk_size\"\n | \"diskd_program\"\n | \"dns_children\"\n | \"dns_defnames\"\n | \"dns_nameservers\"\n | \"dns_retransmit_interval\"\n | \"dns_testnames\"\n | \"dns_timeout\"\n | \"emulate_httpd_log\"\n | \"err_html_text\"\n | \"error_directory\"\n | \"error_map\"\n | \"extension_methods\"\n | \"external_acl_type\"\n | \"follow_x_forwarded_for\"\n | \"forward_log\"\n | \"forward_timeout\"\n | \"forwarded_for\"\n | \"fqdncache_size\"\n | \"ftp_list_width\"\n | \"ftp_passive\"\n | \"ftp_sanitycheck\"\n | \"ftp_telnet_protocol\"\n | \"ftp_user\"\n | \"global_internal_static\"\n | \"half_closed_clients\"\n | \"header_access\"\n | \"header_replace\"\n | \"hierarchy_stoplist\"\n | \"high_memory_warning\"\n | \"high_page_fault_warning\"\n | \"high_response_time_warning\"\n | \"hostname_aliases\"\n | \"hosts_file\"\n | \"htcp_access\"\n | \"htcp_clr_access\"\n | \"htcp_port\"\n | \"http_access2\"\n | \"http_port\"\n | \"http_reply_access\"\n | \"httpd_accel_no_pmtu_disc\"\n | \"httpd_suppress_version_string\"\n | \"https_port\"\n | \"icon_directory\"\n | \"icp_access\"\n | \"icp_hit_stale\"\n | \"icp_port\"\n | \"icp_query_timeout\"\n | \"ident_lookup_access\"\n | \"ident_timeout\"\n | \"ie_refresh\"\n | \"ignore_unknown_nameservers\"\n | \"incoming_dns_average\"\n | \"incoming_http_average\"\n | \"incoming_icp_average\"\n | \"ipcache_high\"\n | \"ipcache_low\"\n | \"ipcache_size\"\n | \"location_rewrite_access\"\n | \"location_rewrite_children\"\n | \"location_rewrite_concurrency\"\n | \"location_rewrite_program\"\n | \"log_access\"\n | \"log_fqdn\"\n | \"log_icp_queries\"\n | \"log_ip_on_direct\"\n | \"log_mime_hdrs\"\n | \"log_uses_indirect_client\"\n | \"logfile_rotate\"\n | \"logformat\"\n | \"mail_from\"\n | \"mail_program\"\n | \"max_open_disk_fds\"\n | \"maximum_icp_query_timeout\"\n | \"maximum_object_size\"\n | \"maximum_object_size_in_memory\"\n | \"maximum_single_addr_tries\"\n | \"mcast_groups\"\n | \"mcast_icp_query_timeout\"\n | \"mcast_miss_addr\"\n | \"mcast_miss_encode_key\"\n | \"mcast_miss_port\"\n | \"mcast_miss_ttl\"\n | \"memory_pools\"\n | \"memory_pools_limit\"\n | \"memory_replacement_policy\"\n | \"mime_table\"\n | \"min_dns_poll_cnt\"\n | \"min_http_poll_cnt\"\n | \"min_icp_poll_cnt\"\n | \"minimum_direct_hops\"\n | \"minimum_direct_rtt\"\n | \"minimum_expiry_time\"\n | \"minimum_object_size\"\n | \"miss_access\"\n | \"negative_dns_ttl\"\n | \"negative_ttl\"\n | \"neighbor_type_domain\"\n | \"netdb_high\"\n | \"netdb_low\"\n | \"netdb_ping_period\"\n | \"never_direct\"\n | \"nonhierarchical_direct\"\n | \"offline_mode\"\n | \"pconn_timeout\"\n | \"peer_connect_timeout\"\n | \"persistent_connection_after_error\"\n | \"persistent_request_timeout\"\n | \"pid_filename\"\n | \"pinger_program\"\n | \"pipeline_prefetch\"\n | \"positive_dns_ttl\"\n | \"prefer_direct\"\n | \"query_icmp\"\n | \"quick_abort_max\"\n | \"quick_abort_min\"\n | \"quick_abort_pct\"\n | \"range_offset_limit\"\n | \"read_ahead_gap\"\n | \"read_timeout\"\n | \"redirector_bypass\"\n | \"referer_log\"\n | \"refresh_pattern\"\n | \"refresh_stale_hit\"\n | \"relaxed_header_parser\"\n | \"reload_into_ims\"\n | \"reply_body_max_size\"\n | \"reply_header_max_size\"\n | \"request_body_max_size\"\n | \"request_entities\"\n | \"request_header_max_size\"\n | \"request_timeout\"\n | \"retry_on_error\"\n | \"server_persistent_connections\"\n | \"short_icon_urls\"\n | \"shutdown_lifetime\"\n | \"sleep_after_fork\"\n | \"snmp_access\"\n | \"snmp_incoming_address\"\n | \"snmp_outgoing_address\"\n | \"snmp_port\"\n | \"ssl_engine\"\n | \"ssl_unclean_shutdown\"\n | \"sslpassword_program\"\n | \"sslproxy_cafile\"\n | \"sslproxy_capath\"\n | \"sslproxy_cipher\"\n | \"sslproxy_client_certificate\"\n | \"sslproxy_client_key\"\n | \"sslproxy_flags\"\n | \"sslproxy_options\"\n | \"sslproxy_version\"\n | \"store_avg_object_size\"\n | \"store_dir_select_algorithm\"\n | \"store_objects_per_bucket\"\n | \"strip_query_terms\"\n | \"tcp_outgoing_address\"\n | \"tcp_outgoing_tos\"\n | \"tcp_recv_bufsize\"\n | \"test_reachability\"\n | \"udp_incoming_address\"\n | \"udp_outgoing_address\"\n | \"umask\"\n | \"unique_hostname\"\n | \"unlinkd_program\"\n | \"uri_whitespace\"\n | \"url_rewrite_access\"\n | \"url_rewrite_children\"\n | \"url_rewrite_concurrency\"\n | \"url_rewrite_host_header\"\n | \"url_rewrite_program\"\n | \"useragent_log\"\n | \"vary_ignore_expire\"\n | \"via\"\n | \"visible_hostname\"\n | \"wccp2_address\"\n | \"wccp2_assignment_method\"\n | \"wccp2_forwarding_method\"\n | \"wccp2_rebuild_wait\"\n | \"wccp2_return_method\"\n | \"wccp2_router\"\n | \"wccp2_service\"\n | \"wccp2_service_info\"\n | \"wccp2_weight\"\n | \"wccp_address\"\n | \"wccp_router\"\n | \"wccp_version\"\n\nlet entry = Spacevars.entry entry_re\n\n(************************************************************************\n * AUTH\n *************************************************************************)\n\nlet auth_re = \"auth_param\"\nlet auth = [ key \"auth_param\"\n . value \"scheme\"\n . value \"parameter\"\n . (value \"setting\") ?\n . (eol|comment) ]\n\n(************************************************************************\n * ACL\n *************************************************************************)\n\nlet acl_re = \"acl\"\nlet acl = [ key acl_re . spc\n . [ key word\n . value \"type\"\n . value \"setting\"\n . parameters?\n . (eol|comment) ] ]\n\n(************************************************************************\n * HTTP ACCESS\n *************************************************************************)\n\nlet http_access_re\n = \"http_access\"\nlet http_access\n = [ key http_access_re\n . spc\n . [ key \/allow|deny\/\n . spc\n . sto_to_spc\n . parameters? ]\n . (eol|comment) ]\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\nlet lns = Spacevars.lns (entry|auth|acl|http_access)\n\nlet filter = Util.stdexcl\n . incl \"\/etc\/squid\/squid.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"2ef5a4811acbca363eaa0dd1aa8959cd1d28f05c","subject":"backport fix in aa2763, remove after 0.5.1 release","message":"backport fix in aa2763, remove after 0.5.1 release\n","repos":"camptocamp\/puppet-augeas,SUNET\/puppet-augeas,leapcode\/puppet_augeas,jordiclariana\/puppet-augeas,apa-it\/puppet-augeas","old_file":"files\/logrotate.aug","new_file":"files\/logrotate.aug","new_contents":"(* Logrotate module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* Patches from: *)\n(* Sean Millichamp <sean@bruenor.org> *)\n(* *)\n(* Supported : *)\n(* - defaults *)\n(* - rules *)\n(* - (pre|post)rotate entries *)\n(* *)\n(* Todo : *)\n(* *)\n\nmodule Logrotate =\n autoload xfm\n\n let sep_spc = Util.del_ws_spc\n let sep_val = del \/[ \\t]*=[ \\t]*|[ \\t]+\/ \" \"\n let eol = Util.del_str \"\\n\"\n let num = \/[0-9]+\/\n let word = \/[^,#= \\n\\t{}]+\/\n let size = num . \/[kMG]?\/\n\n (* define comments and empty lines *)\n let comment (indent:string) = [ label \"#comment\" . del \/[ \\t]*\/ indent . del \/#[ \\t]*\/ \"# \" . store \/([^ \\t\\n][^\\n]*)?\/ . eol ]\n let empty = [ del \/[ \\t]*\\n\/ \"\\n\" ]\n\n\n (* Useful functions *)\n\n let list_item = [ sep_spc . key \/[^\\\/+,# \\n\\t{}]+\/ ]\n let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del \/[ \\t]*\/ indent . label kw . store select . eol ]\n let value_to_eol (kw:string) (value:regexp) (indent:string ) = [ del \/[ \\t]*\/ indent . key kw . sep_val . store value . eol ]\n let flag_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . eol ]\n let list_to_eol (kw:string) (indent:string) = [ del \/[ \\t]*\/ indent . key kw . list_item+ . eol ]\n\n\n (* Defaults *)\n\n let create (indent:string ) = [ del \/[ \\t]*\/ indent . key \"create\" .\n ( sep_spc . [ label \"mode\" . store num ] . sep_spc .\n\t\t [ label \"owner\" . store word ] . sep_spc .\n\t\t [ label \"group\" . store word ])?\n\t\t . eol ]\n\n let tabooext (indent:string) = [ del \/[ \\t]*\/ indent . key \"tabooext\" . ( sep_spc . store \/\\+\/ )? . list_item+ . eol ]\n\n let attrs (indent:string) = select_to_eol \"schedule\" \/(daily|weekly|monthly|yearly)\/ indent\n | value_to_eol \"rotate\" num indent\n\t\t| create indent\n\t\t| flag_to_eol \"nocreate\" indent\n\t\t| value_to_eol \"include\" word indent\n\t\t| select_to_eol \"missingok\" \/(no)?missingok\/ indent\n\t\t| select_to_eol \"compress\" \/(no)?compress\/ indent\n\t\t| select_to_eol \"delaycompress\" \/(no)?delaycompress\/ indent\n\t\t| select_to_eol \"ifempty\" \/(not)?ifempty\/ indent\n\t\t| select_to_eol \"sharedscripts\" \/(no)?sharedscripts\/ indent\n\t\t| value_to_eol \"size\" size indent\n\t\t| tabooext indent\n\t\t| value_to_eol \"olddir\" word indent\n\t\t| flag_to_eol \"noolddir\" indent\n\t\t| value_to_eol \"mail\" word indent\n\t\t| flag_to_eol \"mailfirst\" indent\n\t\t| flag_to_eol \"maillast\" indent\n\t\t| flag_to_eol \"nomail\" indent\n\t\t| value_to_eol \"errors\" word indent\n\t\t| value_to_eol \"extension\" word indent\n\t\t| select_to_eol \"dateext\" \/(no)?dateext\/ indent\n\t\t| value_to_eol \"compresscmd\" word indent\n\t\t| value_to_eol \"uncompresscmd\" word indent\n\t\t| value_to_eol \"compressext\" word indent\n\t\t| list_to_eol \"compressoptions\" indent\n\t\t| select_to_eol \"copy\" \/(no)?copy\/ indent\n\t\t| select_to_eol \"copytruncate\" \/(no)?copytruncate\/ indent\n\t\t| value_to_eol \"maxage\" num indent\n\t\t| value_to_eol \"minsize\" size indent\n\t\t| select_to_eol \"shred\" \/(no)?shred\/ indent\n\t\t| value_to_eol \"shredcycles\" num indent\n\t\t| value_to_eol \"start\" num indent\n\n (* Define hooks *)\n\n\n let hook_lines =\n let line_re = \/.*\/ - \/[ \\t]*endscript[ \\t]*\/ in\n store ( line_re . (\"\\n\" . line_re)* )? . del \"\\n\" \"\\n\"\n\n let hooks =\n let hook_names = \/(pre|post)rotate|(first|last)action\/ in\n [ del \/[ \\t]*\/ \"\\t\" . key hook_names . eol .\n hook_lines .\n del \/[ \\t]*endscript\\n\/ \"\\tendscript\\n\" ]\n\n (* Define rule *)\n\n let body = del \/\\{[ \\t]*\\n\/ \"{\\n\"\n . ( comment \"\\t\" | attrs \"\\t\" | hooks | empty )*\n . del \/[ \\t]*\\}[ \\t]*\\n\/ \"}\\n\"\n\n let rule =\n [ label \"rule\" .\n [ label \"file\" . store word ] .\n\t [ del \/[ \\t]+\/ \" \" . label \"file\" . store word ]* .\n\t del \/[ \\t\\n]*\/ \" \" . body ]\n\n let lns = ( comment \"\" | empty | attrs \"\" | rule )*\n\n let filter = incl \"\/etc\/logrotate.d\/*\"\n . incl \"\/etc\/logrotate.conf\"\n\t . Util.stdexcl\n\n let xfm = transform lns filter\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/logrotate.aug' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Augeas"} {"commit":"63aa1dfb1fb405ae29b39073abd9af1264c2fede","subject":"A (pretty kludgy) description for cmfm.conf","message":"A (pretty kludgy) description for cmfm.conf\n","repos":"ptoscano\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,pevalme\/augeas,kumy\/augeas,kunkku\/augeas,raphink\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,lutter\/augeas,mchf\/augeas,kumy\/augeas,pevalme\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,hercules-team\/augeas,ptoscano\/augeas,domcleal\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,camptocamp\/augeas,mlichvar\/augeas,kunkku\/augeas,ptoscano\/augeas,manandbytes\/augeas,camptocamp\/augeas,MikaelSmith\/augeas,bkearney\/augeas,jtopjian\/augeas,bkearney\/augeas,kumy\/augeas,jjlin\/augeas,lutter\/augeas,jasperla\/augeas,bkearney\/augeas,dafugg\/augeas,bkearney\/augeas,dafugg\/augeas,mlichvar\/augeas,domcleal\/augeas,jjlin\/augeas,kunkku\/augeas,pevalme\/augeas,dafugg\/augeas,jtopjian\/augeas,camptocamp\/augeas,kumy\/augeas,camptocamp\/augeas,mchf\/augeas,lutter\/augeas,raphink\/augeas","old_file":"spec\/cmfm.aug","new_file":"spec\/cmfm.aug","new_contents":"# A complicated format: cmfm.conf\n\nmap\n grammar cmfm\n include '\/etc\/cmfm.conf' '\/system\/config\/cmfm'\nend\n\ngrammar cmfm\n # Matches whitespace and comments\n token CWS \/([ \\n\\t]+|\\\/\\*([^\\*]|\\*[^\\\/])*\\*\\\/)*\/ = ''\n\n token WORD \/[a-zA-Z_0-9]+\/ = ''\n\n # Boomerang definition:\n # let pci_elt = \"(\" . word . (\",\" . cws_re . word){3} . \")\"\n # token PCI_ELT \/\\(WORD(,CWS WORD){3}\\)\/\n # let pci_array = \"(\" . cws_re . pci_elt . (\",\" . cws_re . pci_elt)* . cws_re . \")\"\n # token PCI_ARRAY \/\\(CWS PCI_ELT (,CWS PCI_ELT)* CWS\\)\/\n # let value = (word | \"\\\"\" . [^\"]* . \"\\\"\" | pci_array )\n\n # the above manually expanded and turned into a POSIX regexp since\n # augeas can't concat regexps:\n token VALUE \/([a-zA-Z_0-9]+|\"[^\"]*\"|\\(([ \\n\\t]+|\\\/\\*([^\\*]|\\*[^\\\/])*\\*\\\/)*\\([a-zA-Z_0-9]+(,([ \\n\\t]+|\\\/\\*([^\\*]|\\*[^\\\/])*\\*\\\/)*[a-zA-Z_0-9]+){3}\\)(,([ \\n\\t]+|\\\/\\*([^\\*]|\\*[^\\\/])*\\*\\\/)*\\([a-zA-Z_0-9]+(,([ \\n\\t]+|\\\/\\*([^\\*]|\\*[^\\\/])*\\*\\\/)*[a-zA-Z_0-9]+){3}\\))*([ \\n\\t]+|\\\/\\*([^\\*]|\\*[^\\\/])*\\*\\\/)*\\))\/ = '\"\"'\n\n file: CWS . (entry3)*\n\n assignment: [ key WORD . CWS . '=' . CWS . store VALUE . ';' . CWS ]\n\n # Approximate the nesting of sections up to a max of 3\n entry1: assignment | sec1\n sec1: [label '{1}' . [ key WORD . ':' . CWS . '{' . CWS . (assignment)* . '}' . ';' . CWS] ]\n\n entry2: assignment | sec2\n sec2: [label '{2}' . [ key WORD . ':' . CWS . '{' . CWS . (entry1)* . '}' . ';' . CWS] ]\n\n entry3: assignment | sec3\n sec3: [ label '{3}' . [ key WORD . ':' . CWS . '{' . CWS . (entry2)* . '}' . ';' . CWS] ]\nend\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spec\/cmfm.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"667eead5e202438898bdaf4c616835ffc9af0678","subject":"backport fix 1a6042, remove after 0.5.1 release","message":"backport fix 1a6042, remove after 0.5.1 release\n","repos":"camptocamp\/puppet-augeas,apa-it\/puppet-augeas,leapcode\/puppet_augeas,SUNET\/puppet-augeas,jordiclariana\/puppet-augeas","old_file":"files\/php.aug","new_file":"files\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/php.aug' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Augeas"} {"commit":"a8273bc566048f7dd8c0f1c42a6e0e998be819ed","subject":"Adapt sudoers.aug for NaturalDocs parsing","message":"Adapt sudoers.aug for NaturalDocs parsing\n","repos":"kunkku\/augeas,dafugg\/augeas,camptocamp\/augeas,lutter\/augeas,bkearney\/augeas,lutter\/augeas,bkearney\/augeas,domcleal\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,mlichvar\/augeas,kumy\/augeas,jjlin\/augeas,MikaelSmith\/augeas,kumy\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,camptocamp\/augeas,camptocamp\/augeas,bkearney\/augeas,mchf\/augeas,hercules-team\/augeas,jjlin\/augeas,mlichvar\/augeas,raphink\/augeas,kumy\/augeas,jjlin\/augeas,bkearney\/augeas,dafugg\/augeas,jtopjian\/augeas,jasperla\/augeas,mchf\/augeas,domcleal\/augeas,camptocamp\/augeas,kumy\/augeas,pevalme\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,mlichvar\/augeas,ptoscano\/augeas,ptoscano\/augeas,jtopjian\/augeas,manandbytes\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,dafugg\/augeas,hercules-team\/augeas,kunkku\/augeas,domcleal\/augeas","old_file":"lenses\/sudoers.aug","new_file":"lenses\/sudoers.aug","new_contents":"(* \nModule: Sudoers\n Parses \/etc\/sudoers \n\nAuthor: Raphael Pinson <raphink@gmail.com> \n \nAbout: Reference\n This lens tries to keep as close as possible to `man sudoers` where possible.\n\nFor example, recursive definitions such as\n\n > Cmnd_Spec_List ::= Cmnd_Spec |\n > Cmnd_Spec ',' Cmnd_Spec_List\n\nare replaced by\n\n > let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\nsince Augeas cannot deal with recursive definitions.\nThe definitions from `man sudoers` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the GPL.\n\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Set first Defaults to apply to the \"LOCALNET\" network alias\n > set \/files\/etc\/sudoers\/Defaults[1]\/type \"@LOCALNET\"\n * List all user specifications applying explicitely to the \"admin\" Unix group\n > match \/files\/etc\/sudoers\/spec\/user \"%admin\"\n * Remove the full 3rd user specification\n > rm \/files\/etc\/sudoers\/spec[3]\n\nAbout: Configuration files\n This lens applies to \/etc\/sudoers. See <filter>.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n(* Variable: eol *)\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\n\n(* Variable: indent *)\nlet indent = del \/[ \\t]*\/ \"\"\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\n\n(* Variable: sep_cont *)\nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_conf_opt *)\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\n(* Variable: sep_com *)\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\n\n(* Variable: sep_eq *)\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\n\n(* Variable: sep_col *)\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n\n(* Group: Stores *)\n\n(* Variable: sto_to_com_cmnd\nsto_to_com_cmnd does not begin or end with a space\n\nTODO: there could be a \\ in the middle of a command... *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n\\\\\\\\]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\n\n(* Variable: sto_to_com *)\nlet sto_to_com = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_com_user *)\nlet sto_to_com_user = store ( \/[^,=:#() \\t\\n]+\/\n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\n\n(* Variable: sto_to_eq *)\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* Variable: sto_to_spc *)\nlet sto_to_spc = store \/[^() \\t\\n\\\\\\\\]+\/\n\n\n(* Group: Comments and empty lines *)\n\n(* View: comment\nMap comments in \"#comment\" nodes *)\nlet comment =\n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n\n(* View: empty\nMap empty lines *)\nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * Group: ALIASES\n *************************************************************************)\n\n(************************************************************************\n * View: alias_field\n * Generic alias field to gather all Alias definitions\n *\n * Definition:\n * > User_Alias ::= NAME '=' User_List\n * > Runas_Alias ::= NAME '=' Runas_List\n * > Host_Alias ::= NAME '=' Host_List\n * > Cmnd_Alias ::= NAME '=' Cmnd_List\n *\n * Parameters:\n * kw:string - the label string\n * sto:lens - the store lens\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\n\n(* View: alias_list\n List of <alias_fields>, separated by commas *)\nlet alias_list (kw:string) (sto:lens) =\n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * View: alias_name\n * Name of an <alias_entry_single>\n *\n * Definition:\n * > NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * View: alias_entry_single\n * Single <alias_entry>, named using <alias_name> and listing <alias_list>\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, ...\n *\n * Parameters:\n * field:string - the field name, passed to <alias_list>\n * sto:lens - the store lens, passed to <alias_list>\n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * View: alias_entry\n * Alias entry, a list of comma-separated <alias_entry_single> fields\n *\n * Definition:\n * > Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *\n * Parameters:\n * kw:string - the alias keyword string\n * field:string - the field name, passed to <alias_entry_single>\n * sto:lens - the store lens, passed to <alias_entry_single>\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\n(* View: user_alias\n User_Alias, see <alias_field> *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\n(* View: runas_alias\n Run_Alias, see <alias_field> *)\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\n(* View: host_alias\n Host_Alias, see <alias_field> *)\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\n(* View: cmnd_alias\n Cmnd_Alias, see <alias_field> *)\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * View: alias\n * Every kind of Alias entry,\n * see <user_alias>, <runas_alias>, <host_alias> and <cmnd_alias>\n *\n * Definition:\n * > Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * > 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * > 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * > 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n(************************************************************************\n * Group: DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * View: default_type\n * Type definition for <defaults>\n *\n * Definition:\n * > Default_Type ::= 'Defaults' |\n * > 'Defaults' '@' Host_List |\n * > 'Defaults' ':' User_List |\n * > 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type =\n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * View: parameter\n * A single parameter for <defaults>\n *\n * Definition:\n * > Parameter ::= Parameter '=' Value |\n * > Parameter '+=' Value |\n * > Parameter '-=' Value |\n * > '!'* Parameter\n *************************************************************************)\nlet parameter =\n let value = \/([^,:= \\t\\n\\\\\\\\][^,\\n\\\\\\\\]*[^, \\t\\n\\\\\\\\])|[^,:= \\t\\n\\\\\\\\]\/ in\n [ label \"parameter\" . store value ]\n\n(************************************************************************\n * View: paramater_list\n * A list of comma-separated <parameters> for <defaults>\n *\n * Definition:\n * > Parameter_List ::= Parameter |\n * > Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n\n(************************************************************************\n * View: defaults\n * A Defaults entry\n *\n * Definition:\n * > Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont\n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * Group: USER SPECIFICATION\n *************************************************************************)\n\n(************************************************************************\n * View: runas_spec\n * A runas specification for <spec>, using <alias_list>\n *\n * Definition:\n * > Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com\n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * View: tag_spec\n * Tag specification for <spec>\n *\n * Definition:\n * > Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * > 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * View: cmnd_spec\n * Command specification for <spec>,\n * with optional <runas_spec> and any amount of <tag_specs>\n *\n * Definition:\n * > Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * View: cmnd_spec_list\n * A list of comma-separated <cmnd_specs>\n *\n * Definition:\n * > Cmnd_Spec_List ::= Cmnd_Spec |\n * > Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * View: spec_list\n * Group of hosts with <cmnd_spec_list>\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com\n . sep_eq . cmnd_spec_list ]\n\n(************************************************************************\n * View: spec\n * A user specification, listing colon-separated <spec_lists>\n *\n * Definition:\n * > User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * > (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * Group: LENS & FILTER\n *************************************************************************)\n\n(* View: lns\n The sudoers lens, any amount of\n * <empty> lines\n * <comments>\n * <aliases>\n * <defaults>\n * <specs>\n*)\nlet lns = ( empty | comment | alias | defaults | spec )*\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n\n","old_contents":"(* Sudoers module for Augeas \n Author: Raphael Pinson <raphink@gmail.com> \n \n Reference: `man sudoers` \n This lens tries to keep as close as possible to `man sudoers` where possible. \n For example, recursive definitions such as:\n\n Cmnd_Spec_List ::= Cmnd_Spec |\n Cmnd_Spec ',' Cmnd_Spec_List\n\n are replaced by \n\n let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )* \n\n since Augeas cannot deal with recursive definitions.\n The definitions from `man sudoers` are put as commentaries for reference\n throughout the file. More information can be found in the manual.\n*)\n\n\n\nmodule Sudoers =\n autoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = del \/[ \\t]*\\n\/ \"\\n\"\nlet indent = del \/[ \\t]*\/ \"\"\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \" \nlet sep_cont = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\nlet sep_cont_opt = del \/([ \\t]*|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\nlet sep_com = sep_cont_opt . Util.del_str \",\" . sep_cont_opt\nlet sep_eq = sep_cont_opt . Util.del_str \"=\" . sep_cont_opt\nlet sep_col = sep_cont_opt . Util.del_str \":\" . sep_cont_opt\n\n(* Define fields *)\nlet sto_to_com_cmnd = store \/([^,=:#() \\t\\n\\\\\\\\][^,=:#()\\n\\\\\\\\]*[^,=:#() \\t\\n\\\\\\\\])|[^,=:#() \\t\\n\\\\\\\\]\/\nlet sto_to_com = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\n\n(* sto_to_com does not begin or end with a space *)\n(* TODO: there could be a \\ in the middle of a command... *)\nlet sto_to_com_user = store ( \/[^,=:#() \\t\\n]+\/ \n - \/(User|Runas|Host|Cmnd)_Alias|Defaults.*\/ )\nlet sto_to_eq = store \/[^,=:#() \\t\\n\\\\\\\\]+\/\nlet sto_to_spc = store \/[^() \\t\\n\\\\\\\\]+\/\n\n\n(* define comments and empty lines *)\nlet comment = \n let sto_to_eol = store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ in\n [ label \"comment\" . del \/[ \\t]*#[ \\t]*\/ \"# \" . sto_to_eol . eol ]\n \nlet empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\\n\" ]\n\n(************************************************************************\n * ALIASES\n *************************************************************************)\n\n(************************************************************************\n * User_Alias ::= NAME '=' User_List\n * Runas_Alias ::= NAME '=' Runas_List\n * Host_Alias ::= NAME '=' Host_List\n * Cmnd_Alias ::= NAME '=' Cmnd_List\n *************************************************************************)\nlet alias_field (kw:string) (sto:lens) = [ label kw . sto ]\nlet alias_list (kw:string) (sto:lens) = \n alias_field kw sto . ( sep_com . alias_field kw sto )*\n\n(************************************************************************\n * NAME ::= [A-Z]([A-Z][0-9]_)*\n *************************************************************************)\nlet alias_name\n = [ label \"name\" . store \/[A-Z][A-Z0-9_]*\/ ]\n\n(************************************************************************\n * Alias_Type NAME = item1, item2, ... \n *************************************************************************)\nlet alias_entry_single (field:string) (sto:lens)\n = [ label \"alias\" . alias_name . sep_eq . alias_list field sto ]\n\n(************************************************************************\n * Alias_Type NAME = item1, item2, item3 : NAME = item4, item5\n *************************************************************************)\nlet alias_entry (kw:string) (field:string) (sto:lens)\n = [ indent . key kw . sep_cont . alias_entry_single field sto\n . ( sep_col . alias_entry_single field sto )* . eol ]\n\n(* TODO: go further in user definitions *)\nlet user_alias = alias_entry \"User_Alias\" \"user\" sto_to_com\nlet runas_alias = alias_entry \"Runas_Alias\" \"runas_user\" sto_to_com\nlet host_alias = alias_entry \"Host_Alias\" \"host\" sto_to_com\nlet cmnd_alias = alias_entry \"Cmnd_Alias\" \"command\" sto_to_com_cmnd\n\n\n(************************************************************************\n * Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |\n * 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |\n * 'Host_Alias' Host_Alias (':' Host_Alias)* |\n * 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*\n *************************************************************************)\nlet alias = user_alias | runas_alias | host_alias | cmnd_alias\n\n\n\n(************************************************************************\n * DEFAULTS\n *************************************************************************)\n\n(************************************************************************\n * Default_Type ::= 'Defaults' |\n * 'Defaults' '@' Host_List |\n * 'Defaults' ':' User_List |\n * 'Defaults' '>' Runas_List\n *************************************************************************)\nlet default_type = \n let value = store \/[@:>][^ \\t\\n\\\\\\\\]+\/ in\n [ label \"type\" . value ]\n\n(************************************************************************\n * Parameter ::= Parameter '=' Value |\n * Parameter '+=' Value |\n * Parameter '-=' Value |\n * '!'* Parameter\n *************************************************************************)\nlet parameter = \n let value = \/([^,:= \\t\\n\\\\\\\\][^,\\n\\\\\\\\]*[^, \\t\\n\\\\\\\\])|[^,:= \\t\\n\\\\\\\\]\/ in\n [ label \"parameter\" . store value ]\n\n(************************************************************************\n * Parameter_List ::= Parameter |\n * Parameter ',' Parameter_List\n *************************************************************************)\nlet parameter_list = parameter . ( sep_com . parameter )*\n \n(************************************************************************\n * Default_Entry ::= Default_Type Parameter_List\n *************************************************************************)\nlet defaults = [ indent . key \"Defaults\" . default_type? . sep_cont \n . parameter_list . eol ]\n\n\n\n(************************************************************************\n * USER SPECIFICATION \n *************************************************************************)\n\n(************************************************************************\n * Runas_Spec ::= '(' Runas_List ')'\n *************************************************************************)\nlet runas_spec = Util.del_str \"(\" . alias_list \"runas_user\" sto_to_com \n . Util.del_str \")\" . sep_cont_opt\n\n(************************************************************************\n * Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |\n * 'SETENV:' | 'NOSETENV:')\n *************************************************************************)\nlet tag_spec =\n [ label \"tag\" . store \/(NO)?(PASSWD|EXEC|SETENV)\/ . sep_col ]\n\n(************************************************************************\n * Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd\n *************************************************************************)\nlet cmnd_spec =\n [ label \"command\" . runas_spec? . tag_spec* . sto_to_com_cmnd ]\n\n(************************************************************************\n * Cmnd_Spec_List ::= Cmnd_Spec |\n * Cmnd_Spec ',' Cmnd_Spec_List\n *************************************************************************)\nlet cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*\n\n\n(************************************************************************\n * User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \\\n * (':' Host_List '=' Cmnd_Spec_List)*\n *************************************************************************)\nlet spec_list = [ label \"host_group\" . alias_list \"host\" sto_to_com \n . sep_eq . cmnd_spec_list ]\n\nlet spec = [ label \"spec\" . indent\n . alias_list \"user\" sto_to_com_user . sep_cont\n . spec_list\n \t . ( sep_col . spec_list )* . eol ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\n\nlet lns = ( empty | comment | alias | defaults | spec )*\n\nlet filter = (incl \"\/etc\/sudoers\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b7668109fd03d77eb85e346adc31d185febc4f0c","subject":"Support \\r in httpd.aug","message":"Support \\r in httpd.aug\n","repos":"kunkku\/augeas,ptoscano\/augeas,dafugg\/augeas,manandbytes\/augeas,ptoscano\/augeas,hercules-team\/augeas,domcleal\/augeas,pevalme\/augeas,mlichvar\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,kumy\/augeas,lutter\/augeas,hercules-team\/augeas,kumy\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,raphink\/augeas,jjlin\/augeas,mchf\/augeas,lutter\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,raphink\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,MikaelSmith\/augeas,GeoffWilliams\/augeas,kumy\/augeas,jtopjian\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,mlichvar\/augeas,mchf\/augeas,jjlin\/augeas,domcleal\/augeas,kunkku\/augeas,jasperla\/augeas,pevalme\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,kumy\/augeas","old_file":"lenses\/httpd.aug","new_file":"lenses\/httpd.aug","new_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPLv2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\r?\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.doseol\nlet empty = Util.empty_dos\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\r\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\r\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\r\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\r\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let h = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n [ indent . dels \"<\" . square word h . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","old_contents":"(* Apache HTTPD lens for Augeas\n\nAuthors:\n David Lutterkort <lutter@redhat.com>\n Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n Online Apache configuration manual: http:\/\/httpd.apache.org\/docs\/trunk\/\n\nAbout: License\n This file is licensed under the LGPLv2+.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Apache configuration is represented by two main structures, nested sections\n and directives. Sections are used as labels, while directives are kept as a\n value. Sections and directives can have positional arguments inside values\n of \"arg\" nodes. Arguments of sections must be the firsts child of the\n section node.\n\n This lens doesn't support automatic string quoting. Hence, the string must\n be quoted when containing a space.\n\n Create a new VirtualHost section with one directive:\n > clear \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/arg \"172.16.0.1:80\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/directive \"ServerAdmin\"\n > set \/files\/etc\/apache2\/sites-available\/foo\/VirtualHost\/*[self::directive=\"ServerAdmin\"]\/arg \"admin@example.com\"\n\nAbout: Configuration files\n This lens applies to files in \/etc\/httpd and \/etc\/apache2. See <filter>.\n\n*)\n\n\nmodule Httpd =\n\nautoload xfm\n\n(******************************************************************\n * Utilities lens\n *****************************************************************)\nlet dels (s:string) = del s s\n\n(* deal with continuation lines *)\nlet sep_spc = del \/([ \\t]+|[ \\t]*\\\\\\\\\\n[ \\t]*)\/ \" \"\n\nlet sep_osp = Sep.opt_space\nlet sep_eq = del \/[ \\t]*=[ \\t]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\n\nlet comment = Util.comment\nlet eol = Util.eol\nlet empty = Util.empty\nlet indent = Util.indent\n\n(* borrowed from shellvars.aug *)\nlet char_arg_dir = \/[^ '\"\\t\\n]|\\\\\\\\\"|\\\\\\\\'\/\nlet char_arg_sec = \/[^ '\"\\t\\n>]|\\\\\\\\\"|\\\\\\\\'\/\nlet dquot = \/\"([^\"\\\\\\n]|\\\\\\\\.)*\"\/\nlet squot = \/'([^'\\\\\\n]|\\\\\\\\.)*'\/\n\n(******************************************************************\n * Attributes\n *****************************************************************)\n\nlet arg_dir = [ label \"arg\" . store (char_arg_dir+|dquot|squot) ]\nlet arg_sec = [ label \"arg\" . store (char_arg_sec+|dquot|squot) ]\n\nlet argv (l:lens) = l . (sep_spc . l)*\n\nlet directive = [ indent . label \"directive\" . store word .\n (sep_spc . argv arg_dir)? . eol ]\n\nlet section (body:lens) =\n let h = (sep_spc . argv arg_sec)? . sep_osp .\n dels \">\" . eol . body* . indent . dels \"<\/\" in\n [ indent . dels \"<\" . square word h . del \">\" \">\" . eol ]\n\nlet rec content = section (content|directive|comment|empty)\n\nlet lns = (content|directive|comment|empty)*\n\nlet filter = (incl \"\/etc\/apache2\/apache2.conf\") .\n (incl \"\/etc\/apache2\/httpd.conf\") .\n (incl \"\/etc\/apache2\/ports.conf\") .\n (incl \"\/etc\/apache2\/conf.d\/*\") .\n (incl \"\/etc\/apache2\/mods-available\/*\") .\n (incl \"\/etc\/apache2\/sites-available\/*\") .\n (incl \"\/etc\/httpd\/conf.d\/*.conf\") .\n (incl \"\/etc\/httpd\/httpd.conf\") .\n (incl \"\/etc\/httpd\/conf\/httpd.conf\") .\n Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6172c0c41e4f06cb169c04d9342bc5af4fe58c73","subject":"Util: add eol, indent, comment and empty","message":"Util: add eol, indent, comment and empty\n","repos":"ptoscano\/augeas,pevalme\/augeas,bkearney\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,mlichvar\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,lutter\/augeas,lutter\/augeas,domcleal\/augeas,hercules-team\/augeas,domcleal\/augeas,ptoscano\/augeas,manandbytes\/augeas,jjlin\/augeas,bkearney\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,mchf\/augeas,hercules-team\/augeas,mlichvar\/augeas,kumy\/augeas,kunkku\/augeas,raphink\/augeas,kunkku\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,kumy\/augeas,pevalme\/augeas,camptocamp\/augeas,bkearney\/augeas,raphink\/augeas,kunkku\/augeas,jasperla\/augeas,kumy\/augeas,pevalme\/augeas,camptocamp\/augeas,dafugg\/augeas,camptocamp\/augeas,camptocamp\/augeas,kumy\/augeas,domcleal\/augeas,lutter\/augeas,MikaelSmith\/augeas,bkearney\/augeas,mchf\/augeas,ptoscano\/augeas,manandbytes\/augeas,dafugg\/augeas","old_file":"lenses\/util.aug","new_file":"lenses\/util.aug","new_contents":"(* Simple utilities used in several places *)\nmodule Util =\n let del_str (s:string) = del s s\n\n let del_ws = del \/[ \\t]+\/\n let del_ws_spc = del_ws \" \"\n let del_ws_tab = del_ws \"\\t\"\n\n let del_opt_ws = del \/[ \\t]*\/\n\n let eol = del \/[ \\t]*\\n\/ \"\\n\"\n let indent = del \/[ \\t]*\/ \"\"\n\n (* comment and empty\n This is a general definition of comment and empty.\n It allows indentation for comments, removes the leading and trailing spaces\n of comments and stores them in nodes, except for empty comments which are \n ignored together with empty lines\n *)\n let comment = \n [ indent . label \"comment\" . del \/#[ \\t]*\/ \"# \" \n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/ . eol ]\n\n let empty = [ del \/[ \\t]*#?[ \\t]*\\n\/ \"\" ]\n\n (* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n (* appears in a separate subtree. The labels for the subtrees are *)\n (* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n (* Exclusion for files that are commonly not wanted\/needed *)\n let stdexcl = (excl \"*~\") . (excl \"*.rpmnew\") . (excl \"*.rpmsave\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Simple utilities used in several places *)\nmodule Util =\n let del_str (s:string) = del s s\n\n let del_ws = del \/[ \\t]+\/\n let del_ws_spc = del_ws \" \"\n let del_ws_tab = del_ws \"\\t\"\n\n let del_opt_ws = del \/[ \\t]*\/\n\n (* Split (SEP . ELT)* into an array-like tree where each match for ELT *)\n (* appears in a separate subtree. The labels for the subtrees are *)\n (* consecutive numbers, starting at 0 *)\n let split (elt:lens) (sep:lens) =\n let sym = gensym \"split\" in\n counter sym . ( [ seq sym . sep . elt ] ) *\n\n (* Exclusion for files that are commonly not wanted\/needed *)\n let stdexcl = (excl \"*~\") . (excl \"*.rpmnew\") . (excl \"*.rpmsave\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"18e12d78e38bfd4bcd947fa8a20a194556c5654e","subject":"dhcpd, removed unused variable and reformatted","message":"dhcpd, removed unused variable and reformatted\n\nstmt_subclass was a little too cluttered so I changed it to multiple\nlines for readability. I had also introduced an unused lens sep_to_ncl\nwhich I removed.\n","repos":"dafugg\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,mchf\/augeas,lutter\/augeas,dafugg\/augeas,ptoscano\/augeas,jjlin\/augeas,pevalme\/augeas,hercules-team\/augeas,kunkku\/augeas,jtopjian\/augeas,hercules-team\/augeas,ptoscano\/augeas,jasperla\/augeas,raphink\/augeas,kunkku\/augeas,pevalme\/augeas,MikaelSmith\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,lutter\/augeas,jtopjian\/augeas,jasperla\/augeas,dafugg\/augeas,mchf\/augeas,mlichvar\/augeas,jjlin\/augeas,jjlin\/augeas,manandbytes\/augeas,ptoscano\/augeas,mlichvar\/augeas,kunkku\/augeas,lutter\/augeas,MikaelSmith\/augeas,raphink\/augeas,mlichvar\/augeas","old_file":"lenses\/dhcpd.aug","new_file":"lenses\/dhcpd.aug","new_contents":"(*\nModule: Dhcpd\n BIND dhcp 3 server configuration module for Augeas\n\nAuthor: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\nAbout: Reference\n Reference: manual of dhcpd.conf and dhcp-eval\n Follow dhclient module for tree structure\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Directive without argument.\n Set this dhcpd server authoritative on the domain.\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/authoritative\n\n Directives with integer or string argument.\n Set max-lease-time to one hour:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/max-lease-time 3600\n\n Options are declared as a list, even for single values.\n Set the domain of the network:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name\/arg example.org\n Set two name server:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[1] foo.example.org\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[2] bar.example.org\n\n Create the subnet 172.16.0.1 with 10 addresses:\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last() + 1]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/network 172.16.0.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/netmask 255.255.255.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/from 172.16.0.10\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/to 172.16.0.20\n\n Create a new group \"foo\" with one static host. Nodes type and address are ordered.\n > ins group after \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/*[last()]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[last()]\/host foo\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/type \"ethernet\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/address \"00:00:00:aa:bb:cc\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/fixed-address 172.16.0.100\n\nAbout: Configuration files\n This lens applies to \/etc\/dhcpd3\/dhcpd.conf. See <filter>.\n*)\n\nmodule Dhcpd =\n\nautoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\nlet dels (s:string) = del s s\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet indent = Util.indent\nlet eos = comment?\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\nlet sep_osp = del \/[ \\t]*\/ \"\"\nlet sep_scl = del \/[ \\t]*;([ \\t]*\\n)*\/ \";\\n\"\nlet sep_obr = del \/[ \\t\\n]*\\{([ \\t]*\\n)*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t]*\\}([ \\t]*\\n)*\/ \"}\\n\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \", \"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\nlet sep_eq = del \/[ \\t\\n]*=[ \\t\\n]*\/ \"=\"\nlet scl = del \";\" \";\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\nlet ip = Rx.ipv4\n\n(* Define fields *)\n\n(* adapted from sysconfig.aug *)\n (* Chars allowed in a bare string *)\n let bchar = \/[^ \\t\\n\"'\\\\{}#,()\\\/]|\\\\\\\\.\/\n let qchar = \/[\"']\/ (* \" *)\n\n (* We split the handling of right hand sides into a few cases:\n * bare - strings that contain no spaces, optionally enclosed in\n * single or double quotes\n * dquot - strings that contain at least one space, apostrophe or slash\n * which must be enclosed in double quotes\n * squot - strings that contain an unescaped double quote\n *)\n let bare = del qchar? \"\" . store (bchar+) . del qchar? \"\"\n let quote = Quote.do_quote (store (bchar* . \/[ \\t'\\\/]\/ . bchar*)+)\n let dquote = Quote.do_dquote (store (bchar+))\n (* these two are for special cases. bare_to_scl is for any bareword that is\n * space or semicolon terminated. dquote_any allows almost any character in\n * between the quotes. *)\n let bare_to_scl = Quote.do_dquote_opt(store \/[^\" \\t\\n;]+\/)\n let dquote_any = Quote.do_dquote(store \/[^\"\\n]*[ \\t]+[^\"\\n]*\/)\n\nlet sto_to_spc = store \/[^\\\\#,;\\{\\}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_to_scl = store \/[^ \\t;][^;\\n=]+[^ \\t;]|[^ \\t;=]+\/\n\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * NO ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_noarg_re = \"authoritative\"\n | \"primary\"\n | \"secondary\"\n\nlet stmt_noarg = [ indent\n . key stmt_noarg_re\n . sep_scl\n . eos ]\n\n(************************************************************************\n * INT ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_integer_re = \"default-lease-time\"\n | \"max-lease-time\"\n | \"min-lease-time\"\n | \/lease[ ]+limit\/\n | \"port\"\n | \/peer[ ]+port\/\n | \"max-response-delay\"\n | \"max-unacked-updates\"\n | \"mclt\"\n | \"split\"\n | \/load[ ]+balance[ ]+max[ ]+seconds\/\n | \"max-lease-misbalance\"\n | \"max-lease-ownership\"\n | \"min-balance\"\n | \"max-balance\"\n | \"adaptive-lease-time-threshold\"\n | \"dynamic-bootp-lease-length\"\n | \"local-port\"\n | \"min-sec\"\n | \"omapi-port\"\n | \"ping-timeout\"\n | \"remote-port\"\n\nlet stmt_integer = [ indent\n . key stmt_integer_re\n . sep_spc\n . sto_number\n . sep_scl\n . eos ]\n\n(************************************************************************\n * STRING ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_string_re = \"ddns-update-style\"\n | \"ddns-updates\"\n | \"ddns-hostname\"\n | \"ddns-domainname\"\n | \"ddns-rev-domainname\"\n | \"log-facility\"\n | \"server-name\"\n | \"fixed-address\"\n | \/failover[ ]+peer\/\n | \"use-host-decl-names\"\n | \"next-server\"\n | \"address\"\n | \/peer[ ]+address\/\n | \"type\"\n | \"file\"\n | \"algorithm\"\n | \"secret\"\n | \"key\"\n | \"include\"\n | \"hba\"\n | \"boot-unknown-clients\"\n | \"db-time-format\"\n | \"do-forward-updates\"\n | \"dynamic-bootp-lease-cutoff\"\n | \"get-lease-hostnames\"\n | \"infinite-is-reserved\"\n | \"lease-file-name\"\n | \"local-address\"\n | \"one-lease-per-client\"\n | \"pid-file-name\"\n | \"ping-check\"\n | \"server-identifier\"\n | \"site-option-space\"\n | \"stash-agent-options\"\n | \"update-conflict-detection\"\n | \"update-optimization\"\n | \"update-static-leases\"\n | \"use-host-decl-names\"\n | \"use-lease-addr-for-default-route\"\n | \"vendor-option-space\"\n | \"primary\"\n | \"omapi-key\"\n\nlet stmt_string_tpl (kw:regexp) (l:lens) = [ indent\n . key kw\n . sep_spc\n . l\n . sep_scl\n . eos ]\n\nlet stmt_string = stmt_string_tpl stmt_string_re bare\n | stmt_string_tpl stmt_string_re quote\n | stmt_string_tpl \"filename\" dquote\n\n(************************************************************************\n * RANGE STATEMENTS\n *************************************************************************)\n\nlet stmt_range = [ indent\n . key \"range\"\n . sep_spc\n . [ label \"flag\" . store \/dynamic-bootp\/ . sep_spc ]?\n . [ label \"from\" . store ip . sep_spc ]?\n . [ label \"to\" . store ip ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * HARDWARE STATEMENTS\n *************************************************************************)\n\nlet stmt_hardware = [ indent\n . key \"hardware\"\n . sep_spc\n . [ label \"type\" . store \/ethernet|tokenring|fddi\/ ]\n . sep_spc\n . [ label \"address\" . store \/[a-fA-F0-9:-]+\/ ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * SET STATEMENTS\n *************************************************************************)\nlet stmt_set = [ indent\n . key \"set\"\n . sep_spc\n . store word\n . sep_spc\n . Sep.equal\n . sep_spc\n . [ label \"value\" . sto_to_scl ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * OPTION STATEMENTS\n *************************************************************************)\n(* The general case is considering options as a list *)\n\n\nlet stmt_option_value = \/((array of[ \\t]+)?(((un)?signed[ \\t]+)?integer (8|16|32)|string|ip6?-address|boolean|domain-list|text)|encapsulate [A-Za-z0-9_.-]+)\/\n\nlet stmt_option_list = ([ label \"arg\" . bare ] | [ label \"arg\" . quote ])\n . ( sep_com . ([ label \"arg\" . bare ] | [ label \"arg\" . quote ]))*\n\nlet del_trail_spc = del \/[ \\t\\n]*\/ \"\"\n\nlet stmt_record = [ label \"record\" . counter \"record\" . Util.del_str \"{\"\n . sep_spc\n . ([seq \"record\" . store stmt_option_value . sep_com]*\n . [seq \"record\" . store stmt_option_value . del_trail_spc])?\n . Util.del_str \"}\" ]\n\nlet stmt_types = store stmt_option_value|stmt_record\n\nlet stmt_option_code = [ label \"label\" . store word . sep_spc ]\n . [ key \"code\" . sep_spc . store word ]\n . sep_eq\n . [ label \"type\" . stmt_types ]\n\nlet stmt_option_basic = [ key word . sep_spc . stmt_option_list ]\nlet stmt_option_extra = [ key word . sep_spc . store \/true|false\/ . sep_spc . stmt_option_list ]\n\nlet stmt_option_body = stmt_option_basic | stmt_option_extra\n\nlet stmt_option1 = [ indent\n . key \"option\"\n . sep_spc\n . stmt_option_body\n . sep_scl\n . eos ]\n\nlet stmt_option2 = [ indent\n . dels \"option\" . label \"rfc-code\"\n . sep_spc\n . stmt_option_code\n . sep_scl\n . eos ]\n\nlet stmt_option = stmt_option1 | stmt_option2\n\n(************************************************************************\n * SUBCLASS STATEMENTS\n *************************************************************************)\n(* this statement is not well documented in the manual dhcpd.conf\n we support basic use case *)\n\nlet stmt_subclass = [ indent . key \"subclass\" . sep_spc \n . ( [ label \"name\" . bare_to_scl ]|[ label \"name\" . dquote_any ] )\n . sep_spc \n . ( [ label \"value\" . bare_to_scl ]|[ label \"value\" . dquote_any ] ) \n . sep_scl \n . eos ]\n\n\n(************************************************************************\n * ALLOW\/DENY STATEMENTS\n *************************************************************************)\n(* We have to use special key for allow\/deny members of\n to avoid ambiguity in the put direction *)\n\nlet allow_deny_re = \/unknown(-|[ ]+)clients\/\n | \/known(-|[ ]+)clients\/\n | \/all[ ]+clients\/\n | \/dynamic[ ]+bootp[ ]+clients\/\n | \/authenticated[ ]+clients\/\n | \/unauthenticated[ ]+clients\/\n | \"bootp\"\n | \"booting\"\n | \"duplicates\"\n | \"declines\"\n | \"client-updates\"\n | \"leasequery\"\n\nlet stmt_secu_re = \"allow\"\n | \"deny\"\n\nlet del_allow = del \/allow[ ]+members[ ]+of\/ \"allow members of\"\nlet del_deny = del \/deny[ \\t]+members[ \\t]+of\/ \"deny members of\"\n\n(* bare is anything but whitespace, quote marks or semicolon.\n * technically this should be locked down to mostly alphanumerics, but the\n * idea right now is just to make things work. Also ideally I would use\n * dquote_space but I had a whale of a time with it. It doesn't like\n * semicolon termination and my attempts to fix that led me to 3 hours of\n * frustration and back to this :)\n *)\nlet stmt_secu_tpl (l:lens) (s:string) =\n [ indent . l . sep_spc . label s . bare_to_scl . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . dquote_any . sep_scl . eos ]\n\n\nlet stmt_secu = [ indent . key stmt_secu_re . sep_spc .\n store allow_deny_re . sep_scl . eos ] |\n stmt_secu_tpl del_allow \"allow-members-of\" |\n stmt_secu_tpl del_deny \"deny-members-of\"\n\n(************************************************************************\n * MATCH STATEMENTS\n *************************************************************************)\n\nlet sto_com = \/[^ \\t\\n,\\(\\)][^,\\(\\)]*[^ \\t\\n,\\(\\)]|[^ \\t\\n,\\(\\)]+\/ | word . \/[ \\t]*\\([^)]*\\)\/\n(* this is already the most complicated part of this module and it's about to\n * get worse. match statements can be way more complicated than this\n *\n * examples:\n * using or:\n * match if ((option vendor-class-identifier=\"Banana Bready\") or (option vendor-class-identifier=\"Cherry Sunfire\"));\n * unneeded parenthesis:\n * match if (option vendor-class-identifier=\"Hello\");\n *\n * and of course the fact that the above two rules used one of infinately\n * many potential options instead of a builtin function.\n *)\n(* sto_com doesn't support quoted strings as arguments. It also doesn't\n support single arguments (needs to match a comma) It will need to be\n updated for lcase, ucase and log to be workable.\n\n it also doesn't support no arguments, so gethostbyname() doesn't work.\n\n option and config-option are considered operators. They should be matched\n in stmt_entry but also available under \"match if\" and \"if\" conditionals\n leased-address, host-decl-name, both take no args and return a value. We\n might need to treat them as variable names in the parser.\n\n things like this may be near-impossible to parse even with recursion\n because we have no way of knowing when or if a subfunction takes arguments\n set ClientMac = binary-to-ascii(16, 8, \":\", substring(hardware, 1, 6));\n\n even if we could parse it, they could get arbitrarily complicated like:\n binary-to-ascii(16, 8, \":\", substring(hardware, 1, 6) and substring(hardware, 2, 3));\n\n so at some point we may need to programmatically knock it off and tell\n people to put weird stuff in an include file that augeas doesn't parse.\n\n the other option is to change the API to not parse the if statement at all,\n just pull in the conditional as a string.\n *)\n\nlet fct_re = \"substring\" | \"binary-to-ascii\" | \"suffix\" | \"lcase\" | \"ucase\"\n | \"gethostbyname\" | \"packet\"\n | \"concat\" | \"reverse\" | \"encode-int\"\n | \"extract-int\" | \"lease-time\" | \"client-state\" | \"exists\" | \"known\" | \"static\"\n | \"pick-first-value\" | \"log\" | \"execute\"\n\n(* not needs to be different because it's a negation of whatever happens next *)\nlet op_re = \"~=\"|\"=\"|\"~~\"|\"and\"|\"or\"\n\nlet fct_args = [ label \"args\" . dels \"(\" . sep_osp .\n ([ label \"arg\" . store sto_com ] . [ label \"arg\" . sep_com . store sto_com ]+) .\n sep_osp . dels \")\" ]\n\nlet stmt_match_ifopt = [ dels \"if\" . sep_spc . key \"option\" . sep_spc . store(word) .\n sep_eq . ([ label \"value\" . bare_to_scl ]|[ label \"value\" . dquote_any ]) ]\n\nlet stmt_match_func = [ store fct_re . sep_osp . label \"function\" . fct_args ] .\n sep_eq . ([ label \"value\" . bare_to_scl ]|[ label \"value\" . dquote_any ])\n\nlet stmt_match_pfv = [ label \"function\" . store \"pick-first-value\" . sep_spc .\n dels \"(\" . sep_osp .\n [ label \"args\" .\n [ label \"arg\" . store sto_com ] .\n [ sep_com . label \"arg\" . store sto_com ]+ ] .\n dels \")\" ]\n\nlet stmt_match_tpl (l:lens) = [ indent . key \"match\" . sep_spc . l . sep_scl . eos ]\n\nlet stmt_match = stmt_match_tpl (dels \"if\" . sep_spc . stmt_match_func | stmt_match_pfv | stmt_match_ifopt)\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n(* Blocks doesn't support comments at the end of the closing bracket *)\n\nlet stmt_entry = stmt_secu\n | stmt_option\n | stmt_hardware\n | stmt_range\n | stmt_string\n | stmt_integer\n | stmt_noarg\n | stmt_match\n | stmt_subclass\n | stmt_set\n | empty\n | comment\n\nlet stmt_block_noarg_re = \"pool\"\n | \"group\"\n | \"allow-update\"\n\nlet stmt_block_noarg (body:lens)\n = [ indent\n . key stmt_block_noarg_re\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_arg_re = \"host\"\n | \"class\"\n | \"shared-network\"\n | \/failover[ ]+peer\/\n | \"zone\"\n | \"group\"\n | \"on\"\n\nlet stmt_block_arg (body:lens)\n = ([ indent . key stmt_block_arg_re . sep_spc . dquote_any . sep_obr . body* . sep_cbr ]\n |[ indent . key stmt_block_arg_re . sep_spc . bare_to_scl . sep_obr . body* . sep_cbr ]\n |[ indent . key \"key\" . sep_spc . dquote_any . sep_obr . body* . sep_cbr . del \/(;([ \\t]*\\n)*)?\/ \"\" ]\n |[ indent . key \"key\" . sep_spc . bare_to_scl . sep_obr . body* . sep_cbr . del \/(;([ \\t]*\\n)*)?\/ \"\" ])\n\nlet stmt_block_subnet (body:lens)\n = [ indent\n . key \"subnet\"\n . sep_spc\n . [ label \"network\" . store ip ]\n . sep_spc\n . [ key \"netmask\" . sep_spc . store ip ]\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet conditional (body:lens) =\n let condition = \/[^{ \\r\\t\\n][^{\\n]*[^{ \\r\\t\\n]|[^{ \\t\\n\\r]\/\n in let elsif = [ indent\n . Build.xchgs \"elsif\" \"@elsif\"\n . sep_spc\n . store condition\n . sep_obr\n . body*\n . sep_cbr ]\n in let else = [ indent\n . Build.xchgs \"else\" \"@else\"\n . sep_obr\n . body*\n . sep_cbr ]\n in [ indent\n . Build.xchgs \"if\" \"@if\"\n . sep_spc\n . store condition\n . sep_obr\n . body*\n . sep_cbr\n . elsif*\n . else? ]\n\n\nlet all_block (body:lens) =\n let lns1 = stmt_block_subnet body in\n let lns2 = stmt_block_arg body in\n let lns3 = stmt_block_noarg body in\n let lns4 = conditional body in\n (lns1 | lns2 | lns3 | lns4 | stmt_entry)\n\nlet rec lns_staging = stmt_entry|all_block lns_staging\nlet lns = (lns_staging)*\n\nlet filter = incl \"\/etc\/dhcp3\/dhcpd.conf\"\n . incl \"\/etc\/dhcp\/dhcpd.conf\"\n . incl \"\/etc\/dhcpd.conf\"\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Dhcpd\n BIND dhcp 3 server configuration module for Augeas\n\nAuthor: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\nAbout: Reference\n Reference: manual of dhcpd.conf and dhcp-eval\n Follow dhclient module for tree structure\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n Directive without argument.\n Set this dhcpd server authoritative on the domain.\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/authoritative\n\n Directives with integer or string argument.\n Set max-lease-time to one hour:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/max-lease-time 3600\n\n Options are declared as a list, even for single values.\n Set the domain of the network:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name\/arg example.org\n Set two name server:\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[1] foo.example.org\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/option\/domain-name-servers\/arg[2] bar.example.org\n\n Create the subnet 172.16.0.1 with 10 addresses:\n > clear \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last() + 1]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/network 172.16.0.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/netmask 255.255.255.0\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/from 172.16.0.10\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[last()]\/range\/to 172.16.0.20\n\n Create a new group \"foo\" with one static host. Nodes type and address are ordered.\n > ins group after \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/*[last()]\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[last()]\/host foo\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/type \"ethernet\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/hardware\/address \"00:00:00:aa:bb:cc\"\n > set \/files\/etc\/dhcp3\/dhcpd.conf\/subnet[network='172.16.0.0']\/group[host='foo']\/host\/fixed-address 172.16.0.100\n\nAbout: Configuration files\n This lens applies to \/etc\/dhcpd3\/dhcpd.conf. See <filter>.\n*)\n\nmodule Dhcpd =\n\nautoload xfm\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\nlet dels (s:string) = del s s\nlet eol = Util.eol\nlet comment = Util.comment\nlet empty = Util.empty\nlet indent = Util.indent\nlet eos = comment?\n\n(* Define separators *)\nlet sep_spc = del \/[ \\t]+\/ \" \"\nlet sep_osp = del \/[ \\t]*\/ \"\"\nlet sep_osp_or_nl = del \/[ \\t\\n]*\/ \"\"\nlet sep_scl = del \/[ \\t]*;([ \\t]*\\n)*\/ \";\\n\"\nlet sep_obr = del \/[ \\t\\n]*\\{([ \\t]*\\n)*\/ \" {\\n\"\nlet sep_cbr = del \/[ \\t]*\\}([ \\t]*\\n)*\/ \"}\\n\"\nlet sep_com = del \/[ \\t\\n]*,[ \\t\\n]*\/ \", \"\nlet sep_slh = del \"\\\/\" \"\/\"\nlet sep_col = del \":\" \":\"\nlet sep_eq = del \/[ \\t\\n]*=[ \\t\\n]*\/ \"=\"\nlet scl = del \";\" \";\"\n\n(* Define basic types *)\nlet word = \/[A-Za-z0-9_.-]+(\\[[0-9]+\\])?\/\nlet ip = Rx.ipv4\n\n(* Define fields *)\n\n(* adapted from sysconfig.aug *)\n (* Chars allowed in a bare string *)\n let bchar = \/[^ \\t\\n\"'\\\\{}#,()\\\/]|\\\\\\\\.\/\n let qchar = \/[\"']\/ (* \" *)\n\n (* We split the handling of right hand sides into a few cases:\n * bare - strings that contain no spaces, optionally enclosed in\n * single or double quotes\n * dquot - strings that contain at least one space, apostrophe or slash\n * which must be enclosed in double quotes\n * squot - strings that contain an unescaped double quote\n *)\n let bare = del qchar? \"\" . store (bchar+) . del qchar? \"\"\n let quote = Quote.do_quote (store (bchar* . \/[ \\t'\\\/]\/ . bchar*)+)\n let dquote = Quote.do_dquote (store (bchar+))\n (* these two are for special cases. bare_to_scl is for any bareword that is\n * space or semicolon terminated. dquote_any allows almost any character in\n * between the quotes. *)\n let bare_to_scl = Quote.do_dquote_opt(store \/[^\" \\t\\n;]+\/)\n let dquote_any = Quote.do_dquote(store \/[^\"\\n]*[ \\t]+[^\"\\n]*\/)\n\nlet sto_to_spc = store \/[^\\\\#,;\\{\\}\" \\t\\n]+|\"[^\\\\#\"\\n]+\"\/\nlet sto_to_scl = store \/[^ \\t;][^;\\n=]+[^ \\t;]|[^ \\t;=]+\/\n\nlet sto_number = store \/[0-9][0-9]*\/\n\n(************************************************************************\n * NO ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_noarg_re = \"authoritative\"\n | \"primary\"\n | \"secondary\"\n\nlet stmt_noarg = [ indent\n . key stmt_noarg_re\n . sep_scl\n . eos ]\n\n(************************************************************************\n * INT ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_integer_re = \"default-lease-time\"\n | \"max-lease-time\"\n | \"min-lease-time\"\n | \/lease[ ]+limit\/\n | \"port\"\n | \/peer[ ]+port\/\n | \"max-response-delay\"\n | \"max-unacked-updates\"\n | \"mclt\"\n | \"split\"\n | \/load[ ]+balance[ ]+max[ ]+seconds\/\n | \"max-lease-misbalance\"\n | \"max-lease-ownership\"\n | \"min-balance\"\n | \"max-balance\"\n | \"adaptive-lease-time-threshold\"\n | \"dynamic-bootp-lease-length\"\n | \"local-port\"\n | \"min-sec\"\n | \"omapi-port\"\n | \"ping-timeout\"\n | \"remote-port\"\n\nlet stmt_integer = [ indent\n . key stmt_integer_re\n . sep_spc\n . sto_number\n . sep_scl\n . eos ]\n\n(************************************************************************\n * STRING ARG STATEMENTS\n *************************************************************************)\n\nlet stmt_string_re = \"ddns-update-style\"\n | \"ddns-updates\"\n | \"ddns-hostname\"\n | \"ddns-domainname\"\n | \"ddns-rev-domainname\"\n | \"log-facility\"\n | \"server-name\"\n | \"fixed-address\"\n | \/failover[ ]+peer\/\n | \"use-host-decl-names\"\n | \"next-server\"\n | \"address\"\n | \/peer[ ]+address\/\n | \"type\"\n | \"file\"\n | \"algorithm\"\n | \"secret\"\n | \"key\"\n | \"include\"\n | \"hba\"\n | \"boot-unknown-clients\"\n | \"db-time-format\"\n | \"do-forward-updates\"\n | \"dynamic-bootp-lease-cutoff\"\n | \"get-lease-hostnames\"\n | \"infinite-is-reserved\"\n | \"lease-file-name\"\n | \"local-address\"\n | \"one-lease-per-client\"\n | \"pid-file-name\"\n | \"ping-check\"\n | \"server-identifier\"\n | \"site-option-space\"\n | \"stash-agent-options\"\n | \"update-conflict-detection\"\n | \"update-optimization\"\n | \"update-static-leases\"\n | \"use-host-decl-names\"\n | \"use-lease-addr-for-default-route\"\n | \"vendor-option-space\"\n | \"primary\"\n | \"omapi-key\"\n\nlet stmt_string_tpl (kw:regexp) (l:lens) = [ indent\n . key kw\n . sep_spc\n . l\n . sep_scl\n . eos ]\n\nlet stmt_string = stmt_string_tpl stmt_string_re bare\n | stmt_string_tpl stmt_string_re quote\n | stmt_string_tpl \"filename\" dquote\n\n(************************************************************************\n * RANGE STATEMENTS\n *************************************************************************)\n\nlet stmt_range = [ indent\n . key \"range\"\n . sep_spc\n . [ label \"flag\" . store \/dynamic-bootp\/ . sep_spc ]?\n . [ label \"from\" . store ip . sep_spc ]?\n . [ label \"to\" . store ip ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * HARDWARE STATEMENTS\n *************************************************************************)\n\nlet stmt_hardware = [ indent\n . key \"hardware\"\n . sep_spc\n . [ label \"type\" . store \/ethernet|tokenring|fddi\/ ]\n . sep_spc\n . [ label \"address\" . store \/[a-fA-F0-9:-]+\/ ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * SET STATEMENTS\n *************************************************************************)\nlet stmt_set = [ indent\n . key \"set\"\n . sep_spc\n . store word\n . sep_spc\n . Sep.equal\n . sep_spc\n . [ label \"value\" . sto_to_scl ]\n . sep_scl\n . eos ]\n\n(************************************************************************\n * OPTION STATEMENTS\n *************************************************************************)\n(* The general case is considering options as a list *)\n\n\nlet stmt_option_value = \/((array of[ \\t]+)?(((un)?signed[ \\t]+)?integer (8|16|32)|string|ip6?-address|boolean|domain-list|text)|encapsulate [A-Za-z0-9_.-]+)\/\n\nlet stmt_option_list = ([ label \"arg\" . bare ] | [ label \"arg\" . quote ])\n . ( sep_com . ([ label \"arg\" . bare ] | [ label \"arg\" . quote ]))*\n\nlet del_trail_spc = del \/[ \\t\\n]*\/ \"\"\n\nlet stmt_record = [ label \"record\" . counter \"record\" . Util.del_str \"{\"\n . sep_spc\n . ([seq \"record\" . store stmt_option_value . sep_com]*\n . [seq \"record\" . store stmt_option_value . del_trail_spc])?\n . Util.del_str \"}\" ]\n\nlet stmt_types = store stmt_option_value|stmt_record\n\nlet stmt_option_code = [ label \"label\" . store word . sep_spc ]\n . [ key \"code\" . sep_spc . store word ]\n . sep_eq\n . [ label \"type\" . stmt_types ]\n\nlet stmt_option_basic = [ key word . sep_spc . stmt_option_list ]\nlet stmt_option_extra = [ key word . sep_spc . store \/true|false\/ . sep_spc . stmt_option_list ]\n\nlet stmt_option_body = stmt_option_basic | stmt_option_extra\n\nlet stmt_option1 = [ indent\n . key \"option\"\n . sep_spc\n . stmt_option_body\n . sep_scl\n . eos ]\n\nlet stmt_option2 = [ indent\n . dels \"option\" . label \"rfc-code\"\n . sep_spc\n . stmt_option_code\n . sep_scl\n . eos ]\n\nlet stmt_option = stmt_option1 | stmt_option2\n\n(************************************************************************\n * SUBCLASS STATEMENTS\n *************************************************************************)\n(* this statement is not well documented in the manual dhcpd.conf\n we support basic use case *)\n\nlet stmt_subclass = [ indent . key \"subclass\" . sep_spc . ([ label \"name\" . bare_to_scl ]|[ label \"name\" . dquote_any ])\n . sep_spc . ([ label \"value\" . bare_to_scl ]|[ label \"value\" . dquote_any ]) . sep_scl . eos ]\n\n\n(************************************************************************\n * ALLOW\/DENY STATEMENTS\n *************************************************************************)\n(* We have to use special key for allow\/deny members of\n to avoid ambiguity in the put direction *)\n\nlet allow_deny_re = \/unknown(-|[ ]+)clients\/\n | \/known(-|[ ]+)clients\/\n | \/all[ ]+clients\/\n | \/dynamic[ ]+bootp[ ]+clients\/\n | \/authenticated[ ]+clients\/\n | \/unauthenticated[ ]+clients\/\n | \"bootp\"\n | \"booting\"\n | \"duplicates\"\n | \"declines\"\n | \"client-updates\"\n | \"leasequery\"\n\nlet stmt_secu_re = \"allow\"\n | \"deny\"\n\nlet del_allow = del \/allow[ ]+members[ ]+of\/ \"allow members of\"\nlet del_deny = del \/deny[ \\t]+members[ \\t]+of\/ \"deny members of\"\n\n(* bare is anything but whitespace, quote marks or semicolon.\n * technically this should be locked down to mostly alphanumerics, but the\n * idea right now is just to make things work. Also ideally I would use\n * dquote_space but I had a whale of a time with it. It doesn't like\n * semicolon termination and my attempts to fix that led me to 3 hours of\n * frustration and back to this :)\n *)\nlet stmt_secu_tpl (l:lens) (s:string) =\n [ indent . l . sep_spc . label s . bare_to_scl . sep_scl . eos ] |\n [ indent . l . sep_spc . label s . dquote_any . sep_scl . eos ]\n\n\nlet stmt_secu = [ indent . key stmt_secu_re . sep_spc .\n store allow_deny_re . sep_scl . eos ] |\n stmt_secu_tpl del_allow \"allow-members-of\" |\n stmt_secu_tpl del_deny \"deny-members-of\"\n\n(************************************************************************\n * MATCH STATEMENTS\n *************************************************************************)\n\nlet sto_com = \/[^ \\t\\n,\\(\\)][^,\\(\\)]*[^ \\t\\n,\\(\\)]|[^ \\t\\n,\\(\\)]+\/ | word . \/[ \\t]*\\([^)]*\\)\/\n(* this is already the most complicated part of this module and it's about to\n * get worse. match statements can be way more complicated than this\n *\n * examples:\n * using or:\n * match if ((option vendor-class-identifier=\"Banana Bready\") or (option vendor-class-identifier=\"Cherry Sunfire\"));\n * unneeded parenthesis:\n * match if (option vendor-class-identifier=\"Hello\");\n *\n * and of course the fact that the above two rules used one of infinately\n * many potential options instead of a builtin function.\n *)\n(* sto_com doesn't support quoted strings as arguments. It also doesn't\n support single arguments (needs to match a comma) It will need to be\n updated for lcase, ucase and log to be workable.\n\n it also doesn't support no arguments, so gethostbyname() doesn't work.\n\n option and config-option are considered operators. They should be matched\n in stmt_entry but also available under \"match if\" and \"if\" conditionals\n leased-address, host-decl-name, both take no args and return a value. We\n might need to treat them as variable names in the parser.\n\n things like this may be near-impossible to parse even with recursion\n because we have no way of knowing when or if a subfunction takes arguments\n set ClientMac = binary-to-ascii(16, 8, \":\", substring(hardware, 1, 6));\n\n even if we could parse it, they could get arbitrarily complicated like:\n binary-to-ascii(16, 8, \":\", substring(hardware, 1, 6) and substring(hardware, 2, 3));\n\n so at some point we may need to programmatically knock it off and tell\n people to put weird stuff in an include file that augeas doesn't parse.\n\n the other option is to change the API to not parse the if statement at all,\n just pull in the conditional as a string.\n *)\n\nlet fct_re = \"substring\" | \"binary-to-ascii\" | \"suffix\" | \"lcase\" | \"ucase\"\n | \"gethostbyname\" | \"packet\"\n | \"concat\" | \"reverse\" | \"encode-int\"\n | \"extract-int\" | \"lease-time\" | \"client-state\" | \"exists\" | \"known\" | \"static\"\n | \"pick-first-value\" | \"log\" | \"execute\"\n\n(* not needs to be different because it's a negation of whatever happens next *)\nlet op_re = \"~=\"|\"=\"|\"~~\"|\"and\"|\"or\"\n\nlet fct_args = [ label \"args\" . dels \"(\" . sep_osp .\n ([ label \"arg\" . store sto_com ] . [ label \"arg\" . sep_com . store sto_com ]+) .\n sep_osp . dels \")\" ]\n\nlet stmt_match_ifopt = [ dels \"if\" . sep_spc . key \"option\" . sep_spc . store(word) .\n sep_eq . ([ label \"value\" . bare_to_scl ]|[ label \"value\" . dquote_any ]) ]\n\nlet stmt_match_func = [ store fct_re . sep_osp . label \"function\" . fct_args ] .\n sep_eq . ([ label \"value\" . bare_to_scl ]|[ label \"value\" . dquote_any ])\n\nlet stmt_match_pfv = [ label \"function\" . store \"pick-first-value\" . sep_spc .\n dels \"(\" . sep_osp .\n [ label \"args\" .\n [ label \"arg\" . store sto_com ] .\n [ sep_com . label \"arg\" . store sto_com ]+ ] .\n dels \")\" ]\n\nlet stmt_match_tpl (l:lens) = [ indent . key \"match\" . sep_spc . l . sep_scl . eos ]\n\nlet stmt_match = stmt_match_tpl (dels \"if\" . sep_spc . stmt_match_func | stmt_match_pfv | stmt_match_ifopt)\n\n(************************************************************************\n * BLOCK STATEMENTS\n *************************************************************************)\n(* Blocks doesn't support comments at the end of the closing bracket *)\n\nlet stmt_entry = stmt_secu\n | stmt_option\n | stmt_hardware\n | stmt_range\n | stmt_string\n | stmt_integer\n | stmt_noarg\n | stmt_match\n | stmt_subclass\n | stmt_set\n | empty\n | comment\n\nlet stmt_block_noarg_re = \"pool\"\n | \"group\"\n | \"allow-update\"\n\nlet stmt_block_noarg (body:lens)\n = [ indent\n . key stmt_block_noarg_re\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet stmt_block_arg_re = \"host\"\n | \"class\"\n | \"shared-network\"\n | \/failover[ ]+peer\/\n | \"zone\"\n | \"group\"\n | \"on\"\n\nlet stmt_block_arg (body:lens)\n = ([ indent . key stmt_block_arg_re . sep_spc . dquote_any . sep_obr . body* . sep_cbr ]\n |[ indent . key stmt_block_arg_re . sep_spc . bare_to_scl . sep_obr . body* . sep_cbr ]\n |[ indent . key \"key\" . sep_spc . dquote_any . sep_obr . body* . sep_cbr . del \/(;([ \\t]*\\n)*)?\/ \"\" ]\n |[ indent . key \"key\" . sep_spc . bare_to_scl . sep_obr . body* . sep_cbr . del \/(;([ \\t]*\\n)*)?\/ \"\" ])\n\nlet stmt_block_subnet (body:lens)\n = [ indent\n . key \"subnet\"\n . sep_spc\n . [ label \"network\" . store ip ]\n . sep_spc\n . [ key \"netmask\" . sep_spc . store ip ]\n . sep_obr\n . body*\n . sep_cbr ]\n\nlet conditional (body:lens) =\n let condition = \/[^{ \\r\\t\\n][^{\\n]*[^{ \\r\\t\\n]|[^{ \\t\\n\\r]\/\n in let elsif = [ indent\n . Build.xchgs \"elsif\" \"@elsif\"\n . sep_spc\n . store condition\n . sep_obr\n . body*\n . sep_cbr ]\n in let else = [ indent\n . Build.xchgs \"else\" \"@else\"\n . sep_obr\n . body*\n . sep_cbr ]\n in [ indent\n . Build.xchgs \"if\" \"@if\"\n . sep_spc\n . store condition\n . sep_obr\n . body*\n . sep_cbr\n . elsif*\n . else? ]\n\n\nlet all_block (body:lens) =\n let lns1 = stmt_block_subnet body in\n let lns2 = stmt_block_arg body in\n let lns3 = stmt_block_noarg body in\n let lns4 = conditional body in\n (lns1 | lns2 | lns3 | lns4 | stmt_entry)\n\nlet rec lns_staging = stmt_entry|all_block lns_staging\nlet lns = (lns_staging)*\n\nlet filter = incl \"\/etc\/dhcp3\/dhcpd.conf\"\n . incl \"\/etc\/dhcp\/dhcpd.conf\"\n . incl \"\/etc\/dhcpd.conf\"\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"b932fe26eb9825002282f71eecac921c7d2d0e95","subject":"Fix author","message":"Fix author\n","repos":"MikaelSmith\/augeas,pevalme\/augeas,ptoscano\/augeas,domcleal\/augeas,ptoscano\/augeas,ptoscano\/augeas,kunkku\/augeas,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,hercules-team\/augeas,jjlin\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,jtopjian\/augeas,kumy\/augeas,domcleal\/augeas,dafugg\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,raphink\/augeas,lutter\/augeas,pevalme\/augeas,kumy\/augeas,pevalme\/augeas,kumy\/augeas,mlichvar\/augeas,domcleal\/augeas,manandbytes\/augeas,jjlin\/augeas,raphink\/augeas,dafugg\/augeas,jasperla\/augeas,GeoffWilliams\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,hercules-team\/augeas,manandbytes\/augeas,mchf\/augeas,kunkku\/augeas,jasperla\/augeas,MikaelSmith\/augeas,lutter\/augeas,jtopjian\/augeas","old_file":"lenses\/sysctl.aug","new_file":"lenses\/sysctl.aug","new_contents":"(*\nModule: Sysctl\n Parses \/etc\/sysctl.conf and \/etc\/sysctl.d\/*\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: Reference\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/sysctl.conf and \/etc\/sysctl.d\/*. See <filter>.\n\nAbout: Examples\n The <Test_Sysctl> file contains various examples and tests.\n*)\n\nmodule Sysctl =\nautoload xfm\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/sysctl.conf\"\n . incl \"\/etc\/sysctl.d\/*\"\n . excl \"\/etc\/sysctl.d\/README\"\n . Util.stdexcl\n\n(* View: comment *)\nlet comment = Util.comment_generic \/[ \\t]*[#;][ \\t]*\/ \"# \"\n\n(* View: lns\n The sysctl lens *)\nlet lns = (Util.empty | comment | Simplevars.entry)*\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Sysctl\n Parses \/etc\/sysctl.conf and \/etc\/sysctl.d\/*\n\nAuthor: Raphael Pinson <raphink@gmail.com>\n\nAbout: Reference\n\nAbout: License\n This file is licenced under the LGPLv2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n\nAbout: Configuration files\n This lens applies to \/etc\/sysctl.conf and \/etc\/sysctl.d\/*. See <filter>.\n\nAbout: Examples\n The <Test_Sysctl> file contains various examples and tests.\n*)\n\nmodule Sysctl =\nautoload xfm\n\n(* Variable: filter *)\nlet filter = incl \"\/etc\/sysctl.conf\"\n . incl \"\/etc\/sysctl.d\/*\"\n . excl \"\/etc\/sysctl.d\/README\"\n . Util.stdexcl\n\n(* View: comment *)\nlet comment = Util.comment_generic \/[ \\t]*[#;][ \\t]*\/ \"# \"\n\n(* View: lns\n The sysctl lens *)\nlet lns = (Util.empty | comment | Simplevars.entry)*\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"f218d05899362615124cfab574cef888b3cefff2","subject":"* tests\/modules\/pass_strip_quotes.aug: test quote stripping","message":"* tests\/modules\/pass_strip_quotes.aug: test quote stripping\n\nThe tests strips optional quotes and puts them back (or creates them) as\nneeded, only depending on the value of the tree node.\n","repos":"kunkku\/augeas,lutter\/augeas,MikaelSmith\/augeas,bkearney\/augeas,kumy\/augeas,hercules-team\/augeas,dafugg\/augeas,manandbytes\/augeas,mlichvar\/augeas,jjlin\/augeas,lutter\/augeas,mlichvar\/augeas,domcleal\/augeas,pevalme\/augeas,MikaelSmith\/augeas,jasperla\/augeas,hercules-team\/augeas,bkearney\/augeas,jjlin\/augeas,kumy\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,ptoscano\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,jasperla\/augeas,mlichvar\/augeas,raphink\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,domcleal\/augeas,jtopjian\/augeas,dafugg\/augeas,raphink\/augeas,pevalme\/augeas,dafugg\/augeas,manandbytes\/augeas,lutter\/augeas,kumy\/augeas,kunkku\/augeas,jtopjian\/augeas,domcleal\/augeas,mchf\/augeas,jjlin\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,bkearney\/augeas,pevalme\/augeas,GeoffWilliams\/augeas","old_file":"tests\/modules\/pass_strip_quotes.aug","new_file":"tests\/modules\/pass_strip_quotes.aug","new_contents":"(* Demonstrate how quotes can be stripped from values. *)\n(* Values can be enclosed in single or double quotes, if they *)\n(* contain spaces they _have_ to be enclosed in quotes. Since *)\n(* everything's regular, we can't actually match a closing quote *)\n(* to the opening quote, so \"hello' will be accepted, too. *)\n\nmodule Pass_strip_quotes =\n\n let nuttin = del \/(\"\"|'')?\/ \"''\"\n let bare = del \/[\"']?\/ \"\" . store \/[a-zA-Z0-9]+\/ . del \/[\"']?\/ \"\"\n let quoted = del \/[\"']\/ \"'\" . store \/.*[ \\t].*\/ . del \/[\"']\/ \"'\"\n\n let lns = [ label \"foo\" . bare ]\n | [ label \"foo\" . quoted ]\n | [ label \"foo\" . nuttin ]\n\n test lns get \"'hello'\" = { \"foo\" = \"hello\" }\n test lns get \"'hello world'\" = { \"foo\" = \"hello world\" }\n\n let hw = \"'hello world'\"\n let set_hw = set \"\/foo\" \"hello world\"\n test lns put \"hello\" after set_hw = hw\n test lns put \"'hello world'\" after set \"\/foo\" \"hello\" = \"'hello'\"\n\n test lns put \"\" after set_hw = hw\n test lns put \"\\\"\\\"\" after set_hw = hw\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/modules\/pass_strip_quotes.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"bcd545bc8388de5111b49eda2c40202e8238bac0","subject":"Add basic EPSG augeas lens","message":"Add basic EPSG augeas lens\n","repos":"camptocamp\/puppet-proj","old_file":"files\/lenses\/epsg.aug","new_file":"files\/lenses\/epsg.aug","new_contents":"module EPSG =\n\nlet proj = [ key \/[^\\\/= \\t\\n]+\/ . (Sep.equal . store Rx.no_spaces)? ]\n\nlet entry = [ Util.del_str \"<\" . key Rx.integer . Util.del_str \">\"\n . Sep.space . Build.opt_list proj Sep.space . Sep.space\n . Util.del_str \"<>\" . Util.eol ]\n\nlet lns = (Util.empty | Util.comment | entry)*\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/lenses\/epsg.aug' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Augeas"} {"commit":"86c4b81ed9283d8fed86d11ed475aa0ceb433410","subject":"Augeas file for log4j.properties","message":"Augeas file for log4j.properties","repos":"JensPiegsa\/JIRA","old_file":"adjust-config-files.aug","new_file":"adjust-config-files.aug","new_contents":"transform Properties.lns incl \/atlassian-jira\/WEB-INF\/classes\/log4j.properties\nload\nset \/augeas\/context \/files\/atlassian-jira\/WEB-INF\/classes\/log4j.properties\nset log4j.logger.org.apache.catalina.webresources.Cache \"ERROR, console, filelog\"\nsave \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'adjust-config-files.aug' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Augeas"} {"commit":"1a51d6aa523df4613253fb6049122fe9d3ddf6b2","subject":"delete unused augeas file","message":"delete unused augeas file\n","repos":"netors\/puppet-php,mmoll\/puppet-php,NickelMedia\/puppet-php,mmoll\/puppet-php,cgalvarez\/puppet-php,mayflower\/puppet-php,NickelMedia\/puppet-php,glorpen\/puppet-php,glorpen\/puppet-php,cgalvarez\/puppet-php,netors\/puppet-php,mayflower\/puppet-php","old_file":"files\/php.aug","new_file":"files\/php.aug","new_contents":"","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry =\n let word = IniFile.entry_re\n in let entry_re = word . ( \"[\" . word . \"]\" )?\n in IniFile.indented_entry entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n (* PHPFPM Support *)\n . (incl \"\/etc\/php*\/fpm\/pool.d\/*.conf\")\n . (incl \"\/etc\/php-fpm.d\/*.conf\")\n (* Zend Community edition *)\n . (incl \"\/usr\/local\/zend\/etc\/php.ini\")\n . (incl \"\/usr\/local\/zend\/etc\/conf.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"mit","lang":"Augeas"} {"commit":"6216f3cb9c13a313d6aed2ce643c8b202f539627","subject":"Dput: add 'allow_dcut' parameter","message":"Dput: add 'allow_dcut' parameter\n\nFixes bug #105\n","repos":"hercules-team\/augeas-do-not-use,ptoscano\/augeas,raphink\/augeas,dafugg\/augeas,lutter\/augeas,hercules-team\/augeas,raphink\/augeas,ptoscano\/augeas,domcleal\/augeas,jtopjian\/augeas,hercules-team\/augeas,kunkku\/augeas,manandbytes\/augeas,kunkku\/augeas,kumy\/augeas,pevalme\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,mlichvar\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,mchf\/augeas,kumy\/augeas,kumy\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,jasperla\/augeas,mchf\/augeas,domcleal\/augeas,dafugg\/augeas,pevalme\/augeas,jjlin\/augeas,jasperla\/augeas,ptoscano\/augeas,dafugg\/augeas,MikaelSmith\/augeas,domcleal\/augeas,jjlin\/augeas,hercules-team\/augeas-do-not-use,lutter\/augeas,kunkku\/augeas,lutter\/augeas,GeoffWilliams\/augeas,kumy\/augeas,manandbytes\/augeas,jjlin\/augeas","old_file":"lenses\/dput.aug","new_file":"lenses\/dput.aug","new_contents":"(* Dput module for Augeas\n Author: Raphael Pinson <raphink@gmail.com>\n\n\n Reference: dput uses Python's ConfigParser:\n http:\/\/docs.python.org\/lib\/module-ConfigParser.html\n*)\n\n\nmodule Dput =\n autoload xfm\n\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\n\nlet setting = \"allow_dcut\"\n | \"allow_non-us_software\"\n | \"allow_unsigned_uploads\"\n | \"check_version\"\n | \"default_host_main\"\n | \"default_host_non-us\"\n | \"fqdn\"\n | \"hash\"\n | \"incoming\"\n | \"login\"\n | \"method\"\n | \"passive_ftp\"\n | \"post_upload_command\"\n | \"pre_upload_command\"\n | \"progress_indicator\"\n | \"run_dinstall\"\n | \"run_lintian\"\n | \"scp_compress\"\n | \"ssh_config_options\"\n | \"allowed_distributions\"\n\n(************************************************************************\n * \"name: value\" entries, with continuations in the style of RFC 822;\n * \"name=value\" is also accepted\n * leading whitespace is removed from values\n *************************************************************************)\nlet entry = IniFile.entry setting sep comment\n\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/dput.cf\")\n . (incl \"~\/.dput.cf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(* Dput module for Augeas\n Author: Raphael Pinson <raphink@gmail.com>\n\n\n Reference: dput uses Python's ConfigParser:\n http:\/\/docs.python.org\/lib\/module-ConfigParser.html\n*)\n\n\nmodule Dput =\n autoload xfm\n\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\n\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\n\n\nlet setting = \"allow_non-us_software\"\n | \"allow_unsigned_uploads\"\n | \"check_version\"\n | \"default_host_main\"\n | \"default_host_non-us\"\n | \"fqdn\"\n | \"hash\"\n | \"incoming\"\n | \"login\"\n | \"method\"\n | \"passive_ftp\"\n | \"post_upload_command\"\n | \"pre_upload_command\"\n | \"progress_indicator\"\n | \"run_dinstall\"\n | \"run_lintian\"\n | \"scp_compress\"\n | \"ssh_config_options\"\n | \"allowed_distributions\"\n\n(************************************************************************\n * \"name: value\" entries, with continuations in the style of RFC 822;\n * \"name=value\" is also accepted\n * leading whitespace is removed from values\n *************************************************************************)\nlet entry = IniFile.entry setting sep comment\n\n\n(************************************************************************\n * sections, led by a \"[section]\" header\n * We can't use titles as node names here since they could contain \"\/\"\n * We remove #comment from possible keys\n * since it is used as label for comments\n * We also remove \/ as first character\n * because augeas doesn't like '\/' keys (although it is legal in INI Files)\n *************************************************************************)\nlet title = IniFile.title_label \"target\" IniFile.record_label_re\nlet record = IniFile.record title entry\n\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/dput.cf\")\n . (incl \"~\/.dput.cf\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"49bfdb100cf348120986aba7de144008fd47a176","subject":"Grub: add \/boot\/grub\/grub.conf to transform","message":"Grub: add \/boot\/grub\/grub.conf to transform\n","repos":"pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,jjlin\/augeas,manandbytes\/augeas,domcleal\/augeas,pevalme\/augeas,kunkku\/augeas,lutter\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,jtopjian\/augeas,mchf\/augeas,jjlin\/augeas,ptoscano\/augeas,mlichvar\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,hercules-team\/augeas,mchf\/augeas,ptoscano\/augeas,domcleal\/augeas,MikaelSmith\/augeas,domcleal\/augeas,lutter\/augeas,dafugg\/augeas,dafugg\/augeas,jasperla\/augeas,jjlin\/augeas,hercules-team\/augeas,kumy\/augeas,dafugg\/augeas,mlichvar\/augeas,jasperla\/augeas,kumy\/augeas,raphink\/augeas,pevalme\/augeas,mlichvar\/augeas,kunkku\/augeas,kumy\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kunkku\/augeas","old_file":"lenses\/grub.aug","new_file":"lenses\/grub.aug","new_contents":"(*\nModule: Grub\n Parses grub configuration\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* View: value_to_eol *)\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n\n (* View: eol *)\n let eol = Util.eol\n\n (* View: del_to_eol *)\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n\n (* View: spc *)\n let spc = Util.del_ws_spc\n\n (* View: opt_ws *)\n let opt_ws = Util.del_opt_ws \"\"\n\n (* View: dels *)\n let dels (s:string) = Util.del_str s\n\n (* View: eq *)\n let eq = dels \"=\"\n\n (* View: switch *)\n let switch (n:regexp) = dels \"--\" . key n\n\n (* View: switch_arg *)\n let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces\n\n (* View: value_sep *)\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n (* View: comment_re *)\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n (* View: comment *)\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n\n (* View: empty *)\n let empty = Util.empty\n\n(************************************************************************\n * Group: USEFUL FUNCTIONS\n *************************************************************************)\n\n (* View: command *)\n let command (kw:regexp) (indent:string) =\n Util.del_opt_ws indent . key kw\n\n (* View: kw_arg *)\n let kw_arg (kw:regexp) (indent:string) (dflt_sep:string) =\n [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]\n\n (* View: kw_boot_arg *)\n let kw_boot_arg (kw:regexp) = kw_arg kw \"\\t\" \" \"\n\n (* View: kw_menu_arg *)\n let kw_menu_arg (kw:regexp) = kw_arg kw \"\" \" \"\n\n (* View: password_arg *)\n let password_arg = [ key \"password\" .\n (spc . [ switch \"md5\" ])? .\n (spc . [ switch \"encrypted\" ])? .\n spc . store (\/[^ \\t\\n]+\/ - \/--[^ \\t\\n]+\/) .\n (spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n (* View: kw_pres *)\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n(************************************************************************\n * Group: BOOT ENTRIES\n *************************************************************************)\n\n (* View: device\n * This is a shell-only directive in upstream grub; the grub versions\n * in at least Fedora\/RHEL use this to find devices for UEFI boot *)\n let device =\n\t [ command \"device\" \"\" . Sep.space . store \/\\([A-Za-z0-9_.-]+\\)\/ . spc .\n\t\t [ label \"file\" . value_to_eol ] . Util.eol ]\n\n (* View: color *)\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n dels \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n spc . [ label \"normal\" . color_spec ] .\n (spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n (* View: serial *)\n let serial =\n [ command \"serial\" \"\" .\n [ spc . switch_arg \/unit|port|speed|word|parity|stop|device\/ ]* .\n eol ]\n\n (* View: terminal *)\n let terminal =\n [ command \"terminal\" \"\" .\n ([ spc . switch \/dumb|no-echo|no-edit|silent\/ ]\n |[ spc . switch_arg \/timeout|lines\/ ])* .\n [ spc . key \/console|serial|hercules\/ ]* . eol ]\n\n (* View: menu_setting *)\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"gfxmenu\"\n | kw_menu_arg \"background\"\n | serial\n | terminal\n | password_arg\n | color\n\t\t | device\n\n (* View: title *)\n let title = del \/title[ \\t=]+\/ \"title \" . value_to_eol . eol\n\n (* View: multiboot_arg\n * Permits a second form for Solaris multiboot kernels that\n * take a path (with a slash) as their first arg, e.g.\n * \/boot\/multiboot kernel\/unix another=arg *)\n let multiboot_arg = [ label \"@path\" .\n store (Rx.word . \"\/\" . Rx.no_spaces) ]\n\n (* View: kernel_args\n Parse the file name and args on a kernel or module line. *)\n let kernel_args =\n let arg = \/[A-Za-z0-9_.$-]+\/ - \/type|no-mem-option\/ in\n store \/(\\([a-z0-9,]+\\))?\\\/[^ \\t\\n]*\/ .\n (spc . multiboot_arg)? .\n (spc . [ key arg . (eq. store \/([^ \\t\\n])*\/)?])* . eol\n\n (* View: module_line\n Solaris extension adds module$ and kernel$ for variable interpolation *)\n let module_line =\n [ command \/module\\$?\/ \"\\t\" . spc . kernel_args ]\n\n (* View: map_line *)\n let map_line =\n [ command \"map\" \"\\t\" . spc .\n [ label \"from\" . store \/[()A-za-z0-9]+\/ ] . spc .\n [ label \"to\" . store \/[()A-za-z0-9]+\/ ] . eol ]\n\n (* View: kernel *)\n let kernel =\n [ command \/kernel\\$?\/ \"\\t\" .\n (spc .\n ([switch \"type\" . eq . store \/[a-z]+\/]\n |[switch \"no-mem-option\"]))* .\n spc . kernel_args ]\n\n (* View: chainloader *)\n let chainloader =\n [ command \"chainloader\" \"\\t\" .\n [ spc . switch \"force\" ]? . spc . store Rx.no_spaces . eol ]\n\n (* View: savedefault *)\n let savedefault =\n [ command \"savedefault\" \"\\t\" . (spc . store Rx.integer)? . eol ]\n\n (* View: configfile *)\n let configfile =\n [ command \"configfile\" \"\\t\" . spc . store Rx.no_spaces . eol ]\n\n (* View: boot_setting\n <boot> entries *)\n let boot_setting =\n let boot_arg_re = \"root\" | \"initrd\" | \"rootnoverify\" | \"uuid\"\n | \"findroot\" | \"bootfs\" (* Solaris extensions *)\n in kw_boot_arg boot_arg_re\n | kernel\n | chainloader\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | savedefault\n | configfile\n | module_line\n | map_line\n\n (* View: boot *)\n let boot =\n let line = ((boot_setting|comment)* . boot_setting)? in\n [ label \"title\" . title . line ]\n\n(************************************************************************\n * Group: DEBIAN-SPECIFIC SECTIONS\n *************************************************************************)\n\n (* View: debian_header\n Header for a <debian>-specific section *)\n let debian_header = \"## ## Start Default Options ##\\n\"\n\n (* View: debian_footer\n Footer for a <debian>-specific section *)\n let debian_footer = \"## ## End Default Options ##\\n\"\n\n (* View: debian_comment_re *)\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n\n (* View: debian_comment\n A comment entry inside a <debian>-specific section *)\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n\n (* View: debian_setting_re *)\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n | \"indomU\"\n\n (* View: debian_entry *)\n let debian_entry = [ Util.del_str \"#\" . Util.indent\n . key debian_setting_re . del \/[ \\t]*=\/ \"=\"\n . value_to_eol? . eol ]\n\n (* View: debian\n A debian-specific section, made of <debian_entry> lines *)\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n (* View: lns *)\n let lns = (comment | empty | menu_setting | boot | debian)*\n\n (* View: filter *)\n let filter = incl \"\/boot\/grub\/grub.conf\"\n . incl \"\/boot\/grub\/menu.lst\"\n . incl \"\/etc\/grub.conf\"\n\n let xfm = transform lns filter\n","old_contents":"(*\nModule: Grub\n Parses grub configuration\n\nAuthor: David Lutterkort <lutter@redhat.com>\n\nAbout: License\n This file is licenced under the LGPL v2+, like the rest of Augeas.\n\nAbout: Lens Usage\n To be documented\n*)\n\nmodule Grub =\n autoload xfm\n\n (* This only covers the most basic grub directives. Needs to be *)\n (* expanded to cover more (and more esoteric) directives *)\n (* It is good enough to handle the grub.conf on my Fedora 8 box *)\n\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n (* View: value_to_eol *)\n let value_to_eol = store \/[^= \\t\\n][^\\n]*[^= \\t\\n]|[^= \\t\\n]\/\n\n (* View: eol *)\n let eol = Util.eol\n\n (* View: del_to_eol *)\n let del_to_eol = del \/[^ \\t\\n]*\/ \"\"\n\n (* View: spc *)\n let spc = Util.del_ws_spc\n\n (* View: opt_ws *)\n let opt_ws = Util.del_opt_ws \"\"\n\n (* View: dels *)\n let dels (s:string) = Util.del_str s\n\n (* View: eq *)\n let eq = dels \"=\"\n\n (* View: switch *)\n let switch (n:regexp) = dels \"--\" . key n\n\n (* View: switch_arg *)\n let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces\n\n (* View: value_sep *)\n let value_sep (dflt:string) = del \/[ \\t]*[ \\t=][ \\t]*\/ dflt\n\n (* View: comment_re *)\n let comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \/# ## (Start|End) Default Options ##\/\n\n (* View: comment *)\n let comment =\n [ Util.indent . label \"#comment\" . del \/#[ \\t]*\/ \"# \"\n . store comment_re . eol ]\n\n (* View: empty *)\n let empty = Util.empty\n\n(************************************************************************\n * Group: USEFUL FUNCTIONS\n *************************************************************************)\n\n (* View: command *)\n let command (kw:regexp) (indent:string) =\n Util.del_opt_ws indent . key kw\n\n (* View: kw_arg *)\n let kw_arg (kw:regexp) (indent:string) (dflt_sep:string) =\n [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]\n\n (* View: kw_boot_arg *)\n let kw_boot_arg (kw:regexp) = kw_arg kw \"\\t\" \" \"\n\n (* View: kw_menu_arg *)\n let kw_menu_arg (kw:regexp) = kw_arg kw \"\" \" \"\n\n (* View: password_arg *)\n let password_arg = [ key \"password\" .\n (spc . [ switch \"md5\" ])? .\n (spc . [ switch \"encrypted\" ])? .\n spc . store (\/[^ \\t\\n]+\/ - \/--[^ \\t\\n]+\/) .\n (spc . [ label \"file\" . store \/[^ \\t\\n]+\/ ])? .\n eol ]\n\n (* View: kw_pres *)\n let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ]\n\n(************************************************************************\n * Group: BOOT ENTRIES\n *************************************************************************)\n\n (* View: device\n * This is a shell-only directive in upstream grub; the grub versions\n * in at least Fedora\/RHEL use this to find devices for UEFI boot *)\n let device =\n\t [ command \"device\" \"\" . Sep.space . store \/\\([A-Za-z0-9_.-]+\\)\/ . spc .\n\t\t [ label \"file\" . value_to_eol ] . Util.eol ]\n\n (* View: color *)\n let color =\n (* Should we nail it down to exactly the color names that *)\n (* grub supports ? *)\n let color_name = store \/[A-Za-z-]+\/ in\n let color_spec =\n [ label \"foreground\" . color_name] .\n dels \"\/\" .\n [ label \"background\" . color_name ] in\n [ opt_ws . key \"color\" .\n spc . [ label \"normal\" . color_spec ] .\n (spc . [ label \"highlight\" . color_spec ])? .\n eol ]\n\n (* View: serial *)\n let serial =\n [ command \"serial\" \"\" .\n [ spc . switch_arg \/unit|port|speed|word|parity|stop|device\/ ]* .\n eol ]\n\n (* View: terminal *)\n let terminal =\n [ command \"terminal\" \"\" .\n ([ spc . switch \/dumb|no-echo|no-edit|silent\/ ]\n |[ spc . switch_arg \/timeout|lines\/ ])* .\n [ spc . key \/console|serial|hercules\/ ]* . eol ]\n\n (* View: menu_setting *)\n let menu_setting = kw_menu_arg \"default\"\n | kw_menu_arg \"fallback\"\n | kw_pres \"hiddenmenu\"\n | kw_menu_arg \"timeout\"\n | kw_menu_arg \"splashimage\"\n | kw_menu_arg \"gfxmenu\"\n | kw_menu_arg \"background\"\n | serial\n | terminal\n | password_arg\n | color\n\t\t | device\n\n (* View: title *)\n let title = del \/title[ \\t=]+\/ \"title \" . value_to_eol . eol\n\n (* View: multiboot_arg\n * Permits a second form for Solaris multiboot kernels that\n * take a path (with a slash) as their first arg, e.g.\n * \/boot\/multiboot kernel\/unix another=arg *)\n let multiboot_arg = [ label \"@path\" .\n store (Rx.word . \"\/\" . Rx.no_spaces) ]\n\n (* View: kernel_args\n Parse the file name and args on a kernel or module line. *)\n let kernel_args =\n let arg = \/[A-Za-z0-9_.$-]+\/ - \/type|no-mem-option\/ in\n store \/(\\([a-z0-9,]+\\))?\\\/[^ \\t\\n]*\/ .\n (spc . multiboot_arg)? .\n (spc . [ key arg . (eq. store \/([^ \\t\\n])*\/)?])* . eol\n\n (* View: module_line\n Solaris extension adds module$ and kernel$ for variable interpolation *)\n let module_line =\n [ command \/module\\$?\/ \"\\t\" . spc . kernel_args ]\n\n (* View: map_line *)\n let map_line =\n [ command \"map\" \"\\t\" . spc .\n [ label \"from\" . store \/[()A-za-z0-9]+\/ ] . spc .\n [ label \"to\" . store \/[()A-za-z0-9]+\/ ] . eol ]\n\n (* View: kernel *)\n let kernel =\n [ command \/kernel\\$?\/ \"\\t\" .\n (spc .\n ([switch \"type\" . eq . store \/[a-z]+\/]\n |[switch \"no-mem-option\"]))* .\n spc . kernel_args ]\n\n (* View: chainloader *)\n let chainloader =\n [ command \"chainloader\" \"\\t\" .\n [ spc . switch \"force\" ]? . spc . store Rx.no_spaces . eol ]\n\n (* View: savedefault *)\n let savedefault =\n [ command \"savedefault\" \"\\t\" . (spc . store Rx.integer)? . eol ]\n\n (* View: configfile *)\n let configfile =\n [ command \"configfile\" \"\\t\" . spc . store Rx.no_spaces . eol ]\n\n (* View: boot_setting\n <boot> entries *)\n let boot_setting =\n let boot_arg_re = \"root\" | \"initrd\" | \"rootnoverify\" | \"uuid\"\n | \"findroot\" | \"bootfs\" (* Solaris extensions *)\n in kw_boot_arg boot_arg_re\n | kernel\n | chainloader\n | kw_pres \"quiet\" (* Seems to be a Ubuntu extension *)\n | savedefault\n | configfile\n | module_line\n | map_line\n\n (* View: boot *)\n let boot =\n let line = ((boot_setting|comment)* . boot_setting)? in\n [ label \"title\" . title . line ]\n\n(************************************************************************\n * Group: DEBIAN-SPECIFIC SECTIONS\n *************************************************************************)\n\n (* View: debian_header\n Header for a <debian>-specific section *)\n let debian_header = \"## ## Start Default Options ##\\n\"\n\n (* View: debian_footer\n Footer for a <debian>-specific section *)\n let debian_footer = \"## ## End Default Options ##\\n\"\n\n (* View: debian_comment_re *)\n let debian_comment_re = \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\n - \"## End Default Options ##\"\n\n (* View: debian_comment\n A comment entry inside a <debian>-specific section *)\n let debian_comment =\n [ Util.indent . label \"#comment\" . del \/##[ \\t]*\/ \"## \"\n . store debian_comment_re . eol ]\n\n (* View: debian_setting_re *)\n let debian_setting_re = \"kopt\"\n | \"groot\"\n | \"alternative\"\n | \"lockalternative\"\n | \"defoptions\"\n | \"lockold\"\n | \"xenhopt\"\n | \"xenkopt\"\n | \"altoptions\"\n | \"howmany\"\n | \"memtest86\"\n | \"updatedefaultentry\"\n | \"savedefault\"\n | \"indomU\"\n\n (* View: debian_entry *)\n let debian_entry = [ Util.del_str \"#\" . Util.indent\n . key debian_setting_re . del \/[ \\t]*=\/ \"=\"\n . value_to_eol? . eol ]\n\n (* View: debian\n A debian-specific section, made of <debian_entry> lines *)\n let debian = [ label \"debian\"\n . del debian_header debian_header\n . (debian_comment|empty|debian_entry)*\n . del debian_footer debian_footer ]\n\n(************************************************************************\n * Group: LENS AND FILTER\n *************************************************************************)\n\n (* View: lns *)\n let lns = (comment | empty | menu_setting | boot | debian)*\n\n (* View: filter *)\n let filter = incl \"\/boot\/grub\/menu.lst\"\n . incl \"\/etc\/grub.conf\"\n\n let xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"c3bd786d9a17bcdb2334740eca06abf1345762cf","subject":"Add \/etc\/mtab to known files","message":"Add \/etc\/mtab to known files\n","repos":"jjlin\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,jjlin\/augeas,manandbytes\/augeas,dafugg\/augeas,MikaelSmith\/augeas,jjlin\/augeas,mchf\/augeas,jtopjian\/augeas,lutter\/augeas,raphink\/augeas,domcleal\/augeas,hercules-team\/augeas,dafugg\/augeas,hercules-team\/augeas-do-not-use,ptoscano\/augeas,domcleal\/augeas,jtopjian\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kunkku\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,jasperla\/augeas,kunkku\/augeas,mlichvar\/augeas,domcleal\/augeas,pevalme\/augeas,pevalme\/augeas,kumy\/augeas,GeoffWilliams\/augeas,ptoscano\/augeas,manandbytes\/augeas,lutter\/augeas,mlichvar\/augeas,mchf\/augeas,GeoffWilliams\/augeas,kumy\/augeas,kumy\/augeas,pevalme\/augeas,jasperla\/augeas,mlichvar\/augeas,raphink\/augeas,kunkku\/augeas","old_file":"lenses\/fstab.aug","new_file":"lenses\/fstab.aug","new_contents":"(* Parsing \/etc\/fstab *)\n\nmodule Fstab =\n autoload xfm\n\n let sep_tab = Sep.tab\n let sep_spc = Sep.space\n let comma = Sep.comma\n let eol = Util.eol\n\n let comment = Util.comment\n let empty = Util.empty\n\n let word = Rx.neg1\n let spec = \/[^,# \\n\\t][^ \\n\\t]*\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns comma\n\n let record = [ seq \"mntent\" .\n [ label \"spec\" . store spec ] . sep_tab .\n [ label \"file\" . store word ] . sep_tab .\n comma_sep_list \"vfstype\" . sep_tab .\n comma_sep_list \"opt\" .\n (sep_tab . [ label \"dump\" . store \/[0-9]+\/ ] .\n ( sep_spc . [ label \"passno\" . store \/[0-9]+\/ ])? )?\n . eol ]\n\n let lns = ( empty | comment | record ) *\n let filter = (incl \"\/etc\/fstab\")\n . (incl \"\/etc\/mtab\")\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing \/etc\/fstab *)\n\nmodule Fstab =\n autoload xfm\n\n let sep_tab = Sep.tab\n let sep_spc = Sep.space\n let comma = Sep.comma\n let eol = Util.eol\n\n let comment = Util.comment\n let empty = Util.empty\n\n let word = Rx.neg1\n let spec = \/[^,# \\n\\t][^ \\n\\t]*\/\n\n let comma_sep_list (l:string) =\n let lns = [ label l . store word ] in\n Build.opt_list lns comma\n\n let record = [ seq \"mntent\" .\n [ label \"spec\" . store spec ] . sep_tab .\n [ label \"file\" . store word ] . sep_tab .\n comma_sep_list \"vfstype\" . sep_tab .\n comma_sep_list \"opt\" .\n (sep_tab . [ label \"dump\" . store \/[0-9]+\/ ] .\n ( sep_spc . [ label \"passno\" . store \/[0-9]+\/ ])? )?\n . eol ]\n\n let lns = ( empty | comment | record ) *\n\n let xfm = transform lns (incl \"\/etc\/fstab\")\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"9c645afbde88a2bdb5f8b139fde44968b019234c","subject":"Yum.lns: simplify code for combinatory logic of list_entry elements","message":"Yum.lns: simplify code for combinatory logic of list_entry elements\n","repos":"pevalme\/augeas,kunkku\/augeas,kunkku\/augeas,lutter\/augeas,mlichvar\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,jasperla\/augeas,ptoscano\/augeas,lutter\/augeas,ptoscano\/augeas,mchf\/augeas,manandbytes\/augeas,jjlin\/augeas,raphink\/augeas,mlichvar\/augeas,lutter\/augeas,hercules-team\/augeas,pevalme\/augeas,dafugg\/augeas,GeoffWilliams\/augeas,GeoffWilliams\/augeas,pevalme\/augeas,jasperla\/augeas,kunkku\/augeas,MikaelSmith\/augeas,jjlin\/augeas,jtopjian\/augeas,mlichvar\/augeas,mchf\/augeas,raphink\/augeas,dafugg\/augeas,manandbytes\/augeas,dafugg\/augeas,ptoscano\/augeas,jjlin\/augeas","old_file":"lenses\/yum.aug","new_file":"lenses\/yum.aug","new_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . Sep.opt_space . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries = entry*\n | entry* . list_entry \"baseurl\" . entry* . (list_entry \"gpgkey\" . entry*)?\n | entry* . list_entry \"gpgkey\" . entry* . (list_entry \"baseurl\" . entry*)?\n\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*.repo\")\n . (incl \"\/etc\/yum\/yum-cron*.conf\") \n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"(* Parsing yum's config files *)\nmodule Yum =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\nlet empty = Util.empty\nlet eol = IniFile.eol\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\nlet list_entry (list_key:string) =\n let list_value = store \/[^# \\t\\r\\n,][^ \\t\\r\\n,]*[^# \\t\\r\\n,]|[^# \\t\\r\\n,]\/ in\n let list_sep = del \/([ \\t]*(,[ \\t]*|\\r?\\n[ \\t]+))|[ \\t]+\/ \"\\n\\t\" in\n [ key list_key . sep . Sep.opt_space . list_value ]\n . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?\n . eol\n\nlet entry_re = IniFile.entry_re - (\"baseurl\" | \"gpgkey\")\n\nlet entry = IniFile.entry entry_re sep comment\n | empty\n\nlet entries = entry*\n | entry* . list_entry \"baseurl\" . entry*\n | entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"baseurl\" . entry* . list_entry \"gpgkey\" . entry*\n | entry* . list_entry \"gpgkey\" . entry* . list_entry \"baseurl\" . entry*\n\n\n\n(***********************************************************************a\n * TITLE\n *************************************************************************)\nlet title = IniFile.title IniFile.record_re\nlet record = [ title . entries ]\n\n\n(************************************************************************\n * LENS & FILTER\n *************************************************************************)\nlet lns = (empty | comment)* . record*\n\n let filter = (incl \"\/etc\/yum.conf\")\n . (incl \"\/etc\/yum.repos.d\/*.repo\")\n . (incl \"\/etc\/yum\/yum-cron*.conf\") \n . (incl \"\/etc\/yum\/pluginconf.d\/*\")\n . (excl \"\/etc\/yum\/pluginconf.d\/versionlock.list\")\n . Util.stdexcl\n\n let xfm = transform lns filter\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"6b66dbdc6ff10af9cfe401d9d7ac1a69045f5628","subject":"Add lens for radicale config file","message":"Add lens for radicale config file\n","repos":"pevalme\/augeas,mchf\/augeas,mchf\/augeas,mlichvar\/augeas,kunkku\/augeas,mlichvar\/augeas,lutter\/augeas,manandbytes\/augeas,pevalme\/augeas,ptoscano\/augeas,lutter\/augeas,ptoscano\/augeas,kunkku\/augeas,pevalme\/augeas,hercules-team\/augeas,ptoscano\/augeas,hercules-team\/augeas,mlichvar\/augeas,kunkku\/augeas,lutter\/augeas,manandbytes\/augeas","old_file":"lenses\/radicale.aug","new_file":"lenses\/radicale.aug","new_contents":"(* Radicale module for Augeas\n Based on Puppet lens.\n\n \/etc\/radicale\/config is a standard INI File.\n*)\n\n\nmodule Radicale =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *\n * \/etc\/radicale\/config only supports \"#\" as commentary and \"=\" as separator\n *************************************************************************)\nlet comment = IniFile.comment \"#\" \"#\"\nlet sep = IniFile.sep \"=\" \"=\"\n\n\n(************************************************************************\n * ENTRY\n * \/etc\/radicale\/config uses standard INI File entries\n *************************************************************************)\nlet entry = IniFile.indented_entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * RECORD\n * \/etc\/radicale\/config uses standard INI File records\n *************************************************************************)\nlet title = IniFile.indented_title IniFile.record_re\nlet record = IniFile.record title entry\n\n\n(************************************************************************\n * LENS & FILTER\n * \/etc\/radicale\/config uses standard INI File records\n *************************************************************************)\nlet lns = IniFile.lns record comment\n\nlet filter = (incl \"\/etc\/radicale\/config\")\n\nlet xfm = transform lns filter\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lenses\/radicale.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"fcbe13863a82778739dc98e5b468ea3fa8c697aa","subject":"Inifile: no space around seps by default","message":"Inifile: no space around seps by default\n","repos":"dafugg\/augeas,mlichvar\/augeas,kumy\/augeas,camptocamp\/augeas,hercules-team\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,kunkku\/augeas,kumy\/augeas,mlichvar\/augeas,ptoscano\/augeas,jjlin\/augeas,domcleal\/augeas,mchf\/augeas,dafugg\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,jasperla\/augeas,manandbytes\/augeas,manandbytes\/augeas,jtopjian\/augeas,kunkku\/augeas,bkearney\/augeas,pevalme\/augeas,domcleal\/augeas,camptocamp\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,mchf\/augeas,kunkku\/augeas,jtopjian\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,bkearney\/augeas,bkearney\/augeas,domcleal\/augeas,raphink\/augeas,camptocamp\/augeas,hercules-team\/augeas,jjlin\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,mlichvar\/augeas,lutter\/augeas,jasperla\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,lutter\/augeas,kumy\/augeas,kumy\/augeas,camptocamp\/augeas,lutter\/augeas","old_file":"lenses\/inifile.aug","new_file":"lenses\/inifile.aug","new_contents":"(* IniFile generic module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* TODO: Support double quotes in value *)\n\nmodule IniFile =\n\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\n\nlet sep_gen (pat:regexp) (default:string) \n = Util.del_opt_ws \"\" . del pat default\nlet value_sep = sep_gen \"=\" \"=\"\nlet value_sepwithcolon = sep_gen \/[:=]\/ \"=\"\n\nlet value_to_eol = Util.del_opt_ws \"\"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet value_to_comment = Util.del_opt_ws \"\"\n . store \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n\n(* Define comment and empty strings *)\n(* Some implementations of INI file allow \"#\" as a comment sign *)\n\nlet comment_generic (pat:regexp) (default:string)\n = [ label \"comment\" . sep_gen pat default\n\t\t\t . value_to_eol . eol ]\nlet comment = comment_generic \/[#;]\/ \";\"\nlet comment_nosharp = comment_generic \";\" \";\"\n\nlet empty = Util.empty\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\n(* Some implementations of INI file allow \":\" as separator *)\nlet entry_generic (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . value_to_comment? . (comment|eol) ]\nlet entry (kw:regexp)\n = entry_generic kw value_sepwithcolon comment\nlet entry_setcomment (kw:regexp) (comment:lens)\n = entry_generic kw value_sepwithcolon comment\nlet entry_nocolon (kw:regexp)\n = entry_generic kw value_sep comment\nlet entry_nocolon_setcomment (kw:regexp) (comment:lens)\n = entry_generic kw value_sep comment\n\n\n(************************************************************************\n * RECORD \n *************************************************************************)\n\nlet title = Util.del_str \"[\" . store \/[^]]+\/\n . Util.del_str \"]\". eol\n\nlet record (label_name:string) (entry:lens)\n = [ label label_name . title\n\t\t\t . (entry | comment | empty)* ]\n\nlet record_setcomment (label_name:string) (entry:lens)\n (comment:lens) = [ label label_name . title\n . (entry | comment | empty)* ]\n\n(* Some implementations of INI File do not allow empty lines *)\nlet record_noempty (label_name:string) (entry:lens)\n = [ label label_name . title\n . (entry | comment)* ]\n\nlet record_noempty_setcomment (label_name:string) (entry:lens)\n (comment:lens) = [ label label_name . title\n . (entry | comment)* ] \n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\n\n(* Generic INI file lens *)\nlet lns (record:lens) = ( comment | empty )* . record*\n\n(* Let the user choose the type of comment they want *)\nlet lns_setcomment (record:lens) (comment:lens)\n = ( comment | empty )* . record*\n\n(* Some implementations of INI File do not allow empty lines *)\nlet lns_noempty (record:lens) = comment* . record*\n\n(* Let the user choose the type of comment they want *)\nlet lns_noempty_setcomment (record:lens) (comment:lens)\n = comment* . record*\n\n\n","old_contents":"(* IniFile generic module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n(* TODO: Support double quotes in value *)\n\nmodule IniFile =\n\n\n(************************************************************************\n * USEFUL PRIMITIVES\n *************************************************************************)\n\nlet eol = Util.eol\n\nlet sep_gen (pat:regexp) (default:string) \n = Util.del_opt_ws \" \" . del pat default\nlet value_sep = sep_gen \"=\" \"=\"\nlet value_sepwithcolon = sep_gen \/[:=]\/ \"=\"\n\nlet value_to_eol = Util.del_opt_ws \" \"\n . store \/([^ \\t\\n].*[^ \\t\\n]|[^ \\t\\n])\/\nlet value_to_comment = Util.del_opt_ws \" \"\n . store \/[^;# \\t\\n][^;#\\n]*[^;# \\t\\n]|[^;# \\t\\n]\/\n\n\n(* Define comment and empty strings *)\n(* Some implementations of INI file allow \"#\" as a comment sign *)\n\nlet comment_generic (pat:regexp) (default:string)\n = [ label \"comment\" . sep_gen pat default\n\t\t\t . value_to_eol . eol ]\nlet comment = comment_generic \/[#;]\/ \";\"\nlet comment_nosharp = comment_generic \";\" \";\"\n\nlet empty = Util.empty\n\n\n(************************************************************************\n * ENTRY\n *************************************************************************)\n\n(* Some implementations of INI file allow \";\" as separator *)\nlet entry_generic (kw:regexp) (sep:lens) (comment:lens)\n = [ key kw . sep . value_to_comment? . (comment|eol) ]\nlet entry (kw:regexp)\n = entry_generic kw value_sepwithcolon comment\nlet entry_setcomment (kw:regexp) (comment:lens)\n = entry_generic kw value_sepwithcolon comment\nlet entry_nocolon (kw:regexp)\n = entry_generic kw value_sep comment\nlet entry_nocolon_setcomment (kw:regexp) (comment:lens)\n = entry_generic kw value_sep comment\n\n\n(************************************************************************\n * RECORD \n *************************************************************************)\n\nlet title = Util.del_str \"[\" . store \/[^]]+\/\n . Util.del_str \"]\". eol\n\nlet record (label_name:string) (entry:lens)\n = [ label label_name . title\n\t\t\t . (entry | comment | empty)* ]\n\nlet record_setcomment (label_name:string) (entry:lens)\n (comment:lens) = [ label label_name . title\n . (entry | comment | empty)* ]\n\n(* Some implementations of INI File do not allow empty lines *)\nlet record_noempty (label_name:string) (entry:lens)\n = [ label label_name . title\n . (entry | comment)* ]\n\nlet record_noempty_setcomment (label_name:string) (entry:lens)\n (comment:lens) = [ label label_name . title\n . (entry | comment)* ] \n\n\n(************************************************************************\n * LENS\n *************************************************************************)\n\n\n(* Generic INI file lens *)\nlet lns (record:lens) = ( comment | empty )* . record*\n\n(* Let the user choose the type of comment they want *)\nlet lns_setcomment (record:lens) (comment:lens)\n = ( comment | empty )* . record*\n\n(* Some implementations of INI File do not allow empty lines *)\nlet lns_noempty (record:lens) = comment* . record*\n\n(* Let the user choose the type of comment they want *)\nlet lns_noempty_setcomment (record:lens) (comment:lens)\n = comment* . record*\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"335c87fdf3892d25543ce8e3e7df05933d3bc36c","subject":"Add test_fonts.aug","message":"Add test_fonts.aug\n","repos":"hercules-team\/augeas-do-not-use,hercules-team\/augeas-do-not-use,mchf\/augeas,kunkku\/augeas,jjlin\/augeas,hercules-team\/augeas,ptoscano\/augeas,kumy\/augeas,kunkku\/augeas,mchf\/augeas,jjlin\/augeas,ptoscano\/augeas,kumy\/augeas,kumy\/augeas,pevalme\/augeas,hercules-team\/augeas,manandbytes\/augeas,raphink\/augeas,domcleal\/augeas,dafugg\/augeas,kunkku\/augeas,lutter\/augeas,jasperla\/augeas,jtopjian\/augeas,domcleal\/augeas,manandbytes\/augeas,GeoffWilliams\/augeas,MikaelSmith\/augeas,dafugg\/augeas,jtopjian\/augeas,lutter\/augeas,jasperla\/augeas,jjlin\/augeas,pevalme\/augeas,ptoscano\/augeas,kumy\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,raphink\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,dafugg\/augeas,lutter\/augeas,mlichvar\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas","old_file":"lenses\/tests\/test_fonts.aug","new_file":"lenses\/tests\/test_fonts.aug","new_contents":"(*\nModule: Test_Fonts\n Provides unit tests and examples for the <Fonts> lens.\n*)\n\nmodule Test_Fonts =\n\n(* Variable: conf *)\nlet conf = \"<?xml version=\\\"1.0\\\"?>\n<!DOCTYPE fontconfig SYSTEM \\\"fonts.dtd\\\">\n<!-- \/etc\/fonts\/fonts.conf file to configure system font access -->\n<fontconfig>\n\n<!--\n\tDO NOT EDIT THIS FILE.\n\tIT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.\n\tLOCAL CHANGES BELONG IN 'local.conf'.\n\n\tThe intent of this standard configuration file is to be adequate for\n\tmost environments. If you have a reasonably normal environment and\n\thave found problems with this configuration, they are probably\n\tthings that others will also want fixed. Please submit any\n\tproblems to the fontconfig bugzilla system located at fontconfig.org\n\n\tNote that the normal 'make install' procedure for fontconfig is to\n\treplace any existing fonts.conf file with the new version. Place\n\tany local customizations in local.conf which this file references.\n\n\tKeith Packard\n-->\n\n<!-- Font directory list -->\n\n\t<dir>\/usr\/share\/fonts<\/dir>\n\t<dir>\/usr\/X11R6\/lib\/X11\/fonts<\/dir> <dir>\/usr\/local\/share\/fonts<\/dir>\n\t<dir>~\/.fonts<\/dir>\n\n<!--\n Accept deprecated 'mono' alias, replacing it with 'monospace'\n-->\n\t<match target=\\\"pattern\\\">\n\t\t<test qual=\\\"any\\\" name=\\\"family\\\">\n\t\t\t<string>mono<\/string>\n\t\t<\/test>\n\t\t<edit name=\\\"family\\\" mode=\\\"assign\\\">\n\t\t\t<string>monospace<\/string>\n\t\t<\/edit>\n\t<\/match>\n\n<!--\n Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'\n-->\n\t<match target=\\\"pattern\\\">\n\t\t<test qual=\\\"any\\\" name=\\\"family\\\">\n\t\t\t<string>sans serif<\/string>\n\t\t<\/test>\n\t\t<edit name=\\\"family\\\" mode=\\\"assign\\\">\n\t\t\t<string>sans-serif<\/string>\n\t\t<\/edit>\n\t<\/match>\n\n<!--\n Accept deprecated 'sans' alias, replacing it with 'sans-serif'\n-->\n\t<match target=\\\"pattern\\\">\n\t\t<test qual=\\\"any\\\" name=\\\"family\\\">\n\t\t\t<string>sans<\/string>\n\t\t<\/test>\n\t\t<edit name=\\\"family\\\" mode=\\\"assign\\\">\n\t\t\t<string>sans-serif<\/string>\n\t\t<\/edit>\n\t<\/match>\n\n<!--\n Load local system customization file\n-->\n\t<include ignore_missing=\\\"yes\\\">conf.d<\/include>\n\n<!-- Font cache directory list -->\n\n\t<cachedir>\/var\/cache\/fontconfig<\/cachedir>\n\t<cachedir>~\/.fontconfig<\/cachedir>\n\n\t<config>\n<!--\n These are the default Unicode chars that are expected to be blank\n in fonts. All other blank chars are assumed to be broken and\n won't appear in the resulting charsets\n -->\n\t\t<blank>\n\t\t\t<int>0x0020<\/int>\t<!-- SPACE -->\n\t\t\t<int>0x00A0<\/int>\t<!-- NO-BREAK SPACE -->\n\t\t\t<int>0x00AD<\/int>\t<!-- SOFT HYPHEN -->\n\t\t\t<int>0x034F<\/int>\t<!-- COMBINING GRAPHEME JOINER -->\n\t\t\t<int>0x0600<\/int>\t<!-- ARABIC NUMBER SIGN -->\n\t\t\t<int>0x0601<\/int>\t<!-- ARABIC SIGN SANAH -->\n\t\t\t<int>0x0602<\/int>\t<!-- ARABIC FOOTNOTE MARKER -->\n\t\t\t<int>0x0603<\/int>\t<!-- ARABIC SIGN SAFHA -->\n\t\t\t<int>0x06DD<\/int>\t<!-- ARABIC END OF AYAH -->\n\t\t\t<int>0x070F<\/int>\t<!-- SYRIAC ABBREVIATION MARK -->\n\t\t\t<int>0x115F<\/int>\t<!-- HANGUL CHOSEONG FILLER -->\n\t\t\t<int>0x1160<\/int>\t<!-- HANGUL JUNGSEONG FILLER -->\n\t\t\t<int>0x1680<\/int>\t<!-- OGHAM SPACE MARK -->\n\t\t\t<int>0x17B4<\/int>\t<!-- KHMER VOWEL INHERENT AQ -->\n\t\t\t<int>0x17B5<\/int>\t<!-- KHMER VOWEL INHERENT AA -->\n\t\t\t<int>0x180E<\/int>\t<!-- MONGOLIAN VOWEL SEPARATOR -->\n\t\t\t<int>0x2000<\/int>\t<!-- EN QUAD -->\n\t\t\t<int>0x2001<\/int>\t<!-- EM QUAD -->\n\t\t\t<int>0x2002<\/int>\t<!-- EN SPACE -->\n\t\t\t<int>0x2003<\/int>\t<!-- EM SPACE -->\n\t\t\t<int>0x2004<\/int>\t<!-- THREE-PER-EM SPACE -->\n\t\t\t<int>0x2005<\/int>\t<!-- FOUR-PER-EM SPACE -->\n\t\t\t<int>0x2006<\/int>\t<!-- SIX-PER-EM SPACE -->\n\t\t\t<int>0x2007<\/int>\t<!-- FIGURE SPACE -->\n\t\t\t<int>0x2008<\/int>\t<!-- PUNCTUATION SPACE -->\n\t\t\t<int>0x2009<\/int>\t<!-- THIN SPACE -->\n\t\t\t<int>0x200A<\/int>\t<!-- HAIR SPACE -->\n\t\t\t<int>0x200B<\/int>\t<!-- ZERO WIDTH SPACE -->\n\t\t\t<int>0x200C<\/int>\t<!-- ZERO WIDTH NON-JOINER -->\n\t\t\t<int>0x200D<\/int>\t<!-- ZERO WIDTH JOINER -->\n\t\t\t<int>0x200E<\/int>\t<!-- LEFT-TO-RIGHT MARK -->\n\t\t\t<int>0x200F<\/int>\t<!-- RIGHT-TO-LEFT MARK -->\n\t\t\t<int>0x2028<\/int>\t<!-- LINE SEPARATOR -->\n\t\t\t<int>0x2029<\/int>\t<!-- PARAGRAPH SEPARATOR -->\n\t\t\t<int>0x202A<\/int>\t<!-- LEFT-TO-RIGHT EMBEDDING -->\n\t\t\t<int>0x202B<\/int>\t<!-- RIGHT-TO-LEFT EMBEDDING -->\n\t\t\t<int>0x202C<\/int>\t<!-- POP DIRECTIONAL FORMATTING -->\n\t\t\t<int>0x202D<\/int>\t<!-- LEFT-TO-RIGHT OVERRIDE -->\n\t\t\t<int>0x202E<\/int>\t<!-- RIGHT-TO-LEFT OVERRIDE -->\n\t\t\t<int>0x202F<\/int>\t<!-- NARROW NO-BREAK SPACE -->\n\t\t\t<int>0x205F<\/int>\t<!-- MEDIUM MATHEMATICAL SPACE -->\n\t\t\t<int>0x2060<\/int>\t<!-- WORD JOINER -->\n\t\t\t<int>0x2061<\/int>\t<!-- FUNCTION APPLICATION -->\n\t\t\t<int>0x2062<\/int>\t<!-- INVISIBLE TIMES -->\n\t\t\t<int>0x2063<\/int>\t<!-- INVISIBLE SEPARATOR -->\n\t\t\t<int>0x206A<\/int>\t<!-- INHIBIT SYMMETRIC SWAPPING -->\n\t\t\t<int>0x206B<\/int>\t<!-- ACTIVATE SYMMETRIC SWAPPING -->\n\t\t\t<int>0x206C<\/int>\t<!-- INHIBIT ARABIC FORM SHAPING -->\n\t\t\t<int>0x206D<\/int>\t<!-- ACTIVATE ARABIC FORM SHAPING -->\n\t\t\t<int>0x206E<\/int>\t<!-- NATIONAL DIGIT SHAPES -->\n\t\t\t<int>0x206F<\/int>\t<!-- NOMINAL DIGIT SHAPES -->\n\t\t\t<int>0x2800<\/int>\t<!-- BRAILLE PATTERN BLANK -->\n\t\t\t<int>0x3000<\/int>\t<!-- IDEOGRAPHIC SPACE -->\n\t\t\t<int>0x3164<\/int>\t<!-- HANGUL FILLER -->\n\t\t\t<int>0xFEFF<\/int>\t<!-- ZERO WIDTH NO-BREAK SPACE -->\n\t\t\t<int>0xFFA0<\/int>\t<!-- HALFWIDTH HANGUL FILLER -->\n\t\t\t<int>0xFFF9<\/int>\t<!-- INTERLINEAR ANNOTATION ANCHOR -->\n\t\t\t<int>0xFFFA<\/int>\t<!-- INTERLINEAR ANNOTATION SEPARATOR -->\n\t\t\t<int>0xFFFB<\/int>\t<!-- INTERLINEAR ANNOTATION TERMINATOR -->\n\t\t<\/blank>\n<!--\n Rescan configuration every 30 seconds when FcFontSetList is called\n -->\n\t\t<rescan>\n\t\t\t<int>30<\/int>\n\t\t<\/rescan>\n\t<\/config>\n\n<\/fontconfig>\n\"\n\n(* Test: Fonts.lns *)\ntest Fonts.lns get conf =\n { \"#declaration\"\n { \"#attribute\"\n { \"version\" = \"1.0\" }\n }\n }\n { \"!DOCTYPE\" = \"fontconfig\"\n { \"SYSTEM\" = \"fonts.dtd\" }\n }\n { \"#comment\" = \" \/etc\/fonts\/fonts.conf file to configure system font access \" }\n { \"fontconfig\"\n { \"#text\" = \"\n\n\" }\n { \"#comment\" = \"\n\tDO NOT EDIT THIS FILE.\n\tIT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.\n\tLOCAL CHANGES BELONG IN 'local.conf'.\n\n\tThe intent of this standard configuration file is to be adequate for\n\tmost environments. If you have a reasonably normal environment and\n\thave found problems with this configuration, they are probably\n\tthings that others will also want fixed. Please submit any\n\tproblems to the fontconfig bugzilla system located at fontconfig.org\n\n\tNote that the normal 'make install' procedure for fontconfig is to\n\treplace any existing fonts.conf file with the new version. Place\n\tany local customizations in local.conf which this file references.\n\n\tKeith Packard\n\" }\n { \"#text\" = \"\n\n\" }\n { \"#comment\" = \" Font directory list \" }\n { \"#text\" = \"\n\n\t\" }\n { \"dir\"\n { \"#text\" = \"\/usr\/share\/fonts\" }\n }\n { \"#text\" = \"\t\" }\n { \"dir\"\n { \"#text\" = \"\/usr\/X11R6\/lib\/X11\/fonts\" }\n }\n { \"#text\" = \" \" }\n { \"dir\"\n { \"#text\" = \"\/usr\/local\/share\/fonts\" }\n }\n { \"#text\" = \"\t\" }\n { \"dir\"\n { \"#text\" = \"~\/.fonts\" }\n }\n { \"#text\" = \"\n\" }\n { \"#comment\" = \"\n Accept deprecated 'mono' alias, replacing it with 'monospace'\n\" }\n { \"#text\" = \"\n\t\" }\n { \"match\"\n { \"#attribute\"\n { \"target\" = \"pattern\" }\n }\n { \"#text\" = \"\n\t\t\" }\n { \"test\"\n { \"#attribute\"\n { \"qual\" = \"any\" }\n { \"name\" = \"family\" }\n }\n { \"#text\" = \"\n\t\t\t\" }\n { \"string\"\n { \"#text\" = \"mono\" }\n }\n { \"#text\" = \"\t\t\" }\n }\n { \"#text\" = \"\t\t\" }\n { \"edit\"\n { \"#attribute\"\n { \"name\" = \"family\" }\n { \"mode\" = \"assign\" }\n }\n { \"#text\" = \"\n\t\t\t\" }\n { \"string\"\n { \"#text\" = \"monospace\" }\n }\n { \"#text\" = \"\t\t\" }\n }\n { \"#text\" = \"\t\" }\n }\n { \"#text\" = \"\n\" }\n { \"#comment\" = \"\n Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'\n\" }\n { \"#text\" = \"\n\t\" }\n { \"match\"\n { \"#attribute\"\n { \"target\" = \"pattern\" }\n }\n { \"#text\" = \"\n\t\t\" }\n { \"test\"\n { \"#attribute\"\n { \"qual\" = \"any\" }\n { \"name\" = \"family\" }\n }\n { \"#text\" = \"\n\t\t\t\" }\n { \"string\"\n { \"#text\" = \"sans serif\" }\n }\n { \"#text\" = \"\t\t\" }\n }\n { \"#text\" = \"\t\t\" }\n { \"edit\"\n { \"#attribute\"\n { \"name\" = \"family\" }\n { \"mode\" = \"assign\" }\n }\n { \"#text\" = \"\n\t\t\t\" }\n { \"string\"\n { \"#text\" = \"sans-serif\" }\n }\n { \"#text\" = \"\t\t\" }\n }\n { \"#text\" = \"\t\" }\n }\n { \"#text\" = \"\n\" }\n { \"#comment\" = \"\n Accept deprecated 'sans' alias, replacing it with 'sans-serif'\n\" }\n { \"#text\" = \"\n\t\" }\n { \"match\"\n { \"#attribute\"\n { \"target\" = \"pattern\" }\n }\n { \"#text\" = \"\n\t\t\" }\n { \"test\"\n { \"#attribute\"\n { \"qual\" = \"any\" }\n { \"name\" = \"family\" }\n }\n { \"#text\" = \"\n\t\t\t\" }\n { \"string\"\n { \"#text\" = \"sans\" }\n }\n { \"#text\" = \"\t\t\" }\n }\n { \"#text\" = \"\t\t\" }\n { \"edit\"\n { \"#attribute\"\n { \"name\" = \"family\" }\n { \"mode\" = \"assign\" }\n }\n { \"#text\" = \"\n\t\t\t\" }\n { \"string\"\n { \"#text\" = \"sans-serif\" }\n }\n { \"#text\" = \"\t\t\" }\n }\n { \"#text\" = \"\t\" }\n }\n { \"#text\" = \"\n\" }\n { \"#comment\" = \"\n Load local system customization file\n\" }\n { \"#text\" = \"\n\t\" }\n { \"include\"\n { \"#attribute\"\n { \"ignore_missing\" = \"yes\" }\n }\n { \"#text\" = \"conf.d\" }\n }\n { \"#text\" = \"\n\" }\n { \"#comment\" = \" Font cache directory list \" }\n { \"#text\" = \"\n\n\t\" }\n { \"cachedir\"\n { \"#text\" = \"\/var\/cache\/fontconfig\" }\n }\n { \"#text\" = \"\t\" }\n { \"cachedir\"\n { \"#text\" = \"~\/.fontconfig\" }\n }\n { \"#text\" = \"\n\t\" }\n { \"config\"\n { \"#text\" = \"\n\" }\n { \"#comment\" = \"\n These are the default Unicode chars that are expected to be blank\n in fonts. All other blank chars are assumed to be broken and\n won't appear in the resulting charsets\n \" }\n { \"#text\" = \"\n\t\t\" }\n { \"blank\"\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x0020\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x00A0\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" NO-BREAK SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x00AD\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" SOFT HYPHEN \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x034F\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" COMBINING GRAPHEME JOINER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x0600\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ARABIC NUMBER SIGN \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x0601\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ARABIC SIGN SANAH \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x0602\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ARABIC FOOTNOTE MARKER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x0603\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ARABIC SIGN SAFHA \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x06DD\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ARABIC END OF AYAH \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x070F\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" SYRIAC ABBREVIATION MARK \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x115F\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" HANGUL CHOSEONG FILLER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x1160\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" HANGUL JUNGSEONG FILLER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x1680\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" OGHAM SPACE MARK \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x17B4\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" KHMER VOWEL INHERENT AQ \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x17B5\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" KHMER VOWEL INHERENT AA \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x180E\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" MONGOLIAN VOWEL SEPARATOR \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2000\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" EN QUAD \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2001\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" EM QUAD \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2002\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" EN SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2003\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" EM SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2004\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" THREE-PER-EM SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2005\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" FOUR-PER-EM SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2006\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" SIX-PER-EM SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2007\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" FIGURE SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2008\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" PUNCTUATION SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2009\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" THIN SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x200A\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" HAIR SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x200B\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ZERO WIDTH SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x200C\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ZERO WIDTH NON-JOINER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x200D\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ZERO WIDTH JOINER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x200E\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" LEFT-TO-RIGHT MARK \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x200F\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" RIGHT-TO-LEFT MARK \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2028\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" LINE SEPARATOR \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2029\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" PARAGRAPH SEPARATOR \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x202A\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" LEFT-TO-RIGHT EMBEDDING \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x202B\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" RIGHT-TO-LEFT EMBEDDING \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x202C\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" POP DIRECTIONAL FORMATTING \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x202D\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" LEFT-TO-RIGHT OVERRIDE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x202E\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" RIGHT-TO-LEFT OVERRIDE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x202F\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" NARROW NO-BREAK SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x205F\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" MEDIUM MATHEMATICAL SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2060\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" WORD JOINER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2061\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" FUNCTION APPLICATION \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2062\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" INVISIBLE TIMES \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2063\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" INVISIBLE SEPARATOR \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x206A\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" INHIBIT SYMMETRIC SWAPPING \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x206B\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ACTIVATE SYMMETRIC SWAPPING \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x206C\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" INHIBIT ARABIC FORM SHAPING \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x206D\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ACTIVATE ARABIC FORM SHAPING \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x206E\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" NATIONAL DIGIT SHAPES \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x206F\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" NOMINAL DIGIT SHAPES \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x2800\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" BRAILLE PATTERN BLANK \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x3000\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" IDEOGRAPHIC SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0x3164\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" HANGUL FILLER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0xFEFF\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" ZERO WIDTH NO-BREAK SPACE \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0xFFA0\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" HALFWIDTH HANGUL FILLER \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0xFFF9\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" INTERLINEAR ANNOTATION ANCHOR \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0xFFFA\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" INTERLINEAR ANNOTATION SEPARATOR \" }\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"0xFFFB\" }\n }\n { \"#text\" = \"\t\" }\n { \"#comment\" = \" INTERLINEAR ANNOTATION TERMINATOR \" }\n { \"#text\" = \"\n\t\t\" }\n }\n { \"#comment\" = \"\n Rescan configuration every 30 seconds when FcFontSetList is called\n \" }\n { \"#text\" = \"\n\t\t\" }\n { \"rescan\"\n { \"#text\" = \"\n\t\t\t\" }\n { \"int\"\n { \"#text\" = \"30\" }\n }\n { \"#text\" = \"\t\t\" }\n }\n { \"#text\" = \"\t\" }\n }\n { \"#text\" = \"\n\" }\n }\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lenses\/tests\/test_fonts.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"} {"commit":"1a604208c21a3fd2a2aa4d7896b88623099579d3","subject":"Php: added default path on redhat","message":"Php: added default path on redhat\n","repos":"manandbytes\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,dafugg\/augeas,pevalme\/augeas,kunkku\/augeas,mlichvar\/augeas,bkearney\/augeas,jtopjian\/augeas,ptoscano\/augeas,hercules-team\/augeas-do-not-use,MikaelSmith\/augeas,pevalme\/augeas,domcleal\/augeas,lutter\/augeas,raphink\/augeas,jjlin\/augeas,mchf\/augeas,ptoscano\/augeas,mchf\/augeas,hercules-team\/augeas,domcleal\/augeas,mlichvar\/augeas,kumy\/augeas,bkearney\/augeas,hercules-team\/augeas-do-not-use,hercules-team\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,kunkku\/augeas,kumy\/augeas,camptocamp\/augeas,camptocamp\/augeas,kumy\/augeas,pevalme\/augeas,GeoffWilliams\/augeas,bkearney\/augeas,lutter\/augeas,raphink\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,kumy\/augeas,camptocamp\/augeas,jasperla\/augeas,manandbytes\/augeas,jjlin\/augeas,jasperla\/augeas,camptocamp\/augeas,jtopjian\/augeas,kunkku\/augeas,jjlin\/augeas,bkearney\/augeas,mlichvar\/augeas,lutter\/augeas,dafugg\/augeas","old_file":"lenses\/php.aug","new_file":"lenses\/php.aug","new_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . (incl \"\/etc\/php.ini\")\n . (incl \"\/etc\/php.d\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","old_contents":"(* PHP module for Augeas *)\n(* Author: Raphael Pinson <raphink@gmail.com> *)\n(* *)\n\nmodule PHP =\n autoload xfm\n\n(************************************************************************\n * INI File settings\n *************************************************************************)\n\nlet comment = IniFile.comment IniFile.comment_re IniFile.comment_default\nlet sep = IniFile.sep IniFile.sep_re IniFile.sep_default\nlet empty = IniFile.empty\n\n\n(************************************************************************\n * ENTRY\n *\n * We have to remove the keyword \"section\" from possible entry keywords\n * otherwise it would lead to an ambiguity with the \"section\" label\n * since PHP allows entries outside of sections.\n *************************************************************************)\nlet entry = IniFile.entry IniFile.entry_re sep comment\n\n\n(************************************************************************\n * TITLE\n *\n * We use IniFile.title_label because there can be entries\n * outside of sections whose labels would conflict with section names\n *************************************************************************)\nlet title = IniFile.title ( IniFile.record_re - \".anon\" )\nlet record = IniFile.record title entry\n\nlet record_anon = [ label \".anon\" . ( entry | empty )+ ]\n\n\n(************************************************************************\n * LENS & FILTER\n * There can be entries before any section\n * IniFile.entry includes comment management, so we just pass entry to lns\n *************************************************************************)\nlet lns = record_anon? . record*\n\nlet filter = (incl \"\/etc\/php*\/*\/*.ini\")\n . Util.stdexcl\n\nlet xfm = transform lns filter\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"8e5d981cbee7c93690bc876f8f9e86e8ea84f7a8","subject":"Added lenses files to Augeas","message":"Added lenses files to Augeas\n","repos":"coi-gov-pl\/puppet-jboss,coi-gov-pl\/puppet-jboss,coi-gov-pl\/puppet-jboss","old_file":"files\/jbxml.aug","new_file":"files\/jbxml.aug","new_contents":"(* XML lens for Augeas\n Author: Francis Giraldeau <francis.giraldeau@usherbrooke.ca>\n\n Reference: http:\/\/www.w3.org\/TR\/2006\/REC-xml11-20060816\/\n*)\n\nmodule JBXml =\n\nautoload xfm\n\n(************************************************************************\n * Utilities lens\n *************************************************************************)\n\nlet dels (s:string) = del s s\nlet spc = \/[ \\t\\n]+\/\nlet osp = \/[ \\t\\n]*\/\nlet sep_spc = del \/[ \\t\\n]+\/ \" \"\nlet sep_osp = del \/[ \\t\\n]*\/ \"\"\nlet sep_eq = del \/[ \\t\\n]*=[ \\t\\n]*\/ \"=\"\n\nlet nmtoken = \/[a-zA-Z:_][a-zA-Z0-9:_.-]*\/\nlet word = \/[a-zA-Z][a-zA-Z0-9._-]*\/\nlet char = \/.|\\n\/\n(* if we hide the quotes, then we can only accept single or double quotes *)\n(* otherwise a put ambiguity is raised *)\nlet sto_dquote = dels \"\\\"\" . store \/[^\"]*\/ . dels \"\\\"\"\nlet sto_squote = dels \"'\" . store \/[^']*\/ . dels \"'\"\n\nlet comment = [ label \"#comment\" .\n dels \"<!--\" .\n store \/([^-]|-[^-])*\/ .\n dels \"-->\" ]\n\nlet pi_target = nmtoken - \/[Xx][Mm][Ll]\/\nlet empty = Util.empty\nlet del_end = del \/>[\\n]?\/ \">\\n\"\nlet del_end_simple = dels \">\"\n\n(* This is siplified version of processing instruction\n * pi has to not start or end with a white space and the string\n * must not contain \"?>\". We restrict too much by not allowing any\n * \"?\" nor \">\" in PI\n *)\nlet pi = \/[^ \\n\\t]|[^ \\n\\t][^?>]*[^ \\n\\t]\/\n\n(************************************************************************\n * Attributes\n *************************************************************************)\n\n\nlet decl = [ label \"#decl\" . sep_spc .\n store \/[^> \\t\\n\\r]|[^> \\t\\n\\r][^>\\t\\n\\r]*[^> \\t\\n\\r]\/ ]\n\nlet decl_def (r:regexp) (b:lens) = [ dels \"<\" . key r .\n sep_spc . store word .\n b . sep_osp . del_end_simple ]\n\nlet elem_def = decl_def \/!ELEMENT\/ decl\n\nlet enum = \"(\" . osp . nmtoken . ( osp . \"|\" . osp . nmtoken )* . osp . \")\"\n\nlet att_type = \/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS\/ |\n enum\n\nlet id_def = [ sep_spc . key \/PUBLIC\/ .\n [ label \"#literal\" . sep_spc . sto_dquote ]* ] |\n [ sep_spc . key \/SYSTEM\/ . sep_spc . sto_dquote ]\n\nlet notation_def = decl_def \/!NOTATION\/ id_def\n\nlet att_def = counter \"att_id\" .\n [ sep_spc . seq \"att_id\" .\n [ label \"#name\" . store word . sep_spc ] .\n [ label \"#type\" . store att_type . sep_spc ] .\n ([ key \/#REQUIRED|#IMPLIED\/ ] |\n [ label \"#FIXED\" . del \/#FIXED[ \\n\\t]*|\/ \"\" . sto_dquote ]) ]*\n\nlet att_list_def = decl_def \/!ATTLIST\/ att_def\n\nlet entity_def = decl_def \/!ENTITY\/ ([sep_spc . label \"#decl\" . sto_dquote ])\n\nlet decl_def_item = elem_def | entity_def | att_list_def | notation_def\n\nlet decl_outer = sep_osp . del \/\\[[ \\n\\t\\r]*\/ \"[\\n\" .\n (decl_def_item . sep_osp )* . dels \"]\"\n\n(* let dtd_def = [ sep_spc . key \"SYSTEM\" . sep_spc . sto_dquote ] *)\n\nlet doctype = decl_def \/!DOCTYPE\/ (decl_outer|id_def)\n\nlet attributes = [ label \"#attribute\" .\n [ sep_spc . key nmtoken . sep_eq . sto_dquote ]+ ]\nlet attributes_sq = [ label \"#attribute\" .\n [ sep_spc . key nmtoken . sep_eq . sto_squote ]+ ]\n\n\nlet prolog = [ label \"#declaration\" .\n dels \"<?xml\" .\n attributes_sq .\n sep_osp .\n dels \"?>\" ]\n\n\n(************************************************************************\n * Tags\n *************************************************************************)\n\n(* we consider entities as simple text *)\nlet text_re = \/[^<]+\/ - \/([^<]*\\]\\]>[^<]*)\/\nlet text = [ label \"#text\" . store text_re ]\nlet cdata = [ label \"#CDATA\" . dels \"<![CDATA[\" .\n store (char* - (char* . \"]]>\" . char*)) . dels \"]]>\" ]\n\nlet element (body:lens) =\n let h = attributes? . sep_osp . dels \">\" . body* . dels \"<\/\" in\n [ dels \"<\" . square nmtoken h . sep_osp . del_end ]\n\nlet empty_element = [ dels \"<\" . key nmtoken . value \"#empty\" .\n attributes? . sep_osp . del \/\\\/>[\\n]?\/ \"\/>\\n\" ]\n\nlet pi_instruction = [ dels \"<?\" . label \"#pi\" .\n [ label \"#target\" . store pi_target ] .\n [ sep_spc . label \"#instruction\" . store pi ]? .\n sep_osp . del \/\\?>\/ \"?>\" ]\n\n(* Typecheck is weaker on rec lens, detected by unfolding *)\n(*\nlet content1 = element text\nlet rec content2 = element (content1|text|comment)\n*)\n\nlet rec content = element (text|comment|content|empty_element|pi_instruction)\n\n(* Constraints are weaker here, but it's better than being too strict *)\nlet doc = (sep_osp . (prolog | comment | doctype | pi_instruction))* .\n ((sep_osp . content) | (sep_osp . empty_element)) .\n (sep_osp . (comment | pi_instruction ))* . sep_osp\n\nlet lns = doc\n\nlet filter = (excl \"*\")\n\nlet xfm = transform lns filter\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/jbxml.aug' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Augeas"} {"commit":"417e094dd53932acfc6465238f96afb4d914cd24","subject":"Store comments in subtrees so they are restored properly","message":"Store comments in subtrees so they are restored properly\n","repos":"kumy\/augeas,dafugg\/augeas,MikaelSmith\/augeas,hercules-team\/augeas-do-not-use,jjlin\/augeas,pevalme\/augeas,mchf\/augeas,jtopjian\/augeas,lutter\/augeas,domcleal\/augeas,hercules-team\/augeas,ptoscano\/augeas,dafugg\/augeas,bkearney\/augeas,raphink\/augeas,ptoscano\/augeas,GeoffWilliams\/augeas,mlichvar\/augeas,ptoscano\/augeas,camptocamp\/augeas,kumy\/augeas,GeoffWilliams\/augeas,kumy\/augeas,camptocamp\/augeas,kunkku\/augeas,camptocamp\/augeas,kunkku\/augeas,jasperla\/augeas,bkearney\/augeas,kumy\/augeas,lutter\/augeas,bkearney\/augeas,camptocamp\/augeas,jjlin\/augeas,kunkku\/augeas,hercules-team\/augeas-do-not-use,pevalme\/augeas,mlichvar\/augeas,domcleal\/augeas,pevalme\/augeas,lutter\/augeas,hercules-team\/augeas,MikaelSmith\/augeas,mchf\/augeas,hercules-team\/augeas-do-not-use,bkearney\/augeas,mlichvar\/augeas,jasperla\/augeas,manandbytes\/augeas,jtopjian\/augeas,domcleal\/augeas,manandbytes\/augeas,dafugg\/augeas,raphink\/augeas,jjlin\/augeas","old_file":"spec\/pam.aug","new_file":"spec\/pam.aug","new_contents":"# Parsing \/etc\/inittab\n\nmap\n grammar pam\n # We really need to be able to exclude some files, like\n # backup files and .rpmsave files\n include '\/etc\/pam.d\/*' '\/system\/config\/pam' $basename\nend\n\ngrammar pam\n\n token SEP \/[ \\t]+\/ = '\\t'\n token EOL '\\n'\n token CONTROL \/(\\[[^\\]]*\\]|[^ \\t]+)\/ = 'none'\n token POUND_TO_EOL \/#.*\\n\/ = '# '\n\n file: ( comment | record ) *\n\n comment: [ ( \/#.*?\\n\/ | \/[ \\t]*\\n\/ ) ]\n\n record: [ seq 'record' .\n [ label 'type' . store ... ] .\n SEP .\n [ label 'control' . store CONTROL] .\n SEP .\n [ label 'module' . store ... ] .\n ( [ SEP . label 'opts' . store ... ] )? .\n EOL\n ]\nend\n","old_contents":"# Parsing \/etc\/inittab\n\nmap\n grammar pam\n # We really need to be able to exclude some files, like\n # backup files and .rpmsave files\n include '\/etc\/pam.d\/*' '\/system\/config\/pam' $basename\nend\n\ngrammar pam\n\n token SEP \/[ \\t]+\/ = '\\t'\n token EOL '\\n'\n token CONTROL \/(\\[[^\\]]*\\]|[^ \\t]+)\/ = 'none'\n token POUND_TO_EOL \/#.*\\n\/ = '# '\n\n file: ( comment | record ) *\n\n comment: ( \/#.*?\\n\/ | \/[ \\t]*\\n\/ )\n\n record: [ seq 'record' .\n [ label 'type' . store ... ] .\n SEP .\n [ label 'control' . store CONTROL] .\n SEP .\n [ label 'module' . store ... ] .\n ( [ SEP . label 'opts' . store ... ] )? .\n EOL\n ]\nend\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"d37abd2ea05f95595b44bccd9f73c5ed6734ff27","subject":"Add experimental Augeas Lens for Deckard tests","message":"Add experimental Augeas Lens for Deckard tests\n","repos":"CZ-NIC\/deckard,CZ-NIC\/deckard","old_file":"augeas\/deckard.aug","new_file":"augeas\/deckard.aug","new_contents":"module Deckard =\n autoload xfm\n\nlet del_str = Util.del_str\n\nlet space = del \/[ \\t]+\/ \" \"\nlet tab = del \/[ \\t]+\/ \"\\t\"\nlet ws = del \/[\\t ]*\/ \"\"\nlet word = \/[^\\t\\n\\\/#; ]+\/\n\nlet comment = del \/[;#]\/ \";\" . [label \"comment\" . store \/[^\\n]+\/]\n\nlet eol = del \/([ \\t]*([;#][^\\n]*)?\\n)+\/ \"\\n\" . Util.indent\nlet comment_or_eol = ws . comment? . del_str \"\\n\" . del \/([ \\t]*([;#][^\\n]*)?\\n)*\/ \"\\n\" . Util.indent\n\n\n(*let comment_or_eol = [ label \"#comment\" . counter \"comment\" . (ws . [del \/[;#]\/ \";\" . label \"\" . store \/[^\\n]*\/ ]? . del_str \"\\n\")]+ . Util.indent\n*)\n\n\nlet domain_re = (\/[^.\\t\\n\\\/#; ]+(\\.[^.\\t\\n\\\/#; ]+)*\\.?\/ | \".\") - \"SECTION\" (*quick n dirty, sorry to whoever will ever own SECTION TLD*)\nlet class_re = \/CLASS[0-9]+\/ | \"IN\" | \"CH\" | \"HS\" | \"NONE\" | \"ANY\"\nlet domain = [ label \"domain\" . store domain_re ]\nlet ttl = [label \"ttl\" . store \/[0-9]+\/]\nlet class = [label \"class\" . store class_re ]\nlet type = [label \"type\" . store ((\/[^0-9#;\\n \\t][^\\t\\n\\\/#; ]*\/) - class_re) ]\nlet data = [label \"data\" . store \/[^\\n\\t ;#][^\\n;#]+[^\\n\\t;# ]\/]\n\nlet ip_re = \/[0-9a-f.:]+\/\n\n\nlet match_option = \"opcode\" | \"qtype\" | \"qcase\" | \"qname\" | \"subdomain\" | \"flags\" | \"rcode\" | \"question\" | \"answer\" | \"authority\" | \"additional\" | \"all\" | \"TCP\" | \"ttl\"\nlet adjust_option = \"copy_id\" | \"copy_query\"\nlet reply_option = \"QR\" | \"TC\" | \"AA\" | \"AD\" | \"RD\" | \"RA\" | \"CD\" | \"DO\" | \"NOERROR\" | \"FORMERR\" | \"SERVFAIL\" | \"NXDOMAIN\" | \"NOTIMP\" | \"REFUSED\" | \"YXDOMAIN\" | \"YXRRSET\" | \"NXRRSET\" | \"NOTAUTH\" | \"NOTZONE\" | \"BADVERS\"\nlet step_option = \"REPLY\" | \"QUERY\" | \"CHECK_ANSWER\" | \"CHECK_OUT_QUERY\" | \/TIME_PASSES[ \\t]+ELAPSE\/\n\nlet mandatory = [del_str \"MANDATORY\" . label \"mandatory\" . value \"true\" . comment_or_eol]\nlet tsig = [del_str \"TSIG\" . label \"tsig\" . space . [label \"keyname\" . store word] . space . [label \"secret\" . store word] . comment_or_eol]\n\nlet match = (mandatory | tsig)* . del_str \"MATCH\" . [space . label \"match\" . store match_option ]+ . comment_or_eol\nlet adjust = (mandatory | tsig)* . del_str \"ADJUST\" . [space . label \"adjust\" . store adjust_option ]+ . comment_or_eol\nlet reply = (mandatory | tsig)* . del (\"REPLY\" | \"FLAGS\") \"REPLY\" . [space . label \"reply\" . store reply_option ]+ . comment_or_eol\n\n\nlet question = domain . tab . (class . tab)? . type . comment_or_eol\nlet record = [seq \"record\" . domain . tab . (ttl . tab)? . (class . tab)? . type . tab . data . comment_or_eol]\n\nlet section_question = [ label \"question\" . del_str \"SECTION QUESTION\" .\n comment_or_eol . question? ]\nlet section_answer = [ label \"answer\" . counter \"record\" . del_str \"SECTION ANSWER\" .\n comment_or_eol . record* ]\nlet section_authority = [ label \"authority\" . counter \"record\" . del_str \"SECTION AUTHORITY\" .\n comment_or_eol . record* ]\nlet section_additional = [ label \"additional\" . counter \"record\" . del_str \"SECTION ADDITIONAL\" .\n comment_or_eol . record* ]\nlet sections = section_question? . section_answer? . section_authority? . section_additional?\n\nlet raw = [del_str \"RAW\" . comment_or_eol . label \"raw\" . store word ] . comment_or_eol\n\nlet normal = (match . (adjust . reply? | reply . adjust?)? | adjust . (match . reply? | reply . match?)? | reply . (match . adjust? | adjust . match?)?) . (mandatory | tsig)* . sections\n\n(*let normal = ((match | adjust | reply | mandatory | tsig)* . sections)*)\n\nlet entry = [label \"entry\" . del_str \"ENTRY_BEGIN\" . comment_or_eol . ( normal | raw )? . del_str \"ENTRY_END\" . eol]\n\nlet single_address = [ label \"address\" . space . store ip_re ]\n\nlet addresses = [label \"address\" . counter \"address\" . [seq \"address\" . del_str \"ADDRESS\" . space . store ip_re . comment_or_eol]+]\n\nlet range = [label \"range\" . del_str \"RANGE_BEGIN\" . space . [ label \"from\" . store \/[0-9]+\/] . space .\n [ label \"to\" . store \/[0-9]+\/] . single_address? . comment_or_eol . addresses? . entry* . del_str \"RANGE_END\" . eol]\n\nlet step = [label \"step\" . del_str \"STEP\" . space . store \/[0-9]+\/ . space . [label \"type\" . store step_option] . [space . label \"timestamp\" . store \/[0-9]+\/]? . comment_or_eol .\n entry? ]\n\nlet config_record = \/[^\\n]*\/ - (\"CONFIG_END\" | \/STEP.*\/ | \/SCENARIO.*\/ | \/RANGE.*\/ | \/ENTRY.*\/)\n\nlet config = [ label \"config\" . counter \"config\" . [seq \"config\" . store config_record . del_str \"\\n\"]* . del_str \"CONFIG_END\" . comment_or_eol ]\n\nlet guts = (step | range )*\n\nlet scenario = [label \"scenario\" . del_str \"SCENARIO_BEGIN\" . (space . store \/[^ \\t\\n#;][^\\n#;]+[^\\t\\n #;]\/)? . comment_or_eol . guts . del_str \"SCENARIO_END\" . eol]\n\nlet lns = config? . scenario\n\n(* TODO: REPLAY step *)\n(* TODO: store all comments into the tree instead of ignoring them *)\n\nlet filter = incl \"\/home\/stepan\/nic\/deckard\/sets\/resolver\/*.rpl\"\n\nlet xfm = transform lns filter\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'augeas\/deckard.aug' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Augeas"} {"commit":"c16de9613982d8401c69a34ef79a56a09c6cea33","subject":"Add more specific entry handlers to xorg.conf","message":"Add more specific entry handlers to xorg.conf\n\nAdditionally handle:\n* Driver\n* Identifier\n* VideoRam\n* DefaultDepth\n\nThis covers all entries in the default configuration.\n\nThe advantage of having a specific handler is that it knows more about what\nvalues are valid. For example, with this patch Driver will not accept an\nunquoted value, which would cause the X server not to start.\n","repos":"domcleal\/augeas,domcleal\/augeas,lutter\/augeas,jjlin\/augeas,kumy\/augeas,GeoffWilliams\/augeas,dafugg\/augeas,mlichvar\/augeas,bkearney\/augeas,jtopjian\/augeas,domcleal\/augeas,lutter\/augeas,ptoscano\/augeas,mlichvar\/augeas,MikaelSmith\/augeas,pevalme\/augeas,mchf\/augeas,raphink\/augeas,pevalme\/augeas,dafugg\/augeas,lutter\/augeas,hercules-team\/augeas-do-not-use,dafugg\/augeas,GeoffWilliams\/augeas,jjlin\/augeas,jtopjian\/augeas,jasperla\/augeas,jjlin\/augeas,kunkku\/augeas,kumy\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,kumy\/augeas,kumy\/augeas,kunkku\/augeas,manandbytes\/augeas,MikaelSmith\/augeas,ptoscano\/augeas,mchf\/augeas,bkearney\/augeas,kunkku\/augeas,jasperla\/augeas,mlichvar\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,bkearney\/augeas,manandbytes\/augeas,hercules-team\/augeas,bkearney\/augeas,ptoscano\/augeas","old_file":"lenses\/xorg.aug","new_file":"lenses\/xorg.aug","new_contents":"(*\nModule: Xorg\n Parses \/etc\/X11\/xorg.conf\n\nAuthors: Raphael Pinson <raphink@gmail.com>\n Matthew Booth <mbooth@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man xorg.conf` where\n possible.\n\nThe definitions from `man xorg.conf` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Quotes in values\n In this file, values may or may not be quoted (with double quotes) unless\nthey contain spaces or tabulations. For this reason, the quotes are\nincluded in the parsed values when present. New values with no spaces will\nnot have quotes by default, unless you type the quotes yourself around\nthem. New values with spaces will not be accepted unless they are\nexplicitely surrounded by double qutoes.\n\nAbout: Configuration files\n This lens applies to \/etc\/X11\/xorg.conf. See <filter>.\n*)\n\nmodule Xorg =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: to_eol\n * Match everything from here to eol, cropping whitespace at both ends\n *)\nlet to_eol = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Fields and values *)\n\n(* Variable: entries_re\n * This is a list of all patterns which have specific handlers, and should\n * therefore not be matched by the generic handler\n *)\nlet entries_re = \/([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth)\/\n\n(* Variable: generic_entry_re *)\nlet generic_entry_re = \/[^# \\t\\n\\\/]+\/ - entries_re\n\n\n(*\n * Variable: unquoted_word\n * Words without spaces may have quotes or not\n * the quotes are then part of the value\n *)\nlet unquoted_word = \/[^\" \\t\\n]+\/ (* \" relax Emacs *)\n\n(* Variable: quoted_word *)\nlet quoted_word = \/\"[^\"\\n]+\"\/ (* \" relax Emacs *)\n\n(* Variable: word_all *)\nlet word_all = unquoted_word | quoted_word\n\n(* Variable: int *)\nlet int = \/[0-9]+\/\n\n\n(************************************************************************\n * Group: ENTRIES AND OPTIONS\n *************************************************************************)\n\n\n(* View: entry_int\n * This matches an entry which takes a single integer for an argument\n *)\nlet entry_int (canon:string) (re:regexp) =\n [ indent . del re canon . label canon . sep_spc . store int . eol ]\n\n(* View: entry_rgb\n * This matches an entry which takes 3 integers as arguments representing red,\n * green and blue components\n *)\nlet entry_rgb (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"red\" . sep_spc . store int ]\n . [ label \"green\" . sep_spc . store int ]\n . [ label \"blue\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_xy\n * This matches an entry which takes 2 integers as arguments representing X and\n * Y coordinates\n *)\nlet entry_xy (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"x\" . sep_spc . store int ]\n . [ label \"y\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_str\n * This matches an entry which takes a single quoted string\n *)\nlet entry_str (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . sep_spc . store quoted_word . eol ]\n\n(* View: entry_generic\n * An entry without a specific handler. Store everything after the keyword,\n * cropping whitespace at both ends.\n *)\nlet entry_generic = [ indent . key generic_entry_re\n . sep_spc . store to_eol . eol ]\n\n(* View: option *)\nlet option = [ indent . del \/[oO]ption\/ \"Option\" . label \"Option\" . sep_spc\n . store quoted_word\n . [ label \"value\" . sep_spc . store quoted_word ]*\n . eol ]\n\n(* View: screen\n * The Screen entry of ServerLayout\n *)\nlet screen = [ indent . del \/[sS]creen\/ \"Screen\" . label \"Screen\" . sep_spc\n . [ label \"num\" . store int . sep_spc ]?\n . store quoted_word . sep_spc\n . [ label \"position\" . store to_eol ]\n . eol ]\n\n(* View: input_device *)\nlet input_device = [ indent . del \/[iI]nput[dD]evice\/ \"InputDevice\"\n . label \"InputDevice\" . sep_spc . store quoted_word\n . [ label \"option\" . sep_spc . store quoted_word ]*\n . eol ]\n\n(* View: driver *)\nlet driver = entry_str \"Driver\" \/[dD]river\/\n\n(* View: identifier *)\nlet identifier = entry_str \"Identifier\" \/[iI]dentifier\/\n\n(* View: videoram *)\nlet videoram = entry_int \"VideoRam\" \/[vV]ideo[rR]am\/\n\n(* View: default_depth *)\nlet default_depth = entry_int \"DefaultDepth\" \/[dD]efault[dD]epth\/\n\n(************************************************************************\n * Group: DISPLAY SUBSECTION\n *************************************************************************)\n\n\n(* View: display_modes *)\nlet display_modes = [ indent . del \/[mM]odes\/ \"Modes\" . label \"Modes\"\n . [ label \"mode\" . sep_spc . store quoted_word ]+\n . eol ]\n\n(*************************************************************************\n * View: display_entry\n * Known values for entries in the Display subsection\n *\n * Definition:\n * > Depth depth\n * > FbBpp bpp\n * > Weight red-weight green-weight blue-weight\n * > Virtual xdim ydim\n * > ViewPort x0 y0\n * > Modes \"mode-name\" ...\n * > Visual \"visual-name\"\n * > Black red green blue\n * > White red green blue\n * > Options\n *)\n\nlet display_entry = entry_int \"Depth\" \/[dD]epth\/ |\n entry_int \"FbBpp\" \/[fF]b[bB]pp\/ |\n entry_rgb \"Weight\" \/[wW]eight\/ |\n entry_xy \"Virtual\" \/[vV]irtual\/ |\n entry_xy \"ViewPort\" \/[vV]iew[pP]ort\/ |\n display_modes |\n entry_str \"Visual\" \/[vV]isual\/ |\n entry_rgb \"Black\" \/[bB]lack\/ |\n entry_rgb \"White\" \/[wW]hite\/ |\n entry_str \"Options\" \/[oO]ptions\/ |\n empty |\n comment\n\n(* View: display *)\nlet display = [ indent . del \"SubSection\" \"SubSection\" . sep_spc\n . sep_dquote . key \"Display\" . sep_dquote\n . eol\n . display_entry*\n . indent . del \"EndSubSection\" \"EndSubSection\" . eol ]\n\n\n(************************************************************************\n * Group: SECTIONS\n *************************************************************************)\n\n\n(************************************************************************\n * Variable: section_re\n * Known values for Section names\n *\n * Definition:\n * > The section names are:\n * >\n * > Files File pathnames\n * > ServerFlags Server flags\n * > Module Dynamic module loading\n * > InputDevice Input device description\n * > Device Graphics device description\n * > VideoAdaptor Xv video adaptor description\n * > Monitor Monitor description\n * > Modes Video modes descriptions\n * > Screen Screen configuration\n * > ServerLayout Overall layout\n * > DRI DRI-specific configuration\n * > Vendor Vendor-specific configuration\n *************************************************************************)\nlet section_re = \/(Files|ServerFlags|Module|InputDevice|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor)\/\n\n\n(************************************************************************\n * Variable: secton_re_obsolete\n * The following obsolete section names are still recognised for\n * compatibility purposes. In new config files, the InputDevice\n * section should be used instead.\n *\n * Definition:\n * > Keyboard Keyboard configuration\n * > Pointer Pointer\/mouse configuration\n *************************************************************************)\nlet section_re_obsolete = \/(Keyboard|Pointer)\/\n\n(* View: section_entry *)\nlet section_entry = option |\n screen |\n display |\n input_device |\n driver |\n identifier |\n videoram |\n default_depth |\n entry_generic |\n empty | comment\n\n(************************************************************************\n * View: section\n * A section in xorg.conf\n *\n * Definition:\n * > Section \"SectionName\"\n * > SectionEntry\n * > ...\n * > EndSection\n *************************************************************************)\nlet section = [ indent . del \"Section\" \"Section\"\n . sep_spc . sep_dquote\n . key (section_re|section_re_obsolete) . sep_dquote\n . eol\n . section_entry*\n . indent . del \"EndSection\" \"EndSection\" . eol ]\n\n(*\n * View: lns\n * The xorg.conf lens\n *)\nlet lns = ( empty | comment | section )*\n\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/X11\/xorg.conf\")\n\nlet xfm = transform lns filter\n","old_contents":"(*\nModule: Xorg\n Parses \/etc\/X11\/xorg.conf\n\nAuthors: Raphael Pinson <raphink@gmail.com>\n Matthew Booth <mbooth@redhat.com>\n\nAbout: Reference\n This lens tries to keep as close as possible to `man xorg.conf` where\n possible.\n\nThe definitions from `man xorg.conf` are put as commentaries for reference\nthroughout the file. More information can be found in the manual.\n\nAbout: License\n This file is licensed under the GPL.\n\nAbout: Lens Usage\n Sample usage of this lens in augtool\n\n * Get the identifier of the devices with a \"Clone\" option:\n > match \"\/files\/etc\/X11\/xorg.conf\/Device[Option = 'Clone']\/Identifier\"\n\nAbout: Quotes in values\n In this file, values may or may not be quoted (with double quotes) unless\nthey contain spaces or tabulations. For this reason, the quotes are\nincluded in the parsed values when present. New values with no spaces will\nnot have quotes by default, unless you type the quotes yourself around\nthem. New values with spaces will not be accepted unless they are\nexplicitely surrounded by double qutoes.\n\nAbout: Configuration files\n This lens applies to \/etc\/X11\/xorg.conf. See <filter>.\n*)\n\nmodule Xorg =\n autoload xfm\n\n(************************************************************************\n * Group: USEFUL PRIMITIVES\n *************************************************************************)\n\n(* Group: Generic primitives *)\n\n(* Variable: eol *)\nlet eol = Util.eol\n\n(* Variable: to_eol\n * Match everything from here to eol, cropping whitespace at both ends\n *)\nlet to_eol = \/[^ \\t\\n](.*[^ \\t\\n])?\/\n\n(* Variable: indent *)\nlet indent = Util.indent\n\n(* Variable: comment *)\nlet comment = Util.comment\n\n(* Variable: empty *)\nlet empty = Util.empty\n\n\n(* Group: Separators *)\n\n(* Variable: sep_spc *)\nlet sep_spc = Util.del_ws_spc\n\n(* Variable: sep_dquote *)\nlet sep_dquote = Util.del_str \"\\\"\"\n\n\n(* Group: Fields and values *)\n\n(* Variable: entries_re *)\nlet entries_re = \/(Option|Screen|InputDevice|SubSection|Display)\/\n\n(* Variable: generic_entry_re *)\nlet generic_entry_re = \/[^# \\t\\n\\\/]+\/ - entries_re\n\n\n(*\n * Variable: unquoted_word\n * Words without spaces may have quotes or not\n * the quotes are then part of the value\n *)\nlet unquoted_word = \/[^\" \\t\\n]+\/ (* \" relax Emacs *)\n\n(* Variable: quoted_word *)\nlet quoted_word = \/\"[^\"\\n]+\"\/ (* \" relax Emacs *)\n\n(* Variable: word_all *)\nlet word_all = unquoted_word | quoted_word\n\n(* Variable: int *)\nlet int = \/[0-9]+\/\n\n\n(************************************************************************\n * Group: ENTRIES AND OPTIONS\n *************************************************************************)\n\n\n(* View: entry_int\n * This matches an entry which takes a single integer for an argument\n *)\nlet entry_int (canon:string) (re:regexp) =\n [ indent . del re canon . label canon . sep_spc . store int . eol ]\n\n(* View: entry_rgb\n * This matches an entry which takes 3 integers as arguments representing red,\n * green and blue components\n *)\nlet entry_rgb (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"red\" . sep_spc . store int ]\n . [ label \"green\" . sep_spc . store int ]\n . [ label \"blue\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_xy\n * This matches an entry which takes 2 integers as arguments representing X and\n * Y coordinates\n *)\nlet entry_xy (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . [ label \"x\" . sep_spc . store int ]\n . [ label \"y\" . sep_spc . store int ]\n . eol ]\n\n(* View: entry_str\n * This matches an entry which takes a single, possibly quoted, string\n *)\nlet entry_str (canon:string) (re:regexp) =\n [ indent . del re canon . label canon\n . sep_spc . store word_all . eol ]\n\n(* View: entry_generic\n * An entry without a specific handler. Store everything after the keyword,\n * cropping whitespace at both ends.\n *)\nlet entry_generic = [ indent . key generic_entry_re\n . sep_spc . store to_eol . eol ]\n\n(* View: option *)\nlet option = [ indent . key \"Option\" . sep_spc\n . store word_all\n . [ label \"value\" . sep_spc . store word_all ]*\n . eol ]\n\n(* View: screen\n * The Screen entry of ServerLayout\n *)\nlet screen = [ indent . key \"Screen\" . sep_spc\n . [ label \"num\" . store int . sep_spc ]?\n . store quoted_word . sep_spc\n . [ label \"position\" . store to_eol ]\n . eol ]\n\n(* View: input_device *)\nlet input_device = [ indent . key \"InputDevice\" . sep_spc . store word_all\n . [ label \"option\" . sep_spc . store word_all ]*\n . eol ]\n\n\n(************************************************************************\n * Group: DISPLAY SUBSECTION\n *************************************************************************)\n\n\n(* View: display_modes *)\nlet display_modes = [ indent . del \/[mM]odes\/ \"Modes\" . label \"Modes\"\n . [ label \"mode\" . sep_spc . store quoted_word ]+\n . eol ]\n\n(*************************************************************************\n * View: display_entry\n * Known values for entries in the Display subsection\n *\n * Definition:\n * > Depth depth\n * > FbBpp bpp\n * > Weight red-weight green-weight blue-weight\n * > Virtual xdim ydim\n * > ViewPort x0 y0\n * > Modes \"mode-name\" ...\n * > Visual \"visual-name\"\n * > Black red green blue\n * > White red green blue\n * > Options\n *)\n\nlet display_entry = entry_int \"Depth\" \/[dD]epth\/ |\n entry_int \"FbBpp\" \/[fF]b[bB]pp\/ |\n entry_rgb \"Weight\" \/[wW]eight\/ |\n entry_xy \"Virtual\" \/[vV]irtual\/ |\n entry_xy \"ViewPort\" \/[vV]iew[pP]ort\/ |\n display_modes |\n entry_str \"Visual\" \/[vV]isual\/ |\n entry_rgb \"Black\" \/[bB]lack\/ |\n entry_rgb \"White\" \/[wW]hite\/ |\n entry_str \"Options\" \/[oO]ptions\/ |\n empty |\n comment\n\n(* View: display *)\nlet display = [ indent . del \"SubSection\" \"SubSection\" . sep_spc\n . sep_dquote . key \"Display\" . sep_dquote\n . eol\n . display_entry*\n . indent . del \"EndSubSection\" \"EndSubSection\" . eol ]\n\n\n(************************************************************************\n * Group: SECTIONS\n *************************************************************************)\n\n\n(************************************************************************\n * Variable: section_re\n * Known values for Section names\n *\n * Definition:\n * > The section names are:\n * >\n * > Files File pathnames\n * > ServerFlags Server flags\n * > Module Dynamic module loading\n * > InputDevice Input device description\n * > Device Graphics device description\n * > VideoAdaptor Xv video adaptor description\n * > Monitor Monitor description\n * > Modes Video modes descriptions\n * > Screen Screen configuration\n * > ServerLayout Overall layout\n * > DRI DRI-specific configuration\n * > Vendor Vendor-specific configuration\n *************************************************************************)\nlet section_re = \/(Files|ServerFlags|Module|InputDevice|Device|VideoAdaptor\n |Monitor|Modes|Screen|ServerLayout|DRI|Vendor)\/\n\n\n(************************************************************************\n * Variable: secton_re_obsolete\n * The following obsolete section names are still recognised for\n * compatibility purposes. In new config files, the InputDevice\n * section should be used instead.\n *\n * Definition:\n * > Keyboard Keyboard configuration\n * > Pointer Pointer\/mouse configuration\n *************************************************************************)\nlet section_re_obsolete = \/(Keyboard|Pointer)\/\n\n(* View: section_entry *)\nlet section_entry = empty | comment |\n option | screen | display | input_device |\n entry_generic\n\n(************************************************************************\n * View: section\n * A section in xorg.conf\n *\n * Definition:\n * > Section \"SectionName\"\n * > SectionEntry\n * > ...\n * > EndSection\n *************************************************************************)\nlet section = [ indent . del \"Section\" \"Section\"\n . sep_spc . sep_dquote\n . key (section_re|section_re_obsolete) . sep_dquote\n . eol\n . section_entry*\n . indent . del \"EndSection\" \"EndSection\" . eol ]\n\n(*\n * View: lns\n * The xorg.conf lens\n *)\nlet lns = ( empty | comment | section )*\n\n\n(* Variable: filter *)\nlet filter = (incl \"\/etc\/X11\/xorg.conf\")\n\nlet xfm = transform lns filter\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Augeas"} {"commit":"a953a294b231367d276f365842682a32d6b14e61","subject":"Check that let expressions work","message":"Check that let expressions work\n","repos":"mchf\/augeas,jjlin\/augeas,mchf\/augeas,bkearney\/augeas,hercules-team\/augeas,hercules-team\/augeas-do-not-use,raphink\/augeas,GeoffWilliams\/augeas,domcleal\/augeas,kumy\/augeas,mlichvar\/augeas,kunkku\/augeas,jjlin\/augeas,ptoscano\/augeas,MikaelSmith\/augeas,jjlin\/augeas,mlichvar\/augeas,lutter\/augeas,MikaelSmith\/augeas,hercules-team\/augeas,camptocamp\/augeas,jtopjian\/augeas,hercules-team\/augeas-do-not-use,domcleal\/augeas,camptocamp\/augeas,bkearney\/augeas,raphink\/augeas,GeoffWilliams\/augeas,lutter\/augeas,kunkku\/augeas,jasperla\/augeas,kunkku\/augeas,dafugg\/augeas,camptocamp\/augeas,jasperla\/augeas,ptoscano\/augeas,bkearney\/augeas,manandbytes\/augeas,kumy\/augeas,lutter\/augeas,kumy\/augeas,pevalme\/augeas,dafugg\/augeas,mlichvar\/augeas,bkearney\/augeas,ptoscano\/augeas,kumy\/augeas,camptocamp\/augeas,dafugg\/augeas,pevalme\/augeas,hercules-team\/augeas-do-not-use,manandbytes\/augeas,domcleal\/augeas,pevalme\/augeas,jtopjian\/augeas","old_file":"tests\/modules\/pass_let_exp.aug","new_file":"tests\/modules\/pass_let_exp.aug","new_contents":"(* Test let expressions *)\nmodule Pass_let_exp =\n\n (* This definition is insanely roundabout; it's written that way *)\n (* since we want to exercise LET expressions *)\n let lns = \n let lbl = \"a\" in\n let spc = \" \" in\n let del_spaces (s:string) = del spc+ s in\n let del_str (s:string) = del s s in\n let store_delim (ldelim:string) \n (rdelim:string) (val:regexp) = \n del_str ldelim . store val . del_str rdelim in\n [ label lbl . del_spaces \" \" . store_delim \"(\" \")\" \/[a-z]+\/ ]\n\n test lns get \" (abc)\" = { \"a\" = \"abc\" }\n\n\n(* Local Variables: *)\n(* mode: caml *)\n(* End: *)\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/modules\/pass_let_exp.aug' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Augeas"}