[yast-commit] r40651 - in /trunk/network: agents/root_curlrc.scr package/yast2-network.changes src/modules/Proxy.ycp
![](https://seccdn.libravatar.org/avatar/2e1a2d7374f0eeb790839676bdd1123a.jpg?s=120&d=mm&r=g)
Author: locilka Date: Fri Aug 31 16:06:38 2007 New Revision: 40651 URL: http://svn.opensuse.org/viewcvs/yast?rev=40651&view=rev Log: - Using --proxy-user and --proxy in /root/.curlrc (#305163). - Changing priorities in syntax for /root/.curlrc parser (#305163). Modified: trunk/network/agents/root_curlrc.scr trunk/network/package/yast2-network.changes trunk/network/src/modules/Proxy.ycp Modified: trunk/network/agents/root_curlrc.scr URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/agents/root_curlrc.scr?re... ============================================================================== --- trunk/network/agents/root_curlrc.scr (original) +++ trunk/network/agents/root_curlrc.scr Fri Aug 31 16:06:38 2007 @@ -25,12 +25,12 @@ "options" : [ "ignore_case", "global_values", "flat" ], "comments" : [ "^#.*", "^[ \t]*$", ], "params" : [ + $[ "match" : [ "^[ \t]*([a-zA-Z_-]+)[ \t]* [ \t]*\"(.*)\"[ \t]*$", "%s \"%s\"" ] ], $[ "match" : [ "^[ \t]*([a-zA-Z_-]+)[ \t]*=[ \t]*\"(.*)\"[ \t]*$", "%s = \"%s\"" ] ], $[ "match" : [ "^[ \t]*([a-zA-Z_-]+)[ \t]*:[ \t]*\"(.*)\"[ \t]*$", "%s : \"%s\"" ] ], - $[ "match" : [ "^[ \t]*([a-zA-Z_-]+)[ \t]* [ \t]*\"(.*)\"[ \t]*$", "%s \"%s\"" ] ], + $[ "match" : [ "^[ \t]*([a-zA-Z_-]+)[ \t]* [ \t]*(.*)[ \t]*$", "%s %s" ] ], $[ "match" : [ "^[ \t]*([a-zA-Z_-]+)[ \t]*=[ \t]*(.*)[ \t]*$", "%s = %s" ] ], $[ "match" : [ "^[ \t]*([a-zA-Z_-]+)[ \t]*:[ \t]*(.*)[ \t]*$", "%s : %s" ] ], - $[ "match" : [ "^[ \t]*([a-zA-Z_-]+)[ \t]* [ \t]*(.*)[ \t]*$", "%s %s" ] ], ] ] ) Modified: trunk/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.cha... ============================================================================== --- trunk/network/package/yast2-network.changes (original) +++ trunk/network/package/yast2-network.changes Fri Aug 31 16:06:38 2007 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Aug 31 16:04:05 CEST 2007 - locilka@suse.cz + +- Using --proxy-user and --proxy in /root/.curlrc (#305163). +- Changing priorities in syntax for /root/.curlrc parser (#305163). + +------------------------------------------------------------------- Fri Aug 31 15:38:31 CEST 2007 - mzugec@suse.cz - autoyast support for udev rules and backport compatibility with Modified: trunk/network/src/modules/Proxy.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Proxy.ycp?rev... ============================================================================== --- trunk/network/src/modules/Proxy.ycp (original) +++ trunk/network/src/modules/Proxy.ycp Fri Aug 31 16:06:38 2007 @@ -71,7 +71,7 @@ /* Read /root/.curlrc */ if(SCR::Read(.target.size, "/root/.curlrc") > 0) - user = (string) SCR::Read(.root.curlrc.proxy-user); + user = (string) SCR::Read (add (.root.curlrc, "--proxy-user")); if(user == nil) user = ""; @@ -110,7 +110,9 @@ ]; string caption = _("Saving Proxy Configuration"); - integer sl = 500; //sleep for longer time, so that progress does not disappear right afterwards + // sleep for longer time, so that progress does not disappear right afterwards + // but only when Progress is visible + integer sl = (Progress::status() == true ? 500 : 0); Progress::New(caption, " ", size(steps), steps, [], ""); @@ -124,14 +126,40 @@ SCR::Write(.sysconfig.proxy.NO_PROXY, no); SCR::Write(.sysconfig.proxy, nil); - /* Update /root/.curlrc */ - string proxyuser = nil; - if(user != "") { - proxyuser = user; - if(pass != "") proxyuser = user + ":" + pass; + // proxy is used, write /root/.curlrc + // bugzilla #305163 + if (enabled) { + /* Update /root/.curlrc */ + string proxyuser = nil; + if (user != "") { + proxyuser = user; + if (pass != "") proxyuser = user + ":" + pass; + } + + // nil or real value + SCR::Write (add (.root.curlrc, "--proxy-user"), proxyuser); + + // not 'nil', not empty + // bugzilla #305163 + if (http != nil && size (http) > 0) { + SCR::Write (add (.root.curlrc, "--proxy"), http); + } else { + SCR::Write (add (.root.curlrc, "--proxy"), nil); + } + + // only written value can have a comment + if (proxyuser != nil) { + SCR::Write (add (add (.root.curlrc, "--proxy-user"), "comment"), ChangedComment("proxy")); + // only when set, can have a comment + } else if (http != nil && size (http) > 0) { + SCR::Write (add (add (.root.curlrc, "--proxy"), "comment"), ChangedComment("proxy")); + } + // proxy is not used, remove proxy-related settings + } else { + SCR::Write (add (.root.curlrc, "--proxy-user"), nil); + SCR::Write (add (.root.curlrc, "--proxy"), nil); } - SCR::Write(.root.curlrc.proxy-user, proxyuser); - SCR::Write(.root.curlrc.proxy-user.comment, ChangedComment("proxy")); + SCR::Write(.root.curlrc, nil); sleep(sl); Progress::NextStage(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org