Author: lslezak Date: Thu Aug 16 12:00:25 2007 New Revision: 40310 URL: http://svn.opensuse.org/viewcvs/yast?rev=40310&view=rev Log: - disable autorefresh for CD repositories (#300928) - use the last directory name from URL as name (#299816) - display more details when adding a source fails Modified: trunk/packager/package/yast2-packager.changes trunk/packager/src/clients/inst_source.ycp Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=40310&r1=40309&r2=40310&view=diff ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Thu Aug 16 12:00:25 2007 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Aug 16 11:29:15 CEST 2007 - lslezak@suse.cz + +- disable autorefresh for CD repositories (#300928) +- use the last directory name from URL as name (#299816) +- display more details when adding a source fails + +------------------------------------------------------------------- Tue Aug 14 17:10:21 CEST 2007 - jsuchome@suse.cz - Merged proofread texts Modified: trunk/packager/src/clients/inst_source.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_source.ycp?rev=40310&r1=40309&r2=40310&view=diff ============================================================================== --- trunk/packager/src/clients/inst_source.ycp (original) +++ trunk/packager/src/clients/inst_source.ycp Thu Aug 16 12:00:25 2007 @@ -185,16 +185,26 @@ // add at least one product if the scan result is empty (no product info available) if (size(new_repos) == 0) { - // use url as the name - string url_name = url; + string url_path = URL::Parse(url)["path"]:""; + list<string> p_elems = splitstring(url_path, "/"); + const string fallback = _("Repository"); - // limit alias and name lenght to 25 characters - if (size(url_name) > 25) + if (size(p_elems) > 1) { - url_name = URL::FormatURL(URL::Parse(url), 25); + url_path = p_elems[size(p_elems) - 1]:fallback; + + if (url_path == nil || url_path == "" ) + { + url_path = p_elems[size(p_elems) - 2]:fallback; + + if (url_path == nil || url_path == "" ) + { + url_path = fallback; + } + } } - new_repos = [ [ url_name, "/" ] ]; + new_repos = [ [ url_path, "/" ] ]; } list<integer> newSources = []; @@ -208,6 +218,14 @@ auto_refresh = false; } + // CD or DVD repository? + boolean cd_scheme = contains(["cd", "dvd"], tolower(URL::Parse(url)["scheme"]:"")); + if (cd_scheme) + { + y2milestone("CD/DVD repository detected, disabling autorefresh (%1)", url); + auto_refresh = false; + } + boolean enter_again = false; foreach(list<string> repo, new_repos, @@ -295,7 +313,7 @@ newSources = add(newSources, new_repo_id); - if (contains(["cd", "dvd"], tolower(URL::Parse(url)["scheme"]:""))) + if (cd_scheme) { // for CD/DVD repo download the metadata immediately, // the medium is in the drive right now, it can be changed later @@ -318,7 +336,7 @@ // popup message part 2 string _msg2 = _("Try again?"); - boolean tryagain = Popup::YesNo( _msg1 + "\n" + _msg2 ); + boolean tryagain = Popup::YesNo( _msg1 + "\n" + Pkg::LastError() + "\n" + _msg2 ); if ( tryagain ) return `again; else return `cancel; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org