Mailinglist Archive: yast-commit (1212 mails)

< Previous Next >
[yast-commit] r50719 - in /trunk/support: agents/ agents/Makefile.am agents/supportconfig.scr src/Support.ycp src/dialogs.ycp
  • From: mzugec@xxxxxxxxxxxxxxxx
  • Date: Fri, 05 Sep 2008 08:33:13 -0000
  • Message-id: <20080905083313.2487A30CA2@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Fri Sep 5 10:33:12 2008
New Revision: 50719

URL: http://svn.opensuse.org/viewcvs/yast?rev=50719&view=rev
Log:
added agent

Added:
trunk/support/agents/
trunk/support/agents/Makefile.am
trunk/support/agents/supportconfig.scr
Modified:
trunk/support/src/Support.ycp
trunk/support/src/dialogs.ycp

Added: trunk/support/agents/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/support/agents/Makefile.am?rev=50719&view=auto
==============================================================================
--- trunk/support/agents/Makefile.am (added)
+++ trunk/support/agents/Makefile.am Fri Sep 5 10:33:12 2008
@@ -0,0 +1,7 @@
+# Makefile.am for slp-server/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA = supportconfig.scr
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)

Added: trunk/support/agents/supportconfig.scr
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/support/agents/supportconfig.scr?rev=50719&view=auto
==============================================================================
--- trunk/support/agents/supportconfig.scr (added)
+++ trunk/support/agents/supportconfig.scr Fri Sep 5 10:33:12 2008
@@ -0,0 +1,50 @@
+/*
+ * Read(.slp.Compression)
+ * (["yes"])
+ *
+ * Write(.slp.Compression, "no")
+ * (true)
+ *
+ * Fore more information about possible keys and values
+ * consult with the slp_config man pages `man slp_config`.
+ */
+
+.etc.supportconfig
+
+`ag_ini(
+ `IniAgent( "/etc/supportconfig.conf",
+ $[
+ "options" : [ "global_values", "comments_last", "line_can_continue",
"join_multiline" ],
+ "comments": [
+ "^[ \t]*$", // empty line
+ "^[ \t]+[;#].*$", // comment char is not first char
+ "^[#][ \t]*$", // only comment chars
+ "^[#][ \t]*\\[[^]]*$", // comment chars followed by '[' without
matching ']'
+ "^[#][^ \t[]", // comment char followed by non-blank nor '['
+ "^[#][ \t]+[^[a-z \t].*$", // comment chars followed by non a-z
char nor '[' nor blank
+ "^[#][ \t]+[a-z ]*[a-z][ \t]*$", // comment chars followed by a-z
or blank chars
+ "^[#][ \t]+[a-z ]*[a-z][ \t]*[^a-z \t=].*$", // like above, but
followed by non a-z nor blank nor '=' chars
+ ],
+/*
+ "sections" : [
+ $[
+ "begin" : [ "^[ \t]*\\[[ \t]*(.*[^ \t])[ \t]*\\][ \t]*",
"[%s]" ],
+ ], $[
+ // this is a special type for commenting out the values
+ "begin" : [ "^[#;][ \t]*\\[[ \t]*(.*[^ \t])[ \t]*\\][ \t]*",
"# [%s]" ],
+ ]
+ ],
+*/
+ // we need to exclude ; because of the second matching rule
+ "params" : [
+ // Options with one value ('yes' / 'no')
+// $[ "match" : [ "^[#;][ \t]*([^ \t]+)[ \t]+([^ \t]+)[ \t]+$",
"%s %s" ]],
+// $[ "match" : [ "^[#;][ \t]*([^ \t\=]+)[ \t\=]?(.+)[ \t]*$",
"; %s %s" ]],
+ // Options with more possible values
+ $[ "match" : [ "^[ \t]*([^ \t\=]+)[ \t\=]+[ ]*\"(.*)\"[
\t]*$", "%s=\"%s\"" ]],
+ $[ "match" : [ "^[ \t]*([^ \t\=]+)[ \t\=]+[ ]*(.+)[ \t]*$",
"%s=%s" ]],
+ ],
+ ]
+ )
+)
+

