Author: lslezak Date: Tue Jul 10 17:26:39 2007 New Revision: 39290 URL: http://svn.opensuse.org/viewcvs/yast?rev=39290&view=rev Log: - implemented SourceFinishAll() Modified: branches/REFACTORING-10_3/pkg-bindings/src/Source.cc Modified: branches/REFACTORING-10_3/pkg-bindings/src/Source.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/pkg-bindings/src/Source.cc?rev=39290&r1=39289&r2=39290&view=diff ============================================================================== --- branches/REFACTORING-10_3/pkg-bindings/src/Source.cc (original) +++ branches/REFACTORING-10_3/pkg-bindings/src/Source.cc Tue Jul 10 17:26:39 2007 @@ -455,6 +455,8 @@ YCPValue PkgModuleFunctions::SourceSaveAll () { + y2milestone("Saving the source setup..."); + zypp::RepoManager repomanager; // TODO: do it better, remove only really removed repos @@ -510,18 +512,34 @@ YCPValue PkgModuleFunctions::SourceFinishAll () { -/* try + try { - // look if there are any enabled sources - std::listzypp::SourceManager::SourceId enabled_sources = zypp::SourceManager::sourceManager()->enabledSources(); - if (enabled_sources.empty()) { - y2milestone( "No enabled sources." ); + bool found_enabled = false; + for (std::vectorzypp::RepoInfo::iterator it = repos.begin(); + it != repos.end(); ++it) + { + if (it->enabled()) + { + found_enabled = true; + break; + } + } + + if (!found_enabled) + { + y2milestone( "No enabled sources, skipping SourceFinishAll()" ); return YCPBoolean( true ); } - y2milestone( "Storing the source setup in %s", _target_root.asString().c_str()) ; - zypp::SourceManager::sourceManager()->store( _target_root, true ); - y2milestone( "Disabling all sources") ; - zypp::SourceManager::sourceManager()->disableAllSources (); + + SourceSaveAll(); + + y2milestone( "Disabling all sources...") ; + for (std::vectorzypp::RepoInfo::iterator it = repos_orig.begin(); + it != repos_orig.end(); ++it) + { + it->setEnabled(false); + } + // TODO FIXME remove all resolvables?? } catch (zypp::Exception & excpt) { @@ -530,8 +548,8 @@ return YCPBoolean(false); } - y2milestone( "All sources finished"); -*/ + y2milestone("All sources have been saved and disabled"); + return YCPBoolean(true); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org