Author: jkupec Date: Fri Feb 1 17:45:00 2008 New Revision: 8431 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8431&view=rev Log: - fixed renaming a repo to an existing one (bnc #228216) Modified: trunk/libzypp/zypp/RepoManager.cc trunk/libzypp/zypp/RepoManager.h Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=8431&r1=8430&r2=8431&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Fri Feb 1 17:45:00 2008 @@ -1114,6 +1114,19 @@ { RepoInfo toedit = getRepositoryInfo(alias); + // check if the new alias already exists when renaming the repo + if (alias != newinfo.alias()) + { + std::list<RepoInfo> repos = knownRepositories(); + for ( std::list<RepoInfo>::const_iterator it = repos.begin(); + it != repos.end(); + ++it ) + { + if ( newinfo.alias() == (*it).alias() ) + ZYPP_THROW(RepoAlreadyExistsException(newinfo.alias())); + } + } + if (toedit.filepath().empty()) { ZYPP_THROW(RepoException("Can't figure where the repo is stored")); Modified: trunk/libzypp/zypp/RepoManager.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.h?rev=8431&r1=8430&r2=8431&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.h (original) +++ trunk/libzypp/zypp/RepoManager.h Fri Feb 1 17:45:00 2008 @@ -325,6 +325,8 @@ /** * \short Modify repository attributes * + * \throws RepoAlreadyExistsException if the alias specified in newinfo + * is already used by another repository * \throws RepoNotFoundException If no repo match * \throws ParseException If the file parsing fails * \throws Exception On other errors. -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org