Author: jsuchome Date: Fri Apr 4 12:47:01 2008 New Revision: 46083 URL: http://svn.opensuse.org/viewcvs/yast?rev=46083&view=rev Log: - write the full URL into config.xml for https sources (bnc#376666) - 2.16.13 Modified: trunk/product-creator/VERSION trunk/product-creator/package/yast2-product-creator.changes trunk/product-creator/src/Kiwi.ycp trunk/product-creator/src/kiwi_dialogs.ycp Modified: trunk/product-creator/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/VERSION?rev=46083... ============================================================================== --- trunk/product-creator/VERSION (original) +++ trunk/product-creator/VERSION Fri Apr 4 12:47:01 2008 @@ -1 +1 @@ -2.16.12 +2.16.13 Modified: trunk/product-creator/package/yast2-product-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/package/yast2-pro... ============================================================================== --- trunk/product-creator/package/yast2-product-creator.changes (original) +++ trunk/product-creator/package/yast2-product-creator.changes Fri Apr 4 12:47:01 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Apr 4 12:29:17 CEST 2008 - jsuchome@suse.cz + +- write the full URL into config.xml for https sources (bnc#376666) +- 2.16.13 + +------------------------------------------------------------------- Wed Apr 2 16:47:28 CEST 2008 - lslezak@suse.cz - adapted to the new callback registration scheme (fate#302296) Modified: trunk/product-creator/src/Kiwi.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/Kiwi.ycp?rev=... ============================================================================== --- trunk/product-creator/src/Kiwi.ycp (original) +++ trunk/product-creator/src/Kiwi.ycp Fri Apr 4 12:47:01 2008 @@ -21,6 +21,7 @@ import "Report"; import "Security"; import "String"; + import "URL"; string encryption_method = nil; @@ -120,18 +121,23 @@ // ... otherwise, we must ask zypp: string type = "yast2"; - string source_path = adapt_source_path (source); foreach (map sourcemap, all_sources, { integer srcid = sourcemap["SrcId"]:-1; map data = Pkg::SourceGeneralData (srcid); string url = data["url"]:""; - if (url == source || url == source_path) + if (url == source || url == adapt_source_path (source)) { if (data["type"]:"" == "Plaindir") type = "rpm-dir"; if (data["type"]:"" == "YUM") type = "rpm-md"; + map parsed = URL::Parse(url); + if (parsed["scheme"]:"" == "https") + { + // change source url to contain password + source = Pkg::SourceURL (srcid); + } } }); ret = $[ @@ -140,7 +146,7 @@ "__children": [ $[ "__key" : "source", - "path" : source_path + "path" : adapt_source_path (source) ] ] ]; @@ -595,6 +601,8 @@ config_dir = tmp_dir + "/" + KiwiConfig["name"]:""; SCR::Execute (.target.mkdir, config_dir); SCR::Write (.target.string, config_dir + "/config.xml", write_string); + // config.xml may contain password + SCR::Execute (.target.bash, sformat ("chmod 600 %1/config.xml",config_dir)); foreach (string dir, ["root_dir", "config_dir"], { foreach (string val, KiwiConfig[dir]:[], { string realdir = config_dir + "/" + substring (dir, 0, search (dir, "_")); @@ -780,10 +788,18 @@ if (substring (source, 0, 1) == "/") url = "dir://"; url = url + source; + map parsed = URL::Parse (url); + string full_url = url; + if (parsed["pass"]:"" != "") + { + parsed = remove (parsed, "pass"); + url = URL::Build (parsed); + } current_repositories [url] = $[ "url" : url, "plaindir" : repo["type"]:"" == "rpm-dir", "org" : repo, + "full_url" : full_url ]; } }); @@ -800,9 +816,14 @@ integer srcid = source["SrcId"]:-1; map data = Pkg::SourceGeneralData (srcid); string url = data["url"]:""; + string full_url = url; + map parsed = URL::Parse(url); + if (parsed["scheme"]:"" == "https") + full_url = Pkg::SourceURL (srcid); current_repositories[url] = $[ - "url" : url, - "plaindir" : data["type"]:"" == "Plaindir" + "url" : url, + "plaindir" : data["type"]:"" == "Plaindir", + "full_url" : full_url, ]; }); return current_repositories; Modified: trunk/product-creator/src/kiwi_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/kiwi_dialogs.... ============================================================================== --- trunk/product-creator/src/kiwi_dialogs.ycp (original) +++ trunk/product-creator/src/kiwi_dialogs.ycp Fri Apr 4 12:47:01 2008 @@ -1908,10 +1908,13 @@ return true; } integer source_ret = -1; + string full_url = url; + if (repo["full_url"]:"" != "" && repo["full_url"]:"" != url) + full_url = repo["full_url"]:""; if (repo["plaindir"]:false) - source_ret = Pkg::SourceCreateType (url, "", "Plaindir"); + source_ret = Pkg::SourceCreateType (full_url, "", "Plaindir"); else - source_ret = Pkg::SourceCreate (url, ""); + source_ret = Pkg::SourceCreate (full_url, ""); if (source_ret == -1) { failed_repositories = add (failed_repositories, url); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org