diff --git a/deb/list.go b/deb/list.go index ca6f00b6..2f96f7c9 100644 --- a/deb/list.go +++ b/deb/list.go @@ -441,18 +441,6 @@ func (l *PackageList) Search(dep Dependency, allMatches bool) (searchResults []* panic("list not indexed, can't search") } - if dep.Relation == VersionDontCare { - for _, p := range l.providesIndex[dep.Pkg] { - if dep.Architecture == "" || p.MatchesArchitecture(dep.Architecture) { - searchResults = append(searchResults, p) - - if !allMatches { - break - } - } - } - } - i := sort.Search(len(l.packagesIndex), func(j int) bool { return l.packagesIndex[j].Name >= dep.Pkg }) for i < len(l.packagesIndex) && l.packagesIndex[i].Name == dep.Pkg { @@ -468,6 +456,18 @@ func (l *PackageList) Search(dep Dependency, allMatches bool) (searchResults []* i++ } + if dep.Relation == VersionDontCare { + for _, p := range l.providesIndex[dep.Pkg] { + if dep.Architecture == "" || p.MatchesArchitecture(dep.Architecture) { + searchResults = append(searchResults, p) + + if !allMatches { + break + } + } + } + } + return } diff --git a/system/t04_mirror/SearchMirror4Test_gold b/system/t04_mirror/SearchMirror4Test_gold index 5b72415d..86ff46f1 100644 --- a/system/t04_mirror/SearchMirror4Test_gold +++ b/system/t04_mirror/SearchMirror4Test_gold @@ -85,6 +85,7 @@ tar_1.26+dfsg-0.1_amd64 tar_1.26+dfsg-0.1_i386 ttf-bitstream-vera_1.10-8_all ttf-dejavu-core_2.33-3_all +ttf-freefont_20120503-1_all ucf_3.0025+nmu3_all x11-common_1:7.7+3~deb7u1_all xfonts-encodings_1:1.0.4-1_all diff --git a/system/t05_snapshot/SearchSnapshot4Test_gold b/system/t05_snapshot/SearchSnapshot4Test_gold index 5b72415d..86ff46f1 100644 --- a/system/t05_snapshot/SearchSnapshot4Test_gold +++ b/system/t05_snapshot/SearchSnapshot4Test_gold @@ -85,6 +85,7 @@ tar_1.26+dfsg-0.1_amd64 tar_1.26+dfsg-0.1_i386 ttf-bitstream-vera_1.10-8_all ttf-dejavu-core_2.33-3_all +ttf-freefont_20120503-1_all ucf_3.0025+nmu3_all x11-common_1:7.7+3~deb7u1_all xfonts-encodings_1:1.0.4-1_all diff --git a/system/t09_repo/SearchRepo4Test_gold b/system/t09_repo/SearchRepo4Test_gold index 5b72415d..86ff46f1 100644 --- a/system/t09_repo/SearchRepo4Test_gold +++ b/system/t09_repo/SearchRepo4Test_gold @@ -85,6 +85,7 @@ tar_1.26+dfsg-0.1_amd64 tar_1.26+dfsg-0.1_i386 ttf-bitstream-vera_1.10-8_all ttf-dejavu-core_2.33-3_all +ttf-freefont_20120503-1_all ucf_3.0025+nmu3_all x11-common_1:7.7+3~deb7u1_all xfonts-encodings_1:1.0.4-1_all