ref: refs/heads/master
commit 0c8d555fa7b530f554e0722682176d9110074549
Author: Ján Kupec
Date: Thu Dec 3 23:44:07 2009 +0100
Match repos also by name (bnc #462697).
---
src/repos.cc | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/repos.cc b/src/repos.cc
index 7179cb7..7ba87a4 100644
--- a/src/repos.cc
+++ b/src/repos.cc
@@ -282,7 +282,8 @@ bool match_repo(Zypper & zypper, string str, RepoInfo *repo)
{
RepoManager & manager = zypper.repoManager();
- // Quick check for alias/reponumber first:
+ // Quick check for alias/reponumber/name first.
+ // Name can be ambiguous, in which case the first match found will be returned
{
unsigned int number = 1; // repo number
unsigned int tmp = 0;
@@ -290,7 +291,7 @@ bool match_repo(Zypper & zypper, string str, RepoInfo *repo)
for (RepoManager::RepoConstIterator known_it = manager.repoBegin();
known_it != manager.repoEnd(); ++known_it, ++number)
{
- if ( known_it->alias() == str || tmp == number )
+ if (known_it->alias() == str || tmp == number || known_it->name() == str)
{
if (repo)
*repo = *known_it;
@@ -300,7 +301,8 @@ bool match_repo(Zypper & zypper, string str, RepoInfo *repo)
}
}
- // Expensive URL analysis only if needed:
+ // expensive URL analysis only if the above did not find anything.
+ // URL can be ambiguous, in which case the first found match will be returned.
bool found = false;
for (RepoManager::RepoConstIterator known_it = manager.repoBegin();
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org