{
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"));
/**
* \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.