[yast-commit] r62795 - in /branches/SuSE-SLE-10-SP4-Branch/slp-server: VERSION agents/slp_conf.scr package/yast2-slp-server.changes src/SlpServer.ycp src/dialogs.ycp
Author: mzugec Date: Wed Nov 10 10:36:56 2010 New Revision: 62795 URL: http://svn.opensuse.org/viewcvs/yast?rev=62795&view=rev Log: store case-sensitive configuration options (bnc#291301) Modified: branches/SuSE-SLE-10-SP4-Branch/slp-server/VERSION branches/SuSE-SLE-10-SP4-Branch/slp-server/agents/slp_conf.scr branches/SuSE-SLE-10-SP4-Branch/slp-server/package/yast2-slp-server.changes branches/SuSE-SLE-10-SP4-Branch/slp-server/src/SlpServer.ycp branches/SuSE-SLE-10-SP4-Branch/slp-server/src/dialogs.ycp Modified: branches/SuSE-SLE-10-SP4-Branch/slp-server/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/slp-server/VERSION?rev=62795&r1=62794&r2=62795&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP4-Branch/slp-server/VERSION (original) +++ branches/SuSE-SLE-10-SP4-Branch/slp-server/VERSION Wed Nov 10 10:36:56 2010 @@ -1 +1 @@ -2.13.14 +2.13.15 Modified: branches/SuSE-SLE-10-SP4-Branch/slp-server/agents/slp_conf.scr URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/slp-server/agents/slp_conf.scr?rev=62795&r1=62794&r2=62795&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP4-Branch/slp-server/agents/slp_conf.scr (original) +++ branches/SuSE-SLE-10-SP4-Branch/slp-server/agents/slp_conf.scr Wed Nov 10 10:36:56 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: branches/SuSE-SLE-10-SP4-Branch/slp-server/package/yast2-slp-server.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/slp-server/package/yast2-slp-server.changes?rev=62795&r1=62794&r2=62795&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP4-Branch/slp-server/package/yast2-slp-server.changes (original) +++ branches/SuSE-SLE-10-SP4-Branch/slp-server/package/yast2-slp-server.changes Wed Nov 10 10:36:56 2010 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Nov 10 10:29:43 CET 2010 - mzugec@suse.de + +- store case-sensitive configuration options (bnc#291301) +- 2.13.15 + +------------------------------------------------------------------- Thu May 21 10:17:16 CEST 2009 - mzugec@suse.cz - accept both IP and hostname in configuration (bnc#501941) Modified: branches/SuSE-SLE-10-SP4-Branch/slp-server/src/SlpServer.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/slp-server/src/SlpServer.ycp?rev=62795&r1=62794&r2=62795&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP4-Branch/slp-server/src/SlpServer.ycp (original) +++ branches/SuSE-SLE-10-SP4-Branch/slp-server/src/SlpServer.ycp Wed Nov 10 10:36:56 2010 @@ -95,10 +95,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 ]; @@ -113,7 +113,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"]:""; }); } }); @@ -125,59 +125,36 @@ // write global configuration file /etc/slp.conf boolean WriteGlobalConfig(){ - list<string> correct_case2 = [ -"net.slp.useScopes", -"net.slp.DAAddresses", -"net.slp.isDA", -"net.slp.DAHeartBeat", -"net.slp.watchRegistrationPID", -"net.slp.maxResults", -"net.slp.isBroadcastOnly", -"net.slp.passiveDADetection", -"net.slp.activeDADetection", -"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", -"net.slp.checkSourceAddr", -"net.slp.traceDATraffic", -"net.slp.traceReg", -"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, { + boolean found=false; + SETTINGS["value"] = maplist(map<string, any > v2, (list < map<string, any> >) SETTINGS["value"]:[], { 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; + found=true; } return v2; }); + if (!found) SETTINGS["value"]=add(SETTINGS["value"]:[], + $[ + "name" : k1, + "type" : (v1 == nil) ? 0 : 1, + "kind" : "value", + "comment":"", + "value": v1 + ] + ); }); + y2milestone("slp_config %1", slp_config); + y2milestone("SETTINGS %1", SETTINGS); + REGFILES["value"] = reg_files; - y2milestone("write reg_files %1", reg_files); - y2milestone("write REGFILES %1", REGFILES); + y2debug("write reg_files %1", reg_files); + y2debug("write REGFILES %1", REGFILES); SCR::Write(.etc.slp.all, SETTINGS); SCR::Write(.etc.slp.reg.all, REGFILES); Modified: branches/SuSE-SLE-10-SP4-Branch/slp-server/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/slp-server/src/dialogs.ycp?rev=62795&r1=62794&r2=62795&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP4-Branch/slp-server/src/dialogs.ycp (original) +++ branches/SuSE-SLE-10-SP4-Branch/slp-server/src/dialogs.ycp Wed Nov 10 10:36:56 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
participants (1)
-
mzugec@svn2.opensuse.org