Modified: trunk/support/src/Support.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/support/src/Support.ycp?rev=50719&r1=50718&r2=50719&view=diff
==============================================================================
--- trunk/support/src/Support.ycp (original)
+++ trunk/support/src/Support.ycp Fri Sep 5 10:33:12 2008
@@ -122,7 +122,7 @@
AbortFunction = function;
}

-// content of /etc/support.conf
+// content of /etc/supportconfig.conf
map configuration = $[];

// options parsed from configuration map
@@ -208,7 +208,7 @@
// read database
if(Abort()) return false;
Progress::NextStage();
- configuration = (map)SCR::Read(.etc.support.all);
+ configuration = (map)SCR::Read(.etc.supportconfig.all);
foreach(map<string, any> row, configuration["value"]:[], {
options[row["name"]:""]=row["value"]:"";
});
@@ -265,7 +265,7 @@
// write settings
if(Abort()) return false;
Progress::NextStage();
- string command = sformat("support %1 -f %2", GetParameterList(),
proposed_log_path);
+ string command = sformat("supportconfig %1 -f %2", GetParameterList(),
proposed_log_path);
map<string, any> output = (map<string,
any>)SCR::Execute(.target.bash_output, command);
y2milestone("output %1", output);
/* Error message */
@@ -289,7 +289,7 @@
}

global boolean WriteConfig(){
- y2milestone("Writing /etc/support.conf configuration");
+ y2milestone("Writing /etc/supportconfig.conf configuration");
list new_config=[];
list<string>used_options=[];
foreach(map<string, any> row, configuration["value"]:[], {
@@ -310,8 +310,8 @@
}
});
configuration["value"]=new_config;
- y2internal("Write:%1", SCR::Write(.etc.support.all, configuration));
- y2internal("Write:%1", SCR::Write(.etc.support, nil));
+ y2internal("Write:%1", SCR::Write(.etc.supportconfig.all, configuration));
+ y2internal("Write:%1", SCR::Write(.etc.supportconfig, nil));
return true;
}


Modified: trunk/support/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/support/src/dialogs.ycp?rev=50719&r1=50718&r2=50719&view=diff
==============================================================================
--- trunk/support/src/dialogs.ycp (original)
+++ trunk/support/src/dialogs.ycp Fri Sep 5 10:33:12 2008
@@ -49,7 +49,7 @@
string caption = _("OnStar Configuration (1/3)");

list<term> items = [
- `item(`id(`use_defaults), _("Use Defaults (ignore
/etc/support.conf)"), Support::use_defaults),
+ `item(`id(`use_defaults), _("Use Defaults (ignore
/etc/supportconfig.conf)"), Support::use_defaults),
`item(`id(`full_listening), _("Create a full file listing from '/'"),
Support::full_listening),
`item(`id(`exclude_disk_scan), _("Exclude detailed disk info and
scans"), Support::exclude_disk_scan),
`item(`id(`search_for_edir), _("Search root filesystem for eDirectory
instances"), Support::search_for_edir),
@@ -180,7 +180,7 @@
continue;
}
else if(ret == `next || ret == `back) {
- y2milestone("store configuration for /etc/support.conf");
+ y2milestone("store configuration for /etc/supportconfig.conf");
list selected_items = (list)UI::QueryWidget(`id(`opt_msb),
`SelectedItems);
foreach(string key, (list<string>)Map::Keys(Support::options), {
string val = Support::options[key]:"";
@@ -265,7 +265,7 @@


symbol GenerateDialog () {
- string cmd = sformat("support %1 -t %2", Support::GetParameterList(),
Support::proposed_log_path);
+ string cmd = sformat("supportconfig %1 -t %2",
Support::GetParameterList(), Support::proposed_log_path);
string caption = _("Collecting Data");
term contents = `VBox (
`LogView (`id (`log), _("Progress"), 1000, 1000)

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages