Add Matches() to pkg.Package

This commit is contained in:
Ettore Di Giacinto
2019-11-15 18:04:46 +01:00
parent 891daf4b71
commit 83fb1d1219
5 changed files with 19 additions and 11 deletions

View File

@@ -68,7 +68,7 @@ func (gt *DefaultTree) World() ([]pkg.Package, error) {
func (gt *DefaultTree) UpdateWorldPackage(p pkg.Package) {
//var CacheWorld []pkg.Package
for _, pid := range gt.CacheWorld {
if p.GetFingerPrint() == pid.GetFingerPrint() {
if p.Matches(pid) {
pid.Requires(p.GetRequires())
pid.Conflicts(p.GetConflicts())
}
@@ -83,7 +83,7 @@ func (gt *DefaultTree) FindPackage(pack pkg.Package) (pkg.Package, error) {
return nil, err
}
for _, pid := range packages {
if pack.GetFingerPrint() == pid.GetFingerPrint() {
if pack.Matches(pid) {
return pid, nil
}
}