From 5b8cc98afa65383607804a0e07d9ba5107e22c57 Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 19 Jun 2023 08:13:47 +0000 Subject: [PATCH] fix(dep_graph): do not package provides when providing itself. fix: #2215 (#2216) fix #2215. package provides itself --- pkg/dep/dep_graph.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/dep/dep_graph.go b/pkg/dep/dep_graph.go index a7fdfc77..aab48e8f 100644 --- a/pkg/dep/dep_graph.go +++ b/pkg/dep/dep_graph.go @@ -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) - } } }