Author: jkupec Date: Tue Oct 14 16:03:08 2008 New Revision: 11342 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11342&view=rev Log: - don't initialize servicesTargetDistro via global ZYpp instance in RepoManagerOptions() constructor (bnc #435184) Modified: trunk/libzypp/zypp/RepoManager.cc Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=1... ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Tue Oct 14 16:03:08 2008 @@ -112,15 +112,6 @@ knownServicesPath = Pathname::assertprefix( root_r, ZConfig::instance().knownServicesPath() ); probe = ZConfig::instance().repo_add_probe(); - if ( getZYpp()->getTarget() ) - { - servicesTargetDistro = getZYpp()->target()->targetDistribution(); - } - else - { - DBG << "Target not initialized, using an empty servicesTargetDistro." << endl; - } - rootDir = root_r; } @@ -1676,8 +1667,14 @@ mediamanager.provideFile( mid, "repo/repoindex.xml" ); Pathname path = mediamanager.localPath(mid, "repo/repoindex.xml" ); + // get target distro identifier + std::string servicesTargetDistro = _pimpl->options.servicesTargetDistro; + if ( servicesTargetDistro.empty() && getZYpp()->getTarget() ) + servicesTargetDistro = getZYpp()->target()->targetDistribution(); + DBG << "servicesTargetDistro: " << servicesTargetDistro << endl; + // parse it - RepoCollector collector(_pimpl->options.servicesTargetDistro); + RepoCollector collector(servicesTargetDistro); parser::RepoindexFileReader reader( path, bind( &RepoCollector::collect, &collector, _1 ) ); mediamanager.release( mid ); mediamanager.close( mid ); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org