Mailinglist Archive: yast-devel (17 mails)

< Previous Next >
[yast-devel] ini-agent vs Augeas, Re: [yast-commit] r62714
  • From: Martin Vidner <mvidner@xxxxxxx>
  • Date: Mon, 8 Nov 2010 16:15:01 +0100
  • Message-id: <20101108151501.GF7317@xxxxxxxxxxxxxxxx>
On Tue, Nov 02, 2010 at 01:03:09PM -0000, lslezak@xxxxxxxxxxxxxxxxx wrote:
Author: lslezak
Date: Tue Nov 2 14:03:08 2010
New Revision: 62714

URL: http://svn.opensuse.org/viewcvs/yast?rev=62714&view=rev
Log:
- correctly display download progress in DownloadInAdvance
libzypp mode (bnc#616708)

Ah, nice to see this fixed :-)

Added:
trunk/packager/agents/etc_zypp_conf.scr
[...]
But this reminds me that it is high time to replace the Ini Agent
(and mostly all agents) with something more modern and maintained,
namely Augeas (already used by zypper).

See what it can parse (and write!)
http://git.fedorahosted.org/git/?p=augeas.git;a=tree;f=lenses;h=60be35d5c8a514772bca3d06d95868c8e0419611;hb=HEAD
(or rpm -ql augeas-lenses )
and how it can define macros for the regexes seen below
http://git.fedorahosted.org/git/?p=augeas.git;a=blob;f=lenses/sep.aug;h=c49927ebcea22a3e8d9db11d53835887f2601fde;hb=HEAD
http://git.fedorahosted.org/git/?p=augeas.git;a=blob;f=lenses/rx.aug;h=95df76dd0e99719bb374aae601bcaee8c401e19f;hb=HEAD

Anyone interested in playing with it?
Of course it has scripting bindings so we can use it in the Lighter
WebYaST.

+.etc.zypp_conf
+
+`ag_ini(
+ `IniAgent( "/etc/zypp/zypp.conf" , $[
+ "options" : [ "no_nested_sections", "line_can_continue",
"comments_last" ],
+ "comments": [
+ "^[ \t]*$", // empty line
+ "^[ \t]*#.*$", // comment char
+ ],
+ "sections" : [
+ $[
+ "begin" : [ "^[ \t]*\\[[ \t]*(.*[^ \t])[ \t]*\\][ \t]*", "[%s]"
],
+ ]
+ ],
+ "params" : [
+ $[
+ "match" : [ "^[ \t]*([^=]*[^ \t=])[ \t]*=[ \t]*(.*[^ \t]|)[
\t]*$" , "%s=%s"],
+ ]
+ ]
+ ]
+ )
+)
--
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
< Previous Next >