Fix bug with matching in Search method.

This commit is contained in:
Andrey Smirnov
2014-07-12 13:58:22 +04:00
parent 898870038a
commit e08d44ff0a
+1 -4
View File
@@ -352,7 +352,7 @@ func (l *PackageList) Search(dep Dependency, allMatches bool) (searchResults []*
if dep.Relation == VersionDontCare {
for _, p := range l.providesIndex[dep.Pkg] {
if p.MatchesArchitecture(dep.Architecture) {
if dep.Architecture == "" || p.MatchesArchitecture(dep.Architecture) {
searchResults = append(searchResults, p)
if !allMatches {
@@ -360,9 +360,6 @@ func (l *PackageList) Search(dep Dependency, allMatches bool) (searchResults []*
}
}
}
if len(searchResults) != 0 {
return
}
}
i := sort.Search(len(l.packagesIndex), func(j int) bool { return l.packagesIndex[j].Name >= dep.Pkg })