Author: coolo Date: Fri Feb 8 10:14:10 2008 New Revision: 8566 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8566&view=rev Log: r8431 | jkupec | 2008-02-01 17:45:00 +0100 (Fr, 01 Feb 2008) | 2 lines - fixed renaming a repo to an existing one (bnc #228216) Modified: branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.h Modified: branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc?rev=8566&r1=8565&r2=8566&view=diff ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc Fri Feb 8 10:14:10 2008 @@ -1168,6 +1168,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: branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.h?rev=8566&r1=8565&r2=8566&view=diff ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.h (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.h Fri Feb 8 10:14:10 2008 @@ -311,6 +311,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