[yast-commit] r59859 - in /branches/SuSE-Code-11-SP1-Branch/installation: package/yast2-installation.changes src/clients/inst_addon_update_sources.ycp
Author: locilka Date: Mon Nov 30 14:45:12 2009 New Revision: 59859 URL: http://svn.opensuse.org/viewcvs/yast?rev=59859&view=rev Log: - Repositories added by inst_addon_update_sources use Pkg::RepositoryAdd that does not need access to network (bnc #557723) Modified: branches/SuSE-Code-11-SP1-Branch/installation/package/yast2-installation.changes branches/SuSE-Code-11-SP1-Branch/installation/src/clients/inst_addon_update_sources.ycp Modified: branches/SuSE-Code-11-SP1-Branch/installation/package/yast2-installation.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/installation/package/yast2-installation.changes?rev=59859&r1=59858&r2=59859&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/installation/package/yast2-installation.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/installation/package/yast2-installation.changes Mon Nov 30 14:45:12 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Nov 30 14:38:26 CET 2009 - locilka@suse.cz + +- Repositories added by inst_addon_update_sources use + Pkg::RepositoryAdd that does not need access to network + (bnc #557723) + +------------------------------------------------------------------- Thu Nov 19 16:51:55 CET 2009 - locilka@suse.cz - Added control file configuration option require_registration Modified: branches/SuSE-Code-11-SP1-Branch/installation/src/clients/inst_addon_update_sources.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/installation/src/clients/inst_addon_update_sources.ycp?rev=59859&r1=59858&r2=59859&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/installation/src/clients/inst_addon_update_sources.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/installation/src/clients/inst_addon_update_sources.ycp Mon Nov 30 14:45:12 2009 @@ -40,13 +40,23 @@ /** * @return the installation sources to be added */ -list<string> UpdateUrls () { - // get all available products - list<map<string,any> > products = Pkg::ResolvableProperties ("", `product, ""); - list<list<string> > urls = maplist (map<string, any> p, products, { - return p["update_urls"]:[]; +map <string, string> UpdateUrls () { + map <string, string> urls = $[]; + list <map <string,any> > products = Pkg::ResolvableProperties ("", `product, ""); + + foreach (map<string, any> p, products, { + foreach (string u, p["update_urls"]:[], { + // bnc #542792 + // Repository name must be generated from product details + urls[u] = sformat ( + _("Updates for %1 %2"), + p["display_name"]:p["name"]:p["summary"]:_("Unknown Product"), + p["version"]:"" + ); + }); }); - return (list<string>)toset (flatten (urls)); + + return urls; } @@ -64,23 +74,35 @@ y2milestone ("sources known: %1", knownUrls); map<string, boolean> is_known = listmap (string u, knownUrls, ``($[u: true])); -list<string> updateUrls = UpdateUrls (); +map <string, string> updateUrls = UpdateUrls (); y2milestone ("sources for updates: %1", updateUrls); -list<string> addUrls = filter (string u, updateUrls, ``( ! is_known[u]:false )); +map <string, string> addUrls = filter (string url, string name, updateUrls, ``( ! is_known[url]:false )); y2milestone ("sources to add: %1", addUrls); -if (addUrls != []) +if (addUrls != $[]) { Popup::ShowFeedback (heading, message); list<integer> added_ids = []; - foreach (string u, addUrls, { + foreach (string url, string name, addUrls, { boolean again = true; while (again) { - integer srcid = Pkg::SourceCreate (u, "/"); - y2milestone ("got %1 from creating %2", srcid, u); + // BNC #557723: Repositories migh be created without access to network + // Libzypp must not probe the repo + map <string,any> repo_prop = $[ + "enabled" : true, + "autorefresh" : true, + "name" : (size(name) > 0 ? name : url), + "alias" : (size(name) > 0 ? name : url), + "base_urls" : [url], + "prod_dir" : "/", + + ]; + + integer srcid = Pkg::RepositoryAdd (repo_prop); + y2milestone ("got %1 from creating %2/%3", srcid, url, name); // wrong srcid, must have failed if (srcid == -1) { @@ -94,7 +116,7 @@ Pkg::LastError() ))) { // try again - u = editUrl (u); + url = editUrl (url); } else { // abort again = false; -- 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