Author: jreidinger Date: Fri Mar 7 15:47:53 2008 New Revision: 9052 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9052&view=rev Log: fix code style mistakesand remove one useless if(due to previous commit which add break). Modified: trunk/zypper/src/zypper-repos.cc trunk/zypper/src/zypper.cc Modified: trunk/zypper/src/zypper-repos.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-repos.cc?rev=9052&r1=9051&r2=9052&view=diff ============================================================================== --- trunk/zypper/src/zypper-repos.cc (original) +++ trunk/zypper/src/zypper-repos.cc Fri Mar 7 15:47:53 2008 @@ -216,7 +216,8 @@ return false; // no error } -bool match_repo(Zypper & zypper, string str, RepoInfo *repo){ +bool match_repo(Zypper & zypper, string str, RepoInfo *repo) +{ RepoManager manager(zypper.globalOpts().rm_options); list<RepoInfo> known = manager.knownRepositories(); bool founded = false; @@ -282,9 +283,10 @@ // alias if (repo_it->alias() != repo.alias()) + { equals = false; - - if (equals) + } + else { // URIs (all of them) for (RepoInfo::urls_const_iterator urlit = repo_it->baseUrlsBegin(); @@ -297,7 +299,8 @@ catch(const url::UrlException &){} } - if (equals){ + if (equals) + { duplicate = true; break; } Modified: trunk/zypper/src/zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=9052&r1=9051&r2=9052&view=diff ============================================================================== --- trunk/zypper/src/zypper.cc (original) +++ trunk/zypper/src/zypper.cc Fri Mar 7 15:47:53 2008 @@ -1494,7 +1494,8 @@ string type = copts.count("type") ? copts["type"].front() : ""; // display help message if insufficient info was given - switch (_arguments.size()){ + switch (_arguments.size()) + { case 0: out().error(_("Too few arguments.")); ERR << "Too few arguments." << endl; @@ -1572,9 +1573,12 @@ for (vector<string>::const_iterator it = _arguments.begin(); it!= _arguments.end();++it){ RepoInfo repo; - if (match_repo(*this,*it,&repo)){ + if (match_repo(*this,*it,&repo)) + { repo_to_remove.push_back(repo); - } else { + } + else + { MIL << "Repository not found by given alias, number or URL." << endl; out().error(boost::str(format( //TranslatorExplanation %s is string which was not found (can be url, @@ -1585,7 +1589,8 @@ } for (std::list<RepoInfo>::const_iterator it = repo_to_remove.begin(); - it!=repo_to_remove.end();++it){ + it!=repo_to_remove.end();++it) + { if (!remove_repo(*this,*it)) ERR << "Repository '" << it->alias() << "' found but cound not be" " removed with root privileges. Should not happen." << endl; @@ -1629,9 +1634,12 @@ warn_if_zmd (); try { RepoInfo repo; - if (match_repo(*this,_arguments[0], &repo)){ + if (match_repo(*this,_arguments[0], &repo)) + { rename_repo(*this, repo.alias(), _arguments[1]); - } else { + } + else + { out().error(boost::str(format( _("Repository '%s' not found.")) % _arguments[0])); ERR << "Repo " << _arguments[0] << " not found" << endl; @@ -1679,9 +1687,12 @@ } RepoInfo repo; - if (match_repo(*this,_arguments[0],&repo)){ + if (match_repo(*this,_arguments[0],&repo)) + { modify_repo(*this, repo.alias()); - } else { + } + else + { out().error( boost::str(format(_("Repository %s not found.")) % _arguments[0])); ERR << "Repo " << _arguments[0] << " not found" << endl; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org