MatchesDependency should check on Provides: as well.

This commit is contained in:
Andrey Smirnov
2014-07-11 16:30:41 +04:00
parent ede5449440
commit b42fd71acf
2 changed files with 14 additions and 5 deletions
+8 -5
View File
@@ -199,16 +199,19 @@ func (p *Package) MatchesArchitecture(arch string) bool {
// MatchesDependency checks whether package matches specified dependency
func (p *Package) MatchesDependency(dep Dependency) bool {
if dep.Pkg != p.Name {
return false
}
if dep.Architecture != "" && !p.MatchesArchitecture(dep.Architecture) {
return false
}
if dep.Relation == VersionDontCare {
return true
if utils.StrSliceHasItem(p.Provides, dep.Pkg) {
return true
}
return dep.Pkg == p.Name
}
if dep.Pkg != p.Name {
return false
}
r := CompareVersions(p.Version, dep.Version)