Author: mzugec Date: Mon Jun 28 16:15:17 2010 New Revision: 62161 URL: http://svn.opensuse.org/viewcvs/yast?rev=62161&view=rev Log: parse config file case sensitive Modified: trunk/slp-server/VERSION trunk/slp-server/agents/slp_conf.scr trunk/slp-server/package/yast2-slp-server.changes trunk/slp-server/src/SlpServer.ycp trunk/slp-server/src/dialogs.ycp Modified: trunk/slp-server/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/slp-server/VERSION?rev=62161&r1=62160&r2=62161&view=diff ============================================================================== --- trunk/slp-server/VERSION (original) +++ trunk/slp-server/VERSION Mon Jun 28 16:15:17 2010 @@ -1 +1 @@ -2.18.1 +2.19.0 Modified: trunk/slp-server/agents/slp_conf.scr URL: http://svn.opensuse.org/viewcvs/yast/trunk/slp-server/agents/slp_conf.scr?rev=62161&r1=62160&r2=62161&view=diff ============================================================================== --- trunk/slp-server/agents/slp_conf.scr (original) +++ trunk/slp-server/agents/slp_conf.scr Mon Jun 28 16:15:17 2010 @@ -14,7 +14,7 @@ `ag_ini( `IniAgent( "/etc/slp.conf", $[ - "options" : [ "global_values", "comments_last", "ignore_case", "line_can_continue", "join_multiline" ], + "options" : [ "global_values", "comments_last", "line_can_continue", "join_multiline" ], "comments": [ "^[ \t]*$", // empty line "^[ \t]+[;#].*$", // comment char is not first char Modified: trunk/slp-server/package/yast2-slp-server.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/slp-server/package/yast2-slp-server.changes?rev=62161&r1=62160&r2=62161&view=diff ============================================================================== --- trunk/slp-server/package/yast2-slp-server.changes (original) +++ trunk/slp-server/package/yast2-slp-server.changes Mon Jun 28 16:15:17 2010 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Jun 28 16:14:37 CEST 2010 - mzugec@suse.cz + +- parse config file case sensitive +- 2.19.0 + +------------------------------------------------------------------- Wed Jan 13 18:56:03 CET 2010 - kmachalkova@suse.cz - Adjusted .desktop file(s) to wrap /sbin/yast2/ calls in xdg-su Modified: trunk/slp-server/src/SlpServer.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/slp-server/src/SlpServer.ycp?rev=62161&r1=62160&r2=62161&view=diff ============================================================================== --- trunk/slp-server/src/SlpServer.ycp (original) +++ trunk/slp-server/src/SlpServer.ycp Mon Jun 28 16:15:17 2010 @@ -96,10 +96,10 @@ map <string, any> SETTINGS = $[]; global map<string, any> slp_config = $[ - "net.slp.usescopes":"DEFAULT", - "net.slp.isda":"false", - "net.slp.isbroadcastonly":"false", - "net.slp.daheartbeat":nil + "net.slp.useScopes":"DEFAULT", + "net.slp.isDA":"false", + "net.slp.isBroadcastOnly":"false", + "net.slp.DAHeartBeat":nil ]; @@ -114,7 +114,7 @@ foreach(string k1, any v1, SETTINGS, { if (k1 == "value") { foreach(map<string, any > v2, (list < map<string, any> >)v1, { - if (v2["type"]:nil == 1) slp_config[tolower(v2["name"]:"") ]=v2["value"]:""; + if (v2["type"]:nil == 1) slp_config[v2["name"]:""]=v2["value"]:""; }); } }); @@ -126,6 +126,7 @@ // write global configuration file /etc/slp.conf boolean WriteGlobalConfig(){ +/* list<string> correct_case2 = [ "net.slp.useScopes", "net.slp.DAAddresses", @@ -155,26 +156,20 @@ "net.slp.traceDrop", "net.slp.traceMsg" ]; +*/ foreach(string k1, any v1, slp_config, { SETTINGS["value"] = maplist(map<string, any > v2, (list < map<string, any> >) SETTINGS["value"]:nil, { if (k1 == v2["name"]:"") { - if (v1 == nil) v2["type"]=0; - else { - foreach(string s, correct_case2, { - if (tolower(s)==k1){ - v2["name"] = s; - break; - } - }); - v2["type"]=1; - v2["value"]=v1; - } + v2["type"]= (v1 == nil) ? 0 : 1; + v2["value"]=v1; } return v2; }); }); +y2internal("slp_config %1", slp_config); + REGFILES["value"] = reg_files; y2milestone("write reg_files %1", reg_files); Modified: trunk/slp-server/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/slp-server/src/dialogs.ycp?rev=62161&r1=62160&r2=62161&view=diff ============================================================================== --- trunk/slp-server/src/dialogs.ycp (original) +++ trunk/slp-server/src/dialogs.ycp Mon Jun 28 16:15:17 2010 @@ -240,33 +240,33 @@ define map getServerOptions() ``{ return $[ - "net.slp.usescopes":$[], - "net.slp.daaddresses":$[], - "net.slp.isda":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.daheartbeat":$[], - "net.slp.watchregistrationpid":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.maxresults":$[], - "net.slp.isbroadcastonly":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.passivedadetection":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.activedadetection":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.daactivediscoveryinterval":$[], - "net.slp.multicastttl":$[], - "net.slp.dadiscoverymaximumwait":$[], - "net.slp.dadiscoverytimeouts":$[], - "net.slp.multicastmaximumwait":$[], - "net.slp.multicasttimeouts":$[], - "net.slp.unicastmaximumwait":$[], - "net.slp.unicasttimeouts":$[], - "net.slp.datagramtimeouts":$[], - "net.slp.randomWaitbound":$[], - "net.slp.mtu":$[], + "net.slp.useScopes":$[], + "net.slp.DAAddresses":$[], + "net.slp.isDA":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.DAHeartBeat":$[], + "net.slp.watchRegistrationPID":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.maxResults":$[], + "net.slp.isBroadcastOnly":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.passiveDADetection":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.activeDADetection":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.DAActiveDiscoveryInterval":$[], + "net.slp.multicastTTL":$[], + "net.slp.DADiscoveryMaximumWait":$[], + "net.slp.DADiscoveryTimeouts":$[], + "net.slp.multicastMaximumWait":$[], + "net.slp.multicastTimeouts":$[], + "net.slp.unicastMaximumWait":$[], + "net.slp.unicastTimeouts":$[], + "net.slp.datagramTimeouts":$[], + "net.slp.randomWaitBound":$[], + "net.slp.MTU":$[], "net.slp.interfaces":$[], - "net.slp.securityenabled":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.checksourceaddr":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.tracedatraffic":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.tracereg":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.tracedrop":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], - "net.slp.tracemsg":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]] + "net.slp.securityEnabled":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.checkSourceAddr":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.traceDATraffic":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.traceReg":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.traceDrop":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]], + "net.slp.traceMsg":$["popup":$["items":[["true"], ["false"]], "widget":`combobox]] ]; } @@ -523,24 +523,24 @@ case(`bc) : y2milestone("Use broadcast"); UI::ChangeWidget(`id(`ip), `Enabled, false); UI::ChangeWidget(`id(`scope), `Enabled, false); - SlpServer::slp_config["net.slp.isda"]="false"; - SlpServer::slp_config["net.slp.isbroadcastonly"]="true"; + SlpServer::slp_config["net.slp.isDA"]="false"; + SlpServer::slp_config["net.slp.isBroadcastOnly"]="true"; break; case(`mc) : y2milestone("Use multicast"); UI::ChangeWidget(`id(`ip), `Enabled, false); UI::ChangeWidget(`id(`scope), `Enabled, true); - SlpServer::slp_config["net.slp.isda"]="false"; - SlpServer::slp_config["net.slp.isbroadcastonly"]="false"; + SlpServer::slp_config["net.slp.isDA"]="false"; + SlpServer::slp_config["net.slp.isBroadcastOnly"]="false"; break; case(`da) : y2milestone("Use DA Server"); UI::ChangeWidget(`id(`ip), `Enabled, true); UI::ChangeWidget(`id(`scope), `Enabled, true); - SlpServer::slp_config["net.slp.isda"]="false"; + SlpServer::slp_config["net.slp.isDA"]="false"; break; case(`da_server) : y2milestone("Becomes DA Server"); UI::ChangeWidget(`id(`ip), `Enabled, false); // UI::ChangeWidget(`id(`scope), `Enabled, false); - SlpServer::slp_config["net.slp.isda"]="true"; + SlpServer::slp_config["net.slp.isDA"]="true"; break; } @@ -550,13 +550,13 @@ define void initServerSettings(string key) ``{ symbol mode = nil; keys = []; - UI::ChangeWidget(`id(`ip), `Value, String::CutBlanks( SlpServer::slp_config["net.slp.daaddresses"]:"") ); - UI::ChangeWidget(`id(`scope), `Value, SlpServer::slp_config["net.slp.usescopes"]:""); - if (SlpServer::slp_config["net.slp.isda"]:"false" == "true") mode = `da_server; + UI::ChangeWidget(`id(`ip), `Value, String::CutBlanks( SlpServer::slp_config["net.slp.DAAddresses"]:"") ); + UI::ChangeWidget(`id(`scope), `Value, SlpServer::slp_config["net.slp.useScopes"]:""); + if (SlpServer::slp_config["net.slp.isDA"]:"false" == "true") mode = `da_server; else - if (SlpServer::slp_config["net.slp.isbroadcastonly"]:"false" == "true") mode = `bc; + if (SlpServer::slp_config["net.slp.isBroadcastOnly"]:"false" == "true") mode = `bc; else - if (size(deletechars(SlpServer::slp_config["net.slp.daaddresses"]:"", " "))>0) mode = `da; + if (size(deletechars(SlpServer::slp_config["net.slp.DAAddresses"]:"", " "))>0) mode = `da; else mode = `mc; UI::ChangeWidget(`id(`resp), `CurrentButton, mode); changeResponseTo(mode); @@ -571,8 +571,8 @@ } void storeServerSettings(string option_id, map option_map) ``{ - SlpServer::slp_config["net.slp.usescopes"]=UI::QueryWidget(`id(`scope), `Value); - SlpServer::slp_config["net.slp.daaddresses"]=UI::QueryWidget(`id(`ip), `Value); + SlpServer::slp_config["net.slp.useScopes"]=UI::QueryWidget(`id(`scope), `Value); + SlpServer::slp_config["net.slp.DAAddresses"]=UI::QueryWidget(`id(`ip), `Value); }; define boolean validateServerSettings (string key, map event) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org