From 1901099f5d1000225cc8a9a44c84ddaf14a91a92 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Wed, 20 May 2009 14:11:48 +0200 Subject: [PATCH] Fix lost housekeeping data in modifyRepo (bnc #503207) --- zypp/RepoManager.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index 740f70f..42f73bf 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -1531,19 +1531,16 @@ namespace zypp //////////////////////////////////////////////////////////////////////////// void RepoManager::modifyRepository( const std::string &alias, - const RepoInfo & newinfo, + const RepoInfo & newinfo_r, const ProgressData::ReceiverFnc & progressrcv ) { RepoInfo toedit = getRepositoryInfo(alias); + RepoInfo newinfo( newinfo_r ); // need writable copy to upadte housekeeping data // check if the new alias already exists when renaming the repo - if (alias != newinfo.alias()) + if ( alias != newinfo.alias() && hasRepo( newinfo.alias() ) ) { - for_( it, repoBegin(), repoEnd() ) - { - if ( newinfo.alias() == (*it).alias() ) - ZYPP_THROW(RepoAlreadyExistsException(newinfo)); - } + ZYPP_THROW(RepoAlreadyExistsException(newinfo)); } if (toedit.filepath().empty()) @@ -1581,6 +1578,7 @@ namespace zypp newinfo.dumpAsIniOn(file); } + newinfo.setFilepath(toedit.filepath()); _pimpl->repos.erase(toedit); _pimpl->repos.insert(newinfo); HistoryLog(_pimpl->options.rootDir).modifyRepository(toedit, newinfo); -- 2.7.4