From e08d44ff0a865b581cd97be6f09f23b06823725f Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sat, 12 Jul 2014 13:58:22 +0400 Subject: [PATCH] Fix bug with matching in Search method. --- deb/list.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/deb/list.go b/deb/list.go index eb32f5de..36eae5e6 100644 --- a/deb/list.go +++ b/deb/list.go @@ -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 })