Author: lslezak Date: Tue Jul 10 18:36:08 2007 New Revision: 39295 URL: http://svn.opensuse.org/viewcvs/yast?rev=39295&view=rev Log: - implemented TargetDisableSources() Modified: branches/REFACTORING-10_3/pkg-bindings/src/Target.cc Modified: branches/REFACTORING-10_3/pkg-bindings/src/Target.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/pkg-bindings/src/Target.cc?rev=39295&r1=39294&r2=39295&view=diff ============================================================================== --- branches/REFACTORING-10_3/pkg-bindings/src/Target.cc (original) +++ branches/REFACTORING-10_3/pkg-bindings/src/Target.cc Tue Jul 10 18:36:08 2007 @@ -137,25 +137,24 @@ { try { -#warning TargetDisableSources is NOT implemented // FIXME: should it also remove from pool? -/* - zypp::SourceManager::disableSourcesAt( _target_root ); - // disable source refresh - workaround for #220056 - zypp::storage::PersistentStorage store; - store.init( _target_root ); + // set path option, use root dir as a prefix for the default directory + zypp::RepoManagerOptions repo_options; + repo_options.knownReposPath = zypp::Pathname(_target_root) + repo_options.knownReposPath; + + y2milestone("Disabling all sources at %s", repo_options.knownReposPath.asString().c_str()); - std::listzypp::source::SourceInfo new_sources = store.storedSources(); - y2milestone("Disabling refresh for sources at %s", _target_root.asString().c_str()); + zypp::RepoManager repomanager(repo_options); + std::listzypp::RepoInfo all_sources = repomanager.knownRepositories(); - for ( std::listzypp::source::SourceInfo::iterator it = new_sources.begin(); it != new_sources.end(); ++it) + for (std::listzypp::RepoInfo::iterator it = all_sources.begin(); it != all_sources.end(); ++it) { - y2milestone("Disabling refresh: alias: %s", it->alias().c_str()); + y2milestone("Disabling source '%s'", it->alias().c_str()); it->setAutorefresh(false); - store.storeSource( *it ); + + repomanager.modifyRepository(it->alias(), *it); } -*/ } catch (zypp::Exception & excpt) { @@ -163,6 +162,7 @@ ycperror("TargetDisableSources has failed: %s", excpt.msg().c_str() ); return YCPBoolean(false); } + return YCPBoolean(true); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org