From a457c5382499f9e0186b640532d2e25bf5cefb06 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Fri, 24 Apr 2020 00:15:18 +0200 Subject: [PATCH] Fixups to ExpandedRevdeps --- pkg/package/package.go | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/pkg/package/package.go b/pkg/package/package.go index ffc6c94b..c06358cf 100644 --- a/pkg/package/package.go +++ b/pkg/package/package.go @@ -424,6 +424,7 @@ func (p *DefaultPackage) ExpandedRevdeps(definitiondb PackageDatabase, visited m if _, ok := visited[p.HumanReadableString()]; ok { return versionsInWorld } + visited[p.HumanReadableString()] = true for _, w := range definitiondb.World() { if w.Matches(p) { @@ -436,21 +437,29 @@ func (p *DefaultPackage) ExpandedRevdeps(definitiondb PackageDatabase, visited m match = true } if !match { - } - packages, _ := re.Expand(definitiondb) - for _, pa := range packages { - if pa.Matches(p) { - match = true + + packages, _ := re.Expand(definitiondb) + for _, pa := range packages { + if pa.Matches(p) { + match = true + } } } + + // if ok, _ := w.RequiresContains(definitiondb, p); ok { + } if match { versionsInWorld = append(versionsInWorld, w) - versionsInWorld = append(versionsInWorld, w.ExpandedRevdeps(definitiondb, visited)...) - visited[w.HumanReadableString()] = true + + versionsInWorld = append(versionsInWorld, w.ExpandedRevdeps(definitiondb, visited).Unique()...) + } + // } + } + //visited[p.HumanReadableString()] = true return versionsInWorld.Unique() }