ref: refs/heads/master
commit 1901099f5d1000225cc8a9a44c84ddaf14a91a92
Author: Michael Andres
Date: Wed May 20 14:11:48 2009 +0200
Fix lost housekeeping data in modifyRepo (bnc #503207)
---
zypp/RepoManager.cc | 12 +++++-------
1 files 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);
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org