Author: lslezak Date: Wed Aug 22 16:29:36 2007 New Revision: 40409 URL: http://svn.opensuse.org/viewcvs/yast?rev=40409&view=rev Log: - better error handling when adding Online Repositories (#302385) Modified: trunk/packager/package/yast2-packager.changes trunk/packager/src/clients/inst_productsources.ycp Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=40409&r1=40408&r2=40409&view=diff ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Wed Aug 22 16:29:36 2007 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Wed Aug 22 16:22:21 CEST 2007 - lslezak@suse.cz + +- better error handling when adding Online Repositories (#302385) + +------------------------------------------------------------------- Wed Aug 22 10:27:15 CEST 2007 - locilka@suse.cz - Make possible to abort in the the Read/Write dialog of Online Modified: trunk/packager/src/clients/inst_productsources.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_productsources.ycp?rev=40409&r1=40408&r2=40409&view=diff ============================================================================== --- trunk/packager/src/clients/inst_productsources.ycp (original) +++ trunk/packager/src/clients/inst_productsources.ycp Wed Aug 22 16:29:36 2007 @@ -987,13 +987,23 @@ } boolean CreateSource (string url, string pth, string repo_name) { - integer src_id = Pkg::RepositoryAdd ($[ - "enabled" : false, - "name" : repo_name, - "base_urls" : [url], - "prod_dir" : pth, - "alias" : url, - ]); + integer src_id = nil; + + string repo_type = Pkg::RepositoryProbe(url, pth); + y2milestone("Probed repository type: %1", repo_type); + + // probing succeeded? + if (repo_type != nil && repo_type != "NONE") + { + src_id = Pkg::RepositoryAdd ($[ + "enabled" : false, + "name" : repo_name, + "base_urls" : [url], + "prod_dir" : pth, + "alias" : url, + "type" : repo_type, + ]); + } if (src_id == nil) { Report::Error (sformat ( -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org