fix(dep_graph): do not package provides when providing itself. fix: #2215 (#2216)

fix #2215. package provides itself
This commit is contained in:
Jo 2023-06-19 08:13:47 +00:00 committed by GitHub
parent e25d00015a
commit 5b8cc98afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -478,15 +478,18 @@ func (g *Grapher) findDepsFromAUR(ctx context.Context,
for i := range aurPkgs {
pkg := &aurPkgs[i]
if deps.Contains(pkg.Name) {
g.providerCache[pkg.Name] = append(g.providerCache[pkg.Name], *pkg)
}
for _, val := range pkg.Provides {
if val == pkg.Name {
continue
}
if deps.Contains(val) {
g.providerCache[val] = append(g.providerCache[val], *pkg)
}
}
if deps.Contains(pkg.Name) {
g.providerCache[pkg.Name] = append(g.providerCache[pkg.Name], *pkg)
}
}
}